Browse Source

Fix failing tests in master.

move some strings into attendance plugin.
MOODLE_36_STABLE
Dan Marsden 6 years ago
parent
commit
c17eb582b0
  1. 1
      absentee.php
  2. 2
      classes/calendar_helpers.php
  3. 9
      lang/en/attendance.php
  4. 6
      message.html
  5. 20
      messageselect.php
  6. 2
      tests/behat/defaultstatus.feature

1
absentee.php

@ -27,7 +27,6 @@ require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->dirroot.'/mod/attendance/lib.php');
require_once($CFG->dirroot.'/mod/attendance/locallib.php');
require_once($CFG->libdir.'/tablelib.php');
require_once($CFG->libdir.'/coursecatlib.php');
$category = optional_param('category', 0, PARAM_INT);
$attendancecm = optional_param('id', 0, PARAM_INT);

2
classes/calendar_helpers.php

@ -132,7 +132,7 @@ function attendance_update_calendar_event($session) {
return attendance_create_calendar_event($session);
}
// Boring update
// Boring update.
$caleventdata = new stdClass();
$caleventdata->timeduration = $timeduration;
$caleventdata->timestart = $timestart;

9
lang/en/attendance.php

@ -545,3 +545,12 @@ $string['privacy:metadata:timesent'] = 'Timestamp when warning was sent.';
$string['privacy:metadata:attendancelog'] = 'Log of user attendances recorded.';
$string['privacy:metadata:attendancesessions'] = 'Sessions to which attendance will be recorded.';
$string['privacy:metadata:attendancewarningdone'] = 'Log of warnings sent to users over their attendance record.';
$string['coursemessage'] = 'Message course users';
$string['addedrecip'] = 'Added {$a} new recipient';
$string['addedrecips'] = 'Added {$a} new recipients';
$string['keepsearching'] = 'Keep searching';
$string['formattexttype'] = 'Formatting';
$string['currentlyselectedusers'] = 'Currently selected users';
$string['usemessageform'] = 'or use the form below to send a message to the selected students';
$string['backtoparticipants'] = 'Back to participants list';

6
message.html

@ -10,12 +10,12 @@
<?php print_string("messagebody"); ?>:
</b></td>
<td align="left">
<?php print_textarea(true, 15, 65, 1, 1, "messagebody", $messagebody); ?>
<?php echo $OUTPUT->print_textarea("messagebody", "edit-messagebody", $messagebody, 15, 65); ?>
</td>
</tr>
<tr valign="top">
<td align="right"><label for="menuformat"><b><?php print_string("formattexttype"); ?>:</b></label></td>
<td align="right"><label for="menuformat"><b><?php print_string("formattexttype", 'mod_attendance'); ?>:</b></label></td>
<td>
<?php
print_string('formathtml');
@ -30,7 +30,7 @@
</td></tr>
</table>
<?php echo $OUTPUT->box_end(); ?>
<table align="center"><tr><th colspan="4" scope="row"><?php print_string('currentlyselectedusers'); ?></th></tr>
<table align="center"><tr><th colspan="4" scope="row"><?php print_string('currentlyselectedusers', 'mod_attendance'); ?></th></tr>
<?php
if (count($SESSION->emailto[$id])) {
foreach ($SESSION->emailto[$id] as $user) {

20
messageselect.php

@ -24,7 +24,8 @@
require_once('../../config.php');
require_once($CFG->dirroot.'/message/lib.php');
$id = required_param('id', PARAM_INT);
$messagebody = optional_param('messagebody', '', PARAM_CLEANHTML);
$messagebody = optional_param_array('messagebody', '', PARAM_CLEANHTML);
$send = optional_param('send', '', PARAM_BOOL);
$preview = optional_param('preview', '', PARAM_BOOL);
$edit = optional_param('edit', '', PARAM_BOOL);
@ -32,9 +33,7 @@ $returnto = optional_param('returnto', '', PARAM_LOCALURL);
$format = optional_param('format', FORMAT_MOODLE, PARAM_INT);
$deluser = optional_param('deluser', 0, PARAM_INT);
$url = new moodle_url('/user/messageselect.php', array('id' => $id));
if ($messagebody !== '') {
$url->param('messagebody', $messagebody);
}
if ($send !== '') {
$url->param('send', $send);
}
@ -53,6 +52,9 @@ if ($format !== FORMAT_MOODLE) {
if ($deluser !== 0) {
$url->param('deluser', $deluser);
}
if (!empty($messagebody['text'])) {
$messagebody = $messagebody['text'];
}
$PAGE->set_url($url);
if (!$course = $DB->get_record('course', array('id' => $id))) {
print_error('invalidcourseid');
@ -97,7 +99,7 @@ if ($course->id == SITEID) {
$strtitle = get_string('sitemessage');
$PAGE->set_pagelayout('admin');
} else {
$strtitle = get_string('coursemessage');
$strtitle = get_string('coursemessage', 'mod_attendance');
$PAGE->set_pagelayout('incourse');
}
$link = null;
@ -113,9 +115,9 @@ echo $OUTPUT->header();
if ($count) {
if ($count == 1) {
$heading = get_string('addedrecip', 'moodle', $count);
$heading = get_string('addedrecip', 'mod_attendance', $count);
} else {
$heading = get_string('addedrecips', 'moodle', $count);
$heading = get_string('addedrecips', 'mod_attendance', $count);
}
echo $OUTPUT->heading($heading);
}
@ -162,8 +164,8 @@ if (!empty($messagebody) && !$edit && !$deluser && ($preview || $send)) {
echo $OUTPUT->notification(get_string('nousersyet'));
}
}
echo '<p align="center"><a href="'.$returnto.'">'.get_string("keepsearching").'</a>'.
((count($SESSION->emailto[$id])) ? ', '.get_string('usemessageform') : '').'</p>';
echo '<p align="center"><a href="'.$returnto.'">'.get_string("keepsearching", 'mod_attendance').'</a>'.
((count($SESSION->emailto[$id])) ? ', '.get_string('usemessageform', 'mod_attendance') : '').'</p>';
if ((!empty($send) || !empty($preview) || !empty($edit)) && (empty($messagebody))) {
echo $OUTPUT->notification(get_string('allfieldsrequired'));
}

2
tests/behat/defaultstatus.feature

@ -12,7 +12,7 @@ Feature: Admin can set default status set for use in new attendance
| course | user | role | timestart |
| C1 | teacher1 | editingteacher | ##yesterday## |
And I log in as "admin"
And I navigate to "Attendance" node in "Site administration > Plugins"
And I navigate to "Plugins > Attendance" in site administration
And I follow "Default status set"
And I set the field with xpath "//*[@id='preferencesform']/table/tbody/tr[2]/td[3]/input" to "customstatusdescription"
And I click on "Update" "button" in the "#preferencesform" "css_element"

Loading…
Cancel
Save