From: Michael M Slusarz Date: Tue, 20 Oct 2009 04:37:36 +0000 (-0600) Subject: Dear Jan, Here is sent-mail selection for dimp. Sincerely, Michael X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=c67b7f34f32eb941e0e93a395a5dde08b6c9a4d1;p=horde.git Dear Jan, Here is sent-mail selection for dimp. Sincerely, Michael --- diff --git a/imp/docs/CHANGES b/imp/docs/CHANGES index 5b97aaf56..53af983ed 100644 --- a/imp/docs/CHANGES +++ b/imp/docs/CHANGES @@ -2,6 +2,7 @@ v5.0-git -------- +[mms] Add ability to select sent-mail mailbox when composing in DIMP. [mms] Add ability to save drafts in MIMP. [mms] Add spam reporting in MIMP. [mms] Added contextmenu support in DIMP for Opera. diff --git a/imp/js/compose-dimp.js b/imp/js/compose-dimp.js index c5bdacca9..bc828521b 100644 --- a/imp/js/compose-dimp.js +++ b/imp/js/compose-dimp.js @@ -10,8 +10,8 @@ var DimpCompose = { // Variables defaulting to empty/false: // auto_save_interval, button_pressed, compose_cursor, dbtext, - // drafts_mbox, editor_on, mp_padding, resizebcc, resizecc, resizeto, - // row_height, sbtext, skip_spellcheck, spellcheck, uploading + // drafts_mbox, editor_on, knl, mp_padding, resizebcc, resizecc, + // resizeto, row_height, sbtext, skip_spellcheck, spellcheck, uploading last_msg: '', textarea_ready: true, @@ -77,7 +77,7 @@ var DimpCompose = { next = this.get_identity(id), ssm = $('save_sent_mail'); - $('sent_mail_folder_label').setText(next.id[5]); + this.setSentMailLabel(next.id[5]); $('bcc').setValue(next.id[6]); if (ssm) { ssm.writeAttribute('checked', next.id[4]); @@ -121,6 +121,14 @@ var DimpCompose = { } }, + setSentMailLabel: function(s) + { + var label = $('sent_mail_folder_label'); + if (label) { + $('sent_mail_folder_label').writeAttribute('title', s.escapeHTML()).setText('"' + s.truncate(15) + '"'); + } + }, + get_identity: function(id, editor_on) { editor_on = Object.isUndefined(editor_on) ? this.editor_on : editor_on; @@ -428,7 +436,7 @@ var DimpCompose = { fillForm: function(msg, header, focus, noupdate) { - // On IE, this can get loaded before DOM;loaded. Check for an init + // On IE, this can get loaded before DOM:loaded. Check for an init // value and don't load until it is available. if (!this.resizeto) { this.fillForm.bind(this, msg, header, focus, noupdate).defer(); @@ -479,6 +487,7 @@ var DimpCompose = { if (DIMP.conf_compose.cc) { this.toggleCC('cc'); } + this.setSentMailLabel(identity.id[5]); if (header.bcc) { $('bcc').setValue(header.bcc); this.resizebcc.resizeNeeded(); @@ -766,6 +775,16 @@ var DimpCompose = { a.down('TD.label SPAN').addClassName('composeAddrbook'); }); } + + /* Create folderlist. */ + if (DIMP.conf_compose.flist) { + this.knl = new KeyNavList('save_sent_mail', { + esc: true, + list: DIMP.conf_compose.flist, + onChoose: this.setSentMailLabel.bind(this) + }); + $('sent_mail_folder_label').insert({ after: new Element('SPAN', { className: 'popdownImg', id: 'compose_flist_popdown' }).observe('click', function(e) { this.knl.show(); e.stop(); }.bindAsEventListener(this)) }); + } } }, diff --git a/imp/lib/Views/Compose.php b/imp/lib/Views/Compose.php index e1d133a6a..eb17d24a3 100644 --- a/imp/lib/Views/Compose.php +++ b/imp/lib/Views/Compose.php @@ -39,10 +39,6 @@ class IMP_Views_Compose /* Load Identity. */ $identity = Identity::singleton(array('imp', 'imp')); $selected_identity = $identity->getDefault(); - $sent_mail_folder = $identity->getValue('sent_mail_folder'); - if (!empty($sent_mail_folder)) { - $sent_mail_folder = htmlspecialchars('"' . IMP::displayFolder($sent_mail_folder) . '"'); - } /* Get user identities. */ $all_sigs = $identity->getAllSignatures(); @@ -95,6 +91,17 @@ class IMP_Views_Compose $result['jsappend'] .= $imp_ui->initRTE('dimp'); } + /* Create list for sent-mail selection. */ + if (!empty($GLOBALS['conf']['user']['select_sentmail_folder']) && + !$GLOBALS['prefs']->isLocked('sent_mail_folder')) { + $imp_folder = IMP_Folder::singleton(); + $flist = array(); + foreach ($imp_folder->flist() as $val) { + $flist[] = array('l' => $val['abbrev'], 'v' => $val['val']); + } + $result['js'][] = 'DIMP.conf_compose.flist = ' . Horde_Serialize::serialize($flist, Horde_Serialize::JSON); + } + // Buffer output so that we can return a string from this function ob_start(); require IMP_TEMPLATES . '/chunks/compose.php'; diff --git a/imp/templates/chunks/compose.php b/imp/templates/chunks/compose.php index dfb502827..f3323a9f9 100644 --- a/imp/templates/chunks/compose.php +++ b/imp/templates/chunks/compose.php @@ -4,7 +4,7 @@ * * Variables passed in from calling code: * $compose_html, $from, $id, $identity, $composeCache, $rte, - * $selected_identity, $sent_mail_folder + * $selected_identity * * Copyright 2005-2009 The Horde Project (http://www.horde.org/) * @@ -60,7 +60,7 @@ function _createDAcompose($text, $image, $id) isLocked('save_sent_mail')): ?> - + diff --git a/imp/themes/screen-dimp.css b/imp/themes/screen-dimp.css index 1488b1900..2d2d8fad5 100644 --- a/imp/themes/screen-dimp.css +++ b/imp/themes/screen-dimp.css @@ -688,6 +688,10 @@ div.dimpActionsCompose, div.dimpActionsMsg { left: 0; } +#compose_flist_popdown { + margin-top: -1px; +} + /* attachment file list */ #attach_list { padding-top: 5px; @@ -862,7 +866,7 @@ a.address:hover img { } /* Images */ -div.msgStatus div, #msgHeadersContent .subject span, span.iconImg, span.contextImg, span.spellcheckPopdownImg, #qsearch_icon, #qsearch_close { +div.msgStatus div, #msgHeadersContent .subject span, span.iconImg, span.contextImg, span.spellcheckPopdownImg, #qsearch_icon, #qsearch_close, #compose_flist_popdown { display: -moz-inline-stack; display: inline-block; height: 16px;