From: Roland Hieber Date: Fri, 13 Mar 2009 00:59:34 +0000 (+0100) Subject: removed other obsolete code and task tags, wrapped text to 80 columns X-Git-Tag: REL_9.10.23~4 X-Git-Url: https://git.rohieb.name/iserv-mod-room-reservation.git/commitdiff_plain/ce63b9c371709177de3f8aeec14b8d4229c8c91e?ds=sidebyside removed other obsolete code and task tags, wrapped text to 80 columns --- diff --git a/inc/functions.inc b/inc/functions.inc index bf85b36..741f8f7 100644 --- a/inc/functions.inc +++ b/inc/functions.inc @@ -24,8 +24,6 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. - * - * @todo move some functions into M Class Library */ require_once("share.inc"); diff --git a/inc/mod_roomReservationBookingsManager.inc b/inc/mod_roomReservationBookingsManager.inc index 3f2cab6..c91f34a 100644 --- a/inc/mod_roomReservationBookingsManager.inc +++ b/inc/mod_roomReservationBookingsManager.inc @@ -135,7 +135,6 @@ class mod_roomReservationBookingsManager { * @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 @@ -221,7 +220,6 @@ class mod_roomReservationBookingsManager { * Delete a booking from the database * @param $nUid (int) Unique ID of the booking * @return (bool) true on success, otherwise false. - * @todo test */ public function delete($nUid) { // Only administrators and owners are allowed to delete bookings diff --git a/inc/mod_roomReservationRoom.inc b/inc/mod_roomReservationRoom.inc index 64ed6cb..4fe2f31 100644 --- a/inc/mod_roomReservationRoom.inc +++ b/inc/mod_roomReservationRoom.inc @@ -24,8 +24,6 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. - * - * @todo move into M Class Library */ /** diff --git a/inc/mod_roomReservationRoomsManager.inc b/inc/mod_roomReservationRoomsManager.inc index edce221..4c90b79 100644 --- a/inc/mod_roomReservationRoomsManager.inc +++ b/inc/mod_roomReservationRoomsManager.inc @@ -5,7 +5,6 @@ * @author Roland Hieber (roland.hieber@wilhelm-gym.net) * @date 28.12.2007 * - * TODO: move into M Class Library * Copyright © 2007 Roland Hieber * * Permission is hereby granted, free of charge, to any person obtaining @@ -46,72 +45,6 @@ class mod_roomReservationRoomsManager { public function __construct(mod_roomReservationConfig &$oCfg) { $this->oCfg = $oCfg; } - - /** - * Insert or update a room in the database - * param $or (rsRoom) Room to store in the database - * return (int) The UID of the booking, or -1 in case of a failure. - * Call getLastError() to get more information about the error. - */ -/** public function write(rsRoom $or) { - // Only administrators are allowed to create and alter rooms - if(!$this->oCfg->userIsAdmin()) { - // TODO throw exception - setLastError(RS_ERROR_ACCESS_DENIED); - return -1; - } - - $strWhere = ""; - $strLog = ""; - - // Update or insert? - if($or->getUid() == null) { - // No UID yet, insert new room - $strLog = sprintf("Raum „%s“ angelegt", $or->getName()); - } else { - $strWhere = "rsr_uid = ".qp(intval($or->getUid())); - $strLog = sprintf("Raum „%s“ geändert", $or->getName()); - } - - $aPut["rsr_name"] = $or->getName(); - db_store("rooms", $aPut, $strWhere == "" ? null : $strWhere); - - $hQuery = db_query("SELECT currval('roomschedule_rooms_rsr_uid_seq') ". - "FROM roomschedule_rooms;"); - $nNewUid = pg_fetch_result($hQuery, 0, "currval"); - - rrInsertLog($strLog); - - // Return new UID - return $nNewUid; - } - */ - /** - * Delete a room from the database - * param $nUid (int) Unique ID of the room - * return (bool) true on success, otherwise false. - * Call getLastError() to get more information about the error. - */ -/* public function delete($nUid) { - // Only administrators are allowed to delete rooms - if(!$this->oCfg->userIsAdmin()) { - // TODO throw exception - setLastError(RS_ERROR_ACCESS_DENIED); - return false; - } - // Delete it from the database - $strRoom = $this->getRoomName($nUid); - if(!db_query("DELETE FROM roomschedule_rooms WHERE rsr_uid = $1;", - intval($nUid))) { - // TODO throw exception - setLastError(RS_ERROR_SQL); - return false; - } else { - rsInsertLog(sprintf("Raum „%s“ gelöscht", $strRoom)); - return true; - } - } -*/ /** * Get a room by its OID. Returns null if the room was not found. diff --git a/sql/mod_room-reservation.sql b/sql/mod_room-reservation.sql index 436512a..f29e82a 100644 --- a/sql/mod_room-reservation.sql +++ b/sql/mod_room-reservation.sql @@ -11,28 +11,32 @@ CREATE TABLE mod_roomreservation_roomswhitelist ( -- Table with bookings -- CREATE TABLE mod_roomreservation_bookings ( - rrb_uid SERIAL NOT NULL PRIMARY KEY, -- Unique ID - rrb_room TEXT NOT NULL -- Name of the room + rrb_uid SERIAL NOT NULL -- Unique ID + PRIMARY KEY, + rrb_room TEXT NOT NULL -- Name of the room REFERENCES rooms(name) ON DELETE CASCADE ON UPDATE CASCADE, - rrb_date DATE NOT NULL, -- Date of the booking - rrb_tsfirst SMALLINT NOT NULL, -- Number of the first timeslice - rrb_tslast SMALLINT NOT NULL -- Number of the last timeslice + rrb_date DATE NOT NULL, -- Date of the booking + rrb_tsfirst SMALLINT NOT NULL, -- Number of the first timeslice + rrb_tslast SMALLINT NOT NULL -- Number of the last timeslice CHECK(rrb_tsfirst <= rrb_tslast), - rrb_act TEXT NOT NULL -- Owner of the booking + rrb_act TEXT NOT NULL -- Owner of the booking REFERENCES users(Act) ON DELETE CASCADE ON UPDATE CASCADE, - rrb_reason TEXT NOT NULL, -- Reason - rrb_interval SMALLINT NOT NULL -- Interval in weeks for recurring bookings - DEFAULT 0 + rrb_reason TEXT NOT NULL, -- Reason + rrb_interval SMALLINT NOT NULL -- Interval in weeks for + DEFAULT 0 -- recurring bookings ); -- -- Permissions -- -GRANT SELECT, INSERT, UPDATE, DELETE ON mod_roomreservation_bookings, mod_roomreservation_bookings_rrb_uid_seq TO webusr; -GRANT SELECT, INSERT, UPDATE, DELETE ON mod_roomreservation_bookings, mod_roomreservation_bookings_rrb_uid_seq TO webadm; +GRANT SELECT, INSERT, UPDATE, DELETE ON mod_roomreservation_bookings, + mod_roomreservation_bookings_rrb_uid_seq TO webusr; +GRANT SELECT, INSERT, UPDATE, DELETE ON mod_roomreservation_bookings, + mod_roomreservation_bookings_rrb_uid_seq TO webadm; GRANT SELECT ON mod_roomreservation_roomswhitelist TO webusr; -GRANT SELECT, INSERT, UPDATE, DELETE ON mod_roomreservation_roomswhitelist TO webadm; +GRANT SELECT, INSERT, UPDATE, DELETE ON mod_roomreservation_roomswhitelist + TO webadm; diff --git a/src/config.php b/src/config.php index e884df2..3873bdd 100644 --- a/src/config.php +++ b/src/config.php @@ -26,8 +26,6 @@ * THE SOFTWARE. */ -/** @todo document */ - require_once("sec/admsecure.inc"); require_once("mod_room-reservation/globals.inc"); require_once("mod_room-reservation/mod_roomReservationConfigPage.inc");