removed account data from debian/copyright (Google cache sucks :P), updated image...
authorRoland Hieber <devnull@localhost>
Sat, 26 Sep 2009 03:36:47 +0000 (05:36 +0200)
committerRoland Hieber <devnull@localhost>
Sat, 26 Sep 2009 03:36:47 +0000 (05:36 +0200)
.hgignore
debian/copyright
inc/mod_roomReservationBookingsManager.inc
sql/mod_room-reservation.sql

index 60aa4ea..90e662c 100644 (file)
--- a/.hgignore
+++ b/.hgignore
@@ -4,3 +4,12 @@ debian/iserv-mod-room-reservation
 includes/config.inc
 debian/files
 .buildpath
+
+syntax: regexp
+^\.cache$
+syntax: regexp
+^\.cache$
+syntax: regexp
+^\.settings$
+syntax: regexp
+^\.buildpath$
\ No newline at end of file
index d5e760c..cb9355c 100644 (file)
@@ -4,26 +4,11 @@ The module has been released under the terms of the MIT License, as printed
 following in its original version. Some images which have been used have been
 released under the terms of the GNU Lesser General Public License (see
 http://www.fsf.org/licensing/licenses/lgpl.html). These are in particular:
-   * /usr/share/iserv/www/img/default/16/mod_room-reservation_config.png
    * /usr/share/iserv/www/img/default/16/mod_room-reservation_index.png
    * /usr/share/iserv/www/img/default/24/mod_room-reservation_timeslice.png
    * /usr/share/iserv/www/img/default/32/mod_room-reservation_config.png
    * /usr/share/iserv/www/img/default/32/mod_room-reservation_index.png
 
-If you enjoy this software, you are free to support his author with a small
-donation:
-
-   Roland Hieber
-   IBAN: DE98 250 500 000 150 2141 79
-   BIC: NOLADE2HXXX (Braunschweigische Landessparkasse)
-
-You can also send material donations to
-   Roland Hieber
-   21944471
-   Packstation 103
-   38106 Braunschweig
-   GERMANY
-
 
 === License terms ===
 Copyright (c) 2007 Roland Hieber
index c91f34a..d05b4c7 100644 (file)
@@ -98,10 +98,13 @@ class mod_roomReservationBookingsManager {
    * Get all bookings in database which overlap with the given booking.
    * @param $ob (mod_roomReservationBooking) New booking that should be tested
    *  if it overlaps
+   * @param $bUnblocks (bool) If true, consider $ob as a unblock of a specific
+   *  booking. In this case, you have to specify the Unique ID of the original
+   *  booking in $ob->
    * @return array with elements of type mod_roomReservationBooking
    */
   public static function getOverlappingBookings(
-    mod_roomReservationBooking $ob) {
+    mod_roomReservationBooking $ob, $bUnblocks = false) {
     // TODO: Test for bookings that only take place every n.th week (modulo n)
     
     // Two bookings overlap, when they are on the same day and if
@@ -246,6 +249,37 @@ class mod_roomReservationBookingsManager {
       return true;
     }
   }
+
+  /**
+   * Unblocks a booking for a specific time. Useful to release a room for a 
+   * specific time if it has been blocked by a recurring booking
+   * @param $nUid Unique ID of the booking to be unblocked
+   * @param $tsStart The timestamp when the unblock starts
+   * @param $tsEnd The timestamp when the unblock ends
+   * @return bool
+   * @todo implement this
+   */
+  function unblock($nUid, $tsStart, $tsEnd) {
+    // unblocking only allowed to owners and admins
+    if(!$this->userIsOwner($nUid) || !$this->cfg->userIsAdmin()) {
+      throw new AccessException(MOD_ROOM_RESERVATION_ERROR_ACCESS_DENIED);
+    }
+    return false;
+  }
+  
+  /**
+   * Re-blocks a booking that has been unblocked by unblock().
+   * @param $nUid Unique ID of the booking to be unblocked
+   * @return bool
+   * @todo implement this
+   */
+  function reblock($nUid, $tsStart, $tsEnd) {
+    // re-blocking only allowed to owners and admins
+    if(!$this->userIsOwner($nUid) || !$this->cfg->userIsAdmin()) {
+      throw new AccessException(MOD_ROOM_RESERVATION_ERROR_ACCESS_DENIED);
+    }
+    return false;
+  }
   
   /**
    * Determine if the current user is the owner of a specified error report.
index f29e82a..3f0375e 100644 (file)
@@ -30,6 +30,23 @@ CREATE TABLE mod_roomreservation_bookings (
                              DEFAULT 0        --   recurring bookings
 );
 
+
+--
+-- Table with booking interruptions
+--
+CREATE TABLE mod_roomreservation_intermissions (
+    rri_uid        SERIAL    NOT NULL         -- Unique ID of intermissions
+                             PRIMARY KEY, 
+    rri_rrb_uid    INT       NOT NULL         -- The boooking to intermit
+                             REFERENCES mod_roomreservation_bookings(rrb_uid)
+                             ON UPDATE CASCADE ON DELETE CASCADE,
+    -- Note: start and end date form an closed interval, i.e. the start and 
+    -- end date are part of the interval.
+    rri_start      DATE      NOT NULL,        -- Start date
+    rri_end        DATE      NOT NULL         -- End date
+                             CHECK(rri_start <= rri_end)
+);
+
 --
 -- Permissions
 --
@@ -40,3 +57,9 @@ GRANT SELECT, INSERT, UPDATE, DELETE ON mod_roomreservation_bookings,
 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_intermissions 
+  TO webusr;
+GRANT SELECT, INSERT, UPDATE, DELETE ON mod_roomreservation_intermissions 
+  TO webadm;
+  
\ No newline at end of file
This page took 0.029011 seconds and 4 git commands to generate.