*/
class mod_roomReservationBookingPage extends mod_roomReservationPage {
- /** (mod_roomReservationConfig) Reference to the configuration object */
+ /** (mod_roomReservationConfig) Reference to the configuration object */
protected $oCfg;
/**
* (mod_roomReservationRoomsManager) Reference to the rooms manager object
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());
+ "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(),
$GLOBALS["stdbtn"], _("Change"));
} else {
printf("<p>%s</p>\n", _c("room-reservation:No rooms have been ".
- "configured yet."));
+ "configured yet."));
return;
}
// Print line with next 5 or so weeks
$strSep = " | ";
$strLink = sprintf("<a href='%s?mod_roomReservationBookingTable[date]=%%d".
- "&mod_roomReservationBookingTable[room]=%%s'>%%s</a>",
+ "&mod_roomReservationBookingTable[room]=%%s'>%%s</a>",
$_SERVER["PHP_SELF"]);
echo "<p>".sprintf($strLink, time(), qu($this->getRoom()),
_c("room-reservation:Current Week")) . $strSep;
*/
protected $cAction;
/**
- * (timestamp) The date of the requested booking or the date to show in the
- * booking table
- */
+ * (timestamp) The date of the requested booking or the date to show in the
+ * booking table
+ */
protected $tsDate;
/**
* (string) The name of the room of the requested booking or the room to be
$this->strRoom = $str;
} else {
throw new Exception(_c("room-reservation:This room is not available ".
- "for booking."));
+ "for booking."));
}
}
* @param $ts (timestamp) current date
* @param $ob (mod_roomReservationBooking) the booking
* @param $cFlags (constant) Flags,
- * See @ref bookingtable_printbooking_flags for more information.
+ * See @ref bookingtable_printbooking_flags for more information.
* @param $asMsgs (array of strings) Additional messages to be printed
* inside the cell, one array element per message
* @return (int) the span of the booking
"booking is a recurring booking. If you delete it, the period will ".
"be deallocated for <b>every week</b>, not just this single week!"));
$strAfter .= sprintf("<p name='form' id='form' style='".
- "text-align:center'><form action='%s?".
- "mod_roomReservationBookingTable[action]=submitdelete#form' ".
+ "text-align:center'><form action='%s?".
+ "mod_roomReservationBookingTable[action]=submitdelete#form' ".
"method='post'>%s%s<br /><%s name='mod_roomReservationBookingTable".
"[submitdelete]' value='%s' /> <%s name='".
"mod_roomReservationBookingTable[submitdelete]' value='%s' />".
$sWeeklyForm = "";
if($this->oCfg->userIsAdmin()) {
$sWeeklyForm = sprintf("<label for='interval'>%s</label> %s<br />".
- "<label for='account'>%s</label> <%s name='".
- "mod_roomReservationBookingTable[account]' id='account' value='%s' ".
+ "<label for='account'>%s</label> <%s name='".
+ "mod_roomReservationBookingTable[account]' id='account' value='%s' ".
"size='15' /><br />", _c("room-reservation:Repetition:"),
select("mod_roomReservationBookingTable[interval]",
$this->nPostInterval, array(0 => _c("Select:None"), 1 =>
_c("room-reservation:every week")), array("add" => "id='interval'")),
_c("room-reservation:Account, if not yourself:"), $GLOBALS["stdedt"],
- $this->strPostAccount);
+ $this->strPostAccount);
}
echo sprintf("<td name='form' id='form' style='text-align:left'>%s".
- "<form action='%s?mod_roomReservationBookingTable[action]=".
- "submit#form' method='post'><label for='tslast'>%s</label> %s".
- "<br /><label for='reason'>%s</label> <%s id='reason' size='15' ".
- "value='%s' name='mod_roomReservationBookingTable[reason]' /><br />%s".
- "<%s name='mod_roomReservationBookingTable[submitbooking]' value='%s' />".
- "<input type='hidden' name='mod_roomReservationBookingTable[date]' ".
- "value='%s' /><input type='hidden' name='".
- "mod_roomReservationBookingTable[room]' value='%s' /><input ".
- "type='hidden' name='mod_roomReservationBookingTable[tsfirst]' ".
- "value='%s' /></form></td>\n", (count($asErrors) > 0) ? $strErrors : "",
+ "<form action='%s?mod_roomReservationBookingTable[action]=".
+ "submit#form' method='post'><label for='tslast'>%s</label> %s".
+ "<br /><label for='reason'>%s</label> <%s id='reason' size='15' ".
+ "value='%s' name='mod_roomReservationBookingTable[reason]' /><br />%s".
+ "<%s name='mod_roomReservationBookingTable[submitbooking]' value='%s' />".
+ "<input type='hidden' name='mod_roomReservationBookingTable[date]' ".
+ "value='%s' /><input type='hidden' name='".
+ "mod_roomReservationBookingTable[room]' value='%s' /><input ".
+ "type='hidden' name='mod_roomReservationBookingTable[tsfirst]' ".
+ "value='%s' /></form></td>\n", (count($asErrors) > 0) ? $strErrors : "",
$_SERVER["PHP_SELF"], _c("room-reservation:until:"),
select("mod_roomReservationBookingTable[tslast]", $this->getTsLast(),
$this->oCfg->getTimesliceEndings(true)), _c("room-reservation:Reason:"),
// No UID yet, insert new booking
// @todo write interval and user if interval > 0
$strLog = sprintf("Raum „%s“ am %s von %s bis %s gebucht ".
- "(Begründung: %s)", $ob->getRoom(), date("d\.m\.Y", $ob->getDate()),
+ "(Begründung: %s)", $ob->getRoom(), date("d\.m\.Y", $ob->getDate()),
gmdate("G:i", $oTsB[$ob->getTsFirst()]), gmdate("G:i",
$oTsE[$ob->getTsLast()]), $ob->getReason());
} else {
$oTsE[$ob->getTsLast()]), $ob->getReason());
// Delete it from the database
if(!db_query("DELETE FROM mod_roomreservation_bookings WHERE ".
- "rrb_uid = $1;", $nUid)) {
+ "rrb_uid = $1;", $nUid)) {
throw new SQLException(MOD_ROOM_RESERVATION_ERROR_SQL);
return false;
} else {
return false; // user is not logged in
} else {
$hQuery = db_query("SELECT rrb_act FROM mod_roomreservation_bookings WHERE ".
- "rrb_uid = $1;", intval($nID));
+ "rrb_uid = $1;", intval($nID));
if(!is_resource($hQuery)) {
throw new SQLException(MOD_ROOM_RESERVATION_ERROR_SQL);
return false;
* @{
*/
- /**
+ /**
* Add a timeslice. A check is done that the timeslices do not overlap, and
* in this case, an Exception is thrown.
* @param $oTs (mod_roomReservationTimeslice)
throw new SQLException(MOD_ROOM_RESERVATION_ERROR_SQL);
} else {
log_insert(sprintf("Raum „%s“ für Buchungen zur Verfügung gestellt",
- $sRoom));
+ $sRoom));
}
}
}
*/
public function unWhitelistRoom($sRoom) {
$h = db_query("DELETE FROM mod_roomreservation_roomswhitelist WHERE ".
- "rrr_name = $1;", $sRoom);
+ "rrr_name = $1;", $sRoom);
if(!$h) {
throw new SQLException(MOD_ROOM_RESERVATION_ERROR_SQL);
} else {
*/
public function isRoomWhitelisted($sRoom) {
$h = db_query("SELECT * FROM mod_roomreservation_roomswhitelist WHERE ".
- "rrr_name=$1;", $sRoom);
+ "rrr_name=$1;", $sRoom);
if(!$h) {
throw new SQLException(MOD_ROOM_RESERVATION_ERROR_SQL);
}
array_merge($this->asMessages, array($sMessage));
}
- /**
+ /**
* Get all timeslices in chronological order
* @return array of rmTimeslice
*/
// first column
echo "<table border='0' cellspacing='10' cellpadding='0'><tr>".
- "<td style='width:50%;'>\n";
+ "<td style='width:50%;'>\n";
GroupBox(_c("room-reservation:Available rooms"), "host");
printf("<p>%s</p>", _c("room-reservation:The following rooms are ".
- "available for booking:"));
+ "available for booking:"));
echo "<div style='margin:8px;'>";
$this->orwlb->show();
echo "</div>\n";
"action. Please use the %sgroup administration%s to assign and revoke ".
"privileges."), "<a href='/idesk/admin/act/groups.php'>", "</a>"),
_c("room-reservation:Please note that every group with the booking ".
- "privilege can also implicitly view the booking table and every group with ".
- "the administration privilege can also implicitly book and view the ".
- "booking table."));
+ "privilege can also implicitly view the booking table and every group with ".
+ "the administration privilege can also implicitly book and view the ".
+ "booking table."));
echo "<p><table style='width:100%'><tr>\n";
echo sprintf("<td>%s%s</td><td>%s</td>\n", icon("keys"),
_("View the booking table").":", $asViewGroups == array() ?
GroupBox(_c("room-reservation:Periods"), "mod_room-reservation_timeslice");
printf("<p>%s</p>", _c("room-reservation:Here you can fill in the ".
- "periods where bookings can be undertaken. A booking period can ".
- "e. g. correspond to a lesson."));
+ "periods where bookings can be undertaken. A booking period can ".
+ "e. g. correspond to a lesson."));
echo "<div style='margin:8px;'>";
$this->otlb->show();
echo "</div>\n";
GroupBox(_c("room-reservation:Further options"), "manage");
printf("<div style='margin:8px;'><form action='%s' method='post'>".
- "<table><tr>\n", $_SERVER["PHP_SELF"]);
+ "<table><tr>\n", $_SERVER["PHP_SELF"]);
printf("<td><input type='hidden' name='mod_roomReservationConfigPage".
- "[showweekend]' value='0' /><%s name='mod_roomReservationConfigPage".
- "[showweekend]' id='mod_roomReservationConfigPageShowWeekend' ".
- "value='1' %s /></td><td><label for='".
- "mod_roomReservationConfigPageShowWeekend'><b>%s</b></label><br />".
- "<span class='mod_roomReservationConfigPageExplanation'>%s</span></p>",
+ "[showweekend]' value='0' /><%s name='mod_roomReservationConfigPage".
+ "[showweekend]' id='mod_roomReservationConfigPageShowWeekend' ".
+ "value='1' %s /></td><td><label for='".
+ "mod_roomReservationConfigPageShowWeekend'><b>%s</b></label><br />".
+ "<span class='mod_roomReservationConfigPageExplanation'>%s</span></p>",
$GLOBALS["smlchk"], $this->bPostShowWeekend ? "checked='checked' " : "",
_c("room-reservation:Show weekend"), _c("room-reservation:If ".
"selected, the weekdays saturday and sunday are also shown in the ".
echo "</tr><tr>\n";
printf("<td><input type='hidden' name='mod_roomReservationConfigPage".
- "[showlessons]' value='0' /><%s name='mod_roomReservationConfigPage".
- "[showlessons]' id='mod_roomReservationConfigPageShowLessons' ".
- "value='1'%s /></td><td><label for='".
- "mod_roomReservationConfigPageShowLessons'><b>%s</b></label><br />".
- "<span class='mod_roomReservationConfigPageExplanation'>%s</span></p>",
+ "[showlessons]' value='0' /><%s name='mod_roomReservationConfigPage".
+ "[showlessons]' id='mod_roomReservationConfigPageShowLessons' ".
+ "value='1'%s /></td><td><label for='".
+ "mod_roomReservationConfigPageShowLessons'><b>%s</b></label><br />".
+ "<span class='mod_roomReservationConfigPageExplanation'>%s</span></p>",
$GLOBALS["smlchk"], $this->bPostShowLessons ? "checked='checked' " : "",
_c("room-reservation:Show „lesson” texts"),
_c("room-reservation:Check this box to show texts like ".
- "„<i>n</i>th lesson&rdquo in the booking page. If this box is ".
- "unchecked, none of these texts are shown."));
+ "„<i>n</i>th lesson&rdquo in the booking page. If this box is ".
+ "unchecked, none of these texts are shown."));
printf("</tr><tr><td colspan='2'><%s name='mod_roomReservationConfigPage".
- "[submit]' value='%s' /></td>", $GLOBALS["stdbtn"], _("OK"));
+ "[submit]' value='%s' /></td>", $GLOBALS["stdbtn"], _("OK"));
echo "</tr></table></form></div>\n";
_GroupBox();
echo "</td></tr></table>\n";
}
}
-?>
\ No newline at end of file
+?>
printf("<tr><td class='tbbtm' colspan='%d'>", $GLOBALS["treeview_cols"]);
CheckCombo();
printf("<%s name='mod_roomReservationRoomWhitelistListBox[action]".
- "[delete]' value='%s' />", $GLOBALS["stdbtn"], _("Delete"));
+ "[delete]' value='%s' />", $GLOBALS["stdbtn"], _("Delete"));
echo "</td></tr>\n";
}
TreeViewSubtitle(_("Add"));
$this->showList($aoRooms);
TreeViewLine(sprintf("<p><%s name='mod_roomReservationRoomWhitelistList".
- "Box[action][add]' value='%s' /> <%s name='mod_roomReservationRoom".
- "WhitelistListBox[action][add]' value='%s' /></p>", $GLOBALS["stdbtn"],
+ "Box[action][add]' value='%s' /> <%s name='mod_roomReservationRoom".
+ "WhitelistListBox[action][add]' value='%s' /></p>", $GLOBALS["stdbtn"],
_("OK"), $GLOBALS["stdbtn"], _("Cancel")));
}
_c("room-reservation:rooms")));
$this->showList($aoRooms, false);
TreeViewLine(sprintf("<p><%s name='mod_roomReservationRoomWhitelistList".
- "Box[action][delete]' value='%s' /> <%s name='mod_roomReservationRoom".
- "WhitelistListBox[action][delete]' value='%s' /></p>",
+ "Box[action][delete]' value='%s' /> <%s name='mod_roomReservationRoom".
+ "WhitelistListBox[action][delete]' value='%s' /></p>",
$GLOBALS["stdbtn"], _("OK"), $GLOBALS["stdbtn"], _("Cancel")));
}
$nOid = pg_fetch_result(db_query("SELECT oid FROM ".
"rooms WHERE name = $1", $o->getName()), 0, "oid");
$sBox = $bCheckboxes ? sprintf("<%s id='box%d' name='mod_room".
- "ReservationRoomWhitelistListBox[l][%d]' value='1'%s /><label ".
- "for='box%d'>%s%s</label>", $GLOBALS["smlchk"], $nOid, $nOid,
+ "ReservationRoomWhitelistListBox[l][%d]' value='1'%s /><label ".
+ "for='box%d'>%s%s</label>", $GLOBALS["smlchk"], $nOid, $nOid,
@$this->anPostSelection[$nOid] ? " checked='checked'" : "", $nOid,
icon("host"), $o->getName()) :
sprintf("<input type='hidden' name='mod_roomReservationRoom".
- "WhitelistListBox[l][%d]' value='1' />%s%s", $nOid, icon("host"),
+ "WhitelistListBox[l][%d]' value='1' />%s%s", $nOid, icon("host"),
$o->getName());
TreeViewLine($sBox);
}
// Note: we want to handle the timestamps in GMT format, hence the "+0000"
if(strtotime($this->getNewBegin()." +0000") === false) {
$this->asMessages[] = _c("room-reservation:The beginning time is ".
- "invalid.");
+ "invalid.");
$bErrors = true;
}
if(strtotime($this->getNewEnd()." +0000") === false) {
$this->asMessages[] = _c("room-reservation:The ending time is ".
- "invalid.");
+ "invalid.");
$bErrors = true;
}
}
TreeViewLine(array(sprintf("<%s name='mod_roomReservationTimesliceListBox".
- "[begin]' value='%s' size='8'/>", $GLOBALS["stdedt"],
+ "[begin]' value='%s' size='8'/>", $GLOBALS["stdedt"],
$this->getNewBegin()), sprintf("<%s name='".
"mod_roomReservationTimesliceListBox[end]' value='%s' size='8'/> <%s ".
"name='mod_roomReservationTimesliceListBox[submit]' value='%s' />",
$aoTs = $this->oCfg->getTimeslices();
if(count($aoTs) > 0) {
echo "<form action='?mod_roomReservationTimesliceListBox[action]=delete' ".
- "method='post'>";
+ "method='post'>";
$i = 0;
foreach($aoTs as $oTs) {
$sBox = sprintf("<input type='hidden' ".
- "name='mod_roomReservationTimesliceListBox[l][%d]' value='0' />".
- "<%s name='mod_roomReservationTimesliceListBox[l][%d]' value='1' />",
+ "name='mod_roomReservationTimesliceListBox[l][%d]' value='0' />".
+ "<%s name='mod_roomReservationTimesliceListBox[l][%d]' value='1' />",
$i, $GLOBALS["smlchk"], $i);
// Note: we have only GMT timestamps in the timeslice objects
TreeViewLine(array($sBox . gmstrftime(_("%#I:%M %p"), $oTs->getBegin()),
printf("<tr><td class='tbbtm' colspan='%d'>", $GLOBALS["treeview_cols"]);
CheckCombo();
printf("<%s name='mod_roomReservationTimesliceListBox[submit]' ".
- "value='%s' />", $GLOBALS["stdbtn"], _("Delete"));
+ "value='%s' />", $GLOBALS["stdbtn"], _("Delete"));
echo "</td></tr>\n";
} else {
TreeViewEmpty();
}
/** @} */
}
-?>
\ No newline at end of file
+?>