Revision: 1980
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1980&view=rev
Author:   cimorrison
Date:     2011-09-21 15:57:24 +0000 (Wed, 21 Sep 2011)
Log Message:
-----------
Made the duration column in the report table properly sortable

Modified Paths:
--------------
    mrbs/branches/datatables/web/Themes/default/header.inc
    mrbs/branches/datatables/web/report.php

Modified: mrbs/branches/datatables/web/Themes/default/header.inc
===================================================================
--- mrbs/branches/datatables/web/Themes/default/header.inc      2011-09-21 
15:44:39 UTC (rev 1979)
+++ mrbs/branches/datatables/web/Themes/default/header.inc      2011-09-21 
15:57:24 UTC (rev 1980)
@@ -1425,11 +1425,11 @@
     <?php 
     // Stop the first column ("id") from being searchable.   For some reason
     // using bVisible here does not work, so we will use CSS instead.
-    // Define the type of the start time, end time and last updated columns
+    // Define the type of the start time, end time, duration and last updated 
columns
     // (they have the Unix timestamp in the title of a span for sorting)
     ?>
     tableOptions.aoColumnDefs = [{"bSearchable": false, "bVisible": false, 
"aTargets": [ 0 ]},
-                                 {"sType": "title-numeric", "aTargets": [3, 4, 
-1]}]; 
+                                 {"sType": "title-numeric", "aTargets": [3, 4, 
5, -1]}]; 
 
     <?php
     // Fix the left hand three columns (one of which is the "id" column which

Modified: mrbs/branches/datatables/web/report.php
===================================================================
--- mrbs/branches/datatables/web/report.php     2011-09-21 15:44:39 UTC (rev 
1979)
+++ mrbs/branches/datatables/web/report.php     2011-09-21 15:57:24 UTC (rev 
1980)
@@ -251,8 +251,13 @@
   }
   
   // Duration
+  // Need the duration in seconds for sorting.  Have to correct it for DST
+  // changes so that the user sees what he expects to see
+  $duration_seconds = $row['end_time'] - $row['start_time'];
+  $duration_seconds -= cross_dst($row['start_time'], $row['end_time']);
   $d = get_duration($row['start_time'], $row['end_time']);
-  $values[] = escape($d['duration'] . ' ' . $d['dur_units']);
+  $values[] = "<span title=\"$duration_seconds\"></span>" .
+              escape($d['duration'] . ' ' . $d['dur_units']);
 
   // Description:
   $values[] = escape($row['description']);

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-d2dcopy1
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to