forked from bostelm/moodle-mod_scheduler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappoint.html
117 lines (115 loc) · 5.3 KB
/
appoint.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<!-- This page defines the form to choose an appointed student within an appointment list -->
<?php
$usehtmleditor = can_use_html_editor();
?>
<form name="appoint" method="post" action="view.php" method="POST">
<input type="hidden" name="what" value="<?php p($form->what) ?>" />
<input type="hidden" name="subaction" value="doaddappointed" />
<input type="hidden" name="id" value="<?php p($cm->id) ?>" />
<input type="hidden" name="page" value="<?php p($page) ?>" />
<input type="hidden" name="offset" value="<?php p($offset) ?>" />
<?php
if ($form->what == 'updateslot' || $form->what == 'schedule'){
?>
<input type="hidden" name="slotid" value="<?php p($form->slotid) ?>" />
<input type="hidden" name="studentid" value="<?php p($form->studentid) ?>" />
<?php
}
?>
<input type="hidden" name="appointments" value="<?php p(serialize($form->appointments)) ?>" />
<input type="hidden" name="appointmentssaved" value="<?php p(serialize($form->appointmentssaved)) ?>" />
<input type="hidden" name="teacherid" value="<?php p($form->teacherid) ?>" />
<input type="hidden" name="exclusivity" value="<?php p($form->exclusivity) ?>" />
<input type="hidden" name="reuse" value="<?php p($form->reuse) ?>" />
<input type="hidden" name="starttime" value="<?php p($form->starttime) ?>" />
<input type="hidden" name="duration" value="<?php p($form->duration) ?>" />
<input type="hidden" name="appointmentlocation" value="<?php p($form->appointmentlocation) ?>" />
<input type="hidden" name="notes" value="<?php p($form->notes) ?>" />
<input type="hidden" name="hideuntil" value="<?php p($form->hideuntil) ?>" />
<center>
<table cellpadding="5">
<tr valign="top">
<td align="right"><b><?php print_string('student', 'scheduler') ?>:</b></td>
<td align="left">
<?php
$students = scheduler_get_possible_attendees($cm, $usergroups);
if ($students){
$studentsmenu = array();
foreach ($students as $aStudent) {
if ($scheduler->schedulermode == 'oneonly' AND scheduler_has_slot($aStudent->id, $scheduler, true, false, $form->slotid)) continue;
if ($scheduler->schedulermode == 'onetime' AND scheduler_has_slot($aStudent->id, $scheduler, true, true, $form->slotid)) continue;
if ($form->appointments and $subaction == 'addappointed'){
if (in_array($aStudent->id, array_keys($form->appointments))) continue; // is already added
}
$studentsmenu[$aStudent->id] = fullname($aStudent);
}
if (!empty($studentsmenu)){
echo html_writer::select($studentsmenu, 'studenttoadd', $form->studentid);
if ($action == 'update'){
$addstudenttogroupstr = get_string('addstudenttogroup', 'scheduler');
echo " <input type=\"button\" value=\"{$addstudenttogroupstr}\" onclick=\"addToGroup()\" />";
echo $OUTPUT->help_icon('addscheduled', get_string('addscheduled', 'scheduler'), 'scheduler');
}
}
else{
print_string('nostudenttobook', 'scheduler');
}
}
else{
print_string('nostudenttobook', 'scheduler');
}
?>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string('seen', 'scheduler') ?>:</b></td>
<td align="left">
<input type="radio" name="attended" value="1" <?php if ($form->attended == 1){ echo 'checked';} ?> />
<?php print_string('yes') ?>
<input type="radio" name="attended" value="0" <?php if ($form->attended == 0){ echo 'checked';} ?> />
<?php print_string('no') ?>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string('appointmentnotes', 'scheduler') ?>:</b></td>
<td align="left">
<?php
if (!isset($form->appointmentnote)) {
$form->appointmentnote = '';
}
print_textarea($usehtmleditor, 20, 60, 680, 400, 'appointmentnote', $form->appointmentnote);
if ($usehtmleditor) {
echo '<input type="hidden" name="appointmentformat" value="'.FORMAT_HTML.'" />';
}
else {
echo '<p align="right">';
echo $OUTPUT->help_icon('textformat', get_string('formattexttype'));
print_string('formattexttype');
echo ': ';
if (empty($form->appointmentformat)) {
$form->appointmentformat = "MOODLE";
}
echo html_writer::select(format_text_menu(), 'appointmentformat', $form->appointmentformat, "");
echo '</p>';
}
?>
</td>
</tr>
<?php
if ($scheduler->scale != 0){
?>
<tr>
<td align="right"><b><?php print_string('grade') ?>:</b></td>
<td align="left">
<?php echo scheduler_make_grading_menu($scheduler, 'grade', $form->grade, false); ?>
</td>
</tr>
<?php
}
$onsubmitcall = ($usehtmleditor) ? "javascript:document.forms['appoint'].submit();" : '' ;
?>
</table>
<input type="button" value="<?php print_string('confirm') ?>" onclick="<?php echo $onsubmitcall ?>document.forms['appoint'].submit();" />
<input type="button" value="<?php print_string('cancel') ?>" onclick="document.forms['appoint'].subaction.value = 'cancel'; document.forms['appoint'].submit();" />
</center>
</form>