Revision: 1219
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1219&view=rev
Author:   jberanek
Date:     2009-10-18 15:30:55 +0000 (Sun, 18 Oct 2009)

Log Message:
-----------
* Patch from Emmanuel Dreyfus to add a config variable to force the
 booking resolution to the value of $resolution, rather than the
 resolution for the area set in the database.

Modified Paths:
--------------
    mrbs/trunk/web/functions.inc
    mrbs/trunk/web/systemdefaults.inc.php

Modified: mrbs/trunk/web/functions.inc
===================================================================
--- mrbs/trunk/web/functions.inc        2009-10-18 15:25:13 UTC (rev 1218)
+++ mrbs/trunk/web/functions.inc        2009-10-18 15:30:55 UTC (rev 1219)
@@ -286,6 +286,7 @@
 {
   global $tbl_area;
   global $resolution, $default_duration, $morningstarts, 
$morningstarts_minutes, $eveningends, $eveningends_minutes;
+  global $force_resolution;
   global $private_enabled, $private_default, $private_mandatory, 
$private_override;
   $sql = "SELECT *
           FROM $tbl_area 
@@ -299,7 +300,8 @@
   else
   {
     $row = sql_row_keyed($res, 0);
-    $resolution = (isset($row['resolution']) ? $row['resolution'] : 
$resolution);
+    if (!isset($force_resolution) || !$force_resolution)
+       $resolution = (isset($row['resolution']) ? $row['resolution'] : 
$resolution);
     $default_duration = (isset($row['default_duration']) ? 
$row['default_duration'] : $default_duration);
     $morningstarts = (isset($row['morningstarts']) ? $row['morningstarts'] : 
$morningstarts);
     $morningstarts_minutes = (isset($row['morningstarts_minutes']) ? 
$row['morningstarts_minutes'] : $morningstarts_minutes);

Modified: mrbs/trunk/web/systemdefaults.inc.php
===================================================================
--- mrbs/trunk/web/systemdefaults.inc.php       2009-10-18 15:25:13 UTC (rev 
1218)
+++ mrbs/trunk/web/systemdefaults.inc.php       2009-10-18 15:30:55 UTC (rev 
1219)
@@ -138,6 +138,11 @@
 // Default is half an hour: 1800 seconds.
 $resolution = (30 * 60);
 
+// If the following variable is set to TRUE, the resolution of bookings
+// is forced to be the value of $resolution, rather than the resolution set
+// for the area in the database.
+$force_resolution = FALSE;
+
 // Default duration - default length (in seconds) of a booking.
 // Defaults to (60 * 60) seconds, i.e. an hour
 $default_duration = (60 * 60);


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to