From 5bb1358b3a17d4b84bc843e79d683acedadd6684 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Mon, 19 Oct 2009 23:53:43 -0600 Subject: [PATCH] Actually use the sentmail value in the dimp compose screen. Correctly display non ascii sentmail folder names. --- imp/compose-dimp.php | 4 +++- imp/js/compose-dimp.js | 15 +++++++++++---- imp/lib/Views/Compose.php | 7 ++++++- imp/templates/chunks/compose.php | 6 +++++- 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/imp/compose-dimp.php b/imp/compose-dimp.php index d292bca62..3a8d308b8 100644 --- a/imp/compose-dimp.php +++ b/imp/compose-dimp.php @@ -157,7 +157,9 @@ if (count($_POST)) { 'save_sent' => (($prefs->isLocked('save_sent_mail')) ? $identity->getValue('save_sent_mail') : (bool)Horde_Util::getFormData('save_sent_mail')), - 'sent_folder' => $identity->getValue('sent_mail_folder'), + 'sent_folder' => (($prefs->isLocked('save_sent_mail')) + ? $identity->getValue('sent_mail_folder') + : Horde_Util::getFormData('save_sent_mail_folder', $identity->getValue('sent_mail_folder'))) ); try { diff --git a/imp/js/compose-dimp.js b/imp/js/compose-dimp.js index bc828521b..e0ad14aaa 100644 --- a/imp/js/compose-dimp.js +++ b/imp/js/compose-dimp.js @@ -77,7 +77,7 @@ var DimpCompose = { next = this.get_identity(id), ssm = $('save_sent_mail'); - this.setSentMailLabel(next.id[5]); + this.setSentMailLabel(next.id[3], next.id[5]); $('bcc').setValue(next.id[6]); if (ssm) { ssm.writeAttribute('checked', next.id[4]); @@ -121,11 +121,18 @@ var DimpCompose = { } }, - setSentMailLabel: function(s) + setSentMailLabel: function(s, l) { var label = $('sent_mail_folder_label'); if (label) { - $('sent_mail_folder_label').writeAttribute('title', s.escapeHTML()).setText('"' + s.truncate(15) + '"'); + if (!l) { + l = DIMP.conf_compose.flist.find(function(f) { + return f.v == s; + }); + l = l.f || l.v; + } + $('save_sent_mail_folder').setValue(s); + $('sent_mail_folder_label').writeAttribute('title', l.escapeHTML()).setText('"' + l.truncate(15) + '"'); } }, @@ -487,7 +494,7 @@ var DimpCompose = { if (DIMP.conf_compose.cc) { this.toggleCC('cc'); } - this.setSentMailLabel(identity.id[5]); + this.setSentMailLabel(identity.id[3], identity.id[5]); if (header.bcc) { $('bcc').setValue(header.bcc); this.resizebcc.resizeNeeded(); diff --git a/imp/lib/Views/Compose.php b/imp/lib/Views/Compose.php index eb17d24a3..35e2b0eaa 100644 --- a/imp/lib/Views/Compose.php +++ b/imp/lib/Views/Compose.php @@ -97,7 +97,12 @@ class IMP_Views_Compose $imp_folder = IMP_Folder::singleton(); $flist = array(); foreach ($imp_folder->flist() as $val) { - $flist[] = array('l' => $val['abbrev'], 'v' => $val['val']); + $tmp = array('l' => $val['abbrev'], 'v' => $val['val']); + $tmp2 = IMP::displayFolder($val['val']); + if ($val['val'] != $tmp2) { + $tmp['f'] = $tmp2; + } + $flist[] = $tmp; } $result['js'][] = 'DIMP.conf_compose.flist = ' . Horde_Serialize::serialize($flist, Horde_Serialize::JSON); } diff --git a/imp/templates/chunks/compose.php b/imp/templates/chunks/compose.php index f3323a9f9..e6caf0cd2 100644 --- a/imp/templates/chunks/compose.php +++ b/imp/templates/chunks/compose.php @@ -60,7 +60,11 @@ function _createDAcompose($text, $image, $id) isLocked('save_sent_mail')): ?> - + + -- 2.11.0