Revision: 1436
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1436&view=rev
Author:   cimorrison
Date:     2010-09-02 10:21:40 +0000 (Thu, 02 Sep 2010)

Log Message:
-----------
- Converted the status field in the entry and repeat tables into an unsigned 
tinyint (MySQL only:  PostgreSQL does not support unsigned, but then the status 
field is a smallint as PostgreSQL does not support tinyint either, so it does 
not matter)
- Enabled the confirmation settings to be set on a per-area basis

Modified Paths:
--------------
    mrbs/branches/provisional_bookings_new_style/tables.my.sql
    mrbs/branches/provisional_bookings_new_style/tables.pg.pre73.sql
    mrbs/branches/provisional_bookings_new_style/tables.pg.sql
    mrbs/branches/provisional_bookings_new_style/web/dbsys.inc
    mrbs/branches/provisional_bookings_new_style/web/edit_area_room.php
    mrbs/branches/provisional_bookings_new_style/web/functions.inc
    mrbs/branches/provisional_bookings_new_style/web/lang.en

Added Paths:
-----------
    mrbs/branches/provisional_bookings_new_style/web/upgrade/18/
    mrbs/branches/provisional_bookings_new_style/web/upgrade/18/mysql.sql
    mrbs/branches/provisional_bookings_new_style/web/upgrade/18/pgsql.sql

Modified: mrbs/branches/provisional_bookings_new_style/tables.my.sql
===================================================================
--- mrbs/branches/provisional_bookings_new_style/tables.my.sql  2010-09-01 
15:19:00 UTC (rev 1435)
+++ mrbs/branches/provisional_bookings_new_style/tables.my.sql  2010-09-02 
10:21:40 UTC (rev 1436)
@@ -39,6 +39,8 @@
   custom_html            text,
   approval_enabled       tinyint(1),
   reminders_enabled      tinyint(1),
+  confirmation_enabled   tinyint(1),
+  confirmed_default      tinyint(1),
 
   PRIMARY KEY (id)
 );
@@ -71,7 +73,7 @@
   name        varchar(80) DEFAULT '' NOT NULL,
   type        char DEFAULT 'E' NOT NULL,
   description text,
-  status      tinyint NOT NULL DEFAULT 0,
+  status      tinyint unsigned NOT NULL DEFAULT 0,
   reminded    int,
   info_time   int,
   info_user   varchar(80),
@@ -97,7 +99,7 @@
   type        char DEFAULT 'E' NOT NULL,
   description text,
   rep_num_weeks smallint NULL, 
-  status      tinyint NOT NULL DEFAULT 0,
+  status      tinyint unsigned NOT NULL DEFAULT 0,
   reminded    int,
   info_time   int,
   info_user   varchar(80),
@@ -128,6 +130,6 @@
 );
 
 INSERT INTO mrbs_variables (variable_name, variable_content)
-  VALUES ( 'db_version', '17');
+  VALUES ( 'db_version', '18');
 INSERT INTO mrbs_variables (variable_name, variable_content)
   VALUES ( 'local_db_version', '1');

Modified: mrbs/branches/provisional_bookings_new_style/tables.pg.pre73.sql
===================================================================
--- mrbs/branches/provisional_bookings_new_style/tables.pg.pre73.sql    
2010-09-01 15:19:00 UTC (rev 1435)
+++ mrbs/branches/provisional_bookings_new_style/tables.pg.pre73.sql    
2010-09-02 10:21:40 UTC (rev 1436)
@@ -41,7 +41,9 @@
   max_book_ahead_secs    int,
   custom_html            text,
   approval_enabled       smallint,
-  reminders_enabled      smallint
+  reminders_enabled      smallint,
+  confirmation_enabled   smallint,
+  confirmed_default      smallint
 );
 
 CREATE TABLE mrbs_room
@@ -119,6 +121,6 @@
 );
 
 INSERT INTO mrbs_variables (variable_name, variable_content)
