Revision: 1441
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1441&view=rev
Author:   cimorrison
Date:     2010-09-03 11:33:44 +0000 (Fri, 03 Sep 2010)

Log Message:
-----------
- Added the ability to filter reports on the various status settings
- Fixed bugs caused by incorrect use of SQL predicates involving the status 
bits (ie using them as integers rather than booleans)

Modified Paths:
--------------
    mrbs/branches/provisional_bookings_new_style/web/Themes/default/header.inc
    mrbs/branches/provisional_bookings_new_style/web/functions.inc
    mrbs/branches/provisional_bookings_new_style/web/functions_mail.inc
    mrbs/branches/provisional_bookings_new_style/web/internalconfig.inc.php
    mrbs/branches/provisional_bookings_new_style/web/lang.en
    mrbs/branches/provisional_bookings_new_style/web/mrbs.css.php
    mrbs/branches/provisional_bookings_new_style/web/pending.php
    mrbs/branches/provisional_bookings_new_style/web/report.php
    mrbs/branches/provisional_bookings_new_style/web/search.php
    mrbs/branches/provisional_bookings_new_style/web/view_entry.php

Modified: 
mrbs/branches/provisional_bookings_new_style/web/Themes/default/header.inc
===================================================================
--- mrbs/branches/provisional_bookings_new_style/web/Themes/default/header.inc  
2010-09-02 14:17:01 UTC (rev 1440)
+++ mrbs/branches/provisional_bookings_new_style/web/Themes/default/header.inc  
2010-09-03 11:33:44 UTC (rev 1441)
@@ -6,7 +6,7 @@
 function print_theme_header($day, $month, $year, $area, $room)
 {
   global $mrbs_company, $mrbs_company_logo, $mrbs_company_url, 
$mrbs_company_more_info,
-         $search_str, $locale_warning, $area_defaults;
+         $search_str, $locale_warning;
   global $tbl_entry, $tbl_room, $tbl_area;
   global $PHP_SELF, $view_week_number, $weekstarts;
   global $default_language_tokens, $disable_automatic_language_changing, 
$override_locale;
@@ -416,28 +416,17 @@
         // Provide a link to the list of bookings awaiting approval
         // (if there are any areas where we require bookings to be approved)
         $user = getUserName();
-        // Build the SQL condition for evaluating whether booking approval is
-        // enabled for an area.   It is enabled if the field is set, or if 
it's 
-        // not set but the default area setting is for it to be enabled.
-        $sql_approval_enabled = "(approval_enabled IS NOT NULL AND 
approval_enabled > 0)";
-        if ($area_defaults['approval_enabled'])
-        {
-          $sql_approval_enabled = "(" . $sql_approval_enabled . " OR 
(approval_enabled IS NULL))";
-        }
-        
-        $sql = "SELECT COUNT(*)
-                        FROM $tbl_area
-                       WHERE $sql_approval_enabled
-                       LIMIT 1";
-        $approval_somewhere = (sql_query1($sql) > 0);
+
+        $approval_somewhere = some_area('approval_enabled');
         if ($approval_somewhere && (authGetUserLevel($user) >= 1))
         {
+          $sql_approval_enabled = some_area_predicate('approval_enabled');
           $is_admin = (authGetUserLevel($user) >= 2);
           // Find out how many bookings are awaiting approval
           // (but only for areas where approval is required)
           $sql = "SELECT COUNT(*)
                     FROM $tbl_entry E, $tbl_room R, $tbl_area A
-                   WHERE status&" . STATUS_AWAITING_APPROVAL . ">0
+                   WHERE status&" . STATUS_AWAITING_APPROVAL . "
                      AND E.room_id = R.id
                      AND R.area_id = A.id
                      AND $sql_approval_enabled";

Modified: mrbs/branches/provisional_bookings_new_style/web/functions.inc
===================================================================
--- mrbs/branches/provisional_bookings_new_style/web/functions.inc      
2010-09-02 14:17:01 UTC (rev 1440)
+++ mrbs/branches/provisional_bookings_new_style/web/functions.inc      
2010-09-03 11:33:44 UTC (rev 1441)
@@ -536,6 +536,36 @@
   }
 }
 
