From 5594db7ade1796b3cb26487114d6d01464c9f820 Mon Sep 17 00:00:00 2001 From: pdontthink Date: Wed, 22 Nov 2017 06:08:38 +0000 Subject: [PATCH] Add option to allow returning to the message one had been replying to after sending git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@14741 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- include/load_prefs.php | 3 +++ include/options/compose.php | 7 +++++++ src/compose.php | 9 +++++++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/include/load_prefs.php b/include/load_prefs.php index 4f698abe..cf8f03b9 100644 --- a/include/load_prefs.php +++ b/include/load_prefs.php @@ -281,6 +281,9 @@ $do_not_reply_to_self = $include_self_reply_all = getPref($data_dir, $username, 'include_self_reply_all', SMPREF_ON); +$return_to_message_after_reply = + getPref($data_dir, $username, 'return_to_message_after_reply', SMPREF_OFF); + /* Page selector options */ $page_selector = getPref($data_dir, $username, 'page_selector', SMPREF_ON); $compact_paginator = getPref($data_dir, $username, 'compact_paginator', SMPREF_OFF); diff --git a/include/options/compose.php b/include/options/compose.php index 07e22895..070c558d 100644 --- a/include/options/compose.php +++ b/include/options/compose.php @@ -132,6 +132,13 @@ function load_optpage_data_compose() { 'refresh' => SMOPT_REFRESH_NONE ); + $optvals[SMOPT_GRP_COMPOSE_REPLY][] = array( + 'name' => 'return_to_message_after_reply', + 'caption' => _("Return to Original Message After Replying"), + 'type' => SMOPT_TYPE_BOOLEAN, + 'refresh' => SMOPT_REFRESH_NONE + ); + $optvals[SMOPT_GRP_COMPOSE_REPLY][] = array( 'name' => 'sig_first', 'caption' => _("Prepend Signature before Reply/Forward Text"), diff --git a/src/compose.php b/src/compose.php index 8d0bd6d9..f25ae34c 100644 --- a/src/compose.php +++ b/src/compose.php @@ -573,8 +573,13 @@ if ($send) { exit(); } else { if ( !isset($pageheader_sent) || !$pageheader_sent ) { - header("Location: $location/right_main.php?mailbox=$urlMailbox". - "&startMessage=$startMessage&mail_sent=$mail_sent"); + global $return_to_message_after_reply; + if (($action === 'reply' || $action === 'reply_all') && $return_to_message_after_reply) + header("Location: $location/read_body.php?passed_id=$passed_id&mailbox=$urlMailbox". + "&startMessage=$startMessage&mail_sent=$mail_sent"); + else + header("Location: $location/right_main.php?mailbox=$urlMailbox". + "&startMessage=$startMessage&mail_sent=$mail_sent"); } else { //FIXME: DON'T ECHO HTML FROM CORE! echo '