diff --git a/mailtemplatelib.php b/mailtemplatelib.php index 51400c97..2af9aa3d 100644 --- a/mailtemplatelib.php +++ b/mailtemplatelib.php @@ -166,6 +166,7 @@ public static function get_scheduler_variables(scheduler_instance $scheduler, $ $vars ['TIME'] = userdate($slot->starttime, get_string('strftimetime'), $tz); $vars ['ENDTIME'] = userdate($slot->endtime, get_string('strftimetime'), $tz); $vars ['LOCATION'] = format_string($slot->appointmentlocation); + $vars ['NOTES'] = format_string($slot->notes); } if ($teacher) { $vars['ATTENDANT'] = fullname($teacher); diff --git a/slotforms.php b/slotforms.php index db9b9b9f..ffb46695 100644 --- a/slotforms.php +++ b/slotforms.php @@ -577,6 +577,11 @@ protected function definition() { $mform->addElement('select', 'emaildaterel', get_string('emailreminder', 'scheduler'), $remindersel); $mform->setDefault('remindersel', -1); + + // Slot comments. + $mform->addElement('editor', 'notes', get_string('comments', 'scheduler'), + array('rows' => 3, 'columns' => 60), $this->noteoptions); + $mform->setType('notes', PARAM_RAW); // Must be PARAM_RAW for rich text editor content. $this->add_action_buttons(); diff --git a/teacherview.controller.php b/teacherview.controller.php index a477615f..34cb3021 100644 --- a/teacherview.controller.php +++ b/teacherview.controller.php @@ -42,8 +42,8 @@ function scheduler_action_doaddsession($scheduler, $formdata) { } else { $slot->duration = $data->endhour * 60 + $data->endminute - $data->starthour * 60 - $data->startminute; }; - $slot->notes = ''; - $slot->notesformat = FORMAT_HTML; + $slot->notes = $data->notes['text']; + $slot->notesformat = $data->notes['format']; $slot->timemodified = time(); for ($d = 0; $d <= $fordays; $d ++) {