Bug 17353: Add phone number column to checkout search
authorNick Clemens <nick@bywatersolutions.com>
Mon, 26 Sep 2016 17:43:20 +0000 (17:43 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Mon, 28 Jan 2019 13:06:35 +0000 (13:06 +0000)
This patch adds borrowers.phone as 'Primary phone' in the checkout
search results. It also ads the table to columns configuration

To test:
1 - Perform a checkout search
2 - Note phone is not displayed
3 - Apply patch
4 - Note phone does not display
5 - Visit columns configuration
6 - Unhide the 'phone' column
7 - Note phone displays
8 - Ensure page functions as before patch

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

C4/Utils/DataTables/Members.pm
admin/columns_settings.yml
koha-tmpl/intranet-tmpl/prog/en/includes/circ-patron-search-results.inc
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
koha-tmpl/intranet-tmpl/prog/js/checkouts.js
koha-tmpl/intranet-tmpl/prog/js/circ-patron-search-results.js

index 1e3f642..caf7a92 100644 (file)
@@ -64,7 +64,7 @@ sub search {
         borrowers.borrowernotes, borrowers.branchcode, borrowers.email,
         borrowers.userid, borrowers.dateofbirth, borrowers.categorycode,
         categories.description AS category_description, categories.category_type,
-        branches.branchname";
+        branches.branchname, borrowers.phone";
     my $from = "FROM borrowers
         LEFT JOIN branches ON borrowers.branchcode = branches.branchcode
         LEFT JOIN categories ON borrowers.categorycode = categories.categorycode";
index c616851..292c72b 100644 (file)
@@ -566,7 +566,24 @@ modules:
           columnname: export
           cannot_be_toggled: 1
           cannot_be_modified: 1
-
+      table_borrowers:
+        -
+          columnname: name
+          cannot_be_toggled: 1
+          cannot_be_modified: 1
+        -
+          columnname: cardnumber
+        -
+          columnname: date_of_birth
+        -
+          columnname: category
+        -
+          columnname: library
+        -
+          columnname: address
+        -
+          columnname: phone
+          is_hidden: 1
     returns:
       checkedintable:
         -
index 8e8845b..8b34bd6 100644 (file)
@@ -9,6 +9,7 @@
             <th>Category</th>
             <th>Library</th>
             <th>Address</th>
+            <th>Primary phone</th>
         </tr>
     </thead>
     <tbody>
@@ -30,6 +31,7 @@
                 <td>[% Categories.GetName( borrower.categorycode ) | html %]</td>
                 <td>[% Branches.GetName( borrower.branchcode ) | html %]</td>
                 <td>[% borrower.address | html %]</td>
+                <td>[% borrower.phone | html %]</td>
             </tr>
         [% END %]
     </tbody>
index 38300c8..006b81a 100644 (file)
@@ -1009,7 +1009,8 @@ No patron matched <span class="ex">[% message | html %]</span>
         var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export");
         var MSG_CONFIRM_DELETE_MESSAGE = _("Are you sure you want to delete this message? This cannot be undone.");
 
-        columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'issues-table', 'json' ) | $raw %]
+        columns_settings_issues_table = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'issues-table', 'json' ) | $raw %]
+        columns_settings_borrowers_table = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %]
 
         [% IF borrowernumber and patron %]
             if($.cookie("holdfor") != [% patron.borrowernumber | html %]){
index 9902f5b..4fbaea6 100644 (file)
@@ -546,7 +546,7 @@ $(document).ready(function() {
                     .append(ul)
                     .insertBefore(oSettings.nTableWrapper)
             },
-        }, columns_settings).rowGrouping(
+        }, columns_settings_issues_table).rowGrouping(
             {
                 iGroupingColumnIndex: 1,
                 iGroupingOrderByColumnIndex: 0,
index f778d15..fa44b3e 100644 (file)
@@ -3,9 +3,11 @@ $(document).ready(function() {
     $(".clickable").click(function() {
         window.document.location = $(this).data('url');
     });
-    var table = $("#table_borrowers").dataTable($.extend(true, {}, dataTablesDefaults, {
-        "aaSorting": [ 0, "asc" ],
-        "sDom": "t",
-        "iDisplayLength": -1
-    }));
-});
\ No newline at end of file
+    var table = KohaTable("table_borrowers",
+        {
+            "aaSorting": [ 0, "asc" ],
+            "sDom": "t",
+            "iDisplayLength": -1
+        },
+        columns_settings_borrowers_table, null);
+});