forked from bostelm/moodle-mod_scheduler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaddslotsform.html
199 lines (198 loc) · 9.09 KB
/
addslotsform.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
<!-- This page defines the form to add an appointment session -->
<!-- it is used from view.php -->
<form name="add" method="post" action="view.php">
<input type="hidden" name="what" value="doaddsession" />
<input type="hidden" name="id" value="<?php p($cm->id) ?>" />
<input type="hidden" name="page" value="<?php p($page) ?>" />
<?php
if (!has_capability('mod/scheduler:canscheduletootherteachers', $context)){
?>
<input type="hidden" name="teacherid" value="<?php p($form->teacherid) ?>" />
<?php
}
?>
<center>
<table cellpadding="5">
<tr>
<td align="right"><b><?php print_string('date', 'scheduler') ?>:</b></td>
<td align="left" <?php print_error_class(@$errors, 'rangestart,range') ?> >
<?php
echo html_writer::select_time('days', 'startday', $form->rangestart);
echo html_writer::select_time('months', 'startmonth', $form->rangestart);
echo html_writer::select_time('years', 'startyear', $form->rangestart);
?>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string('enddate', 'scheduler') ?>:</b></td>
<td align="left" <?php print_error_class(@$errors, 'rangeend,range') ?> >
<?php
echo html_writer::select_time('days', 'endday', $form->rangeend);
echo html_writer::select_time('months', 'endmonth', $form->rangeend);
echo html_writer::select_time('years', 'endyear', $form->rangeend);
?>
</td>
</tr>
<div id="advanced" name="advanced" style="visibility:visible;">
<tr valign="top">
<td align="right"><b><?php print_string('addondays', 'scheduler') ?>:</b></td>
<td align="left" <?php print_error_class(@$errors, 'days,range') ?> >
<input type="checkbox" <?php echo ($form->monday) ? 'checked="checked"' : '' ; ?> name="monday" value="1" /> <?php print_string('monday', 'scheduler') ; ?><br>
<input type="checkbox" <?php echo ($form->tuesday) ? 'checked="checked"' : '' ; ?> name="tuesday" value="1" /> <?php print_string('tuesday', 'scheduler'); ?><br>
<input type="checkbox" <?php echo ($form->wednesday) ? 'checked="checked"' : '' ; ?> name="wednesday" value="1" /> <?php print_string('wednesday', 'scheduler'); ?><br>
<input type="checkbox" <?php echo ($form->thursday) ? 'checked="checked"' : '' ; ?> name="thursday" value="1" /> <?php print_string('thursday', 'scheduler') ?><br>
<input type="checkbox" <?php echo ($form->friday) ? 'checked="checked"' : '' ; ?> name="friday" value="1" /> <?php print_string('friday', 'scheduler') ?><br>
<input type="checkbox" <?php echo ($form->saturday) ? 'checked="checked"' : '' ; ?> name="saturday" value="1" /> <?php print_string('saturday', 'scheduler') ?><br>
<input type="checkbox" <?php echo ($form->sunday) ? 'checked="checked"' : '' ; ?> name="sunday" value="1" /> <?php print_string('sunday', 'scheduler') ?>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string('starttime', 'scheduler') ?>:</b></td>
<td align="left">
<?php
echo html_writer::select_time('hours', 'starthour', $form->timestart);
echo html_writer::select_time('minutes', 'startminute', $form->timestart);
?>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string('endtime', 'scheduler') ?>:</b></td>
<td align="left">
<?php
echo html_writer::select_time('hours', 'endhour', $form->timeend);
echo html_writer::select_time('minutes', 'endminute', $form->timeend);
?>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string('forcewhenoverlap', 'scheduler') ?>:</b></td>
<td align="left">
<input type="radio" name="forcewhenoverlap" value="1" <?php echo ($form->forcewhenoverlap) ? 'checked="checked"' : '' ; ?> />
<?php print_string('yes') ?>
<input type="radio" name="forcewhenoverlap" value="0" <?php echo (!$form->forcewhenoverlap) ? 'checked="checked"' : '' ; ?> />
<?php print_string('no') ?>
<?php echo $OUTPUT->help_icon('forcewhenoverlap', 'scheduler'); ?>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string('location', 'scheduler') ?>:</b></td>
<td align="left">
<input type="text" size="30" maxlength="50" name="appointmentlocation" value="" />
</td>
</tr>
<?php
if (has_capability('mod/scheduler:canscheduletootherteachers', $context)){
?>
<tr valign="top">
<td align="right"><b><?php echo scheduler_get_teacher_name($scheduler); ?>:</b></td>
<td align="left" <?php print_error_class(@$errors, 'teacherid') ?> >
<?php
$attendants = scheduler_get_attendants($cm->id);
$attendantsmenu = array();
if ($attendants){
foreach($attendants as $attendant){
$attendantsmenu[$attendant->id] = fullname($attendant);
}
echo html_writer::select($attendantsmenu, 'teacherid', $form->teacherid);
} else {
print_string('noteachershere', 'scheduler', s(scheduler_get_teacher_name($scheduler)));
}
echo $OUTPUT->help_icon('bookwithteacher', 'scheduler');
?>
</td>
</tr>
<?php
}
?>
<tr valign="top">
<td align="right"><b><?php print_string('divide', 'scheduler') ?>:</b></td>
<td align="left">
<input type="radio" name="hasslots" value="1" checked="checked" />
<?php print_string('yes') ?>
<input type="radio" name="hasslots" value="0" />
<?php print_string('no') ?>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string('duration', 'scheduler') ?>:</b></td>
<td align="left">
<input type="text" size="3" maxlength="3" name="duration" value="<?php echo $form->duration ?>" />
<?php print_string('minutesperslot', 'scheduler') ?>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string('multiplestudents', 'scheduler') ?>:</b></td>
<td align="left">
<?php
$maxexclusive = $CFG->scheduler_maxstudentsperslot;
$exclusivemenu['0'] = get_string('unlimited', 'scheduler');
for($i = 1 ; $i <= $maxexclusive ; $i++){
$exclusivemenu[(string)$i] = $i;
}
echo html_writer::select($exclusivemenu, 'exclusivity', $form->exclusivity);
?>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string('reuse', 'scheduler') ?>:</b></td>
<td align="left">
<?php
echo html_writer::select_yes_no('reuse');
echo $OUTPUT->help_icon('reuse', 'scheduler');
?>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string('displayfrom', 'scheduler') ?>:</b></td>
<td align="left">
<select name="displayfrom" size="1">
<option selected value="now"><?php print_string('now', 'scheduler') ?></option>
<option value="86400"><?php print_string('onedaybefore', 'scheduler') ?></option>
<?php
for ($i = 2; $i < 7; $i++){
?>
<option value="<?php echo (86400*$i); ?>"><?php echo $i; print_string('xdaysbefore', 'scheduler') ?></option>
<?php
}
?>
<option value="<?php echo (86400*7); ?>"><?php print_string('oneweekbefore', 'scheduler') ?></option>
<?php
for ($i = 2; $i < 7; $i++){
?>
<option value="<?php echo (86400*$i*7); ?>"><?php echo $i; print_string('xweeksbefore', 'scheduler') ?></option>
<?php
}
?>
</select>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string('emailreminder', 'scheduler') ?>:</b></td>
<td align="left">
<select name="emailfrom" size="1">
<option selected value="never"><?php print_string('never', 'scheduler') ?></option>
<option value="0"><?php print_string('onthemorningofappointment', 'scheduler') ?></option>
<option value="86400"><?php print_string('onedaybefore', 'scheduler') ?></option>
<?php
for ($i = 2; $i < 7; $i++){
?>
<option value="<?php echo (DAYSECS * $i); ?>"><?php echo $i; print_string('xdaysbefore', 'scheduler') ?></option>
<?php
}
?>
<option value="<?php echo (DAYSECS * 7); ?>"><?php print_string('oneweekbefore', 'scheduler') ?></option>
<?php
for ($i = 2; $i < 7; $i++){
?>
<option value="<?php echo (DAYSECS * $i * 7); ?>"><?php echo $i; print_string('xweeksbefore', 'scheduler') ?></option>
<?php
}
?>
</select>
</td>
</tr>
</table>
<input type="submit" value="<?php print_string('savechanges') ?>" />
<input type="button" value="<?php print_string('cancel') ?>" onclick="self.location.href='view.php?id=<?php p($cm->id) ?>'" />
</center>
</form>