Added code for priority.
[squirrelmail.git] / src / compose.php
index 8c5fc0ac4459316adac529b5353cd5dc8bee979f..176acee74b4265d1b72db1dba4b388205ccc1bcf 100644 (file)
          $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);
    }
 
    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) {
       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");
 
    // True if FAILURE
    function saveAttachedFiles() {
       global $HTTP_POST_FILES, $attachment_dir, $attachments;
-
+      
       $localfilename = GenerateRandomString(32, '', 7);
       while (file_exists($attachment_dir . $localfilename))
           $localfilename = GenerateRandomString(32, '', 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();
          }