mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
Half the work done for bug 1330:
Now when creating events you don't select a course, the current course is selected implicitly.
This commit is contained in:
parent
8c54cec650
commit
e4bbaab3c3
@ -163,7 +163,7 @@
|
||||
|
||||
/// Log the event entry.
|
||||
add_to_log($form->courseid, 'calendar', 'add', 'event.php?action=edit&id='.$eventid, $form->name);
|
||||
|
||||
|
||||
if ($form->repeat) {
|
||||
for($i = 1; $i < $form->repeats; $i++) {
|
||||
$form->timestart += 604800; // add one week
|
||||
@ -173,7 +173,7 @@
|
||||
add_to_log($form->courseid, 'calendar', 'add', 'event.php?action=edit&id='.$eventid, $form->name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// OK, now redirect to day view
|
||||
redirect(CALENDAR_URL.'view.php?view=day&cal_d='.$form->startday.'&cal_m='.$form->startmon.'&cal_y='.$form->startyr);
|
||||
}
|
||||
@ -381,7 +381,7 @@
|
||||
print_side_block_start(get_string('newevent', 'calendar').$header, '', 'mycalendar');
|
||||
if($_REQUEST['type'] == 'select') {
|
||||
optional_variable($_REQUEST['groupid']);
|
||||
optional_variable($_REQUEST['courseid']);
|
||||
optional_variable($_REQUEST['courseid'], $SESSION->cal_course_referer);
|
||||
$groupid = $_REQUEST['groupid'];
|
||||
$courseid = $_REQUEST['courseid'];
|
||||
include('event_select.html');
|
||||
|
@ -20,18 +20,11 @@
|
||||
</select>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php if(!empty($allowed->courses)) { ?><p><input type='radio' name='type' value='course' id='type_course' /><label for='type_course'><?php print_string('typecourse', 'calendar') ?></label></p>
|
||||
<div style="padding-left: 1.5em;">
|
||||
<?php print_string('course'); ?>:
|
||||
<select name='courseid'>
|
||||
<option value=''></option>
|
||||
<?php foreach($allowed->courses as $course) {?>
|
||||
<option value='<?php echo $course->id?>' <?php if($course->id == $courseid) echo 'selected="selected"';?>><?php echo $course->shortname.' - '.$course->fullname?></option>
|
||||
<?php }?>
|
||||
</select>
|
||||
</div>
|
||||
<?php if(!empty($allowed->courses)) { ?>
|
||||
<p><input type='radio' name='type' value='course' id='type_course' /><input type="hidden" name="courseid" value="<?php echo($courseid) ?>" /><label for='type_course'><?php print_string('typecourse', 'calendar') ?></label></p>
|
||||
<?php } ?>
|
||||
<?php if(!empty($allowed->site)) { ?><p><input type='radio' name='type' value='site' id='type_site' /><label for='type_site'><?php print_string('typesite', 'calendar') ?></label></p>
|
||||
<?php if(!empty($allowed->site)) { ?>
|
||||
<p><input type='radio' name='type' value='site' id='type_site' /><label for='type_site'><?php print_string('typesite', 'calendar') ?></label></p>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
Loading…
x
Reference in New Issue
Block a user