JS for sendmdn was not output when comp_in_new was disabled.
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 30 Jun 2003 19:36:16 +0000 (19:36 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 30 Jun 2003 19:36:16 +0000 (19:36 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5181 7612ce4b-ef26-0410-bec9-ea0150e637f0

ChangeLog
functions/page_header.php

index 2765e938777aff7eb5cc6c35b78226425cac5666..981fb00c3b4ddb91560c9f575a88964fef93df0d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -44,6 +44,7 @@ Version 1.5.0 -- CVS
   - Applied bugfixes from stable to htmlfilter code.
   - Fix bug #722933 where resuming a draft message would lose the reference headers
   - Removed hard coded colors from login.php and made it use the default theme and css file
   - Applied bugfixes from stable to htmlfilter code.
   - Fix bug #722933 where resuming a draft message would lose the reference headers
   - Removed hard coded colors from login.php and made it use the default theme and css file
+  - Fix that sending of read receipts failed when JavaScript on and comp in new off (#738130).
 
 **************************************
 *** SquirrelMail Stable Series 1.4 ***
 
 **************************************
 *** SquirrelMail Stable Series 1.4 ***
index c335530594c48b60b8ecb0ca2b5d0327f96f2431..ceea10b213ed773b2ff3a652d0fcbc0bb90f1289 100644 (file)
@@ -86,7 +86,7 @@ function displayPageHeader($color, $mailbox, $xtra='', $session=false) {
     global $hide_sm_attributions, $PHP_SELF, $frame_top,
            $compose_new_win, $compose_width, $compose_height,
            $attachemessages, $provider_name, $provider_uri,
     global $hide_sm_attributions, $PHP_SELF, $frame_top,
            $compose_new_win, $compose_width, $compose_height,
            $attachemessages, $provider_name, $provider_uri,
-           $javascript_on;
+           $javascript_on, $default_use_mdn, $mdn_user_support;
 
     sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION );
     sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION );
 
     sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION );
     sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION );
@@ -110,6 +110,8 @@ function displayPageHeader($color, $mailbox, $xtra='', $session=false) {
       switch ( $module ) {
         case 'src/read_body.php':
                 $js ='';
       switch ( $module ) {
         case 'src/read_body.php':
                 $js ='';
+
+                // compose in new window code
                 if ($compose_new_win == '1') {
                     if (!preg_match("/^[0-9]{3,4}$/", $compose_width)) {
                         $compose_width = '640';
                 if ($compose_new_win == '1') {
                     if (!preg_match("/^[0-9]{3,4}$/", $compose_width)) {
                         $compose_width = '640';
@@ -117,8 +119,6 @@ function displayPageHeader($color, $mailbox, $xtra='', $session=false) {
                     if (!preg_match("/^[0-9]{3,4}$/", $compose_height)) {
                         $compose_height = '550';
                     }
                     if (!preg_match("/^[0-9]{3,4}$/", $compose_height)) {
                         $compose_height = '550';
                     }
-                    $js .= "\n".'<script language="JavaScript" type="text/javascript">' .
-                        "\n<!--\n";
                     $js .= "function comp_in_new(comp_uri) {\n".
                     "       if (!comp_uri) {\n".
                     '           comp_uri = "'.$compose_uri."\";\n".
                     $js .= "function comp_in_new(comp_uri) {\n".
                     "       if (!comp_uri) {\n".
                     '           comp_uri = "'.$compose_uri."\";\n".
@@ -128,19 +128,24 @@ function displayPageHeader($color, $mailbox, $xtra='', $session=false) {
                          '"width='.$compose_width. ',height='.$compose_height.
                          ',scrollbars=yes,resizable=yes");'."\n".
                          "}\n\n";
                          '"width='.$compose_width. ',height='.$compose_height.
                          ',scrollbars=yes,resizable=yes");'."\n".
                          "}\n\n";
+                }
 
 
-
+                // javascript for sending read receipts
+                if($default_use_mdn && $mdn_user_support) {
                     $js .= 'function sendMDN() {'."\n".
                     $js .= 'function sendMDN() {'."\n".
-                           "mdnuri=window.location+'&sendreceipt=1';".
+                           "    mdnuri=window.location+'&sendreceipt=1'; ".
                            "var newwin = window.open(mdnuri,'right');".
                       "\n}\n\n";
                            "var newwin = window.open(mdnuri,'right');".
                       "\n}\n\n";
+                }
+
+                // if any of the above passes, add the JS tags too.
+                if($js) {
+                    $js = "\n".'<script language="JavaScript" type="text/javascript">' .
+                        "\n<!--\n" . $js . "// -->\n</script>\n";
+                }
 
 
-                    $js .= "// -->\n".
-                      "</script>\n";
-            
-                 }
-                 displayHtmlHeader ('SquirrelMail', $js);
-                 $onload = $xtra;
+                displayHtmlHeader ('SquirrelMail', $js);
+                $onload = $xtra;
             break;
         case 'src/compose.php':
             $js = '<script language="JavaScript" type="text/javascript">' .
             break;
         case 'src/compose.php':
             $js = '<script language="JavaScript" type="text/javascript">' .