X-Git-Url: https://git.rohieb.name/iserv-mod-room-reservation.git/blobdiff_plain/8aa81d777b83e2828cf8ca63e178413de0fa81ee..53b4c836cc54c06c3fca9fa9777f00dc4286a7af:/includes/mod_roomReservationBookingPage.inc diff --git a/includes/mod_roomReservationBookingPage.inc b/includes/mod_roomReservationBookingPage.inc index f17d447..219c7bd 100644 --- a/includes/mod_roomReservationBookingPage.inc +++ b/includes/mod_roomReservationBookingPage.inc @@ -156,13 +156,6 @@ class mod_roomReservationBookingPage extends mod_roomReservationPage { die(); } - if($this->oRm->getRooms() == array()) { - echo sprintf("
%s
\n", _c("room-reservation:No rooms have been ". - "configured yet.")); - _PageBlue(); - die(); - } - Title(_c("room-reservation:Book rooms")); // Form for room selection @@ -171,19 +164,31 @@ class mod_roomReservationBookingPage extends mod_roomReservationPage { $_SERVER["PHP_SELF"]); echo sprintf("\n", $this->getStart()); - echo _c("room-reservation:Room:") . sprintf(" <%s value='%s' />\n", - $GLOBALS["stdbtn"], _("Change")); + // Show rooms only if it is whitelisted + try { + $aor = $this->oCfg->getWhitelistedRooms(); + } catch(SQLException $e) { + trigger_error($e->getMessage()); + } + if(count($aor) > 0) { + echo _c("room-reservation:Room:") . sprintf(" <%s value='%s' />\n", + $GLOBALS["stdbtn"], _("Change")); + } else { + printf("%s
\n", _c("room-reservation:No rooms have been ". + "configured yet.")); + return; + } + // Print line with next 5 or so weeks $strSep = " | "; $strLink = sprintf("