From 6c540963c77709619a0670cc733249c8a4162c30 Mon Sep 17 00:00:00 2001 From: tassium Date: Thu, 28 Aug 2003 17:28:21 +0000 Subject: [PATCH] Added a "bypass trash" checkbox to the mailbox display. When checked, the Delete button ignores the use of the trash folder. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5582 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- ChangeLog | 2 ++ functions/imap_messages.php | 4 ++-- functions/mailbox_display.php | 3 ++- src/move_messages.php | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 943edb84..65dfb770 100644 --- a/ChangeLog +++ b/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 *** diff --git a/functions/imap_messages.php b/functions/imap_messages.php index 931ca036..c591038f 100755 --- a/functions/imap_messages.php +++ b/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); diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index 588e813e..2f14e7b1 100644 --- a/functions/mailbox_display.php +++ b/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) . '>' . $thread_name . ' ' - , '', '', '' ) + , '', '', '' ) . html_tag( 'td', 'Bypass Trash','right','','') + , '', '', '' ); } diff --git a/src/move_messages.php b/src/move_messages.php index 70b3d1cb..8200de48 100644 --- a/src/move_messages.php +++ b/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); } -- 2.25.1