From: Pontus U. <ul...@us...> - 2001-11-04 11:55:22
|
Update of /cvsroot/squirrelmail/squirrelmail/src In directory usw-pr-cvs1:/tmp/cvs-serv30092 Modified Files: compose.php read_body.php Log Message: Added code for priority. Sysadmins can allow/disallow users to send e-mail messages with priority using the conf.pl script. Index: compose.php =================================================================== RCS file: /cvsroot/squirrelmail/squirrelmail/src/compose.php,v retrieving revision 1.169 retrieving revision 1.170 diff -u -w -r1.169 -r1.170 --- compose.php 2001/11/03 00:31:19 1.169 +++ compose.php 2001/11/04 11:55:18 1.170 @@ -208,7 +208,8 @@ $editor_size, $attachments, $subject, $newmail, $use_javascript_addr_book, $send_to_bcc, $reply_id, $mailbox, $from_htmladdr_search, $location_of_buttons, $attachment_dir, - $username, $data_dir, $identity, $draft_id, $delete_draft; + $username, $data_dir, $identity, $draft_id, $delete_draft, + $mailprio; $subject = decodeHeader($subject); $reply_subj = decodeHeader($reply_subj); @@ -376,7 +377,8 @@ } function showComposeButtonRow() { - global $use_javascript_addr_book, $save_as_draft; + global $use_javascript_addr_book, $save_as_draft, + $default_use_priority, $mailprio; echo " <TR><td>\n </td><td>\n"; if ($use_javascript_addr_book) { @@ -393,6 +395,16 @@ if ($save_as_draft) { echo "<input type=\"submit\" name =\"draft\" value=\"Save Draft\">\n"; } + if ($default_use_priority) { + if(!isset($mailprio)) { + $mailprio = "3"; + } + echo "\n\t". _("Priority") .":<select name=\"mailprio\">". + "\n\t\t<option value=1".($mailprio=="1"?" selected":"").">". _("High") ."</option>". + "\n\t\t<option value=3".($mailprio=="3"?" selected":"").">". _("Normal") ."</option>". + "\n\t\t<option value=5".($mailprio=="5"?" selected":"").">". _("Low")."</option>". + "\n\t</select>"; + } do_hook("compose_button_row"); @@ -500,7 +512,7 @@ do_hook("compose_send"); - if (! sendMessage($send_to, $send_to_cc, $send_to_bcc, $subject, $body, $reply_id)) { + if (!sendMessage($send_to, $send_to_cc, $send_to_bcc, $subject, $body, $reply_id, $mailprio)) { showInputForm(); exit(); } Index: read_body.php =================================================================== RCS file: /cvsroot/squirrelmail/squirrelmail/src/read_body.php,v retrieving revision 1.116 retrieving revision 1.117 diff -u -w -r1.116 -r1.117 --- read_body.php 2001/10/29 14:48:02 1.116 +++ read_body.php 2001/11/04 11:55:18 1.117 @@ -334,6 +334,17 @@ } } } + + if($default_use_priority) { + switch(substr($message->header->priority,0,1)) { + case "1" : $priority_string = _("High"); + break; + case "3" : $priority_string = _("Normal"); + break; + case "5" : $priority_string = _("Low"); + break; + } + } /** make sure everything will display in HTML format **/ $from_name = decodeHeader(htmlspecialchars($message->header->from)); $subject = decodeHeader(htmlspecialchars($message->header->subject)); @@ -465,6 +476,17 @@ " <B>$bcc_string</B> \n" . ' </TD>' . "\n" . ' </TR>' . "\n"; + } + if ($default_use_priority) { + if (isset($priority_string)) { + echo " <TR>\n" . + " <TD BGCOLOR=\"$color[0]\" ALIGN=RIGHT VALIGN=TOP>\n" . + " "._("Priority").": \n". + " </TD><TD BGCOLOR=\"$color[0]\" VALIGN=TOP colspan=2>\n" . + " <B>$priority_string</B> \n" . + " </TD>" . "\n" . + " </TR>" . "\n"; + } } do_hook("read_body_header"); echo '</TABLE>' . |