Changeset:
        538d31cb85e7
        
https://sourceforge.net/p/mrbs/hg-code/ci/538d31cb85e7430257ef28f23a024495dabcbd1c
Author:
        Campbell Morrison <[email protected]>
Date:
        Sat Feb 27 16:27:48 2016 +0000
Log message:

Sorted by area sort_key where appropriate

diffstat:

 web/admin.php      |   2 +-
 web/edit_entry.php |   2 +-
 web/functions.inc  |   4 ++--
 web/report.php     |  11 +++--------
 4 files changed, 7 insertions(+), 12 deletions(-)

diffs (73 lines):

diff -r 5097f707ed44 -r 538d31cb85e7 web/admin.php
--- a/web/admin.php     Sat Feb 27 15:12:41 2016 +0000
+++ b/web/admin.php     Sat Feb 27 16:27:48 2016 +0000
@@ -68,7 +68,7 @@
 echo "<div id=\"area_form\">\n";
 $sql = "SELECT id, area_name, disabled
           FROM $tbl_area
-      ORDER BY disabled, area_name";
+      ORDER BY disabled, sort_key";
 $res = sql_query($sql);
 $areas_defined = $res && (sql_count($res) > 0);
 if (!$areas_defined)
diff -r 5097f707ed44 -r 538d31cb85e7 web/edit_entry.php
--- a/web/edit_entry.php        Sat Feb 27 15:12:41 2016 +0000
+++ b/web/edit_entry.php        Sat Feb 27 16:27:48 2016 +0000
@@ -1039,7 +1039,7 @@
                max_duration_enabled, max_duration_secs, max_duration_periods
           FROM $tbl_area
          WHERE disabled=0
-      ORDER BY area_name";
+      ORDER BY sort_key";
 $res = sql_query($sql);
 if ($res)
 {
diff -r 5097f707ed44 -r 538d31cb85e7 web/functions.inc
--- a/web/functions.inc Sat Feb 27 15:12:41 2016 +0000
+++ b/web/functions.inc Sat Feb 27 16:27:48 2016 +0000
@@ -1666,11 +1666,11 @@
       return $area;
     }
   }
-  // Otherwise return the first enabled area in alphabetical order in the 
database
+  // Otherwise return the first enabled area in sort key order in the database
   $area = sql_query1("SELECT id
                         FROM $tbl_area
                        WHERE disabled=0
-                    ORDER BY area_name
+                    ORDER BY sort_key
                        LIMIT 1");
   return ((!isset($area) || ($area < 0)) ? 0 : $area);
 }
diff -r 5097f707ed44 -r 538d31cb85e7 web/report.php
--- a/web/report.php    Sat Feb 27 15:12:41 2016 +0000
+++ b/web/report.php    Sat Feb 27 16:27:48 2016 +0000
@@ -36,12 +36,7 @@
       
         
       case 'areamatch':
-        $options = sql_query_array("SELECT area_name FROM $tbl_area ORDER BY 
area_name");
-        if ($options === FALSE)
-        {
-          trigger_error(sql_error(), E_USER_WARNING);
-          fatal_error(FALSE, get_vocab("fatal_db_error"));
-        }
+        $options = get_area_names($all=TRUE);
         echo "<div id=\"div_areamatch\">\n";
         $params = array('label'         => get_vocab("match_area") . ':',
                         'name'          => 'areamatch',
@@ -1436,12 +1431,12 @@
   elseif ($sortby == "r")
   {
     // Order by Area, Room, Start date/time
-    $sql .= " ORDER BY area_name, R.sort_key, start_time";
+    $sql .= " ORDER BY A.sort_key, R.sort_key, start_time";
   }
   else
   {
     // Order by Start date/time, Area, Room
-    $sql .= " ORDER BY start_time, area_name, R.sort_key";
+    $sql .= " ORDER BY start_time, A.sort_key, R.sort_key";
   }
 
   // echo "<p>DEBUG: SQL: <tt> $sql </tt></p>\n";

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to