diff --git a/bug_delete.php b/bug_delete.php index 5889daea65..720e39da76 100644 --- a/bug_delete.php +++ b/bug_delete.php @@ -15,79 +15,7 @@ check_access( $g_handle_bug_threshold ); check_bug_exists( $f_id ); - deleteBug($f_id, $f_bug_text_id); - - # function put in core_helper_API.php - /* - $c_id = (integer)$f_id; - $c_bug_text_id = (integer)$f_bug_text_id; - - # Delete the bug entry - $query = "DELETE - FROM $g_mantis_bug_table - WHERE id='$c_id'"; - $result = db_query($query); - - # Delete the corresponding bug text - $query = "DELETE - FROM $g_mantis_bug_text_table - WHERE id='$c_bug_text_id'"; - $result = db_query($query); - - # Delete the bugnote text items - $query = "SELECT bugnote_text_id - FROM $g_mantis_bugnote_table - WHERE bug_id='$c_id'"; - $result = db_query($query); - $bugnote_count = db_num_rows( $result ); - for ($i=0;$i<$bugnote_count;$i++){ - $row = db_fetch_array( $result ); - $t_bugnote_text_id = $row['bugnote_text_id']; - - # Delete the corresponding bugnote texts - $query = "DELETE - FROM $g_mantis_bugnote_text_table - WHERE id='$t_bugnote_text_id'"; - $result2 = db_query( $query ); - } - - # Delete the corresponding bugnotes - $query = "DELETE - FROM $g_mantis_bugnote_table - WHERE bug_id='$c_id'"; - $result = db_query($query); - - if ( DISK == $g_file_upload_method ) { - # Delete files from disk - $query = "SELECT diskfile - FROM $g_mantis_bug_file_table - WHERE bug_id='$c_id'"; - $result = db_query($query); - $file_count = db_num_rows( $result ); - - # there may be more than one file - for ($i=0;$i<$file_count;$i++){ - $row = db_fetch_array( $result ); - $t_diskfile = $row['diskfile']; - - # use this instead of delete; - # in windows replace with system("del $t_diskfile"); - chmod( $t_diskfile, 0775 ); - unlink( $t_diskfile ); - } - } - - # Delete the corresponding files - $query = "DELETE - FROM $g_mantis_bug_file_table - WHERE bug_id='$c_id'"; - $result = db_query($query); - - # Delete the bug history - $query = "DELETE - FROM $g_mantis_bug_history_table - WHERE bug_id='$c_id'"; - $result = db_query($query); */ + delete_bug($f_id, $f_bug_text_id); $t_redirect_url = 'view_all_bug_page.php'; if ( $result ) { diff --git a/core_email_API.php b/core_email_API.php index 7b805f85d7..757d179856 100644 --- a/core_email_API.php +++ b/core_email_API.php @@ -7,11 +7,11 @@ ########################################################################### # Email API # ------------------------------------------------- - # $Revision: 1.64 $ + # $Revision: 1.65 $ # $Author: vboctor $ - # $Date: 2002-07-02 12:48:52 $ + # $Date: 2002-07-04 10:00:59 $ # - # $Id: core_email_API.php,v 1.64 2002-07-02 12:48:52 vboctor Exp $ + # $Id: core_email_API.php,v 1.65 2002-07-04 10:00:59 vboctor Exp $ ########################################################################### # -------------------- # check to see that the format is valid and that the mx record exists @@ -343,9 +343,17 @@ function email_assign( $p_bug_id ) { email_bug_info( $p_bug_id, $s_email_assigned_msg, $t_bcc ); } # -------------------- + # send notices when a bug is DELETED + function email_bug_deleted( $p_bug_id ) { + global $s_email_bug_deleted_msg; + + $t_bcc = build_bcc_list( $p_bug_id, 'deleted' ); + email_bug_info( $p_bug_id, $s_email_bug_deleted_msg, $t_bcc ); + } + # -------------------- # messages are in two parts, the bug info and the bugnotes # Build the bug info part of the message - function email_build_bug_message( $p_bug_id ) { + function email_build_bug_message( $p_bug_id, $p_message ) { global $g_mantis_bug_table, $g_mantis_bug_text_table, $g_mantis_project_table, $g_complete_date_format, $g_show_view, @@ -357,7 +365,7 @@ function email_build_bug_message( $p_bug_id ) { $s_email_duplicate, $s_email_date_submitted, $s_email_last_modified, $s_email_summary, $s_email_description, - $g_email_separator1, + $g_email_separator1, $s_email_bug_deleted_msg, $g_email_padding_length; $c_bug_id = (integer)$p_bug_id; @@ -397,14 +405,16 @@ function email_build_bug_message( $p_bug_id ) { $t_sta_str = get_enum_element( 'status', $v_status ); $t_rep_str = get_enum_element( 'reproducibility', $v_reproducibility ); $t_message = $g_email_separator1."\n"; - $t_message .= $g_path; - if ( ADVANCED_ONLY == $g_show_view || ( BOTH == $g_show_view && ON == get_current_user_pref_field( 'advanced_view' ) ) ) { - $t_message .= 'view_bug_advanced_page.php'; - } else { - $t_message .= 'view_bug_page.php'; + if ( $p_message != $s_email_bug_deleted_msg) { + $t_message .= $g_path; + if ( ADVANCED_ONLY == $g_show_view || ( BOTH == $g_show_view && ON == get_current_user_pref_field( 'advanced_view' ) ) ) { + $t_message .= 'view_bug_advanced_page.php'; + } else { + $t_message .= 'view_bug_page.php'; + } + $t_message .= '?f_id='.$p_bug_id."\n"; + $t_message .= $g_email_separator1."\n"; } - $t_message .= '?f_id='.$p_bug_id."\n"; - $t_message .= $g_email_separator1."\n"; $t_message .= str_pd( $s_email_reporter.': ', ' ', $g_email_padding_length, STR_PAD_RIGHT ).$t_reporter_name."\n"; $t_message .= str_pd( $s_email_handler.': ', ' ', $g_email_padding_length, STR_PAD_RIGHT ).$t_handler_name."\n"; $t_message .= $g_email_separator1."\n"; @@ -484,7 +494,7 @@ function email_bug_info( $p_bug_id, $p_message, $p_headers='' ) { # build message $t_message = $p_message."\n"; - $t_message .= email_build_bug_message( $p_bug_id ); + $t_message .= email_build_bug_message( $p_bug_id, $p_message ); $t_message .= email_build_bugnote_message( $p_bug_id ); # send mail diff --git a/core_helper_API.php b/core_helper_API.php index 99deb92a69..be61e4debb 100644 --- a/core_helper_API.php +++ b/core_helper_API.php @@ -5,11 +5,11 @@ # See the files README and LICENSE for details # -------------------------------------------------------- - # $Revision: 1.50 $ - # $Author: jctrosset $ - # $Date: 2002-06-24 10:06:18 $ + # $Revision: 1.51 $ + # $Author: vboctor $ + # $Date: 2002-07-04 10:00:59 $ # - # $Id: core_helper_API.php,v 1.50 2002-06-24 10:06:18 jctrosset Exp $ + # $Id: core_helper_API.php,v 1.51 2002-07-04 10:00:59 vboctor Exp $ # -------------------------------------------------------- ########################################################################### @@ -146,18 +146,17 @@ function check_bug_exists( $p_bug_id ) { print_header_redirect( 'main_page.php' ); } } - - # -------------------- - # # allows bug deletion : # delete the bug, bugtext, bugnote, and bugtexts selected # used in bug_delete.php & mass treatments - function deleteBug( $p_id, $p_bug_text_id ) { + function delete_bug( $p_id, $p_bug_text_id ) { global $g_mantis_bug_file_table, $g_mantis_bug_table, $g_mantis_bug_text_table, $g_mantis_bugnote_table, $g_mantis_bugnote_text_table, $g_mantis_bug_history_table, $g_file_upload_method ; + email_bug_deleted($p_id); + $c_id = (integer)$p_id; $c_bug_text_id = (integer)$p_bug_text_id; @@ -228,9 +227,6 @@ function deleteBug( $p_id, $p_bug_text_id ) { WHERE bug_id='$c_id'"; $result = db_query($query); } - - - # -------------------- # check to see if bugnote exists # if it doesn't exist then redirect to the main page diff --git a/doc/ChangeLog b/doc/ChangeLog index 4f1b170464..e0d647da72 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -75,6 +75,7 @@ Mantis ChangeLog * Added configuration flags ($g_show_queries_count and $g_show_queries_list) that track the executed queries and display their total count, unique queries count, and the actual list of queries executed. * Added more visual graph pages in summary_page.php. Caution, old versions of JPGraph may cause problems, use v1.6.3 or above if you can. * Added $g_default_notify_flags and $g_notify_flags which replace $g_notify_developers_on_new, $g_notify_on_new_threshold, and $g_notify_admin_on_new. The old flags are no longer supported. The new ones provide full control on who should be notified on each event/action. + * Added notifications when a bug is deleted. 2002.05.19 - 0.17.3 diff --git a/lang/strings_english.txt b/lang/strings_english.txt index ec604bb004..538cd16f88 100644 --- a/lang/strings_english.txt +++ b/lang/strings_english.txt @@ -8,11 +8,11 @@ ########################################################################### # English strings for Mantis # ------------------------------------------------- - # $Revision: 1.56 $ - # $Author: jctrosset $ - # $Date: 2002-07-04 09:18:35 $ + # $Revision: 1.57 $ + # $Author: vboctor $ + # $Date: 2002-07-04 10:01:12 $ # - # $Id: strings_english.txt,v 1.56 2002-07-04 09:18:35 jctrosset Exp $ + # $Id: strings_english.txt,v 1.57 2002-07-04 10:01:12 vboctor Exp $ ########################################################################### ?>