Added MIME decoder for SENDER.
authoranuko <support@anuko.com>
Sat, 4 Feb 2017 20:42:36 +0000 (20:42 +0000)
committeranuko <support@anuko.com>
Sat, 4 Feb 2017 20:42:36 +0000 (20:42 +0000)
WEB-INF/templates/footer.tpl
WEB-INF/templates/mail.tpl
invoice_send.php
report_send.php

index 728c79e..97662f4 100644 (file)
@@ -12,7 +12,7 @@
       <br>
       <table cellspacing="0" cellpadding="4" width="100%" border="0">
         <tr>
-          <td align="center">&nbsp;Anuko Time Tracker 1.9.35.3558 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.9.36.3559 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
             <a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
             <a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
             <a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>
index 8abe857..4dcf34b 100644 (file)
@@ -8,7 +8,7 @@
         <table>
         <tr>
           <td align="right">{$i18n.form.mail.from} (*):</td>
-          <td>{$smarty.const.SENDER}</td>
+          <td>{$sender}</td>
         </tr>
         <tr>
           <td align="right">{$i18n.form.mail.to} (*):</td>
index b9e2a29..6d85d54 100644 (file)
@@ -94,6 +94,16 @@ if ($request->isPost()) {
   }
 } // isPost
 
+$smarty->assign('sender', SENDER);
+if (function_exists('imap_mime_header_decode')) {
+  // Decode sender in case it is encoded. PHP IMAP extension must be installed for us to get here.
+  $elements = imap_mime_header_decode(SENDER);
+  if (count($elements) > 1) {
+      // Reassign sender.
+      $smarty->assign('sender', $elements[count($elements) - 2]->text);
+  }
+}
+
 $smarty->assign('title', $i18n->getKey('title.send_invoice'));
 $smarty->assign('forms', array($form->getName()=>$form->toArray()));
 $smarty->assign('onload', 'onLoad="document.mailForm.'.($cl_receiver?'comment':'receiver').'.focus()"');
index e11978a..9c02ced 100644 (file)
@@ -91,6 +91,16 @@ if ($request->isPost()) {
   }
 }
 
+$smarty->assign('sender', SENDER);
+if (function_exists('imap_mime_header_decode')) {
+  $elements = imap_mime_header_decode(SENDER);
+  if (count($elements) > 1) {
+      // Reassign sender.
+      $new = $elements[count($elements) - 2]->text;
+      $smarty->assign('sender', $elements[count($elements) - 2]->text);
+  }
+}
+
 $smarty->assign('title', $i18n->getKey('title.send_report'));
 $smarty->assign('forms', array($form->getName()=>$form->toArray()));
 $smarty->assign('onload', 'onLoad="document.mailForm.'.($cl_receiver?'comment':'receiver').'.focus()"');