Revision: 2071
          http://mrbs.svn.sourceforge.net/mrbs/?rev=2071&view=rev
Author:   cimorrison
Date:     2011-10-07 15:34:20 +0000 (Fri, 07 Oct 2011)
Log Message:
-----------
Allowed the highlight line in the day and week views to be toggled on and off 
(previously once a line had been highlighted you could not get rid of it)

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

Modified: mrbs/trunk/web/day.php
===================================================================
--- mrbs/trunk/web/day.php      2011-10-07 15:06:30 UTC (rev 2070)
+++ mrbs/trunk/web/day.php      2011-10-07 15:34:20 UTC (rev 2071)
@@ -328,7 +328,7 @@
   
   // URL for highlighting a time. Don't use REQUEST_URI or you will get
   // the timetohighlight parameter duplicated each time you click.
-  
$hilite_url="day.php?year=$year&month=$month&day=$day&area=$area$room_param&timetohighlight";
+  
$base_url="day.php?year=$year&month=$month&day=$day&area=$area$room_param";
   
   
    
@@ -402,9 +402,14 @@
       if (isset($timetohighlight) && ($time_t == $timetohighlight))
       {
         $class .= " row_highlight";
+        $url = $base_url;
       }
+      else
+      {
+        $url = $base_url . "&timetohighlight=$time_t";
+      }
       echo "<tr class=\"$class\">\n";
-      draw_time_cell($t, $time_t, $time_t_stripped, $hilite_url);
+      draw_time_cell($t, $time_t, $time_t_stripped, $url);
   
       // Loop through the list of rooms we have for this area
       while (list($key, $room_id) = each($rooms))
@@ -425,7 +430,7 @@
       // next lines to display times on right side
       if ( FALSE != $row_labels_both_sides )
       {
-        draw_time_cell($t, $time_t, $time_t_stripped, $hilite_url);
+        draw_time_cell($t, $time_t, $time_t_stripped, $url);
       }
   
       echo "</tr>\n";

Modified: mrbs/trunk/web/functions.inc
===================================================================
--- mrbs/trunk/web/functions.inc        2011-10-07 15:06:30 UTC (rev 2070)
+++ mrbs/trunk/web/functions.inc        2011-10-07 15:34:20 UTC (rev 2071)
@@ -1790,8 +1790,8 @@
 //    $t                 the timestamp for the start of the slot
 //    $time_t            the time converted to HHMM format without leading 
zeros
 //    $time_t_stripped   a stripped version of the time for use with periods
-//    $hilite_url        the url to form the basis of the link in the time cell
-function draw_time_cell($t, $time_t, $time_t_stripped, $hilite_url)
+//    $url               the url to form the basis of the link in the time cell
+function draw_time_cell($t, $time_t, $time_t_stripped, $url)
 {
   global $enable_periods, $periods;
   
@@ -1800,13 +1800,13 @@
   if ( $enable_periods )
   {
     
-    echo "<a href=\"$hilite_url=$time_t\"  title=\""
+    echo "<a href=\"$url\"  title=\""
       . get_vocab("highlight_line") . "\">"
       . $periods[$time_t_stripped] . "</a>\n";
   }
   else
   {
-    echo "<a href=\"$hilite_url=$time_t\" title=\""
+    echo "<a href=\"$url\" title=\""
       . get_vocab("highlight_line") . "\">"
       . utf8_strftime(hour_min_format(),$t) . "</a>\n";
   }

Modified: mrbs/trunk/web/week.php
===================================================================
--- mrbs/trunk/web/week.php     2011-10-07 15:06:30 UTC (rev 2070)
+++ mrbs/trunk/web/week.php     2011-10-07 15:34:20 UTC (rev 2071)
@@ -315,7 +315,7 @@
 
 // URL for highlighting a time. Don't use REQUEST_URI or you will get
 // the timetohighlight parameter duplicated each time you click.
-$hilite_url="week.php?year=$year&amp;month=$month&amp;day=$day&amp;area=$area&amp;room=$room&amp;timetohighlight";
+$base_url="week.php?year=$year&amp;month=$month&amp;day=$day&amp;area=$area&amp;room=$room";
 $row_class = "even_row";
 
 // We can display the table in two ways
@@ -411,9 +411,14 @@
     if (isset($timetohighlight) && ($time_t == $timetohighlight))
     {
       $class .= " row_highlight";
+      $url = $base_url;
     }
+    else
+    {
+      $url = $base_url . "&amp;timetohighlight=$time_t";
+    }
     echo "<tr class=\"$class\">";
-    draw_time_cell($t, $time_t, $time_t_stripped, $hilite_url);
+    draw_time_cell($t, $time_t, $time_t_stripped, $url);
   
   
     // See note above: weekday==0 is day $weekstarts, not necessarily Sunday.
@@ -450,7 +455,7 @@
     // next lines to display times on right side
     if ( FALSE != $row_labels_both_sides )
       {
-        draw_time_cell($t, $time_t, $time_t_stripped, $hilite_url);
+        draw_time_cell($t, $time_t, $time_t_stripped, $url);
       }
   
     echo "</tr>\n";

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


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to