die();
}
- if($this->oRm->getRooms() == array()) {
- echo sprintf("<p>%s</p>\n", _c("room-reservation:No rooms have been ".
- "configured yet."));
- _PageBlue();
- die();
- }
-
Title(_c("room-reservation:Book rooms"));
// Form for room selection
$_SERVER["PHP_SELF"]);
echo sprintf("<input type='hidden' name='mod_roomReservationBookingTable".
"[date]' value='%d' />\n", $this->getStart());
- echo _c("room-reservation:Room:") . sprintf(" <select onchange=".
- "'document.forms[\"room\"].submit()' width='250' ".
- "name='mod_roomReservationBookingTable[room]'>\n", $this->getStart());
- $aor = $this->oRm->getRooms();
- foreach($aor as $or) {
- // note to myself: no qu() here, seems this is being done automagically
- echo sprintf("<option value='%s'%s>%s</option>\n", $or->getName(),
- ($or->getName() == $this->getRoom()) ? " selected='selected'" : "",
- $or->getName());
- }
- echo sprintf("</select> <%s value='%s' /></form><p />\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(" <select onchange=".
+ "'document.forms[\"room\"].submit()' width='250' ".
+ "name='mod_roomReservationBookingTable[room]'>\n", $this->getStart());
+ foreach($aor as $or) {
+ // note to myself: no qu() here, seems this is being done automagically
+ echo sprintf("<option value='%s'%s>%s</option>\n", $or->getName(),
+ ($or->getName() == $this->getRoom()) ? " selected='selected'" : "",
+ $or->getName());
+ }
+ echo sprintf("</select> <%s value='%s' /></form><p />\n",
+ $GLOBALS["stdbtn"], _("Change"));
+ } else {
+ printf("<p>%s</p>\n", _c("room-reservation:No rooms have been ".
+ "configured yet."));
+ return;
+ }
+
// Print line with next 5 or so weeks
$strSep = " | ";
$strLink = sprintf("<a href='%s?mod_roomReservationBookingTable[date]=%%d".