Prechádzať zdrojové kódy

Added a "bypass trash" checkbox to the mailbox display. When checked, the Delete button ignores the use of the trash folder.

tassium 22 rokov pred
rodič
commit
122f1e9e03

+ 2 - 0
ChangeLog

@@ -80,6 +80,8 @@ Version 1.5.0 -- CVS
     with upcoming PHP 4.3.3.
   - Encoding of Russian translation changed to utf-8. Lithuanian translation changed
     to iso-8859-4. Fix allows to use national letters in folder names correctly.
+  - Added "Bypass Trash" checkbox to folder index, used with the Delete
+    button. (tassium)
 
 **************************************
 *** SquirrelMail Stable Series 1.4 ***

+ 2 - 2
functions/imap_messages.php

@@ -51,10 +51,10 @@ function sqimap_messages_delete ($imap_stream, $start, $end, $mailbox) {
     sqimap_messages_flag ($imap_stream, $start, $end, "Deleted", true);
 }
 
-function sqimap_msgs_list_delete ($imap_stream, $mailbox, $id) {
+function sqimap_msgs_list_delete ($imap_stream, $mailbox, $id, $bypass_trash=false) {
     global $move_to_trash, $trash_folder, $uid_support;
     $msgs_id = sqimap_message_list_squisher($id);
-    if (($move_to_trash == true) && (sqimap_mailbox_exists($imap_stream, $trash_folder) && ($mailbox != $trash_folder))) {
+    if (($move_to_trash == true) && (sqimap_mailbox_exists($imap_stream, $trash_folder) && ($mailbox != $trash_folder)) && ($bypass_trash != true)) {
         $read = sqimap_run_command ($imap_stream, "COPY $msgs_id " . sqimap_encode_mailbox_name($trash_folder), true, $response, $message, $uid_support);
     }
     $read = sqimap_run_command ($imap_stream, "STORE $msgs_id +FLAGS (\\Deleted)", true, $response, $message, $uid_support);

+ 2 - 1
functions/mailbox_display.php

@@ -758,7 +758,8 @@ function mail_message_listing_beginning ($imapConnection,
                               . "$sort" . '&start_messages=1&set_thread=' . "$set_thread"
                               . '&mailbox=' . urlencode($mailbox) . '><small>' . $thread_name
                               . '</a></small>&nbsp;'
-                     , '', '', '' )
+                     , '', '', '' ) . html_tag( 'td', 'Bypass Trash<input type="checkbox" name="bypass_trash">','right','','')
+
                  , '', '', '' );
     }
 

+ 2 - 1
src/move_messages.php

@@ -114,6 +114,7 @@ sqgetGlobalVar('markRead',        $markRead,        SQ_POST);
 sqgetGlobalVar('markUnread',      $markUnread,      SQ_POST);
 sqgetGlobalVar('attache',         $attache,         SQ_POST);
 sqgetGlobalVar('location',        $location,        SQ_POST);
+sqgetGlobalVar('bypass_trash',    $bypass_trash,    SQ_POST);
 
 /* end of get globals */
 
@@ -178,7 +179,7 @@ if(isset($expungeButton)) {
                 sqimap_toggle_flag($imapConnection, $id, '\\Seen',false,true);
             } else  {
                 if (!$button_action) {
-                    sqimap_msgs_list_delete($imapConnection, $mailbox, $id);
+                    sqimap_msgs_list_delete($imapConnection, $mailbox, $id,$bypass_trash);
                     if ($auto_expunge) {
                         $cnt = sqimap_mailbox_expunge($imapConnection, $mailbox, true);
                     }