removed other obsolete code and task tags, wrapped text to 80 columns
authorRoland Hieber <devnull@localhost>
Fri, 13 Mar 2009 00:59:34 +0000 (01:59 +0100)
committerRoland Hieber <devnull@localhost>
Fri, 13 Mar 2009 00:59:34 +0000 (01:59 +0100)
inc/functions.inc
inc/mod_roomReservationBookingsManager.inc
inc/mod_roomReservationRoom.inc
inc/mod_roomReservationRoomsManager.inc
sql/mod_room-reservation.sql
src/config.php

index bf85b36..741f8f7 100644 (file)
@@ -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");
index 3f2cab6..c91f34a 100644 (file)
@@ -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) <tt>true</tt> on success, otherwise <tt>false</tt>.
-   * @todo test
    */
   public function delete($nUid) {
     // Only administrators and owners are allowed to delete bookings
index 64ed6cb..4fe2f31 100644 (file)
@@ -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
  */
 
 /**
index edce221..4c90b79 100644 (file)
@@ -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 <tt>-1</tt> 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) <tt>true</tt> on success, otherwise <tt>false</tt>.
-   *  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 <tt>null</tt> if the room was not found.
index 436512a..f29e82a 100644 (file)
@@ -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;
index e884df2..3873bdd 100644 (file)
@@ -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");
This page took 0.031011 seconds and 4 git commands to generate.