This commit is contained in:
Eloy Lafuente (stronk7) 2021-11-29 23:14:48 +01:00
commit cee0949109
6 changed files with 15 additions and 7 deletions

View File

@ -72,6 +72,7 @@ $string['conditionsreset'] = 'Conditions reset';
$string['coursefullnamewithlink'] = 'Course full name with link';
$string['courseidnumberewithlink'] = 'Course ID number with link';
$string['courseshortnamewithlink'] = 'Course short name with link';
$string['courseselect'] = 'Select course';
$string['customfieldcolumn'] = '{$a}';
$string['customreports'] = 'Custom reports';
$string['deleteaudience'] = 'Delete audience \'{$a}\'';
@ -180,7 +181,6 @@ $string['resetconditionsconfirm'] = 'Are you sure you want to reset all conditio
$string['selectacondition'] = 'Select a condition';
$string['selectafilter'] = 'Select a filter';
$string['selectareportsource'] = 'Select a report source';
$string['selectcourses'] = 'Select courses';
$string['showhide'] = 'Show/hide \'{$a}\'';
$string['sorting'] = 'Sorting';
$string['sorting_help'] = 'Sorting defines the initial sort order of columns in the report. The order can be reversed by toggling the Up/down icon. Users can then define their own sort order by clicking on a column name.';

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1111,10 +1111,16 @@ define([
return false;
}
Aria.hide(originalSelect.get());
originalSelect.css('visibility', 'hidden');
// Ensure we enhance the element only once.
if (originalSelect.data('enhanced') === 'enhanced') {
M.util.js_complete(pendingKey);
return false;
}
originalSelect.data('enhanced', 'enhanced');
// Hide the original select.
Aria.hide(originalSelect.get());
originalSelect.css('visibility', 'hidden');
// Find or generate some ids.
var state = {

View File

@ -327,7 +327,7 @@ class course extends base {
$filters[] = (new filter(
course_selector::class,
'courseselector',
new lang_string('courses'),
new lang_string('courseselect', 'core_reportbuilder'),
$this->get_entity_name(),
"{$tablealias}.id"
))

View File

@ -36,10 +36,12 @@ class course_selector extends base {
* @param MoodleQuickForm $mform
*/
public function setup_form(MoodleQuickForm $mform): void {
$operatorlabel = get_string('filterfieldvalue', 'core_reportbuilder', $this->get_header());
$options = [
'multiple' => true,
];
$mform->addElement('course', $this->name . '_values', get_string('selectcourses', 'core_reportbuilder'), $options)
$mform->addElement('course', $this->name . '_values', $operatorlabel, $options)
->setHiddenLabel(true);
}