[Koha-patches] [PATCH] [SIGNED-OFF] Fix for Bug 3987 - New Sys Prefs Branch - Alphabetize prefs in sections

Nicole Engard nengard at bywatersolutions.com
Thu Dec 16 08:34:47 CET 2010


From: Owen Leonard <oleonard at myacpl.org>

Adding jquery tablesorter, sorting on sys pref variable by default

Signed-off-by: Nicole Engard <nengard at bywatersolutions.com>
---
 .../intranet-tmpl/prog/en/js/pages/preferences.js  |    7 +++++++
 .../prog/en/modules/admin/preferences.tmpl         |    6 ++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js b/koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js
index 6f0d064..cbf98b8 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js
+++ b/koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js
@@ -1,3 +1,10 @@
+$(document).ready(function() {
+    $("table.preferences").tablesorter({
+        sortList: [[0,0]],
+        headers: { 1: { sorter:false}}
+    });
+});
+
 // We can assume 'KOHA' exists, as we depend on KOHA.AJAX
 
 KOHA.Preferences = {
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tmpl
index b9bfd4f..3ae0281 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tmpl
@@ -1,6 +1,7 @@
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
 <title>Koha &rsaquo; Administration &rsaquo; System Preferences</title>
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
+<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
 <link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR NAME="themelang"-->/css/preferences.css" />
 <link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR NAME="themelang"-->/css/humanmsg.css" />
 <script src="<!-- TMPL_VAR NAME="themelang" -->/lib/jquery/plugins/humanmsg.js" type="text/javascript"></script>
@@ -48,11 +49,12 @@
             <!-- TMPL_LOOP NAME="LINES" -->
             <!-- TMPL_IF NAME="is_group_title" -->
             <!-- TMPL_UNLESS NAME="__first__" --></tbody></table><!-- /TMPL_UNLESS -->
-            <h3><!-- TMPL_VAR NAME="title" --></h3><table>
+            <h3><!-- TMPL_VAR NAME="title" --></h3>
+            <table class="preferences">
             <thead><tr><th>Preference</th><th>Value</th></tr></thead>
             <!-- TMPL_UNLESS NAME="__last__" --><tbody><!-- /TMPL_UNLESS -->
             <!-- TMPL_ELSE -->
-            <!-- TMPL_IF NAME="__first__" --><table><thead><tr><th>Preference</th><th>Value</th></tr></thead><tbody><!-- /TMPL_IF -->
+            <!-- TMPL_IF NAME="__first__" --><table class="preferences"><thead><tr><th>Preference</th><th>Value</th></tr></thead><tbody><!-- /TMPL_IF -->
             <tr class="name-row">
                 <td class="name-cell">
                     <code>
-- 
1.5.6.5



More information about the Koha-patches mailing list