+// generate the predicate for use in an SQL query to test whether
+// an area has $field set
+function some_area_predicate($field)
+{
+  global $area_defaults;
+  
+  $predicate = "($field IS NOT NULL AND $field > 0)";
+  if ($area_defaults[$field])
+  {
+    $predicate = "(" . $predicate . " OR ($field IS NULL))";
+  }
+  return $predicate;
+}
+
+// Determines whether there is at least one area with the relevant $field
+// set (eg 'approval_enabled' or 'confirmation_enabled')
+//
+// Returns: boolean
+function some_area($field)
+{
+  global $tbl_area;
+  
+  $predicate = some_area_predicate($field);   
+  $sql = "SELECT COUNT(*)
+                  FROM $tbl_area
+                 WHERE $predicate
+                 LIMIT 1";                                
+  return (sql_query1($sql) > 0);
+}
+
 // Get the local day name based on language. Note 2000-01-02 is a Sunday.
 function day_name($daynumber)
 {

Modified: mrbs/branches/provisional_bookings_new_style/web/functions_mail.inc
===================================================================
--- mrbs/branches/provisional_bookings_new_style/web/functions_mail.inc 
2010-09-02 14:17:01 UTC (rev 1440)
+++ mrbs/branches/provisional_bookings_new_style/web/functions_mail.inc 
2010-09-03 11:33:44 UTC (rev 1441)
@@ -444,8 +444,8 @@
     {                        
       // Confirmation status:
       $body .= get_mail_vocab("confirmation_status") . ": ";
-      $old_status = ($mail_previous['status'] & STATUS_TENTATIVE) ? 
get_mail_vocab("tentative_booking") : get_mail_vocab("confirmed_booking");
-      $new_status = ($status & STATUS_TENTATIVE) ? 
get_mail_vocab("tentative_booking") : get_mail_vocab("confirmed_booking");
+      $old_status = ($mail_previous['status'] & STATUS_TENTATIVE) ? 
get_mail_vocab("tentative") : get_mail_vocab("confirmed");
+      $new_status = ($status & STATUS_TENTATIVE) ? get_mail_vocab("tentative") 
: get_mail_vocab("confirmed");
       $body .= compareEntries($new_status, $old_status, $new_entry) . "\n";
     }
                             

Modified: 
mrbs/branches/provisional_bookings_new_style/web/internalconfig.inc.php
===================================================================
--- mrbs/branches/provisional_bookings_new_style/web/internalconfig.inc.php     
2010-09-02 14:17:01 UTC (rev 1440)
+++ mrbs/branches/provisional_bookings_new_style/web/internalconfig.inc.php     
2010-09-03 11:33:44 UTC (rev 1441)
@@ -101,7 +101,8 @@
  // get_area_settings().   [This isn't a very elegant way of handling
  // per-area settings and perhaps ought to be revisited at some stage]
  $area_defaults = array();
- $area_defaults['approval_enabled'] = $approval_enabled;
+ $area_defaults['approval_enabled']     = $approval_enabled;
+ $area_defaults['confirmation_enabled'] = $confirmation_enabled;
                                
 /********************************************************
  * PHP System Configuration - internal use, do not change

Modified: mrbs/branches/provisional_bookings_new_style/web/lang.en
===================================================================
--- mrbs/branches/provisional_bookings_new_style/web/lang.en    2010-09-02 
14:17:01 UTC (rev 1440)
+++ mrbs/branches/provisional_bookings_new_style/web/lang.en    2010-09-03 
11:33:44 UTC (rev 1441)
@@ -108,10 +108,9 @@
 $vocab["invalid_entry_id"]    = "Invalid entry id.";
 $vocab["invalid_series_id"]   = "Invalid series id.";
 $vocab["confirmation_status"] = "Confirmation status";
-$vocab["tentative_booking"]   = "Tentative booking";
-$vocab["confirmed_booking"]   = "Confirmed booking";
+$vocab["tentative"]           = "Tentative";
 $vocab["approval_status"]     = "Approval status";
-$vocab["approved"]            = "Approved booking";
+$vocab["approved"]            = "Approved";
 $vocab["awaiting_approval"]   = "Awaiting approval";
 $vocab["approve"]             = "Approve";
 $vocab["reject"]              = "Reject";
@@ -264,6 +263,10 @@
 $vocab["rep_dsp_dur"]           = "Duration";
 $vocab["rep_dsp_end"]           = "End Time";
 $vocab["fulldescription_short"] = "Full Description";
+$vocab["both"]                  = "All";
+$vocab["privacy_status"]        = "Privacy status";
+$vocab["search_criteria"]       = "Search criteria";
+$vocab["presentation_options"]  = "Presentation options";
 
 // Used in week.php
 $vocab["weekbefore"]         = "Go To Week Before";

Modified: mrbs/branches/provisional_bookings_new_style/web/mrbs.css.php
===================================================================
--- mrbs/branches/provisional_bookings_new_style/web/mrbs.css.php       
2010-09-02 14:17:01 UTC (rev 1440)
+++ mrbs/branches/provisional_bookings_new_style/web/mrbs.css.php       
2010-09-03 11:33:44 UTC (rev 1441)
@@ -731,7 +731,7 @@
 .div_report h3 {border-top: 1px solid <?php echo $report_h3_border_color ?>;
     padding-top: 0.5em; margin-bottom: 0}
 .div_report table {clear: both; width: 100%; margin-top: 0.5em}
-.div_report col.col1 {width: 8em}
+.div_report col.col1 {width: 11em}
 .div_report td:first-child {text-align: right; font-weight: bold}
 .div_report .createdby td, .div_report .lastupdate td {font-size: x-small}
 div.report_entry_title {width: 100%; float: left;
@@ -749,7 +749,10 @@
 #div_summary td.count {border-right-width: 0}
 #div_summary td:first-child {font-weight: bold}
 p.report_entries {font-weight: bold}
+.report .form_general fieldset fieldset {padding-top: 0.5em; padding-bottom: 
0.5em}
+.report .form_general fieldset fieldset legend {font-size: small; font-style: 
italic; font-weight: normal}
 
+
 /* ------------ SEARCH.PHP ----------------------*/
 span#search_str {color: <?php echo $highlight_font_color ?>}
 p#nothing_found {font-weight: bold}

Modified: mrbs/branches/provisional_bookings_new_style/web/pending.php
===================================================================
--- mrbs/branches/provisional_bookings_new_style/web/pending.php        
2010-09-02 14:17:01 UTC (rev 1440)
+++ mrbs/branches/provisional_bookings_new_style/web/pending.php        
2010-09-03 11:33:44 UTC (rev 1441)
@@ -162,14 +162,7 @@
 // Get a list of all bookings awaiting approval
 // We are only interested in areas where approval is required
 
-// Build the SQL condition for evaluating whether approval is
-// required for an area.   It is enabled if the field is set, or if it's 
-// not set but the default area setting is for it to be enabled.
-$sql_approval_enabled = "(approval_enabled IS NOT NULL AND approval_enabled > 
0)";
-if ($area_defaults['approval_enabled'])
-{
-  $sql_approval_enabled = "(" . $sql_approval_enabled . " OR (approval_enabled 
IS NULL))";
-}
+$sql_approval_enabled = some_area_predicate('approval_enabled');
         
 $sql = "SELECT E.id, E.name, E.room_id, E.start_time, E.create_by, " .
                sql_syntax_timestamp_to_unix("E.timestamp") . " AS last_updated,
