* @param $ob (mod_roomReservationBooking) Booking to write to the database
* @return (int) The UID of the written booking
* @throws SQLException, AccessException
- * @todo document
*/
function write(mod_roomReservationBooking $ob) {
// protect access
// 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 {
* Delete a booking from the database
* @param $nUid (int) Unique ID of the booking
* @return (bool) <tt>true</tt> on success, otherwise <tt>false</tt>.
- * @todo test
*/
public function delete($nUid) {
// Only administrators and owners are allowed to delete bookings
$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;