From: Michael M Slusarz Date: Fri, 4 Dec 2009 20:25:12 +0000 (-0700) Subject: Add priority setting to DIMP X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=7b397ded36f54840af7892a54e46b94ddeb4a981;p=horde.git Add priority setting to DIMP --- diff --git a/imp/compose-dimp.php b/imp/compose-dimp.php index 962b1f1a1..69c8f0c98 100644 --- a/imp/compose-dimp.php +++ b/imp/compose-dimp.php @@ -149,6 +149,7 @@ if (count($_POST)) { $imptree->eltDiffStart(); $options = array( + 'priority' => Horde_Util::getFormData('priority'), 'readreceipt' => Horde_Util::getFormData('request_read_receipt'), 'save_attachments' => Horde_Util::getFormData('save_attachments_select'), 'save_sent' => (($prefs->isLocked('save_sent_mail')) diff --git a/imp/docs/CHANGES b/imp/docs/CHANGES index 73a1676bd..ddcbc9fe7 100644 --- a/imp/docs/CHANGES +++ b/imp/docs/CHANGES @@ -2,6 +2,7 @@ v5.0-git -------- +[mms] Add priority setting to DIMP. [mms] Simplify and improve priority header generation/display. [mms] Add Face: header support to IMP. [mms] Add splitbar to resize sidebar in DIMP. diff --git a/imp/js/compose-dimp.js b/imp/js/compose-dimp.js index e501f8c0c..84250f120 100644 --- a/imp/js/compose-dimp.js +++ b/imp/js/compose-dimp.js @@ -10,7 +10,7 @@ var DimpCompose = { // Variables defaulting to empty/false: // auto_save_interval, button_pressed, compose_cursor, dbtext, - // drafts_mbox, editor_on, is_popup, knl, mp_padding, resizebcc, + // drafts_mbox, editor_on, is_popup, knl_sm, knl_p, mp_padding, resizebcc, // resizecc, resizeto, row_height, rte, sbtext, skip_spellcheck, // spellcheck, uploading last_msg: '', @@ -154,10 +154,28 @@ var DimpCompose = { $('sent_mail_folder_label').writeAttribute('title', l.escapeHTML()).setText(l.truncate(15)).up(1).show(); if (DIMP.conf_compose.flist && sel) { - this.knl.setSelected(s); + this.knl_sm.setSelected(s); } }, + setPriorityLabel: function(s, l) + { + var label = $('priority_label'); + + if (!label) { + return; + } + + if (!l) { + l = DIMP.conf_compose.priority.find(function(f) { + return f.v == s; + }); + } + + $('priority').setValue(s); + $('priority_label').setText(l.l); + }, + getIdentity: function(id, editor_on) { editor_on = Object.isUndefined(editor_on) ? this.editor_on : editor_on; @@ -812,13 +830,24 @@ var DimpCompose = { /* Create folderlist. */ if (DIMP.conf_compose.flist) { - this.knl = new KeyNavList('save_sent_mail', { + this.knl_sm = new KeyNavList('save_sent_mail', { esc: true, list: DIMP.conf_compose.flist, onChoose: this.setSentMailLabel.bind(this) }); - this.knl.setSelected(this.getIdentity($F('identity'))[3]); - $('sent_mail_folder_label').insert({ after: new Element('SPAN', { className: 'popdownImg' }).observe('click', function(e) { this.knl.show(); this.knl.ignoreClick(e); e.stop(); }.bindAsEventListener(this)) }); + this.knl_sm.setSelected(this.getIdentity($F('identity'))[3]); + $('sent_mail_folder_label').insert({ after: new Element('SPAN', { className: 'popdownImg' }).observe('click', function(e) { this.knl_sm.show(); this.knl_sm.ignoreClick(e); e.stop(); }.bindAsEventListener(this)) }); + } + + /* Create priority list. */ + if (DIMP.conf_compose.priority) { + this.knl_p = new KeyNavList('priority_label', { + esc: true, + list: DIMP.conf_compose.priority, + onChoose: this.setPriorityLabel.bind(this) + }); + this.setPriorityLabel('normal'); + $('priority_label').insert({ after: new Element('SPAN', { className: 'popdownImg' }).observe('click', function(e) { this.knl_p.show(); this.knl_p.ignoreClick(e); e.stop(); }.bindAsEventListener(this)) }); } $('dimpLoading').hide(); diff --git a/imp/templates/chunks/compose.php b/imp/templates/chunks/compose.php index e85990048..22fb6c52f 100644 --- a/imp/templates/chunks/compose.php +++ b/imp/templates/chunks/compose.php @@ -70,6 +70,12 @@ $compose_disable = !IMP::canCompose(); +getValue('set_priority')): ?> +
+ + +
+ diff --git a/imp/templates/javascript_defs_dimp.php b/imp/templates/javascript_defs_dimp.php index 90c92fec9..d56523f0c 100644 --- a/imp/templates/javascript_defs_dimp.php +++ b/imp/templates/javascript_defs_dimp.php @@ -166,10 +166,6 @@ if ($compose_mode) { 'spellcheck' => intval($GLOBALS['prefs']->getValue('compose_spellcheck')), )); - if ($GLOBALS['registry']->hasMethod('contacts/search')) { - $code['conf_compose']['URI_ABOOK'] = (string) Horde::applicationUrl('contacts.php'); - } - /* Gettext strings used in compose page. */ $code['text_compose'] = array( 'atc_limit' => _("The attachment limit has been reached."), @@ -182,6 +178,28 @@ if ($compose_mode) { 'toggle_html' => _("Really discard all formatting information? This operation cannot be undone."), 'uploading' => _("Uploading..."), ); + + if ($GLOBALS['registry']->hasMethod('contacts/search')) { + $code['conf_compose']['URI_ABOOK'] = (string) Horde::applicationUrl('contacts.php'); + } + + if ($GLOBALS['prefs']->getValue('set_priority')) { + $code['conf_compose']['priority'] = array( + array( + 'l' => _("High"), + 'v' => 'high' + ), + array( + 'l' => _("Normal"), + 's' => true, + 'v' => 'normal' + ), + array( + 'l' => _("Low"), + 'v' => 'low' + ) + ); + } } Horde::addInlineScript(array( diff --git a/imp/themes/screen-dimp.css b/imp/themes/screen-dimp.css index 865dbe02e..8b96a9a60 100644 --- a/imp/themes/screen-dimp.css +++ b/imp/themes/screen-dimp.css @@ -400,6 +400,11 @@ div.vpRowVert.flagUnseen { text-decoration: underline; } +#priority_label { + cursor: default; + font-weight: bold; +} + /* Actions */ .dimpActions { background: #efefef;