From 5538501909a08d700b69fa169ce3e47d56174147 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 15 Jun 2016 06:30:32 -0400 Subject: [PATCH] Fix "Later" vs "Next 7 days" filter inconsistence (#5353) --- plugins/tasklist/tasklist.php | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/plugins/tasklist/tasklist.php b/plugins/tasklist/tasklist.php index edbad3df..d34b9e7c 100644 --- a/plugins/tasklist/tasklist.php +++ b/plugins/tasklist/tasklist.php @@ -1325,19 +1325,27 @@ class tasklist extends rcube_plugin */ public function filter_mask($rec) { - static $today, $today_date, $tomorrow, $tomorrow_date, $week_date, $weeklimit; + static $today, $today_date, $tomorrow, $weeklimit; if (!$today) { - $today_date = new DateTime('now', $this->timezone); - $today = $today_date->format('Y-m-d'); + $today_date = new DateTime('now', $this->timezone); + $today = $today_date->format('Y-m-d'); $tomorrow_date = new DateTime('now + 1 day', $this->timezone); - $tomorrow = $tomorrow_date->format('Y-m-d'); - $week_date = new DateTime('now + 7 days', $this->timezone); - $weeklimit = $week_date->format('Y-m-d'); + $tomorrow = $tomorrow_date->format('Y-m-d'); + + // In Kolab-mode we hide "Next 7 days" filter, which means + // "Later" should catch tasks with date after tomorrow (#5353) + if ($this->rc->output->get_env('tasklist_driver') == 'kolab') { + $weeklimit = $tomorrow; + } + else { + $week_date = new DateTime('now + 7 days', $this->timezone); + $weeklimit = $week_date->format('Y-m-d'); + } } - $mask = 0; - $start = $rec['startdate'] ?: '1900-00-00'; + $mask = 0; + $start = $rec['startdate'] ?: '1900-00-00'; $duedate = $rec['date'] ?: '3000-00-00'; if ($rec['flagged'])