Skip to content

Commit

Permalink
Added multiple bug actions aka "bug action group" in view_all_bug_pag…
Browse files Browse the repository at this point in the history
…e.php. Use the scrolling menu at the bottom of the page, previously used for moving bugs.

A function "deletebug" has been created in core_helper_API.php instead of the code in bug_delete.php

Added a direct link, with a small icon, on each bug row, so that users on a selected project can switch directly to the bug_update_advanced_page. Though, if "all project" is selected, it only displays the view_bug_page


git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@1147 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
jctrosset committed Jun 20, 2002
1 parent de68245 commit b5a707d
Show file tree
Hide file tree
Showing 6 changed files with 414 additions and 20 deletions.
118 changes: 118 additions & 0 deletions bug_actiongroup.php
@@ -0,0 +1,118 @@
<?php
# Mantis - a php based bugtracking system
# Copyright (C) 2000, 2001 Kenzaburo Ito - kenito@300baud.org
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details

# <SQLI>
# This page allows the close / suppress / others mass treatments, and display the adequate page
?>


<?php include( 'core_API.php' ) ?>
<?php login_cookie_check() ?>
<?php

# the queries
function updateBugLite($p_id, $p_status, $p_request) {
global $g_mantis_bug_table;

$t_handler_id = get_current_user_field( 'id' );
$t_query='';

switch ($p_status) {

case 'MOVED' :
$t_query = "project_id='$p_request'";
break;

case CLOSED :
$t_query="status='$p_status'";
break ;

case ASSIGNED :
$t_handler_id = $p_request ;
$t_query="status='$p_status'";
break ;

case RESOLVED :
$t_query=" status='$p_status',"." resolution='$p_request'";
break ;

case 'UP_PRIOR' :
$t_query="priority='$p_request'";
break ;

case 'UP_STATUS' :
$t_query="status='$p_request'";
break ;

}
# Update fields
$query = "UPDATE $g_mantis_bug_table
SET handler_id='$t_handler_id',".$t_query."
WHERE id='$p_id'";

$result = db_query($query);

# update bug last updated
bug_date_update($p_id);

# notify reporter and handler
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


if ( $f_actionconfirmed=='1' ) {

foreach($f_bug_arr as $value) {

# get the id and the bug_text_id parameters
# the bug_text_id is used only for the delete function
$t_id_arr=explode( ',', $value );

switch ( $f_action ) {

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

case 'DELETE':
deleteBug($t_id_arr[0],$t_id_arr[1]);
break;

case 'MOVE':
updateBugLite($t_id_arr[0],'MOVED',$f_project_id);
break;

case 'ASSIGN':
updateBugLite($t_id_arr[0],ASSIGNED,$f_assign);
break;

case 'RESOLVE':
updateBugLite($t_id_arr[0],RESOLVED,$f_resolution);
break;

case 'UP_PRIOR':
updateBugLite($t_id_arr[0],'UP_PRIOR',$f_priority);
break;

case 'UP_STATUS':
updateBugLite($t_id_arr[0],'UP_STATUS',$f_status);
break;
}
}

print_meta_redirect( 'view_all_bug_page.php',0);

}
?>
175 changes: 175 additions & 0 deletions bug_actiongroup_page.php
@@ -0,0 +1,175 @@
<?php
# Mantis - a php based bugtracking system
# Copyright (C) 2000, 2001 Kenzaburo Ito - kenito@300baud.org
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details

# <SQLI>
# This page allows the close / suppress / others mass treatments, and display the adequate page
?>


<?php include( 'core_API.php' ) ?>
<? login_cookie_check() ?>

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

# 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);
exit;
}


switch ($f_action) {

case 'CLOSE' :
# Use a simple confirmation page, if close or delete...
$t_finished = 1 ;
$t_question_title = $s_close_bugs_conf_msg ;
$t_button_title = $s_close_group_bugs_button ;
break ;


case 'DELETE' :
$t_finished = 1;
$t_question_title = $s_delete_bugs_conf_msg ;
$t_button_title = $s_delete_group_bugs_button ;
break ;


# ...else we define the variables used in the form
case 'MOVE' :
$t_question_title = $s_move_bugs_conf_msg ;
$t_button_title = $s_move_group_bugs_button ;
$t_form='f_project_id' ;
break ;


case 'ASSIGN' :
$t_question_title = $s_assign_bugs_conf_msg ;
$t_button_title = $s_assign_group_bugs_button ;
$t_form = 'f_assign' ;
break ;

case 'RESOLVE' :
$t_question_title = $s_resolve_bugs_conf_msg ;
$t_button_title = $s_resolve_group_bugs_button ;
$t_form = 'f_resolution' ;
$t_request = 'resolution'; // the "request" vars allow to display the adequate list
break ;


case 'UP_PRIOR' :
$t_question_title = $s_priority_bugs_conf_msg ;
$t_button_title = $s_priority_group_bugs_button ;
$t_request = 'priority';
$t_form = 'f_priority' ;
break ;

case 'UP_STATUS' :
$t_question_title = $s_status_bugs_conf_msg ;
$t_button_title = $s_status_group_bugs_button ;
$t_form = 'f_status' ;
$t_request = 'status';
break ;
}
?>

<?php print_page_top1() ?>
<?php print_page_top2() ?>



<?php # displays the choices popup menus
if ($t_finished != 1) {
?>
<p>
<div align="center">
<table class="width75" cellspacing="1">

<form method="POST" action="bug_actiongroup.php">
<input type="hidden" name="f_actionconfirmed" value="1">
<input type="hidden" name="f_action" value="<?php echo $f_action ?>">

<?php
foreach($f_bug_arr as $value) {
print "<input type=\"hidden\" name=\"f_bug_arr[]\" value=\"$value\">"; }
?>

<tr class="row-1">
<td class="category">
<?php echo $t_question_title ?>
</td>
<td>
<select name="<?php echo $t_form ?>">
<?php
switch ( $f_action ) {
case 'MOVE':
print_project_option_list();
break;

case 'ASSIGN':
print_assign_to_option_list();
break;
}

#other forms use the same function to display the list
print_enum_string_option_list( $t_request, FIXED ) ?>
</select>
</td>
</tr>
<tr>
<td class="center" colspan="2">
<input type="submit" value="<?php echo $t_button_title ?>">
</td>
</tr>

</form>
</table>
</div>
<?php # Choices Form END ?>


<?php
}
# else, asks for a simple confirmation to close or delete
else {
?>

<p>
<div align="center">
<?php print_hr( $g_hr_size, $g_hr_width ) ?>
<?php echo $t_question_title ?>

<form method="post" action="bug_actiongroup.php">
<input type="hidden" name="f_actionconfirmed" value="1">
<input type="hidden" name="f_action" value="<?php echo $f_action ?>">

<?php
foreach($f_bug_arr as $value)
print "<input type=\"hidden\" name=\"f_bug_arr[]\" value=\"$value\">";
?>

<input type="submit" value="<?php echo $t_button_title ?>">
</form>

<?php print_hr( $g_hr_size, $g_hr_width ) ?>
</div>

<?php
}
?>


<?php print_page_bot1( __FILE__ ) ?>
6 changes: 5 additions & 1 deletion bug_delete.php
Expand Up @@ -15,6 +15,10 @@
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;
Expand Down Expand Up @@ -83,7 +87,7 @@
$query = "DELETE
FROM $g_mantis_bug_history_table
WHERE bug_id='$c_id'";
$result = db_query($query);
$result = db_query($query); */

$t_redirect_url = 'view_all_bug_page.php';
if ( $result ) {
Expand Down

0 comments on commit b5a707d

Please sign in to comment.