From 114810c150ffdab80c0c7e660add669916ba5b6d Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Mon, 20 Dec 2010 19:11:49 -0700 Subject: [PATCH] disposition_request_read -> request_mdn No need for 'allow_receipts' configuration option; admin can lock this preference if needed. --- imp/compose-mimp.php | 2 +- imp/compose.php | 4 ++-- imp/config/conf.xml | 2 -- imp/config/prefs.php.dist | 6 +++--- imp/docs/UPGRADING | 2 ++ imp/lib/Compose.php | 4 ++-- imp/lib/LoginTasks/SystemTask/UpgradeFromImp4.php | 14 ++++++++++++++ imp/lib/Prefs/Ui.php | 3 --- imp/lib/Views/Compose.php | 7 +++---- imp/locale/en/help.xml | 6 +++--- 10 files changed, 30 insertions(+), 20 deletions(-) diff --git a/imp/compose-mimp.php b/imp/compose-mimp.php index 0a75332b9..96f544cbe 100644 --- a/imp/compose-mimp.php +++ b/imp/compose-mimp.php @@ -276,7 +276,7 @@ case _("Send"): $options = array( 'identity' => $identity, - 'readreceipt' => ($conf['compose']['allow_receipts'] && ($prefs->getValue('disposition_request_read') == 'always')), + 'readreceipt' => ($prefs->getValue('request_mdn') == 'always'), 'save_sent' => $save_sent_mail, 'sent_folder' => $sent_mail_folder ); diff --git a/imp/compose.php b/imp/compose.php index 0058ad6e4..2028740cb 100644 --- a/imp/compose.php +++ b/imp/compose.php @@ -931,8 +931,8 @@ if ($redirect) { } } - $d_read = $prefs->getValue('disposition_request_read'); - $t->set('rrr', $conf['compose']['allow_receipts'] && ($d_read != 'never')); + $d_read = $prefs->getValue('request_mdn'); + $t->set('rrr', ($d_read != 'never')); if ($t->get('rrr')) { $t->set('rrr_selected', ($d_read != 'ask') || $request_read_receipt); $t->set('rrr_label', Horde::label('rrr', _("Request a _Read Receipt"))); diff --git a/imp/config/conf.xml b/imp/config/conf.xml index 1b91e05bf..399e98813 100644 --- a/imp/config/conf.xml +++ b/imp/config/conf.xml @@ -133,8 +133,6 @@ - true false _("Request read receipts?"), - 'help' => 'prefs-disposition_request_read' + 'help' => 'prefs-request_mdn' ); // The list of buttons to show in CKeditor diff --git a/imp/docs/UPGRADING b/imp/docs/UPGRADING index b88ece108..799b7c7ba 100644 --- a/imp/docs/UPGRADING +++ b/imp/docs/UPGRADING @@ -54,6 +54,7 @@ minimal (mimp) display have been removed. The following configuration options have been removed: + allow_receipts append_trailer cache_folders limit_factor @@ -74,6 +75,7 @@ your ``config/prefs.php`` file and your preferences backend:: alternative_display attachment_display auto_delete_drafts + disposition_request_read disposition_send_mdn fckeditor_buttons fetchmail_link diff --git a/imp/lib/Compose.php b/imp/lib/Compose.php index 1dcd1a121..0e80a487b 100644 --- a/imp/lib/Compose.php +++ b/imp/lib/Compose.php @@ -657,7 +657,7 @@ class IMP_Compose implements ArrayAccess, Countable, Iterator $flags = array('\\seen'); /* RFC 3503 [3.3] - set $MDNSent flag on sent message. */ - if ($conf['compose']['allow_receipts']) { + if ($prefs->getValue('request_mdn') != 'never') { $mdn = new Horde_Mime_Mdn($headers); if ($mdn->getMdnReturnAddr()) { $flags[] = array('$MDNSent'); @@ -751,7 +751,7 @@ class IMP_Compose implements ArrayAccess, Countable, Iterator /* Add Return Receipt Headers. */ if (!empty($opts['readreceipt']) && - $GLOBALS['conf']['compose']['allow_receipts']) { + ($GLOBALS['prefs']->getValue('request_mdn') != 'never')) { $mdn = new Horde_Mime_Mdn($ob); $mdn->addMdnRequestHeaders(Horde_Mime_Address::bareAddress($ob->getValue('from'), $GLOBALS['session']->get('imp', 'maildomain'))); } diff --git a/imp/lib/LoginTasks/SystemTask/UpgradeFromImp4.php b/imp/lib/LoginTasks/SystemTask/UpgradeFromImp4.php index 5ec8037be..103f57f27 100644 --- a/imp/lib/LoginTasks/SystemTask/UpgradeFromImp4.php +++ b/imp/lib/LoginTasks/SystemTask/UpgradeFromImp4.php @@ -27,6 +27,7 @@ class IMP_LoginTasks_SystemTask_UpgradeFromImp4 extends Horde_LoginTasks_SystemT public function execute() { $this->_upgradeAbookPrefs(); + $this->_upgradeComposePrefs(); $this->_upgradeForwardPrefs(); $this->_upgradeLoginTasksPrefs(); $this->_upgradeMsgDisplayPrefs(); @@ -68,6 +69,19 @@ class IMP_LoginTasks_SystemTask_UpgradeFromImp4 extends Horde_LoginTasks_SystemT } /** + * Upgrade to the new compose preferences. + */ + protected function _upgradeComposePrefs() + { + global $prefs; + + if ($prefs->isDefault('request_mdn') && + ($val = $prefs->getValue('disposition_request_read'))) { + $prefs->setValue('request_mdn', $val); + } + } + + /** * Upgrade to the new forward preferences. */ protected function _upgradeForwardPrefs() diff --git a/imp/lib/Prefs/Ui.php b/imp/lib/Prefs/Ui.php index 689287f75..9b17a5af2 100644 --- a/imp/lib/Prefs/Ui.php +++ b/imp/lib/Prefs/Ui.php @@ -207,9 +207,6 @@ class IMP_Prefs_Ui if ($prefs->isLocked('default_encrypt')) { $ui->suppress[] = 'encryptselect'; } - if (empty($conf['compose']['allow_receipts'])) { - $ui->suppress[] = 'disposition_request_read'; - } if (!$prefs->getValue('compose_html')) { $ui->suppress[] = 'compose_html_font_family'; diff --git a/imp/lib/Views/Compose.php b/imp/lib/Views/Compose.php index 609d17b81..aa28bc3e2 100644 --- a/imp/lib/Views/Compose.php +++ b/imp/lib/Views/Compose.php @@ -134,11 +134,10 @@ class IMP_Views_Compose 'title' => _("Save as Draft") ))); - $d_read = $prefs->getValue('disposition_request_read'); - if ($conf['compose']['allow_receipts'] && - ($d_read != 'never')) { + $d_read = $prefs->getValue('request_mdn'); + if ($d_read != 'never') { $t->set('read_receipt', true); - $t->set('read_receipt_set', $d_read != 'ask'); + $t->set('read_receipt_set', ($d_read != 'ask')); } $t->set('save_sent_mail', ($conf['user']['allow_folders'] && !$prefs->isLocked('save_sent_mail'))); diff --git a/imp/locale/en/help.xml b/imp/locale/en/help.xml index fc1a46764..747478b8a 100644 --- a/imp/locale/en/help.xml +++ b/imp/locale/en/help.xml @@ -762,17 +762,17 @@ - + Preferences: Request Read Receipts - "Request a Read Receipt" sends a request to the recipients of this message to notify you when this message is opened by the recipients. Not all clients support / honor this. + "Request a Read Receipt" sends a read receipt request (also known as a Message Dispositon Notification) to the recipients of a composed message to notify you when this message is opened by the recipients. Not all clients support / honor this. Preferences: Send Read Receipt - "Send a MDN" sends a read receipt (also known as a Message Disposition Notification) when you view a message in which the user has requested that they receive notification that you have read the message. By default, you will be prompted to send the notification. + "Send a Read Receipt" sends a read receipt (also known as a Message Disposition Notification) when you view a message in which the user has requested that they receive notification that you have read the message. By default, you will be prompted to send the notification. -- 2.11.0