This repository has been archived by the owner on Nov 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
addaperiodslotsform.html
195 lines (192 loc) · 7.98 KB
/
addaperiodslotsform.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
<!-- This page defines the form to add an appointment session -->
<!-- it is used from view.php -->
<style type="text/css">@import "<?php echo "{$CFG->wwwroot}/mod/scheduler/scripts/jquerydatepick406/jquery.datepick.css" ?>";</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo "{$CFG->wwwroot}/mod/scheduler/scripts/jquerydatepick406/jquery.datepick.js" ?>">
</script>
<script type="text/javascript" src="<?php echo "{$CFG->wwwroot}/mod/scheduler/scripts/jquerydatepick406/jquery.datepick.lang.js" ?>">
</script>
<script type="text/javascript">
<?php
$courselang = substr($course->lang, 0, 2);
if ($courselang == 'en'){
$courselang = '';
}
?>
$(function()
{
$.datepick.setDefaults($.datepick.regional['<?php echo $courselang ?>']);
$('#multiInlinePicker').datepick({showTrigger: '#calImg', dateFormat: $.datepick.TIMESTAMP, multiSelect: 999, monthsToShow: 4, monthsToStep: 4,
minDate: '<?php echo $form->rangestart ?>'});
});
function getMultipleDates()
{
var listdates1 = $('#multiInlinePicker').datepick('getDate');
var listdates = '';
for (var i = 0; i < listdates1.length; i++) {
listdates += (i == 0 ? '' : ',') + $.datepick.formatDate('yyyy-mm-dd', listdates1[i]);
}
$('#getlistdates').val(listdates || '');
}
</script>
<form name="add" method="post" action="view.php" onSubmit=getMultipleDates()>
<input type="hidden" name="what" value="doaddaperiodsession" />
<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>
<div id="multiInlinePicker"></div>
<input type="hidden" id="getlistdates" name="listdates" value="" />
<table cellpadding="5">
<div id="advanced" name="advanced" style="visibility:visible;">
<tr valign="top">
<td align="right"><b><?php print_string('starttime', 'scheduler') ?>:</b></td>
<td align="left">
<?php print_time_selector('starthour', 'startminute', $form->timestart, 5); ?>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string('endtime', 'scheduler') ?>:</b></td>
<td align="left">
<?php print_time_selector('endhour', 'endminute', $form->timeend, 5); ?>
</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 helpbutton('forcewhenoverlap', get_string('forcewhenoverlap', 'scheduler'), '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 format_string($scheduler->staffrolename) ?>:</b></td>
<td align="left" <?php scheduler_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);
}
choose_from_menu($attendantsmenu, 'teacherid', $form->teacherid);
} else {
print_string('noteachershere', 'scheduler', format_string($scheduler->staffrolename));
}
helpbutton('bookwithteacher', get_string('bookwithteacher', 'scheduler'), '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
$exclusivemenu['0'] = get_string('unlimited', 'scheduler');
for($i = 1 ; $i < 10 ; $i++){
$exclusivemenu[(string)$i] = $i;
}
choose_from_menu($exclusivemenu, 'exclusivity', $form->exclusivity, '');
?>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string('reuse', 'scheduler') ?>:</b></td>
<td align="left">
<?php
$reusemenu[0] = get_string('no');
$reusemenu[1] = get_string('yes');
choose_from_menu($reusemenu, 'reuse', $form->reuse, '');
helpbutton('reuse', get_string('reuse', 'scheduler'), '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('1daybefore', '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('1weekbefore', '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('1daybefore', '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('1weekbefore', '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>