From: <jfi...@us...> - 2002-10-19 04:43:31
|
Update of /cvsroot/mantisbt/mantisbt/core In directory usw-pr-cvs1:/tmp/cvs-serv30281/core Modified Files: custom_attribute_api.php html_api.php print_api.php Log Message: * core/print_api.php (print_project_option_list): - use null as the default value instead of '' - add a second parameter which, if true, prints the option for All Projects as well * tweak every caller of print_project_option_list() to pass the appropriate new parameters Index: custom_attribute_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/custom_attribute_api.php,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- custom_attribute_api.php 1 Sep 2002 01:23:23 -0000 1.9 +++ custom_attribute_api.php 19 Oct 2002 04:43:28 -0000 1.10 @@ -282,7 +282,7 @@ <input type="hidden" name="f_project_id" value="<?php echo $p_project_id ?>" /> <input type="hidden" name="f_parameter" value="<?php echo $p_parameter ?>" /> <select name="f_other_project_id"> - <?php print_project_option_list() ?> + <?php print_project_option_list( null, false ) ?> </select> <input type="submit" name="f_copy_from" value="<?php echo lang_get( 'copy_from' ) ?>" /> <input type="submit" name="f_copy_to" value="<?php echo lang_get( 'copy_to' ) ?>" /> Index: html_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/html_api.php,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- html_api.php 19 Oct 2002 04:11:23 -0000 1.18 +++ html_api.php 19 Oct 2002 04:43:28 -0000 1.19 @@ -264,8 +264,7 @@ } else { PRINT '<select name="f_project_id" class="small">'; } - PRINT '<option value="0000000">' . lang_get( 'all_projects' ) . '</option>'; - print_project_option_list( $g_project_cookie_val ); + print_project_option_list( helper_get_current_project() ); PRINT '</select>'; PRINT '<input type="submit" value="' . lang_get( 'switch' ) . '" class="small" />'; PRINT '</form>'; Index: print_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/print_api.php,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- print_api.php 15 Oct 2002 20:32:54 -0000 1.20 +++ print_api.php 19 Oct 2002 04:43:28 -0000 1.21 @@ -414,7 +414,7 @@ } # -------------------- # List projects that the current user has access to - function print_project_option_list( $p_project_id='' ) { + function print_project_option_list( $p_project_id = null, $p_include_all_projects = true ) { global $g_mantis_project_table, $g_mantis_project_user_list_table, $g_project_cookie_val; @@ -442,6 +442,12 @@ $result = db_query( $query ); $project_count = db_num_rows( $result ); + + if ( $p_include_all_projects ) { + echo '<option value="0"'; + check_selected( $p_project_id, 0 ); + echo '>' . lang_get( 'all_projects' ) . '</option>'; + } for ($i=0;$i<$project_count;$i++) { $row = db_fetch_array( $result ); |