From 13f67d7b4d7cd5fe19fc9b25f40a11bb8365aebc Mon Sep 17 00:00:00 2001 From: David Hicks Date: Sat, 25 Feb 2012 13:48:04 +1000 Subject: [PATCH] Remove use of 'on' and 'off' strings for storing boolean filter states The "sticky issue" and "use date filter" filters are boolean options that are transmitted via use of 'on' and 'off' strings in the URL. gpc_get_bool will take these strings and return either true or false (as a PHP bool type). We were using 'on' and 'off' within filter_api (and elsewhere) to internally store the state of these two boolean filter properties. This has now been replaced with the use of a more sane true/false representation of the state using a PHP bool type. As a consequence, checkboxes in the filter UI throughout MantisBT now correctly reflect the state of the filters as either on/off. --- application/core/filter_api.php | 10 +++++----- public/billing_inc.php | 2 +- public/bugnote_stats_inc.php | 2 +- public/view_all_inc.php | 2 +- public/view_all_set.php | 6 +++--- public/view_filters_page.php | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/application/core/filter_api.php b/application/core/filter_api.php index 4622e88971..53504741a1 100644 --- a/application/core/filter_api.php +++ b/application/core/filter_api.php @@ -1614,7 +1614,7 @@ function filter_get_bug_rows( &$p_page_number, &$p_per_page, &$p_page_count, &$p } # date filter - if(( 'on' == $t_filter[FILTER_PROPERTY_FILTER_BY_DATE] ) && is_numeric( $t_filter[FILTER_PROPERTY_START_MONTH] ) && is_numeric( $t_filter[FILTER_PROPERTY_START_DAY] ) && is_numeric( $t_filter[FILTER_PROPERTY_START_YEAR] ) && is_numeric( $t_filter[FILTER_PROPERTY_END_MONTH] ) && is_numeric( $t_filter[FILTER_PROPERTY_END_DAY] ) && is_numeric( $t_filter[FILTER_PROPERTY_END_YEAR] ) ) { + if( $t_filter[FILTER_PROPERTY_FILTER_BY_DATE] && is_numeric( $t_filter[FILTER_PROPERTY_START_MONTH] ) && is_numeric( $t_filter[FILTER_PROPERTY_START_DAY] ) && is_numeric( $t_filter[FILTER_PROPERTY_START_YEAR] ) && is_numeric( $t_filter[FILTER_PROPERTY_END_MONTH] ) && is_numeric( $t_filter[FILTER_PROPERTY_END_DAY] ) && is_numeric( $t_filter[FILTER_PROPERTY_END_YEAR] ) ) { $t_start_string = $t_filter[FILTER_PROPERTY_START_YEAR] . "-" . $t_filter[FILTER_PROPERTY_START_MONTH] . "-" . $t_filter[FILTER_PROPERTY_START_DAY] . " 00:00:00"; $t_end_string = $t_filter[FILTER_PROPERTY_END_YEAR] . "-" . $t_filter[FILTER_PROPERTY_END_MONTH] . "-" . $t_filter[FILTER_PROPERTY_END_DAY] . " 23:59:59"; @@ -2822,7 +2822,7 @@ function filter_draw_selection_area2( $p_page_number, $p_for_screen = true, $p_e '; echo ''; echo ''; @@ -3745,7 +3745,7 @@ function print_filter_view_state() { function print_filter_sticky_issues() { global $t_filter; ?> - /> + /> - + diff --git a/public/billing_inc.php b/public/billing_inc.php index 992f0d7574..89ae6d1473 100644 --- a/public/billing_inc.php +++ b/public/billing_inc.php @@ -110,7 +110,7 @@ "> - +