disposition_request_read -> request_mdn
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 21 Dec 2010 02:11:49 +0000 (19:11 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 21 Dec 2010 02:16:38 +0000 (19:16 -0700)
No need for 'allow_receipts' configuration option; admin can lock this
preference if needed.

imp/compose-mimp.php
imp/compose.php
imp/config/conf.xml
imp/config/prefs.php.dist
imp/docs/UPGRADING
imp/lib/Compose.php
imp/lib/LoginTasks/SystemTask/UpgradeFromImp4.php
imp/lib/Prefs/Ui.php
imp/lib/Views/Compose.php
imp/locale/en/help.xml

index 0a75332..96f544c 100644 (file)
@@ -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
         );
index 0058ad6..2028740 100644 (file)
@@ -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")));
index 1b91e05..399e988 100644 (file)
 
  <configtab name="compose" desc="Compose">
   <configsection name="compose">
-   <configboolean name="allow_receipts" desc="Can the user request a return
-   receipt?">true</configboolean>
    <configboolean name="use_vfs" desc="Should we use the Horde VFS system for
    storing uploaded attachments?">false</configboolean>
    <configswitch name="link_attachments" desc="Should we allow the users to
index 3769b55..bb4d5cf 100644 (file)
@@ -408,7 +408,7 @@ $prefGroups['compose'] = array(
         'compose_confirm', 'set_priority', 'compose_popup', 'compose_html',
         'compose_html_font_family', 'compose_html_font_size', 'mail_domain',
         'compose_cursor', 'encryptselect', 'save_attachments',
-        'disposition_request_read'
+        'request_mdn'
     )
 );
 
@@ -531,7 +531,7 @@ $_prefs['save_attachments'] = array(
 );
 
 // Disposition Notification Preferences
-$_prefs['disposition_request_read'] = array(
+$_prefs['request_mdn'] = array(
     'value' => 'ask',
     'type' => 'enum',
     'enum' => array(
@@ -540,7 +540,7 @@ $_prefs['disposition_request_read'] = array(
         'always' => _("Always")
     ),
     'desc' => _("Request read receipts?"),
-    'help' => 'prefs-disposition_request_read'
+    'help' => 'prefs-request_mdn'
 );
 
 // The list of buttons to show in CKeditor
index b88ece1..799b7c7 100644 (file)
@@ -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
index 1dcd1a1..0e80a48 100644 (file)
@@ -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')));
         }
index 5ec8037..103f57f 100644 (file)
@@ -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()
index 689287f..9b17a5a 100644 (file)
@@ -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';
index 609d17b..aa28bc3 100644 (file)
@@ -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')));
index fc1a467..747478b 100644 (file)
     </para>
 </entry>
 
-<entry id="prefs-disposition_request_read">
+<entry id="prefs-request_mdn">
     <title>Preferences: Request Read Receipts</title>
     <para>
-    &quot;Request a Read Receipt&quot; 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.
+    &quot;Request a Read Receipt&quot; 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.
     </para>
 </entry>
 
 <entry id="prefs-send_mdn">
     <title>Preferences: Send Read Receipt</title>
     <para>
-    &quot;Send a MDN&quot; 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.
+    &quot;Send a Read Receipt&quot; 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.
     </para>
 </entry>