Skip to content

Commit

Permalink
1. Fixed some bugs in the pen shortcut ; disabled it for the All Proj…
Browse files Browse the repository at this point in the history
…ects view.

2. Disabled email notification for assign/resolve/close mass treatment
3. Fixed some misses in the DeleteBug() function in core_helper_API.php


git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@1154 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
jctrosset committed Jun 24, 2002
1 parent 347b498 commit 935710c
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 56 deletions.
7 changes: 4 additions & 3 deletions bug_actiongroup.php
Expand Up @@ -59,15 +59,16 @@ function updateBugLite($p_id, $p_status, $p_request) {
bug_date_update($p_id);

# notify reporter and handler
switch ( $p_status ) {
# currently desactivated
/*switch ( $p_status ) {
case ASSIGNED: email_assign( $p_id );
break;
case RESOLVED: email_resolved( $p_id );
break;
case CLOSED: email_close( $p_id );
break;
}
}*/

}//updateBug

Expand All @@ -83,7 +84,7 @@ function updateBugLite($p_id, $p_status, $p_request) {
switch ( $f_action ) {

case 'CLOSE':
updateBugLite($t_id_arr[0],CLOSED,$f_resolution);
updateBugLite($t_id_arr[0],CLOSED,'');
break;

case 'DELETE':
Expand Down
13 changes: 7 additions & 6 deletions bug_actiongroup_page.php
Expand Up @@ -15,15 +15,16 @@
<?php
# the pencil shortcut, to directly edit bugs
if ( $QUERY_STRING!='' ) {
$f_qsValues=split('&', $QUERY_STRING);
foreach($f_qsValues as $value) {
$val=split('=', $value);
if ( substr($val[0], 0, 6)=='update' ) {
print_meta_redirect( 'bug_update_advanced_page.php?f_id='.substr($val[0], 7, strlen($val[0])-9), 0 );
$f_qsValues=split('&', $QUERY_STRING);
foreach($f_qsValues as $value) {
$val=split('=', $value);
if ( substr($val[0], 0, 6)=='update' ) {
print_meta_redirect( 'bug_update_advanced_page.php?f_id='.substr($val[0], 7, strlen($val[0])-9), 0 );
exit;
}
}
}

# redirects to all_bug_page if nothing is selected
if (( $f_action=='') or count($f_bug_arr)==0 ) {
print_meta_redirect( 'view_all_bug_page.php',0);
Expand Down
12 changes: 6 additions & 6 deletions core_email_API.php
Expand Up @@ -7,11 +7,11 @@
###########################################################################
# Email API
# -------------------------------------------------
# $Revision: 1.61 $
# $Author: jhuggins $
# $Date: 2002-06-05 17:29:20 $
# $Revision: 1.62 $
# $Author: jctrosset $
# $Date: 2002-06-24 10:06:18 $
#
# $Id: core_email_API.php,v 1.61 2002-06-05 17:29:20 jhuggins Exp $
# $Id: core_email_API.php,v 1.62 2002-06-24 10:06:18 jctrosset Exp $
###########################################################################
# --------------------
# check to see that the format is valid and that the mx record exists
Expand Down Expand Up @@ -507,9 +507,9 @@ function email_send( $p_recipient, $p_subject, $p_message, $p_header='' ) {
if ( ON == $g_use_phpMailer ) {
# Visit http://phpmailer.sourceforge.net
# if you have problems with phpMailer

include('class.phpmailer.php');
$mail = new phpmailer;
$mail = new phpmailer;

# Select the method to send mail
switch ( $g_phpMailer_method ) {
Expand Down
81 changes: 44 additions & 37 deletions core_helper_API.php
Expand Up @@ -5,11 +5,11 @@
# See the files README and LICENSE for details

# --------------------------------------------------------
# $Revision: 1.49 $
# $Revision: 1.50 $
# $Author: jctrosset $
# $Date: 2002-06-20 14:45:39 $
# $Date: 2002-06-24 10:06:18 $
#
# $Id: core_helper_API.php,v 1.49 2002-06-20 14:45:39 jctrosset Exp $
# $Id: core_helper_API.php,v 1.50 2002-06-24 10:06:18 jctrosset Exp $
# --------------------------------------------------------

###########################################################################
Expand Down Expand Up @@ -155,45 +155,46 @@ function check_bug_exists( $p_bug_id ) {
# used in bug_delete.php & mass treatments
function deleteBug( $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_project_table;
$g_mantis_bugnote_table, $g_mantis_bugnote_text_table, $g_mantis_bug_history_table,
$g_file_upload_method ;

$c_id = (integer)$p_id;
$c_bug_text_id = (integer)$p_bug_text_id;

# Delete the bug entry
$query = "DELETE
FROM $g_mantis_bug_table
WHERE id='$c_id'";
$result = db_query($query);
$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);
$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'];
$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 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);
$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
Expand All @@ -211,18 +212,24 @@ function deleteBug( $p_id, $p_bug_text_id ) {
# use this instead of delete;
# in windows replace with system("del $t_diskfile");
chmod( $t_diskfile, 0775 );
if ( file_exists($t_diskfile) )
unlink( $t_diskfile );
}
}

# Delete the corresponding files
$query = "DELETE
FROM $g_mantis_bug_file_table
WHERE bug_id='$c_id'";
$result = db_query($query);
}

$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);
}



# --------------------
# check to see if bugnote exists
Expand Down
13 changes: 9 additions & 4 deletions view_all_inc.php
Expand Up @@ -181,11 +181,13 @@
&nbsp;
</td>
<?php } ?>
<?php if ( access_level_check_greater_or_equal( UPDATER ) ) { ?>
<?php if ($g_project_cookie_val!='0000000') {
if ( access_level_check_greater_or_equal( UPDATER ) ) { ?>
<td class="center" width="2%">
&nbsp;
</td>
<?php } ?>
<?php }
}?>
<td class="center" width="5%">
<?php print_view_bug_sort_link( 'P', 'priority', $f_sort, $f_dir ) ?>
<?php print_sort_icon( $f_dir, $f_sort, 'priority' ) ?>
Expand Down Expand Up @@ -261,11 +263,14 @@
<?php } ?>

<?php # the pencil shortcut
if ( access_level_check_greater_or_equal( UPDATER ) ) { ?>
#only for a per project basis
if ($g_project_cookie_val!='0000000') {
if ( access_level_check_greater_or_equal( UPDATER ) ) { ?>
<td bgcolor="<?php echo $status_color ?>">
<?php print " <input type=\"image\" name=\"update_$v_id\" src=\"images/update.png\" width=\"11\" height=\"11\">"; ?>
</td>
<?php } ?>
<?php }
}?>

<td class="center" bgcolor="<?php echo $status_color ?>">
<?php
Expand Down

0 comments on commit 935710c

Please sign in to comment.