<--- snip --->
- Adds "Edit Message as New" functionality to messages in the sent folder
- Fixes < > showing as &lt; and &gt; when resuming draft or editing as new
- Now remembers priority when saving draft
- Now remembers the correct identity when resuming draft/editing as new (only for people using multiple identities)
- Fixed small bug that broke compose in new window on Resume Draft
<--- snip --->
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2661
7612ce4b-ef26-0410-bec9-
ea0150e637f0
if (! isset($MDN)) {
$MDN = 'False';
}
- if (!saveMessageAsDraft($send_to, $send_to_cc, $send_to_bcc, $subject, $body, $reply_id, $MDN, $session)) {
+ if (! isset($mailprio)) {
+ $mailprio = '';
+ }
+ if (!saveMessageAsDraft($send_to, $send_to_cc, $send_to_bcc, $subject, $body, $reply_id, $mailprio, $session)) {
showInputForm($session);
exit();
} else {
$send_to = decodeHeader($send_to, false);
$send_to_cc = decodeHeader($send_to_cc, false);
$send_to_bcc = decodeHeader($send_to_bcc, false);
+ $send_to = str_replace('<', '<', str_replace('>', '>', str_replace('&', '&', str_replace('"', '"', $send_to))));
+ $send_to_cc = str_replace('<', '<', str_replace('>', '>', str_replace('&', '&', str_replace('"', '"', $send_to_cc))));
+ $send_to_bcc = str_replace('<', '<', str_replace('>', '>', str_replace('&', '&', str_replace('"', '"', $send_to_bcc))));
if ($forward_id) {
$id = $forward_id;
}
-function saveMessageAsDraft($t, $c, $b, $subject, $body, $reply_id, $session) {
+function saveMessageAsDraft($t, $c, $b, $subject, $body, $reply_id, $prio = 3, $session) {
global $useSendmail, $msg_id, $is_reply, $mailbox, $onetimepad,
$data_dir, $username, $domain, $key, $version, $sent_folder,
- $imapServerAddress, $imapPort, $draft_folder, $attachment_dir;
+ $imapServerAddress, $imapPort, $draft_folder, $attachment_dir,
+ $default_use_priority;
$more_headers = Array();
+ if ($default_use_priority) {
+ $more_headers = array_merge($more_headers, createPriorityHeaders($prio));
+ }
+
$imap_stream = sqimap_login($username, $key, $imapServerAddress, $imapPort, 1);
$hashed_attachment_dir = getHashedDir($username, $attachment_dir);
/** make sure everything will display in HTML format **/
$from_name = decodeHeader(htmlspecialchars($message->header->from));
$subject = decodeHeader(htmlspecialchars($message->header->subject));
+$identity = '';
+$idents = getPref($data_dir, $username, 'identities');
+if (!empty($idents) && $idents > 1) {
+ for ($i = 1; $i < $idents; $i++) {
+ if (htmlspecialchars('"' . encodeHeader(getPref($data_dir, $username, 'full_name' . $i)) .
+ '" <' . getPref($data_dir, $username, 'email_address' . $i) . '>') == $from_name) {
+ $identity = $i;
+ break;
+ }
+ }
+}
do_hook('read_body_top');
echo '<BR>' .
echo _("Delete") . '</A> ';
if (($mailbox == $draft_folder) && ($save_as_draft)) {
echo '| <A HREF="' . $base_uri .
- "src/compose.php?mailbox=$mailbox&send_to=$url_to_string&send_to_cc=$url_cc_string&send_to_bcc=$url_bcc_string&subject=$url_subj&draft_id=$passed_id&ent_num=$ent_num" . '"';
+ "src/compose.php?mailbox=$mailbox&identity=$identity&send_to=$url_to_string&send_to_cc=$url_cc_string&send_to_bcc=$url_bcc_string&subject=$url_subj&mailprio=$priority_level&draft_id=$passed_id&ent_num=$ent_num" . '"';
if ($compose_new_win == '1') {
- echo 'TARGET="compose_window" onClick="comp_in_new()"';
+ echo ' TARGET="compose_window" onClick="comp_in_new()"';
}
echo '>'.
_("Resume Draft") . '</a>';
}
+if ($mailbox == $sent_folder) {
+ echo '| <A HREF="' . $base_uri .
+ "src/compose.php?mailbox=$mailbox&identity=$identity&send_to=$url_to_string&send_to_cc=$url_cc_string&send_to_bcc=$url_bcc_string&subject=$url_subj&mailprio=$priority_level&draft_id=$passed_id&ent_num=$ent_num" . '"';
+ if ($compose_new_win == '1') {
+ echo ' TARGET="compose_window" onClick="comp_in_new()"';
+ }
+ echo '>'.
+ _("Edit Message as New") . '</a>';
+}
echo ' ' .
'</SMALL>' .