From f6599b2c5480d2e096bac71e4e7ac759686b9fbc Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Mon, 26 Sep 2016 17:43:20 +0000 Subject: [PATCH] Bug 17353: Add phone number column to checkout search 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 Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens --- C4/Utils/DataTables/Members.pm | 2 +- admin/columns_settings.yml | 19 ++++++++++++++++++- .../includes/circ-patron-search-results.inc | 2 ++ .../prog/en/modules/circ/circulation.tt | 3 ++- koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 2 +- .../prog/js/circ-patron-search-results.js | 14 ++++++++------ 6 files changed, 32 insertions(+), 10 deletions(-) diff --git a/C4/Utils/DataTables/Members.pm b/C4/Utils/DataTables/Members.pm index 1e3f6420a2..caf7a92152 100644 --- a/C4/Utils/DataTables/Members.pm +++ b/C4/Utils/DataTables/Members.pm @@ -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"; diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml index c616851e46..292c72b70d 100644 --- a/admin/columns_settings.yml +++ b/admin/columns_settings.yml @@ -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: - diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-patron-search-results.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-patron-search-results.inc index 8e8845b461..8b34bd6c59 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-patron-search-results.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-patron-search-results.inc @@ -9,6 +9,7 @@ Category Library Address + Primary phone @@ -30,6 +31,7 @@ [% Categories.GetName( borrower.categorycode ) | html %] [% Branches.GetName( borrower.branchcode ) | html %] [% borrower.address | html %] + [% borrower.phone | html %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index 38300c8f33..006b81a33a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -1009,7 +1009,8 @@ No patron matched [% message | html %] 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 %]){ diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js index 9902f5be01..4fbaea60d9 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js @@ -546,7 +546,7 @@ $(document).ready(function() { .append(ul) .insertBefore(oSettings.nTableWrapper) }, - }, columns_settings).rowGrouping( + }, columns_settings_issues_table).rowGrouping( { iGroupingColumnIndex: 1, iGroupingOrderByColumnIndex: 0, diff --git a/koha-tmpl/intranet-tmpl/prog/js/circ-patron-search-results.js b/koha-tmpl/intranet-tmpl/prog/js/circ-patron-search-results.js index f778d159c3..fa44b3e96a 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/circ-patron-search-results.js +++ b/koha-tmpl/intranet-tmpl/prog/js/circ-patron-search-results.js @@ -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); +}); -- 2.39.5