Revision: 2087
          http://mrbs.svn.sourceforge.net/mrbs/?rev=2087&view=rev
Author:   cimorrison
Date:     2011-10-13 21:05:46 +0000 (Thu, 13 Oct 2011)
Log Message:
-----------
Restricted those bookings which are resizable to those which the user is 
allowed to edit.

Modified Paths:
--------------
    mrbs/branches/draggable_bookings/web/Themes/default/header.inc
    mrbs/branches/draggable_bookings/web/functions.inc

Modified: mrbs/branches/draggable_bookings/web/Themes/default/header.inc
===================================================================
--- mrbs/branches/draggable_bookings/web/Themes/default/header.inc      
2011-10-13 18:29:25 UTC (rev 2086)
+++ mrbs/branches/draggable_bookings/web/Themes/default/header.inc      
2011-10-13 21:05:46 UTC (rev 2087)
@@ -1298,10 +1298,9 @@
       var bookedMap = [];
 
       <?php
-      // Get all the booking cells, excluding (a) the row labels columns, (b) 
any empty
-      // cells and (c) any cells to do with multiple bookings
+      // Turn all the writable cells into resizable bookings
       ?>
-      table.find('td').not('.row_labels, .new, .multiple_booking, 
.multiple_booking td')
+      table.find('td.writable')
         .each(function() {
         
             <?php

Modified: mrbs/branches/draggable_bookings/web/functions.inc
===================================================================
--- mrbs/branches/draggable_bookings/web/functions.inc  2011-10-13 18:29:25 UTC 
(rev 2086)
+++ mrbs/branches/draggable_bookings/web/functions.inc  2011-10-13 21:05:46 UTC 
(rev 2087)
@@ -1339,6 +1339,8 @@
   //                     [color]
   //                     [data]
   //                     [long_descr]
+  //                     [create_by]
+  //                     [room_id]
   //                     [start_time]
   //                     [slots]
   //                     [status]
@@ -1423,12 +1425,16 @@
     {
       $column[$time_t][$n]["data"] = $row['name'];
       $column[$time_t][$n]["long_descr"] = $row['entry_description'];
+      $column[$time_t][$n]["create_by"] = $row['entry_create_by'];
+      $column[$time_t][$n]["room_id"] = $row['room_id'];
     }
     // otherwise just leave them blank (we'll fill in the first whole slot 
later)
     else
     {
       $column[$time_t][$n]["data"] = "";
-      $column[$time_t][$n]["long_descr"] = ""; 
+      $column[$time_t][$n]["long_descr"] = "";
+      $column[$time_t][$n]["create_by"] = "";
+      $column[$time_t][$n]["room_id"] = "";
     }
   } // end for
   
@@ -1461,6 +1467,8 @@
         // Move the name and description into the new first slot and decrement 
the number of slots
         $column[date($format, $end_t + $resolution)][0]["data"] = 
$column[$time_end_t][0]["data"];
         $column[date($format, $end_t + $resolution)][0]["long_descr"] = 
$column[$time_end_t][0]["long_descr"];
+        $column[date($format, $end_t + $resolution)][0]["create_by"] = 
$column[$time_end_t][0]["create_by"];
+        $column[date($format, $end_t + $resolution)][0]["room_id"] = 
$column[$time_end_t][0]["room_id"];
         $column[date($format, $end_t + $resolution)][0]["slots"] = 
$column[$time_end_t][0]["slots"] - 1;
       }
     }
@@ -1519,7 +1527,8 @@
       // and put the name and description in the multiply booked slot
       $column[$time_start_t][0]["data"] = 
$column[date($format,$s)][$i]["data"];
       $column[$time_start_t][0]["long_descr"] = 
$column[date($format,$s)][$i]["long_descr"];
-
+      $column[$time_start_t][0]["create_by"] = 
$column[date($format,$s)][$i]["create_by"];
+      $column[$time_start_t][0]["room_id"] = 
$column[date($format,$s)][$i]["room_id"];
     }
   }
  
@@ -1529,6 +1538,8 @@
   {
     $column[date($format,$first_slot)][0]["data"] = $row['name'];
     $column[date($format,$first_slot)][0]["long_descr"] = 
$row['entry_description'];
+    $column[date($format,$first_slot)][0]["create_by"] = 
$row['entry_create_by']; 
+    $column[date($format,$first_slot)][0]["room_id"] = $row['room_id']; 
     $column[date($format,$first_slot)][0]["slots"] = $n_slots;
   }
 
@@ -1548,6 +1559,8 @@
   //         [color]
   //         [data]
   //         [long_descr]
+  //         [create_by]
+  //         [room_id]
   //         [start_time]
   //         [slots]
   //         [status]
@@ -1572,6 +1585,8 @@
   global $enable_periods, $times_along_top, $show_plus_link;
   global $approval_enabled, $confirmation_enabled;
   
+  $user = getUserName();
+  
   // if the time slot has got multiple bookings, then draw a mini-table
   if(isset($cell[1]["id"]))
   {
@@ -1735,7 +1750,11 @@
       if ($confirmation_enabled && ($status & STATUS_TENTATIVE))
       {
         $c .= " tentative";
-      } 
+      }
+      if (getWritable($cell[0]['create_by'], $user, $cell[0]['room_id']))
+      {
+        $c .= " writable";
+      }
     }
     else
     {

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


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to