@@ -182,7 +175,7 @@
          WHERE E.room_id = M.id
            AND M.area_id = A.id
            AND $sql_approval_enabled
-           AND E.status&" . STATUS_AWAITING_APPROVAL . ">0";
+           AND E.status&" . STATUS_AWAITING_APPROVAL;
 
 // Ordinary users can only see their own bookings       
 if (!$is_admin)

Modified: mrbs/branches/provisional_bookings_new_style/web/report.php
===================================================================
--- mrbs/branches/provisional_bookings_new_style/web/report.php 2010-09-02 
14:17:01 UTC (rev 1440)
+++ mrbs/branches/provisional_bookings_new_style/web/report.php 2010-09-03 
11:33:44 UTC (rev 1441)
@@ -10,7 +10,23 @@
 define('SUMMARY', 02);
 define('CSV',     04);
 
+// Constants for booking privacy matching
+define('PRIVATE_NO',   0);
+define('PRIVATE_YES',  1);
+define('PRIVATE_BOTH', 2);  // Can be anything other than 0 or 1
 
+// Constants for booking confirmation matching
+define('CONFIRMED_NO',   0);
+define('CONFIRMED_YES',  1);
+define('CONFIRMED_BOTH', 2);  // Can be anything other than 0 or 1
+
+// Constants for booking approval matching
+define('APPROVED_NO',   0);
+define('APPROVED_YES',  1);
+define('APPROVED_BOTH', 2);  // Can be anything other than 0 or 1
+
+
+
 function date_time_string($t)
 {
   global $twentyfourhour_format;
@@ -127,6 +143,7 @@
 {
   global $csv_row_sep;
   global $custom_fields, $tbl_entry;
+  global $approval_somewhere, $confirmation_somewhere;
   
   // Build an array of values to go into the header row
   $values = array();
@@ -143,6 +160,14 @@
   $values[] = get_vocab("fulldescription_short");
   $values[] = get_vocab("type"); 
   $values[] = get_vocab("createdby");
+  if ($confirmation_somewhere)
+  {
+    $values[] = get_vocab("confirmation_status");
+  }
+  if ($approval_somewhere)
+  {
+    $values[] = get_vocab("approval_status");
+  }
   // Now do the custom fields
   foreach ($custom_fields as $key => $value)
   {
@@ -186,6 +211,7 @@
   global $output_as_csv;
   global $csv_row_sep;
   global $custom_fields, $field_natures, $field_lengths, $tbl_entry;
+  global $approval_somewhere, $confirmation_somewhere;
   
   // Initialise the line for CSV reports
   $line = "";
@@ -324,6 +350,58 @@
     echo "</tr>\n";
   }
   
+  // Confirmation status
+  if ($confirmation_somewhere)
+  {
+    // Translate the status field bit into meaningful text
+    if ($row['confirmation_enabled'])
+    {
+      $confirmation_status = ($row['status'] & STATUS_TENTATIVE) ? 
get_vocab("tentative") : get_vocab("confirmed");
+    }
+    else
+    {
+      $confirmation_status = '';
+    }
+    // Now output the text
+    if ($output_as_csv)
+    {
+      $line = csv_row_add_value($line, $confirmation_status);
+    }
+    else
+    {
+      echo "<tr>\n";
+      echo "<td>" . get_vocab("confirmation_status") . ":</td>\n";
+      echo "<td>" . escape($confirmation_status) . "</td>\n";
+      echo "</tr>\n";
+    }
+  }
+  
+  // Approval status
+  if ($approval_somewhere)
+  {
+    // Translate the status field bit into meaningful text
+    if ($row['approval_enabled'])
+    {
+      $approval_status = ($row['status'] & STATUS_AWAITING_APPROVAL) ? 
get_vocab("awaiting_approval") : get_vocab("approved");
+    }
+    else
+    {
+      $approval_status = '';
+    }
+    // Now output the text
+    if ($output_as_csv)
+    {
+      $line = csv_row_add_value($line, $approval_status);
+    }
+    else
+    {
+      echo "<tr>\n";
+      echo "<td>" . get_vocab("approval_status") . ":</td>\n";
+      echo "<td>" . escape($approval_status) . "</td>\n";
+      echo "</tr>\n";
+    }
+  }
+  
   // Now do any custom fields
   foreach ($custom_fields as $key => $value)
   {
@@ -587,6 +665,9 @@
 $sortby = get_form_var('sortby', 'string');
 $display = get_form_var('display', 'string');
 $sumby = get_form_var('sumby', 'string');
+$match_approved = get_form_var('match_approved', 'string');
+$match_confirmed = get_form_var('match_confirmed', 'string');
+$match_private = get_form_var('match_private', 'string');
 
 
 // Check the user is authorised for this page
@@ -659,8 +740,6 @@
   $namematch_default = htmlspecialchars($namematch);
   $descrmatch_default = htmlspecialchars($descrmatch);
   $creatormatch_default = htmlspecialchars($creatormatch);
-
-
 }
 else
 {
@@ -678,6 +757,9 @@
   $To_day   = date("d", $To_time);
   $To_month = date("m", $To_time);
   $To_year  = date("Y", $To_time);
+  $match_private = PRIVATE_BOTH;
+  $match_approved = APPROVED_BOTH;
+  $match_confirmed = CONFIRMED_BOTH;
 }
 
 // $sumby: d=by brief description, c=by creator.
@@ -696,6 +778,10 @@
   $display = "d";
 }
 
+$private_somewhere = some_area('private_enabled') || 
some_area('private_mandatory');
+$approval_somewhere = some_area('approval_enabled');
+$confirmation_somewhere = some_area('confirmation_enabled');
+
 // Upper part: The form.
 if (!$output_as_csv)
 {
@@ -706,6 +792,9 @@
       <fieldset>
       <legend><?php echo get_vocab("report_on");?></legend>
       
+        <fieldset>
+        <legend><?php echo get_vocab("search_criteria");?></legend>
+      
         <div id="div_report_start">
           <?php
           echo "<label for=\"From_datepicker\">" . get_vocab("report_start") . 
":</label>\n";
@@ -765,6 +854,67 @@
         </div>
         
         <?php
+        // Privacy status
+        // Only show this part of the form if there are areas that allow 
private bookings
+        if ($private_somewhere)
+        {
+          echo "<div id=\"div_privacystatus\">\n";
+          echo "<label>" . get_vocab("privacy_status") . ":</label>\n";
+          echo "<div class=\"group\">\n";   
+          $options = array(PRIVATE_BOTH => 'both', PRIVATE_NO => 
'default_public', PRIVATE_YES => 'default_private');
+          foreach ($options as $option => $token)
+          {
+            echo "<label>";
+            echo "<input class=\"radio\" type=\"radio\" name=\"match_private\" 
value=\"$option\"" .          
+                 (($match_private == $option) ? " checked=\"checked\"" : "") .
+                 ">" . get_vocab($token);
+            echo "</label>\n";
+          }
+          echo "</div>\n";
+          echo "</div>\n";
+        }
+        
+        // Confirmation status
+        // Only show this part of the form if there are areas that require 
approval
+        if ($confirmation_somewhere)
+        {
+          echo "<div id=\"div_confirmationstatus\">\n";
+          echo "<label>" . get_vocab("confirmation_status") . ":</label>\n";
+          echo "<div class=\"group\">\n";   
+          $options = array(CONFIRMED_BOTH => 'both', CONFIRMED_YES => 
'confirmed', CONFIRMED_NO => 'tentative');
+          foreach ($options as $option => $token)
+          {
+            echo "<label>";
+            echo "<input class=\"radio\" type=\"radio\" 
name=\"match_confirmed\" value=\"$option\"" .          
+                 (($match_confirmed == $option) ? " checked=\"checked\"" : "") 
.
+                 ">" . get_vocab($token);
+            echo "</label>\n";
+          }
+          echo "</div>\n";
+          echo "</div>\n";
+        }
+        
+        // Approval status
+        // Only show this part of the form if there are areas that require 
approval
+        if ($approval_somewhere)
+        {
+          echo "<div id=\"div_approvalstatus\">\n";
+          echo "<label>" . get_vocab("approval_status") . ":</label>\n";
+          echo "<div class=\"group\">\n";   
+          $options = array(APPROVED_BOTH => 'both', APPROVED_YES => 
'approved', APPROVED_NO => 'awaiting_approval');
+          foreach ($options as $option => $token)
+          {
+            echo "<label>";
+            echo "<input class=\"radio\" type=\"radio\" 
name=\"match_approved\" value=\"$option\"" .          
+                 (($match_approved == $option) ? " checked=\"checked\"" : "") .
+                 ">" . get_vocab($token);
+            echo "</label>\n";
+          }
+          echo "</div>\n";
+          echo "</div>\n";
+        }
+        
+
         // Now do the custom fields
         foreach ($custom_fields as $key => $value)
         {
@@ -792,7 +942,10 @@
           echo "</div>\n";
         }
         ?>
+        </fieldset>
       
+        <fieldset>
+        <legend><?php echo get_vocab("presentation_options");?></legend>  
         <div id="div_summarize">
           <label><?php echo get_vocab("include");?>:</label>
           <div class="group">
@@ -872,10 +1025,12 @@
             </label>
           </div>
         </div>
+        </fieldset>
       
         <div id="report_submit">
           <input class="submit" type="submit" value="<?php echo 
get_vocab("submitquery") ?>">
         </div>
+        
       
       </fieldset>
     </form>
@@ -889,24 +1044,13 @@
   // Start and end times are also used to clip the times for summary info.
   $report_start = mktime(0, 0, 0, $From_month+0, $From_day+0, $From_year+0);
   $report_end = mktime(0, 0, 0, $To_month+0, $To_day+1, $To_year+0);
-
-  //   SQL result will contain the following columns:
-  // Col Index  Description:
-  //   1  [0]   Entry ID, not displayed -- used for linking to View script.
-  //   2  [1]   Start time as Unix time_t
-  //   3  [2]   End time as Unix time_t
-  //   4  [3]   Entry name or short description, must be HTML escaped
-  //   5  [4]   Entry description, must be HTML escaped
-  //   6  [5]   Type, single char mapped to a string
-  //   7  [6]   Created by (user name or IP addr), must be HTML escaped
-  //   8  [7]   Creation timestamp, converted to Unix time_t by the database
-  //   9  [8]   Area name, must be HTML escaped
-  //  10  [9]   Room name, must be HTML escaped
   
+  // Construct the SQL query
   $sql = "SELECT E.id AS entry_id, E.start_time, E.end_time, E.name, 
E.description, "
-  . "E.type, E.create_by, "
-  .  sql_syntax_timestamp_to_unix("E.timestamp") . " AS last_updated"
-  . ", A.area_name, R.room_name";
+       . "E.type, E.create_by, E.status, "
+       .  sql_syntax_timestamp_to_unix("E.timestamp") . " AS last_updated, "
+       . "A.area_name, R.room_name, "
+       . "A.approval_enabled, A.confirmation_enabled";
   // Get any custom fields
   foreach ($custom_fields as $custom_field => $value)
   {
@@ -959,7 +1103,33 @@
     // sql_syntax_caseless_contains() does the SQL escaping
     $sql .= " AND" .  sql_syntax_caseless_contains("E.create_by", 
$creatormatch);
   }
-  // now do the custom fields
+  
+  // (In the next three cases, you will get the empty string if that part
+  // of the form was not displayed - which means that you need all bookings)
+  
+  // Match the privacy status
+  if (($match_private != PRIVATE_BOTH) && ($match_private != ''))
+  {
+    $sql .= " AND ";
+    $sql .= ($match_private) ? '' : '!';  // Note that private works the other 
way round to the next two
+    $sql .= "(status&" . STATUS_PRIVATE . ")";
+  }
+  // Match the confirmation status
+  if (($match_confirmed != CONFIRMED_BOTH) && ($match_confirmed != ''))
+  {
+    $sql .= " AND ";
+    $sql .= ($match_confirmed) ? '!' : '';
+    $sql .= "(status&" . STATUS_TENTATIVE . ")";
+  }
+  // Match the approval status
+  if (($match_approved != APPROVED_BOTH) && ($match_approved != ''))
+  {
+    $sql .= " AND ";
+    $sql .= ($match_approved) ? '!' : '';
+    $sql .= "(status&" . STATUS_AWAITING_APPROVAL . ")";
+  }
+  
+  // Now do the custom fields
   foreach ($custom_fields as $key => $value)
   {
     $var = "match_$key";
@@ -1003,7 +1173,7 @@
       //   - their own bookings, and others' public bookings if 
private_override is set to 'none'
       //   - just their own bookings, if private_override is set to 'private'
       $sql .= " AND ((A.private_override='public') OR
-                     (A.private_override='none' AND (E.status&" . 
STATUS_PRIVATE . "=0 OR E.create_by = '" . addslashes($user) . "')) OR
+                     (A.private_override='none' AND (!(E.status&" . 
STATUS_PRIVATE . ") OR E.create_by = '" . addslashes($user) . "')) OR
                      (A.private_override='private' AND E.create_by = '" . 
addslashes($user) . "'))";                
     }
     else
@@ -1012,7 +1182,7 @@
       //   - all bookings, if private_override is set to 'public'
       //   - public bookings if private_override is set to 'none'
       $sql .= " AND ((A.private_override='public') OR
-                     (A.private_override='none' AND E.status&" . 
STATUS_PRIVATE . "=0))";
+                     (A.private_override='none' AND !(E.status&" . 
STATUS_PRIVATE . ")))";
     }
   }
    

Modified: mrbs/branches/provisional_bookings_new_style/web/search.php
===================================================================
--- mrbs/branches/provisional_bookings_new_style/web/search.php 2010-09-02 
14:17:01 UTC (rev 1440)
+++ mrbs/branches/provisional_bookings_new_style/web/search.php 2010-09-03 
11:33:44 UTC (rev 1441)
@@ -111,7 +111,7 @@
     //   - their own bookings, and others' public bookings if private_override 
is set to 'none'
     //   - just their own bookings, if private_override is set to 'private'
     $sql_pred .= " AND ((A.private_override='public') OR
-                        (A.private_override='none' AND (E.status&" . 
STATUS_PRIVATE . "=0 OR E.create_by = '" . addslashes($user) . "')) OR
+                        (A.private_override='none' AND (!(E.status&" . 
STATUS_PRIVATE . ") OR E.create_by = '" . addslashes($user) . "')) OR
                         (A.private_override='private' AND E.create_by = '" . 
addslashes($user) . "'))";                
   }
   else
@@ -120,7 +120,7 @@
     //   - all bookings, if private_override is set to 'public'
     //   - public bookings if private_override is set to 'none'
     $sql_pred .= " AND ((A.private_override='public') OR
-                        (A.private_override='none' AND E.status&" . 
STATUS_PRIVATE . "=0))";
+                        (A.private_override='none' AND !(E.status&" . 
STATUS_PRIVATE . ")))";
   }
 }
 

Modified: mrbs/branches/provisional_bookings_new_style/web/view_entry.php
===================================================================
--- mrbs/branches/provisional_bookings_new_style/web/view_entry.php     
2010-09-02 14:17:01 UTC (rev 1440)
+++ mrbs/branches/provisional_bookings_new_style/web/view_entry.php     
2010-09-03 11:33:44 UTC (rev 1441)
@@ -442,7 +442,7 @@
   {
     echo "<tr>\n";
     echo "<td>" . get_vocab("confirmation_status") . ":</td>\n";
-    echo "<td>" . (($status & STATUS_TENTATIVE) ? 
get_vocab("tentative_booking") : get_vocab("confirmed_booking")) . "</td>\n";
+    echo "<td>" . (($status & STATUS_TENTATIVE) ? get_vocab("tentative") : 
get_vocab("confirmed")) . "</td>\n";
     echo "</tr>\n";
   }
   if ($approval_enabled)


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