Revision: 1246
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1246&view=rev
Author:   cimorrison
Date:     2009-11-10 11:20:20 +0000 (Tue, 10 Nov 2009)

Log Message:
-----------
Day and Week views now show provisional bookings with a different styling

Modified Paths:
--------------
    mrbs/branches/provisional_bookings/web/day.php
    mrbs/branches/provisional_bookings/web/functions.inc
    mrbs/branches/provisional_bookings/web/mrbs.css.php
    mrbs/branches/provisional_bookings/web/week.php

Modified: mrbs/branches/provisional_bookings/web/day.php
===================================================================
--- mrbs/branches/provisional_bookings/web/day.php      2009-11-09 23:20:53 UTC 
(rev 1245)
+++ mrbs/branches/provisional_bookings/web/day.php      2009-11-10 11:20:20 UTC 
(rev 1246)
@@ -175,7 +175,7 @@
 //form of the original which had 3 BETWEEN parts. It selects all entries which
 //occur on or cross the current day.
 $sql = "SELECT $tbl_room.id AS room_id, start_time, end_time, name, 
$tbl_entry.id AS entry_id, type,
-        $tbl_entry.description AS entry_description, 
+        $tbl_entry.description AS entry_description, status,
         $tbl_entry.private AS entry_private, $tbl_entry.create_by AS 
entry_create_by
    FROM $tbl_entry, $tbl_room
    WHERE $tbl_entry.room_id = $tbl_room.id
@@ -203,6 +203,7 @@
   //  row['entry_description'] = description
   //  row['entry_private'] = if entry is private
   //  row['entry_create_by'] = Creator/owner of entry
+  //  row['status'] = Status code of the entry
   
   map_add_booking($row, $today[$row['room_id']][$day], $am7, $pm7, $format);
 

Modified: mrbs/branches/provisional_bookings/web/functions.inc
===================================================================
--- mrbs/branches/provisional_bookings/web/functions.inc        2009-11-09 
23:20:53 UTC (rev 1245)
+++ mrbs/branches/provisional_bookings/web/functions.inc        2009-11-10 
11:20:20 UTC (rev 1246)
@@ -709,6 +709,7 @@
   //       entry_description
   //       entry_private
   //       entry_create_by
+  //       status
   
   // $column is a column of the map of the screen that will be displayed
   // It looks like:
@@ -719,6 +720,7 @@
   //                     [long_descr]
   //                     [start_time]
   //                     [slots]
+  //                     [status]
   
   // slots records the duration of the booking in number of time slots.
        // Used to calculate how high to make the block used for clipping
@@ -784,6 +786,7 @@
     // fill in the id, type and start time
     $column[$time_t][$n]["id"] = $row['entry_id'];
     $column[$time_t][$n]["is_private"] = $is_private;
+    $column[$time_t][$n]["status"] = $row['status'];
     $column[$time_t][$n]["color"] = $row['type'];
     $column[$time_t][$n]["start_time"] = utf8_strftime(hour_min_format(), 
$row['start_time']);
     $column[$time_t][$n]["slots"] = null;  // to avoid undefined index NOTICE 
errors
@@ -919,6 +922,7 @@
   //         [long_descr]
   //         [start_time]
   //         [slots]
+  //         [status]
   //
   // where n is the number of the booking in the cell.    There can be none, 
one or many 
   // bookings in a cell.    If there are no bookings then a blank cell is 
drawn with a link
@@ -981,10 +985,15 @@
     {
       $id         = $cell[$n]["id"];
       $is_private = $cell[$n]["is_private"];
+      $status     = $cell[$n]["status"];
       $color      = $cell[$n]["color"];
       $descr      = htmlspecialchars($cell[$n]["data"]);
       $long_descr = htmlspecialchars($cell[$n]["long_descr"]);
       $class = $color;
+      if ($status == STATUS_PROVISIONAL)
+      {
+        $class .= " provisional";
+      }
       if ($is_private)
       {
         $class .= " private";
@@ -1022,10 +1031,15 @@
     {
       $id         = $cell[$n]["id"];
       $is_private = $cell[$n]["is_private"];
+      $status     = $cell[$n]["status"];
       $color      = $cell[$n]["color"];
       $descr      = htmlspecialchars($cell[$n]["start_time"] . " " . 
$cell[$n]["data"]);
       $long_descr = htmlspecialchars($cell[$n]["long_descr"]);
       $class = $color;
+      if ($status == STATUS_PROVISIONAL)
+      {
+        $class .= " provisional";
+      }    
       if ($is_private)
       {
         $class .= " private";
@@ -1055,6 +1069,7 @@
     {       
       $id         = $cell[0]["id"];
       $is_private = $cell[0]["is_private"];
+      $status     = $cell[0]["status"];
       $color      = $cell[0]["color"];
       $descr      = htmlspecialchars($cell[0]["data"]);
       $long_descr = htmlspecialchars($cell[0]["long_descr"]);
@@ -1073,6 +1088,10 @@
     if (isset($id))
     {
       $c = $color;
+      if ($status == STATUS_PROVISIONAL)
+      {
+        $c .= " provisional";
+      } 
       if ($is_private)
       {
         $c .= " private";

Modified: mrbs/branches/provisional_bookings/web/mrbs.css.php
===================================================================
--- mrbs/branches/provisional_bookings/web/mrbs.css.php 2009-11-09 23:20:53 UTC 
(rev 1245)
+++ mrbs/branches/provisional_bookings/web/mrbs.css.php 2009-11-10 11:20:20 UTC 
(rev 1246)
@@ -404,7 +404,12 @@
 /* private bookings */
 .private {opacity: 0.6; font-style: italic}
 
+/* provisional bookings */
+.provisional {opacity: 0.6}
+.provisional a {font-weight: normal}
+.provisional a:before {content: "? "}
 
+
 /* ------------ DEL.PHP -----------------------------*/
 div#del_room_confirm {padding-bottom: 3em}
 #del_room_confirm p {text-align: center; font-size: large; font-weight: bold}

Modified: mrbs/branches/provisional_bookings/web/week.php
===================================================================
--- mrbs/branches/provisional_bookings/web/week.php     2009-11-09 23:20:53 UTC 
(rev 1245)
+++ mrbs/branches/provisional_bookings/web/week.php     2009-11-10 11:20:20 UTC 
(rev 1246)
@@ -256,7 +256,8 @@
 
 for ($j = 0; $j<=($num_of_days-1) ; $j++)
 {
-  $sql = "SELECT start_time, end_time, type, name, id AS entry_id, description 
AS entry_description,
+  $sql = "SELECT start_time, end_time, type, name, status,
+            id AS entry_id, description AS entry_description,
             private AS entry_private, create_by AS entry_create_by
           FROM $tbl_entry
           WHERE room_id = $room


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

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to