-  VALUES ('db_version', '17');
+  VALUES ('db_version', '18');
 INSERT INTO mrbs_variables (variable_name, variable_content)
   VALUES ('local_db_version', '1');

Modified: mrbs/branches/provisional_bookings_new_style/tables.pg.sql
===================================================================
--- mrbs/branches/provisional_bookings_new_style/tables.pg.sql  2010-09-01 
15:19:00 UTC (rev 1435)
+++ mrbs/branches/provisional_bookings_new_style/tables.pg.sql  2010-09-02 
10:21:40 UTC (rev 1436)
@@ -54,7 +54,9 @@
   max_book_ahead_secs    int,
   custom_html            text,
   approval_enabled       smallint,
-  reminders_enabled      smallint
+  reminders_enabled      smallint,
+  confirmation_enabled   smallint,
+  confirmed_default      smallint
 );
 
 CREATE TABLE mrbs_room
@@ -132,6 +134,6 @@
 );
 
 INSERT INTO mrbs_variables (variable_name, variable_content)
-  VALUES ('db_version', '17');
+  VALUES ('db_version', '18');
 INSERT INTO mrbs_variables (variable_name, variable_content)
   VALUES ('local_db_version', '1');

Modified: mrbs/branches/provisional_bookings_new_style/web/dbsys.inc
===================================================================
--- mrbs/branches/provisional_bookings_new_style/web/dbsys.inc  2010-09-01 
15:19:00 UTC (rev 1435)
+++ mrbs/branches/provisional_bookings_new_style/web/dbsys.inc  2010-09-02 
10:21:40 UTC (rev 1436)
@@ -15,7 +15,7 @@
 $tbl_variables = $db_tbl_prefix . "variables";
 
 
-$db_schema_version = 17;
+$db_schema_version = 18;
 $local_db_schema_version = 1;
 
 

Modified: mrbs/branches/provisional_bookings_new_style/web/edit_area_room.php
===================================================================
--- mrbs/branches/provisional_bookings_new_style/web/edit_area_room.php 
2010-09-01 15:19:00 UTC (rev 1435)
+++ mrbs/branches/provisional_bookings_new_style/web/edit_area_room.php 
2010-09-02 10:21:40 UTC (rev 1436)
@@ -78,6 +78,8 @@
 $area_private_override = get_form_var('area_private_override', 'string');
 $area_approval_enabled = get_form_var('area_approval_enabled', 'string');
 $area_reminders_enabled = get_form_var('area_reminders_enabled', 'string');
+$area_confirmation_enabled = get_form_var('area_confirmation_enabled', 
'string');
+$area_confirmed_default = get_form_var('area_confirmed_default', 'string');
 $custom_html = get_form_var('custom_html', 'string');  // Used for both area 
and room, but you only ever have one or the other
 $change_done = get_form_var('change_done', 'string');
 $change_room = get_form_var('change_room', 'string');
@@ -312,6 +314,8 @@
     $area_private_mandatory = (!empty($area_private_mandatory)) ? 1 : 0;
     $area_approval_enabled = (!empty($area_approval_enabled)) ? 1 : 0;
     $area_reminders_enabled = (!empty($area_reminders_enabled)) ? 1 : 0;
