Skip to content
Browse files

Config report: preset the edit form to the current filter

The 'Username', 'Project Name' and 'Configuration Option' fields in the
'Set Configuration Option' form are now preset to the corresponding
value from the filter or defaulting to ALL_USERS, ALL_PROJECTS and blank
respectively if the filter is not defined or set to '[any]'.

This allows easier definition of related config, e.g. for a given
project or user.
  • Loading branch information...
1 parent b6f03b7 commit 8b426cfc6c6ea7149beeafb352fa390dbf8c4624 @dregad dregad committed Jan 2, 2013
Showing with 7 additions and 7 deletions.
  1. +7 −7 adm_config_report.php
View
14 adm_config_report.php
@@ -107,13 +107,6 @@ function print_option_list_from_array( $p_array, $p_filter_value ) {
$t_filter_project_value = gpc_get_int( 'filter_project_id', ALL_PROJECTS );
$t_filter_config_value = gpc_get_string( 'filter_config_id', META_FILTER_NONE );
- # Get config edit values
- $t_edit_user_id = gpc_get_int( 'user_id', ALL_USERS );
- $t_edit_project_id = gpc_get_int( 'project_id', ALL_PROJECTS );
- $t_edit_option = gpc_get_string( 'config_option', '' );
- $t_edit_type = gpc_get_string( 'type', CONFIG_TYPE_DEFAULT );
- $t_edit_value = gpc_get_string( 'value', '' );
-
# Manage filter's persistency through cookie
$t_cookie_name = config_get( 'manage_config_cookie' );
if( $t_filter_save ) {
@@ -143,6 +136,13 @@ function print_option_list_from_array( $p_array, $p_filter_value ) {
}
}
+ # Get config edit values
+ $t_edit_user_id = gpc_get_int( 'user_id', $t_filter_user_value == META_FILTER_NONE ? ALL_USERS : $t_filter_user_value );
+ $t_edit_project_id = gpc_get_int( 'project_id', $t_filter_project_value == META_FILTER_NONE ? ALL_PROJECTS : $t_filter_project_value );
+ $t_edit_option = gpc_get_string( 'config_option', $t_filter_config_value == META_FILTER_NONE ? '' : $t_filter_config_value );
+ $t_edit_type = gpc_get_string( 'type', CONFIG_TYPE_DEFAULT );
+ $t_edit_value = gpc_get_string( 'value', '' );
+
# Apply filters
$t_config_table = db_get_table( 'mantis_config_table' );
$t_project_table = db_get_table( 'mantis_project_table' );

0 comments on commit 8b426cf

Please sign in to comment.
Something went wrong with that request. Please try again.