Skip to content
Snippets Groups Projects
Commit de92eac6 authored by Moritz Strohm's avatar Moritz Strohm
Browse files

do not allow editing the booking style, re #549

Merge request studip/studip!991
parent ac081a39
No related branches found
No related tags found
No related merge requests found
......@@ -208,29 +208,41 @@
<section class="fieldset-row inner-row">
<fieldset id="BookingTypeFieldset">
<legend><?= _('Art des Termins') ?></legend>
<div class="booking-type-item">
<label>
<input type="radio" name="booking_style" value="single"
<?= empty($block_booking) || $booking_style == 'single'
? 'checked="checked"'
: '' ?>
class="booking-type-item">
<? if ($mode == 'add'): ?>
<div class="booking-type-item">
<label>
<input type="radio" name="booking_style" value="single"
<?= empty($block_booking) || $booking_style == 'single'
? 'checked="checked"'
: '' ?>
class="booking-type-item">
<?= _('Einzeltermin') ?>
</label>
<label title="<?= _('Konvolut'); ?>">
<input type="radio" name="booking_style" value="block"
<?= !empty($block_booking) || $booking_style == 'block' ? 'checked="checked"' : '' ?>
class="booking-type-item">
<?= _('Terminblock') ?>
</label>
<label>
<input type="radio" name="booking_style" value="repeat"
<?= $booking_style == 'repeat' ? 'checked="checked"' : '' ?>
class="booking-type-item">
<?= _('Wiederholungstermine') ?>
</label>
</div>
<? else: ?>
<? if ($booking_style == 'single'): ?>
<input type="hidden" name="booking_style" value="single">
<?= _('Einzeltermin') ?>
</label>
<label title="<?= _('Konvolut'); ?>">
<input type="radio" name="booking_style" value="block"
<?= !empty($block_booking) || $booking_style == 'block' ? 'checked="checked"' : '' ?>
class="booking-type-item">
<? elseif ($booking_style == 'block'): ?>
<input type="hidden" name="booking_style" value="block">
<?= _('Terminblock') ?>
</label>
<label>
<input type="radio" name="booking_style" value="repeat"
<?= $booking_style == 'repeat' ? 'checked="checked"' : '' ?>
class="booking-type-item">
<? elseif ($booking_style == 'repeat'): ?>
<input type="hidden" name="booking_style" value="repeat">
<?= _('Wiederholungstermine') ?>
</label>
</div>
<? endif ?>
<? endif ?>
</fieldset>
<fieldset id="BlockBookingFieldset"
......
......@@ -54,8 +54,12 @@ STUDIP.ready(function () {
//Dialog for adding/editing bookings:
if (jQuery('form.create-booking-form').length) {
STUDIP.Resources.moveTimeOptions(jQuery('input[name="booking_style"]:checked').val());
if (jQuery('form.create-booking-form')) {
let time_option = jQuery('input[name="booking_style"]:checked').val();
if (!time_option) {
time_option = jQuery('input[name="booking_style"]').val();
}
STUDIP.Resources.moveTimeOptions(time_option);
}
//Set the date selector in the sidebar to the date from the session,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment