Add option to allow returning to the message one had been replying to after sending
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 22 Nov 2017 06:08:38 +0000 (06:08 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 22 Nov 2017 06:08:38 +0000 (06:08 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@14741 7612ce4b-ef26-0410-bec9-ea0150e637f0

include/load_prefs.php
include/options/compose.php
src/compose.php

index 4f698abef2ba5849c455d704341818adfbcd0f74..cf8f03b94f28930f21de41cec26c0e6902e296ad 100644 (file)
@@ -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);
index 07e22895f3b546d80343c0f97f7f8f31897aa419..070c558d963fa5f2505fc5c7ec70186d28103972 100644 (file)
@@ -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"),
index 8d0bd6d9e3bb17916ab9f2e1c16da79e4715dd7f..f25ae34c4e52b69bf1e3cf86fd2ea356b1caec0b 100644 (file)
@@ -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 '   <br><br><div style="text-align: center;"><a href="' . $location