Commit 1ca9f791 authored by Michael Koch's avatar Michael Koch
Browse files

Hide "subject" for Lernsprint and StudySpace rooms

parent 2a67f216
......@@ -112,6 +112,7 @@ function detectRoomSelection() {
}
$("#frontend_row_times_preparation").hide();
$("#frontend_row_contact_web").hide();
$("#frontend_row_subject").hide();
$("#new_reservation_from_event").datetimepicker({ minDate: _getFormattedDate(_addDays(new Date(), 7)), timepicker: false, defaultTime: '7:00' });
if (r_type === 5) {
$("#frontend_row_ls_intentions").hide();
......@@ -150,6 +151,7 @@ function detectRoomSelection() {
}
$("#frontend_row_lernsprint_info").hide();
$("#frontend_row_studyspace_info").hide();
$("#frontend_row_subject").show();
$("#frontend_row_times_preparation").show();
$("#frontend_row_contact_web").show();
$("#frontend_row_ls_intentions").hide();
......@@ -440,6 +442,8 @@ function clearNewReservationForm() {
$("#frontend_row_times_event > td > label").html("Veranstaltung:");
$("#new_reservation_from_event").removeClass("longer");
$("#new_reservation_from_event").addClass("long");
$("#frontend_row_subject").show();
$("#new_reservation_to_event").show();
resetNewReservationTimes();
checkNewReservationForm();
}
......
......@@ -492,6 +492,7 @@ function addReservation() {
let to_event = $("#new_reservation_to_event").val();
let from_preparation = $("#new_reservation_from_preparation").val();
let to_preparation = $("#new_reservation_to_preparation").val();
let subject = $("#new_reservation_subject").val();
if (r.length === 1) {
let check = checkNewReservationForm();
......@@ -500,9 +501,11 @@ function addReservation() {
if (r[0].room_type === 1) {
from_preparation = "lernsprint";
to_preparation = "lernsprint";
subject = "Lernsprint";
} else if (r[0].room_type === 5) {
from_preparation = "studyspace";
to_preparation = "studyspace";
subject = "StudySpace";
to_event = _addDays(from_event, 6);
to_event = _getFormattedDateTime(dayjs(to_event).set('hours', 22).set('minutes', 0));
......@@ -526,7 +529,7 @@ function addReservation() {
"email": $("#new_reservation_contact_email").val(),
"phone": $("#new_reservation_contact_phone").val(),
"web": $("#new_reservation_contact_web").val(),
"subject": $("#new_reservation_subject").val(),
"subject": subject,
"comment": $("#new_reservation_comment").val(),
"ls_intentions": r[0].room_type !== 1 ? "kein_lernsprint" : $("#new_reservation_ls_intentions").val()
},
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment