Actually use the sentmail value in the dimp compose screen.
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 20 Oct 2009 05:53:43 +0000 (23:53 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 20 Oct 2009 05:53:43 +0000 (23:53 -0600)
Correctly display non ascii sentmail folder names.

imp/compose-dimp.php
imp/js/compose-dimp.js
imp/lib/Views/Compose.php
imp/templates/chunks/compose.php

index d292bca..3a8d308 100644 (file)
@@ -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 {
index bc82852..e0ad14a 100644 (file)
@@ -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();
index eb17d24..35e2b0e 100644 (file)
@@ -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);
         }
index f3323a9..e6caf0c 100644 (file)
@@ -60,7 +60,11 @@ function _createDAcompose($text, $image, $id)
    <label><input name="request_read_receipt" type="checkbox" class="checkbox"<?php if ($d_read != 'ask') echo ' checked="checked"' ?> /> <?php echo _("Read Receipt") ?></label>
 <?php endif; ?>
 <?php if ($GLOBALS['conf']['user']['allow_folders'] && !$GLOBALS['prefs']->isLocked('save_sent_mail')): ?>
-   <label><input id="save_sent_mail" name="save_sent_mail" type="checkbox" class="checkbox"<?php if ($identity->saveSentmail()) echo ' checked="checked"' ?> /> <?php echo _("Save in ") ?><span id="sent_mail_folder_label"></span></label>
+   <label>
+    <input id="save_sent_mail" name="save_sent_mail" type="checkbox" class="checkbox"<?php if ($identity->saveSentmail()) echo ' checked="checked"' ?> /> <?php echo _("Save in") ?>
+    <span id="sent_mail_folder_label"></span>
+   </label>
+   <input id="save_sent_mail_folder" name="save_sent_mail_folder" type="hidden" />
 <?php endif; ?>
   </div>
   <table cellspacing="0">