From 6b910cc5fec16220151242374a50208730d1b8c6 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Thu, 20 Aug 2020 13:53:45 +0200 Subject: [PATCH] Make sure we reset filter or not setting it when choosing select All --- timesheet/inc/class.timesheet_ui.inc.php | 2 +- timesheet/js/app.js | 3 +++ timesheet/js/app.ts | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/timesheet/inc/class.timesheet_ui.inc.php b/timesheet/inc/class.timesheet_ui.inc.php index 8abda4fb3a..f63f26292f 100644 --- a/timesheet/inc/class.timesheet_ui.inc.php +++ b/timesheet/inc/class.timesheet_ui.inc.php @@ -707,7 +707,7 @@ class timesheet_ui extends timesheet_bo } } // Update start / end dates for custom - if($query_in['filter'] != 'custom' && Api\Json\Response::isJSONResponse()) + if($query_in['filter'] != '0' && $query_in['filter'] != 'custom' && Api\Json\Response::isJSONResponse()) { Api\Json\Response::get()->call( 'app.timesheet.update_timespan', diff --git a/timesheet/js/app.js b/timesheet/js/app.js index ad5428e0eb..0ff3f55d75 100644 --- a/timesheet/js/app.js +++ b/timesheet/js/app.js @@ -63,8 +63,11 @@ var TimesheetApp = /** @class */ (function (_super) { TimesheetApp.prototype.filter_change = function () { var filter = this.et2.getWidgetById('filter'); var dates = this.et2.getWidgetById('timesheet.index.dates'); + var nm = this.et2.getDOMWidgetById('nm'); if (filter && dates) { dates.set_disabled(filter.get_value() !== "custom"); + if (filter.get_value() == 0) + nm.activeFilters.startdate = null; if (filter.value == "custom") { jQuery(this.et2.getWidgetById('startdate').getDOMNode()).find('input').focus(); } diff --git a/timesheet/js/app.ts b/timesheet/js/app.ts index d25f2110cc..cda87f13da 100644 --- a/timesheet/js/app.ts +++ b/timesheet/js/app.ts @@ -61,10 +61,11 @@ class TimesheetApp extends EgwApp { var filter = this.et2.getWidgetById('filter'); var dates = this.et2.getWidgetById('timesheet.index.dates'); - + let nm = this.et2.getDOMWidgetById('nm'); if (filter && dates) { dates.set_disabled(filter.get_value() !== "custom"); + if (filter.get_value() == 0) nm.activeFilters.startdate = null; if (filter.value == "custom") { jQuery(this.et2.getWidgetById('startdate').getDOMNode()).find('input').focus();