Index: adm_config_report.php =================================================================== --- adm_config_report.php (revision 286) +++ adm_config_report.php (revision 306) @@ -87,15 +87,143 @@ echo ''; } + + $t_config_table = db_get_table( 'mantis_config_table' ); + + //Listes des filtres + $t_user_table = db_get_table( 'mantis_user_table' ); + $t_project_table = db_get_table( 'mantis_project_table' ); + //Utilisateurs ayant réalisé des tâches sur l'administration + $query = "SELECT DISTINCT user_id, ut.realname as username, ut.username as idrh + FROM $t_config_table as ct + JOIN $t_user_table as ut + ON ut.id=ct.user_id + ORDER BY username"; + $t_result = db_query_bound($query); + $t_users_list = array(); + $t_users_list[-1] = ''.lang_get("none_filter").''; + $t_users_list[ALL_USERS] = lang_get("all_users"); + while ( $row = db_fetch_array( $t_result ) ) { + extract( $row, EXTR_PREFIX_ALL, 'v' ); + $t_users_list[$v_user_id] = "$v_username ($v_idrh)"; + } + + //Projets qui ont subi des modifications + $query = "SELECT DISTINCT project_id, pt.name as project_name + FROM $t_config_table as ct + JOIN $t_project_table as pt + ON pt.id=ct.project_id + WHERE project_id!=0 + ORDER BY project_name"; + $t_result = db_query_bound($query); + $t_projects_list = array(); + $t_projects_list[-1] = ''.lang_get("none_filter").''; + $t_projects_list[ALL_PROJECTS] = lang_get("all_projects"); + while ( $row = db_fetch_array( $t_result ) ) { + extract( $row, EXTR_PREFIX_ALL, 'v' ); + $t_projects_list[$v_project_id] = $v_project_name; + } + + //Options de configuration + $query = "SELECT DISTINCT config_id + FROM $t_config_table + ORDER BY config_id"; + $t_result = db_query_bound($query); + $t_configs_list = array(); + $t_configs_list[-1] = ''.lang_get("none_filter").''; + while ( $row = db_fetch_array( $t_result ) ) { + extract( $row, EXTR_PREFIX_ALL, 'v' ); + $t_configs_list[$v_config_id] = $v_config_id; + } + + function print_option_list_from_array($array,$filter_value){ + + foreach ($array as $key => $value){ + + if($filter_value == $key){ + $selected = " selected='selected' " ; + }else{ + $selected =""; + } + + echo "\n"; + } + + } + + //---- + + $t_filter_user_value = gpc_get_int('filter_user_id',-1); + $t_filter_project_value = gpc_get_int('filter_project_id',-1); + $t_filter_config_value = gpc_get_string('filter_config_id',-1); - $t_config_table = db_get_table( 'mantis_config_table' ); - $query = "SELECT config_id, user_id, project_id, type, value, access_reqd FROM $t_config_table ORDER BY user_id, project_id, config_id"; + $where = ''; + if($t_filter_user_value != -1){ + $where .= " AND user_id=$t_filter_user_value "; + } + if($t_filter_project_value != -1){ + $where .= " AND project_id=$t_filter_project_value "; + } + if($t_filter_config_value != -1){ + $where .= " AND config_id='$t_filter_config_value' "; + } + if($where!=''){ + $where = " WHERE 1=1 ".$where; + } + + $query = "SELECT config_id, user_id, project_id, type, value, access_reqd FROM $t_config_table $where ORDER BY user_id, project_id, config_id "; $result = db_query_bound( $query ); ?> +
+
+ + + + + + + + + + + + + +
+ +
+ :
+ +
+ :
+ +
+ :
+ +
+ +
+
+
+ + +