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 4f698ab..cf8f03b 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);
 
 $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);
 /* Page selector options */
 $page_selector = getPref($data_dir, $username, 'page_selector', SMPREF_ON);
 $compact_paginator = getPref($data_dir, $username, 'compact_paginator', SMPREF_OFF);
index 07e2289..070c558 100644 (file)
@@ -133,6 +133,13 @@ function load_optpage_data_compose() {
     );
 
     $optvals[SMOPT_GRP_COMPOSE_REPLY][] = array(
     );
 
     $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"),
         'type'    => SMOPT_TYPE_BOOLEAN,
         'name'    => 'sig_first',
         'caption' => _("Prepend Signature before Reply/Forward Text"),
         'type'    => SMOPT_TYPE_BOOLEAN,
index 8d0bd6d..f25ae34 100644 (file)
@@ -573,8 +573,13 @@ if ($send) {
             exit();
         } else {
             if ( !isset($pageheader_sent) || !$pageheader_sent ) {
             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
             } else {
 //FIXME: DON'T ECHO HTML FROM CORE!
                 echo '   <br><br><div style="text-align: center;"><a href="' . $location