Skip to content
Snippets Groups Projects
Commit c680179b 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 00dcf254
No related branches found
No related tags found
No related merge requests found
...@@ -208,29 +208,41 @@ ...@@ -208,29 +208,41 @@
<section class="fieldset-row inner-row"> <section class="fieldset-row inner-row">
<fieldset id="BookingTypeFieldset"> <fieldset id="BookingTypeFieldset">
<legend><?= _('Art des Termins') ?></legend> <legend><?= _('Art des Termins') ?></legend>
<div class="booking-type-item"> <? if ($mode == 'add'): ?>
<label> <div class="booking-type-item">
<input type="radio" name="booking_style" value="single" <label>
<?= empty($block_booking) || $booking_style == 'single' <input type="radio" name="booking_style" value="single"
? 'checked="checked"' <?= empty($block_booking) || $booking_style == 'single'
: '' ?> ? 'checked="checked"'
class="booking-type-item"> : '' ?>
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') ?> <?= _('Einzeltermin') ?>
</label> <? elseif ($booking_style == 'block'): ?>
<label title="<?= _('Konvolut'); ?>"> <input type="hidden" name="booking_style" value="block">
<input type="radio" name="booking_style" value="block"
<?= !empty($block_booking) || $booking_style == 'block' ? 'checked="checked"' : '' ?>
class="booking-type-item">
<?= _('Terminblock') ?> <?= _('Terminblock') ?>
</label> <? elseif ($booking_style == 'repeat'): ?>
<label> <input type="hidden" name="booking_style" value="repeat">
<input type="radio" name="booking_style" value="repeat"
<?= $booking_style == 'repeat' ? 'checked="checked"' : '' ?>
class="booking-type-item">
<?= _('Wiederholungstermine') ?> <?= _('Wiederholungstermine') ?>
</label> <? endif ?>
<? endif ?>
</div>
</fieldset> </fieldset>
<fieldset id="BlockBookingFieldset" <fieldset id="BlockBookingFieldset"
......
...@@ -54,8 +54,12 @@ STUDIP.ready(function () { ...@@ -54,8 +54,12 @@ STUDIP.ready(function () {
//Dialog for adding/editing bookings: //Dialog for adding/editing bookings:
if (jQuery('form.create-booking-form').length) { if (jQuery('form.create-booking-form')) {
STUDIP.Resources.moveTimeOptions(jQuery('input[name="booking_style"]:checked').val()); 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, //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.
Please register or to comment