public function get_header(scheduler_instance $scheduler)
 {
     return $scheduler->get_teacher_name();
 }
 public function teacherview_tabs(scheduler_instance $scheduler, moodle_url $baseurl, $selected, $inactive = null)
 {
     $statstab = $this->teacherview_tab($baseurl, 'statistics', 'viewstatistics', 'overall');
     $statstab->subtree = array($this->teacherview_tab($baseurl, 'overall', 'viewstatistics', 'overall'), $this->teacherview_tab($baseurl, 'studentbreakdown', 'viewstatistics', 'studentbreakdown'), $this->teacherview_tab($baseurl, 'staffbreakdown', 'viewstatistics', 'staffbreakdown', $scheduler->get_teacher_name()), $this->teacherview_tab($baseurl, 'lengthbreakdown', 'viewstatistics', 'lengthbreakdown'), $this->teacherview_tab($baseurl, 'groupbreakdown', 'viewstatistics', 'groupbreakdown'));
     $level1 = array($this->teacherview_tab($baseurl, 'myappointments', 'view', 'myappointments'), $this->teacherview_tab($baseurl, 'allappointments', 'view', 'allappointments'), $this->teacherview_tab($baseurl, 'datelist', 'datelist'), $statstab, $this->teacherview_tab($baseurl, 'export', 'export'));
     return $this->tabtree($level1, $selected, $inactive);
 }
/**
 * Construct an array with subtitution rules for mail templates, relating to
 * a single appointment. Any of the parameters can be null.
 * @param scheduler_instance $scheduler The scheduler instance
 * @param scheduler_slot $slot The slot data as an MVC object
 * @param user $attendant A {@link $USER} object describing the attendant (teacher)
 * @param user $attendee A {@link $USER} object describing the attendee (student)
 * @param object $course A course object relating to the ontext of the message
 * @param object $recipient A {@link $USER} object describing the recipient of the message (used for determining the message language)
 * @return array A hash with mail template substitutions
 */
function scheduler_get_mail_variables(scheduler_instance $scheduler, scheduler_slot $slot, $attendant, $attendee, $course, $recipient)
{
    global $CFG;
    $lang = scheduler_get_message_language($recipient, $course);
    // Force any string formatting to happen in the target language.
    $oldlang = force_current_language($lang);
    $tz = core_date::get_user_timezone($recipient);
    $vars = array();
    if ($scheduler) {
        $vars['MODULE'] = $scheduler->name;
        $vars['STAFFROLE'] = $scheduler->get_teacher_name();
        $vars['SCHEDULER_URL'] = $CFG->wwwroot . '/mod/scheduler/view.php?id=' . $scheduler->cmid;
    }
    if ($slot) {
        $vars['DATE'] = userdate($slot->starttime, get_string('strftimedate'), $tz);
        $vars['TIME'] = userdate($slot->starttime, get_string('strftimetime'), $tz);
        $vars['ENDTIME'] = userdate($slot->endtime, get_string('strftimetime'), $tz);
        $vars['LOCATION'] = format_string($slot->appointmentlocation);
    }
    if ($attendant) {
        $vars['ATTENDANT'] = fullname($attendant);
        $vars['ATTENDANT_URL'] = $CFG->wwwroot . '/user/view.php?id=' . $attendant->id . '&course=' . $scheduler->course;
    }
    if ($attendee) {
        $vars['ATTENDEE'] = fullname($attendee);
        $vars['ATTENDEE_URL'] = $CFG->wwwroot . '/user/view.php?id=' . $attendee->id . '&course=' . $scheduler->course;
    }
    // Reset language settings.
    force_current_language($oldlang);
    return $vars;
}