Revision: 1961
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1961&view=rev
Author:   cimorrison
Date:     2011-09-20 15:41:30 +0000 (Tue, 20 Sep 2011)
Log Message:
-----------
Made the "Last updated" 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-20 
15:19:06 UTC (rev 1960)
+++ mrbs/branches/datatables/web/Themes/default/header.inc      2011-09-20 
15:41:30 UTC (rev 1961)
@@ -1380,11 +1380,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 and end time columns (they have the
-    // Unix timestamp in the title of a span for sorting)
+    // Define the type of the start time, end time 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]}]; 
+                                 {"sType": "title-numeric", "aTargets": [3, 4, 
-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-20 15:19:06 UTC (rev 
1960)
+++ mrbs/branches/datatables/web/report.php     2011-09-20 15:41:30 UTC (rev 
1961)
@@ -327,9 +327,18 @@
   }
 
   // Last updated:
-  $values[] = escape(time_date_string($row['last_updated']));
+  $last_updated = time_date_string($row['last_updated']);
+  if ($output_as_csv)
+  {
+    $values[] = escape($last_updated);
+  }
+  else
+  {
+    // Include the numeric last updated time  as a title in an empty span so
+    // that the column can be sorted and filtered properly
+    $values[] = "<span title=\"" . $row['last_updated'] . "\"></span>" . 
escape($last_updated);
+  }
   
-
   if ($ajax)
   {
     $json_data['aaData'][] = $values;

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