Browse Source

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 <oleonard@myacpl.org>

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

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
19.05.x
Nick Clemens 6 years ago
parent
commit
f6599b2c54
  1. 2
      C4/Utils/DataTables/Members.pm
  2. 19
      admin/columns_settings.yml
  3. 2
      koha-tmpl/intranet-tmpl/prog/en/includes/circ-patron-search-results.inc
  4. 3
      koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
  5. 2
      koha-tmpl/intranet-tmpl/prog/js/checkouts.js
  6. 14
      koha-tmpl/intranet-tmpl/prog/js/circ-patron-search-results.js

2
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";

19
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:
-

2
koha-tmpl/intranet-tmpl/prog/en/includes/circ-patron-search-results.inc

@ -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>

3
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt

@ -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 %]){

2
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,

14
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
}));
});
var table = KohaTable("table_borrowers",
{
"aaSorting": [ 0, "asc" ],
"sDom": "t",
"iDisplayLength": -1
},
columns_settings_borrowers_table, null);
});

Loading…
Cancel
Save