diff --git a/admin/tests/behat/task_logs.feature b/admin/tests/behat/task_logs.feature index 3c11386952f..7d7abbac371 100644 --- a/admin/tests/behat/task_logs.feature +++ b/admin/tests/behat/task_logs.feature @@ -41,11 +41,10 @@ Feature: View task logs report and use its filters And I set the following fields in the "Duration" "core_reportbuilder > Filter" to these values: | Duration operator | | | Duration value | 2 | - | Duration unit | minutes | + | Duration unit | minute(s) | And I click on "Apply" "button" in the "[data-region='report-filters']" "css_element" Then I should see "Filters applied" And I "Nothing to display" - Examples: | operator | shouldornotsee | | Less than | should not see | diff --git a/lang/en/reportbuilder.php b/lang/en/reportbuilder.php index cf1a090ee4e..1acd8d36e07 100644 --- a/lang/en/reportbuilder.php +++ b/lang/en/reportbuilder.php @@ -35,14 +35,17 @@ $string['errorsourceinvalid'] = 'Could not find valid report source'; $string['errorsourceunavailable'] = 'Report source is not available'; $string['filtercontains'] = 'Contains'; $string['filterdatecurrent'] = 'Current'; -$string['filterdatedays'] = 'Day(s)'; +$string['filterdatedays'] = 'day(s)'; $string['filterdatefrom'] = 'Date from'; -$string['filterdatemonths'] = 'Month(s)'; +$string['filterdatehours'] = 'hour(s)'; +$string['filterdateminutes'] = 'minute(s)'; +$string['filterdatemonths'] = 'month(s)'; $string['filterdatenext'] = 'Next'; $string['filterdateprevious'] = 'Previous'; +$string['filterdateseconds'] = 'second(s)'; $string['filterdateto'] = 'Date to'; -$string['filterdateweeks'] = 'Week(s)'; -$string['filterdateyears'] = 'Year(s)'; +$string['filterdateweeks'] = 'week(s)'; +$string['filterdateyears'] = 'year(s)'; $string['filterdoesnotcontain'] = 'Does not contain'; $string['filterdurationunit'] = '{$a} unit'; $string['filterendswith'] = 'Ends with'; diff --git a/reportbuilder/classes/local/filters/date.php b/reportbuilder/classes/local/filters/date.php index 827f08c39ea..517bbfaa7d8 100644 --- a/reportbuilder/classes/local/filters/date.php +++ b/reportbuilder/classes/local/filters/date.php @@ -109,7 +109,7 @@ class date extends base { $mform->hideIf("{$this->name}_value", "{$this->name}_operator", 'eq', self::DATE_NOT_EMPTY); $mform->hideIf("{$this->name}_value", "{$this->name}_operator", 'eq', self::DATE_EMPTY); $mform->hideIf("{$this->name}_value", "{$this->name}_operator", 'eq', self::DATE_RANGE); - $mform->disabledIf("{$this->name}_value", "{$this->name}_operator", 'eq', self::DATE_CURRENT); + $mform->hideIf("{$this->name}_value", "{$this->name}_operator", 'eq', self::DATE_CURRENT); // Unit selector for previous and next operators. $unitlabel = get_string('filterdurationunit', 'core_reportbuilder', $this->get_header()); @@ -129,7 +129,7 @@ class date extends base { $mform->hideIf("{$this->name}_unit", "{$this->name}_operator", 'eq', self::DATE_RANGE); // Add operator/value/unit group. - $mform->addGroup($elements, "{$this->name}_group", '', null, false); + $mform->addGroup($elements, "{$this->name}_group", '', '', false); // Date selectors for range operator. $mform->addElement('date_selector', "{$this->name}_from", get_string('filterdatefrom', 'core_reportbuilder'), diff --git a/reportbuilder/classes/local/filters/duration.php b/reportbuilder/classes/local/filters/duration.php index 6738e9d1a76..66c10b2aa4f 100644 --- a/reportbuilder/classes/local/filters/duration.php +++ b/reportbuilder/classes/local/filters/duration.php @@ -84,10 +84,10 @@ class duration extends base { // Unit. $unitlabel = get_string('filterdurationunit', 'core_reportbuilder', $this->get_header()); $units = [ - 1 => get_string('seconds'), - MINSECS => get_string('minutes'), - HOURSECS => get_string('hours'), - DAYSECS => get_string('days'), + 1 => get_string('filterdateseconds', 'core_reportbuilder'), + MINSECS => get_string('filterdateminutes', 'core_reportbuilder'), + HOURSECS => get_string('filterdatehours', 'core_reportbuilder'), + DAYSECS => get_string('filterdatedays', 'core_reportbuilder'), ]; $elements[] = $mform->createElement('select', "{$this->name}_unit", $unitlabel, $units); @@ -95,7 +95,7 @@ class duration extends base { $mform->setDefault("{$this->name}_unit", 1); $mform->hideIf("{$this->name}_unit", "{$this->name}_operator", 'eq', self::DURATION_ANY); - $mform->addGroup($elements, "{$this->name}_group", '', null, false); + $mform->addGroup($elements, "{$this->name}_group", '', '', false); } /**