X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/3ad790a3d4bc23cb23f7ee072171ca6ef987eb56..0500643b9779299b1a643256bf291367528170ff:/invoice_send.php 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()"');