[ Index ] |
|
Code source de Mantis 1.1.0rc3 |
1 <?php 2 # Mantis - a php based bugtracking system 3 4 # Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org 5 # Copyright (C) 2002 - 2007 Mantis Team - mantisbt-dev@lists.sourceforge.net 6 7 # Mantis is free software: you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation, either version 2 of the License, or 10 # (at your option) any later version. 11 # 12 # Mantis is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU General Public License for more details. 16 # 17 # You should have received a copy of the GNU General Public License 18 # along with Mantis. If not, see <http://www.gnu.org/licenses/>. 19 20 # -------------------------------------------------------- 21 # $Id: bug_group_action_api.php,v 1.2.2.1 2007-10-13 22:35:14 giallu Exp $ 22 # -------------------------------------------------------- 23 ?> 24 <?php 25 /** 26 * Print the top part for the bug action group page. 27 */ 28 function bug_group_action_print_top() { 29 html_page_top1(); 30 html_page_top2(); 31 } 32 33 /** 34 * Print the bottom part for the bug action group page. 35 */ 36 function bug_group_action_print_bottom() { 37 html_page_bottom1( __FILE__ ); 38 } 39 40 /** 41 * Print the list of selected issues and the legend for the status colors. 42 * 43 * @param $p_bug_ids_array An array of issue ids. 44 */ 45 function bug_group_action_print_bug_list( $p_bug_ids_array ) { 46 $t_legend_position = config_get( 'status_legend_position' ); 47 48 if ( STATUS_LEGEND_POSITION_TOP == $t_legend_position ) { 49 html_status_legend(); 50 echo '<br />'; 51 } 52 53 echo '<div align="center">'; 54 echo '<table class="width75" cellspacing="1">'; 55 echo '<tr class="row-1">'; 56 echo '<td class="category" colspan="2">'; 57 echo lang_get( 'actiongroup_bugs' ); 58 echo '</td>'; 59 echo '</tr>'; 60 61 $t_i = 1; 62 63 foreach( $p_bug_ids_array as $t_bug_id ) { 64 $t_class = sprintf( "row-%d", ($t_i++ % 2) + 1 ); 65 echo sprintf( "<tr bgcolor=\"%s\"> <td>%s</td> <td>%s</td> </tr>\n", 66 get_status_color( bug_get_field( $t_bug_id, 'status' ) ), 67 string_get_bug_view_link( $t_bug_id ), 68 string_attribute( bug_get_field( $t_bug_id, 'summary' ) ) 69 ); 70 } 71 72 echo '</table>'; 73 echo '</form>'; 74 echo '</div>'; 75 76 if ( STATUS_LEGEND_POSITION_BOTTOM == $t_legend_position ) { 77 echo '<br />'; 78 html_status_legend(); 79 } 80 } 81 82 /** 83 * Print the array of issue ids via hidden fields in the form to be passed on to 84 * the bug action group action page. 85 * 86 * @param $p_bug_ids_array An array of issue ids. 87 */ 88 function bug_group_action_print_hidden_fields( $p_bug_ids_array ) { 89 foreach( $p_bug_ids_array as $t_bug_id ) { 90 echo '<input type="hidden" name="bug_arr[]" value="' . $t_bug_id . '" />' . "\n"; 91 } 92 } 93 94 ###### 95 # Call-Outs for EXT_* custom group actions 96 ###### 97 98 /** 99 * Prints the list of fields in the custom action form. These are the user inputs 100 * and the submit button. This ends up calling action_<action>_print_fields() 101 * from bug_actiongroup_<action>_inc.php 102 * 103 * @param $p_action The custom action name without the "EXT_" prefix. 104 */ 105 function bug_group_action_print_action_fields( $p_action ) { 106 require_once( dirname( dirname( __FILE__ ) ) . DIRECTORY_SEPARATOR . 'bug_actiongroup_' . $p_action . '_inc.php' ); 107 $t_function_name = 'action_' . $p_action . '_print_fields'; 108 $t_function_name(); 109 } 110 111 /** 112 * Prints some title text for the custom action page. This ends up calling 113 * action_<action>_print_title() from bug_actiongroup_<action>_inc.php 114 * 115 * @param $p_action The custom action name without the "EXT_" prefix. 116 */ 117 function bug_group_action_print_title( $p_action ) { 118 require_once( dirname( dirname( __FILE__ ) ) . DIRECTORY_SEPARATOR . 'bug_actiongroup_' . $p_action . '_inc.php' ); 119 $t_function_name = 'action_' . $p_action . '_print_title'; 120 $t_function_name(); 121 } 122 123 /** 124 * Validates the combination of an action and a bug. This ends up calling 125 * action_<action>_validate() from bug_actiongroup_<action>_inc.php 126 * 127 * @param $p_action The custom action name without the "EXT_" prefix. 128 * @param $p_bug_id The id of the bug to validate the action on. 129 * 130 * @returns true Action can be applied. 131 * @returns array( bug_id => reason for failure to validate ) 132 */ 133 function bug_group_action_validate( $p_action, $p_bug_id ) { 134 require_once( dirname( dirname( __FILE__ ) ) . DIRECTORY_SEPARATOR . 'bug_actiongroup_' . $p_action . '_inc.php' ); 135 $t_function_name = 'action_' . $p_action . '_validate'; 136 return $t_function_name( $p_bug_id ); 137 } 138 139 /** 140 * Executes an action on a bug. This ends up calling 141 * action_<action>_process() from bug_actiongroup_<action>_inc.php 142 * 143 * @param $p_action The custom action name without the "EXT_" prefix. 144 * @param $p_bug_id The id of the bug to validate the action on. 145 * 146 * @returns true Action can be applied. 147 * @returns array( bug_id => reason for failure to process ) 148 */ 149 function bug_group_action_process( $p_action, $p_bug_id ) { 150 require_once( dirname( dirname( __FILE__ ) ) . DIRECTORY_SEPARATOR . 'bug_actiongroup_' . $p_action . '_inc.php' ); 151 $t_function_name = 'action_' . $p_action . '_process'; 152 return $t_function_name( $p_bug_id ); 153 } 154 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Thu Nov 29 09:42:17 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |