This commit is contained in:
Jun Pataleta 2021-10-15 12:01:37 +08:00
commit 043a43b089
4 changed files with 15 additions and 13 deletions

View File

@ -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 | <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 <shouldornotsee> "Nothing to display"
Examples:
| operator | shouldornotsee |
| Less than | should not see |

View File

@ -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';

View File

@ -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'),

View File

@ -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);
}
/**