+    $area_confirmation_enabled = (!empty($area_confirmation_enabled)) ? 1 : 0;
+    $area_confirmed_default = (!empty($area_confirmed_default)) ? 1 : 0;
     
     if (!$enable_periods)
     { 
@@ -376,6 +380,8 @@
       $assign_array[] = "private_override='" . $area_private_override . "'";
       $assign_array[] = "approval_enabled=" . $area_approval_enabled;
       $assign_array[] = "reminders_enabled=" . $area_reminders_enabled;
+      $assign_array[] = "confirmation_enabled=" . $area_confirmation_enabled;
+      $assign_array[] = "confirmed_default=" . $area_confirmed_default;
             
       $sql .= implode(",", $assign_array) . " WHERE id=$area";
       if (sql_command($sql) < 0)
@@ -904,6 +910,34 @@
       ?>
       
       <fieldset>
+      <legend><?php echo get_vocab("confirmation_settings")?></legend>
+        <div>
+          <label for="area_confirmation_enabled"><?php echo 
get_vocab("allow_confirmation")?>:</label>
+          <?php $checked = ($confirmation_enabled) ? " checked=\"checked\"" : 
"" ?>
+          <input class="checkbox" type="checkbox"<?php echo $checked ?> 
id="area_confirmation_enabled" name="area_confirmation_enabled">
+        </div>
+        <label>
+          <?php echo get_vocab("default_settings_conf")?>:
+        </label>
+        <div class="group">
+          <div>
+            <label>
+              <?php $checked = ($confirmed_default) ? " checked=\"checked\"" : 
"" ?>
+              <input class="radio" type="radio" name="area_confirmed_default" 
value="1"<?php echo $checked ?>>
+              <?php echo get_vocab("default_confirmed")?>
+            </label>
+          </div>
+          <div>
+            <label>
+              <?php $checked = ($confirmed_default) ? "" : " 
checked=\"checked\"" ?>
+              <input class="radio" type="radio" name="area_confirmed_default" 
value="0"<?php echo $checked ?>>
+              <?php echo get_vocab("default_tentative")?>
+            </label>
+          </div>
+        </div>
+      </fieldset>
+      
+      <fieldset>
       <legend><?php echo get_vocab("approval_settings")?></legend>
         <div>
           <label for="area_approval_enabled"><?php echo 
get_vocab("enable_approval")?>:</label>

Modified: mrbs/branches/provisional_bookings_new_style/web/functions.inc
===================================================================
--- mrbs/branches/provisional_bookings_new_style/web/functions.inc      
2010-09-01 15:19:00 UTC (rev 1435)
+++ mrbs/branches/provisional_bookings_new_style/web/functions.inc      
2010-09-02 10:21:40 UTC (rev 1436)
@@ -492,17 +492,20 @@
   global $private_enabled, $private_default, $private_mandatory, 
$private_override;
   global $min_book_ahead_enabled, $max_book_ahead_enabled, 
$min_book_ahead_secs, $max_book_ahead_secs;
   global $approval_enabled, $reminders_enabled;
+  global $confirmation_enabled, $confirmed_default;
   
   $booleans = array('private_enabled', 'private_default', 'private_mandatory',
                     'min_book_ahead_enabled', 'max_book_ahead_enabled',
-                    'approval_enabled', 'reminders_enabled');
+                    'approval_enabled', 'reminders_enabled',
+                    'confirmation_enabled', 'confirmed_default');
   // Get all the "per area" config settings                  
   $sql = "SELECT resolution, default_duration, morningstarts, 
morningstarts_minutes,
                  eveningends, eveningends_minutes,
                  private_enabled, private_default, private_mandatory, 
private_override,
                  min_book_ahead_enabled, max_book_ahead_enabled,
                  min_book_ahead_secs, max_book_ahead_secs,
-                 approval_enabled, reminders_enabled
+                 approval_enabled, reminders_enabled,
+                 confirmation_enabled, confirmed_default
           FROM $tbl_area 
           WHERE id=$area 
           LIMIT 1";

Modified: mrbs/branches/provisional_bookings_new_style/web/lang.en
===================================================================
--- mrbs/branches/provisional_bookings_new_style/web/lang.en    2010-09-01 
15:19:00 UTC (rev 1435)
+++ mrbs/branches/provisional_bookings_new_style/web/lang.en    2010-09-02 
10:21:40 UTC (rev 1436)
@@ -319,16 +319,21 @@
 $vocab["too_many_slots"]          = 'You need to increase the value of 
$max_slots in the config file!';
 $vocab["general_settings"]        = "General";
 $vocab["time_settings"]           = "Slot times";
