Skip to content

Commit

Permalink
MDL-66143 course: Integration review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta committed Jul 22, 2019
1 parent a676250 commit b850ddf
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
7 changes: 5 additions & 2 deletions course/edit_form.php
Expand Up @@ -130,7 +130,9 @@ function definition() {
$mform->addHelpButton('enddate', 'enddate');

if (!empty($CFG->enablecourserelativedates)) {
$attributes = [];
$attributes = [
'aria-describedby' => 'relativedatesmode_warning'
];
if (!empty($course->id)) {
$attributes['disabled'] = true;
}
Expand All @@ -141,7 +143,8 @@ function definition() {
$relativedatesmodegroup = [];
$relativedatesmodegroup[] = $mform->createElement('select', 'relativedatesmode', get_string('relativedatesmode'),
$relativeoptions, $attributes);
$relativedatesmodegroup[] = $mform->createElement('html', html_writer::span(get_string('relativedatesmode_warning')));
$relativedatesmodegroup[] = $mform->createElement('html', html_writer::span(get_string('relativedatesmode_warning'),
'', ['id' => 'relativedatesmode_warning']));
$mform->addGroup($relativedatesmodegroup, 'relativedatesmodegroup', get_string('relativedatesmode'), null, false);
$mform->addHelpButton('relativedatesmodegroup', 'relativedatesmode');
}
Expand Down
2 changes: 1 addition & 1 deletion course/tests/behat/course_relativedatesmode.feature
Expand Up @@ -26,7 +26,7 @@ Feature: Courses can be set up to display dates relative to the user's enrolment
When I press "Add a new course"
And I wait until the page is ready
Then I should see "Relative dates mode"
And I should see "This cannot be changed once the course has been created."
And I should see "Relative dates mode cannot be changed once the course has been created."

Scenario: Edit courses with relative dates feature enabled
Given I log in as "admin"
Expand Down
2 changes: 1 addition & 1 deletion course/tests/courselib_test.php
Expand Up @@ -772,7 +772,7 @@ public function test_relative_dates_mode_for_course_creation($setting, $mode, $e

set_config('enablecourserelativedates', $setting);

// Generate a course with relative dates mode set to 1.
// Generate a course with relative dates mode set to $mode.
$course = $this->getDataGenerator()->create_course(['relativedatesmode' => $mode]);

// Verify that the relative dates match what's expected.
Expand Down
2 changes: 1 addition & 1 deletion lang/en/admin.php
Expand Up @@ -517,7 +517,7 @@
$string['enablecalendarexport'] = 'Enable calendar export';
$string['enablecomments'] = 'Enable comments';
$string['enablecourserelativedates'] = 'Enable course relative dates';
$string['enablecourserelativedates_desc'] = 'Allow courses to be set up to display dates relative to the user\'s enrolment date in the course.';
$string['enablecourserelativedates_desc'] = 'Allow courses to be set up to display dates relative to the user\'s start date in the course.';
$string['enablecourserequests'] = 'Enable course requests';
$string['enabled'] = 'Enabled';
$string['enabledevicedetection'] = 'Enable device detection';
Expand Down
4 changes: 2 additions & 2 deletions lang/en/moodle.php
Expand Up @@ -1634,8 +1634,8 @@
$string['reject'] = 'Reject';
$string['rejectdots'] = 'Reject...';
$string['relativedatesmode'] = 'Relative dates mode';
$string['relativedatesmode_help'] = 'Display course or activity dates relative to the user\'s start date in the course .<br />The user\'s course start date will be their enrolment start date, unless they are enrolled before the course begins in which case their start date will be the course start date.<br/><strong>WARNING: This is an experimental feature and not all activities may support it. Once the course has been created, this course setting can no longer be changed.</strong>';
$string['relativedatesmode_warning'] = '<strong>Warning:</strong> This cannot be changed once the course has been created.';
$string['relativedatesmode_help'] = 'Display course or activity dates relative to the user\'s start date in the course.<br />The user\'s course start date will be their enrolment start date, unless they are enrolled before the course begins in which case their start date will be the course start date.<br/><strong>WARNING: This is an experimental feature and not all activities may support it. Once the course has been created, this course setting can no longer be changed.</strong>';
$string['relativedatesmode_warning'] = '<strong>Warning:</strong> Relative dates mode cannot be changed once the course has been created.';
$string['reload'] = 'Reload';
$string['remoteappuser'] = 'Remote {$a} User';
$string['remove'] = 'Remove';
Expand Down

0 comments on commit b850ddf

Please sign in to comment.