From 033ba0159f36666046926884165b4cb5550fc76d Mon Sep 17 00:00:00 2001 From: nathangray Date: Wed, 1 Jun 2016 15:50:09 -0600 Subject: [PATCH] Fix calendar list view custom date filter always switched to another filter & hid the dates --- calendar/inc/class.calendar_uilist.inc.php | 11 ++++++----- calendar/templates/default/list.xet | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/calendar/inc/class.calendar_uilist.inc.php b/calendar/inc/class.calendar_uilist.inc.php index c3c2386c5f..a9f591f5ea 100644 --- a/calendar/inc/class.calendar_uilist.inc.php +++ b/calendar/inc/class.calendar_uilist.inc.php @@ -244,20 +244,21 @@ class calendar_uilist extends calendar_ui { unset($readonlys); // not used; //echo "uilist::get_rows() params="; _debug_array($params); + $this->filter = $params['filter']; if ($params['filter'] == 'custom') { if (!$params['startdate'] && !$params['enddate']) { - $params['filter'] = 'all'; + $this->filter = 'all'; } elseif (!$params['startdate']) { - $params['filter'] = 'before'; + $this->filter = 'before'; $this->manage_states(array('date' => $this->bo->date2string($params['enddate']))); } elseif (!$params['enddate']) { - $params['filter'] = 'after'; + $this->filter = 'after'; $this->manage_states(array('date' => $this->bo->date2string($params['startdate']))); } } @@ -293,7 +294,7 @@ class calendar_uilist extends calendar_ui } $search_params = array( 'cat_id' => $params['cat_id'] ? $params['cat_id'] : 0, - 'filter' => isset($params['filter']) ? $params['filter'] : $this->filter, + 'filter' => $this->filter, 'query' => $params['search'], 'offset' => (int) $params['start'], 'num_rows'=> $params['num_rows'], @@ -303,7 +304,7 @@ class calendar_uilist extends calendar_ui // Non-blocking events above blocking $search_params['order'] .= ', cal_non_blocking DESC'; - switch($params['filter']) + switch($this->filter) { case 'all': break; diff --git a/calendar/templates/default/list.xet b/calendar/templates/default/list.xet index 6441f4d9f6..8e161133a9 100644 --- a/calendar/templates/default/list.xet +++ b/calendar/templates/default/list.xet @@ -5,9 +5,9 @@