summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2006-05-01 14:47:27 +0000
committerthomascube <thomas@roundcube.net>2006-05-01 14:47:27 +0000
commit6204390af16bcf50f82da61a1aefc2ad0c0adf94 (patch)
tree21db0bbe17472e7517233fbcc92f1f5ad21e455a
parenta4bafb40979b578951863cb1ae49c95d4a02cb9b (diff)
Applied patch for requesting receipts by Salvatore Ansani
-rw-r--r--program/include/main.inc7
-rw-r--r--program/localization/de_CH/labels.inc1
-rw-r--r--program/localization/de_DE/labels.inc1
-rw-r--r--program/localization/en_US/labels.inc1
-rw-r--r--program/steps/mail/compose.inc16
-rw-r--r--program/steps/mail/sendmail.inc5
-rw-r--r--skins/default/mail.css9
-rw-r--r--skins/default/templates/compose.html4
8 files changed, 40 insertions, 4 deletions
diff --git a/program/include/main.inc b/program/include/main.inc
index c0dd71ecb..67d596d87 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -189,12 +189,12 @@ function rcmail_set_imap_prop()
global $CONFIG, $IMAP;
// set root dir from config
- if (strlen($CONFIG['imap_root']))
+ if (!empty($CONFIG['imap_root']))
$IMAP->set_rootdir($CONFIG['imap_root']);
- if (strlen($_SESSION['mbox']))
+ if (!empty($_SESSION['mbox']))
$IMAP->set_mailbox($_SESSION['mbox']);
-
+
if (isset($_SESSION['page']))
$IMAP->set_page($_SESSION['page']);
}
@@ -1149,6 +1149,7 @@ function rcube_xml_command($command, $str_attrib, $a_attrib=NULL)
'priorityselector' => 'rcmail_priority_selector',
'charsetselector' => 'rcmail_charset_selector',
'searchform' => 'rcmail_search_form',
+ 'receiptcheckbox' => 'rcmail_receipt_checkbox',
// ADDRESS BOOK
'addresslist' => 'rcmail_contacts_list',
diff --git a/program/localization/de_CH/labels.inc b/program/localization/de_CH/labels.inc
index 027142098..72fc87862 100644
--- a/program/localization/de_CH/labels.inc
+++ b/program/localization/de_CH/labels.inc
@@ -123,6 +123,7 @@ $labels['compose'] = 'Neue Nachricht verfassen';
$labels['sendmessage'] = 'Nachricht jetzt senden';
$labels['addattachment'] = 'Datei anfügen';
$labels['charset'] = 'Zeichensatz';
+$labels['returnreceipt'] = 'Empfangsbestätigung';
$labels['attachments'] = 'Anhänge';
$labels['upload'] = 'Hochladen';
diff --git a/program/localization/de_DE/labels.inc b/program/localization/de_DE/labels.inc
index 074ad3d86..249e6ec8f 100644
--- a/program/localization/de_DE/labels.inc
+++ b/program/localization/de_DE/labels.inc
@@ -124,6 +124,7 @@ $labels['compose'] = 'Neue Nachricht verfassen';
$labels['sendmessage'] = 'Nachricht jetzt senden';
$labels['addattachment'] = 'Datei anfügen';
$labels['charset'] = 'Zeichensatz';
+$labels['returnreceipt'] = 'Empfangsbestätigung';
$labels['attachments'] = 'Anhänge';
$labels['upload'] = 'Hochladen';
diff --git a/program/localization/en_US/labels.inc b/program/localization/en_US/labels.inc
index 9b27a90dc..e280dbb29 100644
--- a/program/localization/en_US/labels.inc
+++ b/program/localization/en_US/labels.inc
@@ -123,6 +123,7 @@ $labels['compose'] = 'Compose a message';
$labels['sendmessage'] = 'Send the message now';
$labels['addattachment'] = 'Attach a file';
$labels['charset'] = 'Charset';
+$labels['returnreceipt'] = 'Return receipt';
$labels['attachments'] = 'Attachments';
$labels['upload'] = 'Upload';
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index d278279d9..b25c3690f 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -567,6 +567,22 @@ function rcmail_priority_selector($attrib)
}
+function rcmail_receipt_checkbox($attrib)
+ {
+ list($form_start, $form_end) = get_form_tags($attrib);
+ unset($attrib['form']);
+
+ $attrib['name'] = '_receipt';
+ $checkbox = new checkbox(array('name' => '_receipt', 'id' => 'receipt', 'value' => 1));
+
+ $out = $form_start ? "$form_start\n" : '';
+ $out .= $checkbox->show(0);
+ $out .= $form_end ? "\n$form_end" : '';
+
+ return $out;
+ }
+
+
function get_form_tags($attrib)
{
global $CONFIG, $OUTPUT, $JS_OBJECT_NAME, $MESSAGE_FORM, $SESS_HIDDEN_FIELD;
diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc
index 33f023de1..f8d3ada4f 100644
--- a/program/steps/mail/sendmail.inc
+++ b/program/steps/mail/sendmail.inc
@@ -136,6 +136,11 @@ if (!empty($_POST['_priority']))
$headers['X-Priority'] = sprintf("%d (%s)", $priority, ucfirst($str_priority));
}
+if (!empty($_POST['_receipt']))
+ {
+ $headers['Return-Receipt-To'] = $identity_arr['string'];
+ $headers['Disposition-Notification-To'] = $identity_arr['string'];
+ }
// additional headers
$headers['Message-ID'] = $message_id;
diff --git a/skins/default/mail.css b/skins/default/mail.css
index 3188e6574..333aed0ae 100644
--- a/skins/default/mail.css
+++ b/skins/default/mail.css
@@ -642,7 +642,14 @@ div.message-part pre
#priority-selector
{
position: absolute;
- left: 200px;
+ left: 180px;
+ top: 10px;
+}
+
+#receipt-selector
+{
+ position: absolute;
+ left: 350px;
top: 10px;
}
diff --git a/skins/default/templates/compose.html b/skins/default/templates/compose.html
index d160dd93a..07ebf82ae 100644
--- a/skins/default/templates/compose.html
+++ b/skins/default/templates/compose.html
@@ -39,6 +39,10 @@ function rcmail_toggle_display(id)
<roundcube:label name="priority" />:&nbsp;<roundcube:object name="prioritySelector" form="form" />
</div>
+<div id="receipt-selector">
+<roundcube:object name="receiptCheckBox" form="form" />&nbsp;<roundcube:label name="returnreceipt" />
+</div>
+
</div>
<div id="compose-container">