moodle/calendar/event_new.html
2009-08-20 13:14:35 +00:00

119 lines
5.4 KiB
HTML

<?php
// The following is a hack to fix bug 1488
$course = $DB->get_record('course', array('id'=>($form->courseid ? $form->courseid : $site->id)));
$startselectors = html_select::make_time_selectors(array(
'days' => 'startday',
'months' => 'startmon',
'years' => 'startyr',
'hours' => 'starthr',
'minutes' => 'startmin'), (int) $form->timestart);
$endselectors = html_select::make_time_selectors(array(
'days' => 'endday',
'months' => 'endmon',
'years' => 'endyr',
'hours' => 'endhr',
'minutes' => 'endmin'), $form->timestart + $form->timeduration);
?>
<form method="post" action="event.php" id="eventform">
<table cellpadding="5">
<tr>
<td style="vertical-align: top; text-align: right;"><label for="eventname">
<?php print_string('eventname', 'calendar'); ?>:
</label></td>
<td>
<input type="text" name="name" size="67" id="eventname" value="<?php p($form->name); ?>" />
<?php if (isset($err['name'])) echo $OUTPUT->error_text($err['name']); ?>
</td>
</tr>
<tr>
<td style="vertical-align: top; text-align: right;"><label for="edit-description">
<?php print_string('eventdescription', 'calendar'); ?>:
</label></td>
<td>
<?php
print_textarea($usehtmleditor, 20, 65, 630, 300, "description", $form->description);
if (isset($err['description'])) echo $OUTPUT->error_text($err['description']);
?>
</td>
</tr>
<tr>
<td style="vertical-align: top; text-align: right;">
<?php print_string('eventdate', 'calendar'); ?>:
</td>
<td>
<?php echo $OUTPUT->select($startselectors[0]) . $OUTPUT->select($startselectors[1]) . $OUTPUT->select($startselectors[2]);?>
<?php print_string('eventtime', 'calendar');?>
<?php echo $OUTPUT->select($startselectors[3]) . $OUTPUT->select($startselectors[4]);?>
<?php if (isset($err['timestart'])) echo $OUTPUT->error_text($err['timestart']); ?>
</td>
</tr>
<tr>
<td style="vertical-align: top; text-align: right;">
<?php print_string('eventduration', 'calendar'); ?>:
</td>
<td>
<div>
<input type="radio" name="duration" value="0" id="duration_none" <?php if($form->duration == 0) echo 'checked="checked"'; ?>/>
<label for="duration_none"><?php print_string('durationnone', 'calendar'); ?></label>
</div>
<div>
<input type="radio" name="duration" value="1" id="duration_yes" <?php if($form->duration == 1) echo 'checked="checked"'; ?>/>
<label for="duration_yes"><?php print_string('durationuntil', 'calendar'); ?></label>
<?php echo $OUTPUT->select($endselectors[0]) . $OUTPUT->select($endselectors[1]) . $OUTPUT->select($endselectors[2]);?>
<?php print_string('eventtime', 'calendar');?>
<?php echo $OUTPUT->select($endselectors[3]) . $OUTPUT->select($endselectors[4]);?>
<?php if (isset($err['timeduration'])) echo $OUTPUT->error_text($err['timeduration']); ?>
</div>
<div>
<input type="radio" name="duration" value="2" id="duration_minutes" <?php if($form->duration == 2) echo 'checked="checked"'; ?>/>
<label for="duration_minutes"><?php print_string('durationminutes', 'calendar'); ?></label>
<input type="text" name="minutes" size="3" value="<?php p($form->minutes); ?>" id="minutes"/>
<?php if (isset($err['minutes'])) echo $OUTPUT->error_text($err['minutes']); ?>
<label class="accesshide" for="minutes"><?php print_string('minutes') ?></label>
</div>
</td>
</tr>
<tr>
<td style="vertical-align: top; text-align: right;">
<?php print_string('eventrepeat', 'calendar'); ?>:
</td>
<td>
<div>
<input type="radio" name="repeat" value="0" id="repeat_none" <?php if($form->repeat == 0) echo 'checked="checked"'; ?>/>
<label for="repeat_none">
<?php print_string('repeatnone', 'calendar'); ?>
</label>
</div>
<div>
<input type="radio" name="repeat" value="1" id="repeat_yes" <?php if($form->repeat == 1) echo 'checked="checked"'; ?>/>
<label for="repeat_yes">
<?php print_string('repeatweeksl', 'calendar'); ?>
</label>
<input id="repeats" type="text" name="repeats" size="2" value="<?php p($form->repeats); ?>" />
<label for="repeats"><?php print_string('repeatweeksr', 'calendar'); ?></label>
<?php if (isset($err['repeats'])) echo $OUTPUT->error_text($err['repeats']); ?>
</div>
</td>
</tr>
<tr>
<td align="center" colspan="2"><p><input type="submit" value="<?php print_string('savechanges') ?>" /></p></td>
</tr>
</table>
<p>
<input type="hidden" name="courseid" value="<?php echo $form->courseid?>" />
<input type="hidden" name="groupid" value="<?php echo $form->groupid?>" />
<input type="hidden" name="userid" value="<?php echo $form->userid?>" />
<input type="hidden" name="modulename" value="<?php echo $form->modulename?>" />
<input type="hidden" name="eventtype" value="<?php echo $form->eventtype?>" />
<input type="hidden" name="instance" value="<?php echo $form->instance?>" />
<input type="hidden" name="format" value="<?php echo $form->format; ?>" />
<input type="hidden" name="action" value="new" />
<input type="hidden" name="type" value="<?php echo $form->type; ?>" />
<input type="hidden" name="course" value="<?php p($urlcourse); ?>" />
</p>
</form>