+$vocab["confirmation_settings"]   = "Confirmation settings";
+$vocab["allow_confirmation"]      = "Allow tentative bookings";
+$vocab["default_settings_conf"]   = "Default settings";
+$vocab["default_confirmed"]       = "Confirmed";
+$vocab["default_tentative"]       = "Tentative";
 $vocab["approval_settings"]       = "Approval settings";
 $vocab["enable_approval"]         = "Require bookings to be approved";
 $vocab["enable_reminders"]        = "Allow users to remind admins";
-$vocab["private_settings"]        = "Private bookings";
+$vocab["private_settings"]        = "Privacy settings";
 $vocab["allow_private"]           = "Allow private bookings";
 $vocab["force_private"]           = "Force private bookings";
 $vocab["default_settings"]        = "Default/forced settings";
 $vocab["default_private"]         = "Private";
 $vocab["default_public"]          = "Public";
-$vocab["private_display"]         = "Private bookings (display)";
+$vocab["private_display"]         = "Privacy settings (display)";
 $vocab["private_display_label"]   = "How should private bookings be 
displayed?";
 $vocab["private_display_caution"] = "CAUTION: think carefully about the 
privacy implications before changing these settings!";
 $vocab["treat_respect"]           = "Respect the privacy setting of the 
booking";

Added: mrbs/branches/provisional_bookings_new_style/web/upgrade/18/mysql.sql
===================================================================
--- mrbs/branches/provisional_bookings_new_style/web/upgrade/18/mysql.sql       
                        (rev 0)
+++ mrbs/branches/provisional_bookings_new_style/web/upgrade/18/mysql.sql       
2010-09-02 10:21:40 UTC (rev 1436)
@@ -0,0 +1,24 @@
+# $Id$
+
+# Change the status fields in the entry and repeat tables
+# to be unsigned rather than signed (they are used as bit fields)
+# Note:  PostgreSQL does not have unsigned, but as the status
+# fields there are smallints (there are no tinyints in PostgreSQL)
+# it does not matter.
+
+ALTER TABLE %DB_TBL_PREFIX%entry 
+CHANGE status status tinyint unsigned NOT NULL DEFAULT 0;
+
+ALTER TABLE %DB_TBL_PREFIX%repeat
+CHANGE status status tinyint unsigned NOT NULL DEFAULT 0;
+
+
+# Add two new settings to the area table.  (Note:  we could combine
+# all the various 'booleans' into a integer field, in the same
+# way as status is handled in the entry and repeat tables, but
+# as there are relatively few rows in the area table, this does
+# not seem worth doing).
+
+ALTER TABLE %DB_TBL_PREFIX%area 
+ADD COLUMN confirmation_enabled    tinyint(1),
+ADD COLUMN confirmed_default       tinyint(1);


Property changes on: 
mrbs/branches/provisional_bookings_new_style/web/upgrade/18/mysql.sql
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native

Added: mrbs/branches/provisional_bookings_new_style/web/upgrade/18/pgsql.sql
===================================================================
--- mrbs/branches/provisional_bookings_new_style/web/upgrade/18/pgsql.sql       
                        (rev 0)
+++ mrbs/branches/provisional_bookings_new_style/web/upgrade/18/pgsql.sql       
2010-09-02 10:21:40 UTC (rev 1436)
@@ -0,0 +1,11 @@
+-- $Id$
+
+-- Add two new settings to the area table.  (Note:  we could combine
+-- all the various 'booleans' into a integer field, in the same
+-- way as status is handled in the entry and repeat tables, but
+-- as there are relatively few rows in the area table, this does
+-- not seem worth doing).
+
+ALTER TABLE %DB_TBL_PREFIX%area 
+ADD COLUMN confirmation_enabled    smallint,
+ADD COLUMN confirmed_default       smallint;


Property changes on: 
mrbs/branches/provisional_bookings_new_style/web/upgrade/18/pgsql.sql
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native


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

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to