From 0500643b9779299b1a643256bf291367528170ff Mon Sep 17 00:00:00 2001 From: anuko Date: Sat, 4 Feb 2017 20:42:36 +0000 Subject: [PATCH] Added MIME decoder for SENDER. --- WEB-INF/templates/footer.tpl | 2 +- WEB-INF/templates/mail.tpl | 2 +- invoice_send.php | 10 ++++++++++ report_send.php | 10 ++++++++++ 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 728c79e0..97662f41 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.9.35.3558 | Copyright © Anuko | +  Anuko Time Tracker 1.9.36.3559 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/WEB-INF/templates/mail.tpl b/WEB-INF/templates/mail.tpl index 8abe8572..4dcf34b7 100644 --- a/WEB-INF/templates/mail.tpl +++ b/WEB-INF/templates/mail.tpl @@ -8,7 +8,7 @@ - + diff --git a/invoice_send.php b/invoice_send.php index b9e2a293..6d85d544 100644 --- a/invoice_send.php +++ b/invoice_send.php @@ -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()"'); diff --git a/report_send.php b/report_send.php index e11978aa..9c02ced7 100644 --- a/report_send.php +++ b/report_send.php @@ -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()"'); -- 2.20.1
{$i18n.form.mail.from} (*):{$smarty.const.SENDER}{$sender}
{$i18n.form.mail.to} (*):