From 75c3070107d222cc983f58e2a9a01d2744eb31d4 Mon Sep 17 00:00:00 2001 From: Andrew Isherwood Date: Tue, 5 Jun 2018 14:59:44 +0100 Subject: [PATCH] Bug 20883: Add patron userid to display This patch adds the display of patron userid to both the "illlist" and "illview" pages. Test plan (see bug 7317 for ILL deployment details): 1) Ensure you have at least one ILL request 2) Go to the main "List requests" page by clicking "ILL requests" from the main staff interface TEST => Observe that you see a "Patron username" column the the table, containing the patron's correct userid 3) Click "Manage request" on a request TEST => Observe that, in the "Patron" row, you see the patron's correct userid in brackets (along with their name and barcode) --- Koha/Illrequest.pm | 3 ++- .../prog/en/modules/ill/ill-requests.tt | 27 +++++++++++++++++----- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm index 99b97bdbe4..a1fd1edee6 100644 --- a/Koha/Illrequest.pm +++ b/Koha/Illrequest.pm @@ -1006,7 +1006,8 @@ sub TO_JSON { $object->{patron} = { firstname => $patron->firstname, surname => $patron->surname, - cardnumber => $patron->cardnumber + cardnumber => $patron->cardnumber, + userid => $patron->userid }; } # Augment the request response with metadata details if appropriate diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt index 70f31cad16..392b7cfc40 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt @@ -45,6 +45,7 @@ 'metadata_Author', 'metadata_Title', 'borrowername', + 'borroweruserid', 'biblio_id', 'library', 'status', @@ -106,8 +107,8 @@ return value; }; - // Our 'render' function for borrowerlink - var createPatronLink = function(data, type, row) { + // Our 'render' function for patron name + var createPatronName = function(data, type, row) { return '' + @@ -115,6 +116,15 @@ ''; }; + // Our 'render' function for patron userid + var createPatronUserID = function(data, type, row) { + return '' + + row.patron_userid + + ''; + }; + // Our 'render' function for the library name var createLibrary = function(data, type, row) { return row.library.branchname; @@ -173,8 +183,12 @@ func: createActionLink }, borrowername: { - name: _("Patron"), - func: createPatronLink + name: _("Patron name"), + func: createPatronName + }, + borroweruserid: { + name: _("Patron username"), + func: createPatronUserID }, illrequest_id: { name: _("Request number"), @@ -512,7 +526,7 @@ Patron: [% borrowerlink = "/cgi-bin/koha/members/moremember.pl" _ "?borrowernumber=" _ request.patron.borrowernumber %] - [% request.patron.firstname _ " " _ request.patron.surname _ " [" _ request.patron.cardnumber _ "]" %] + [% request.patron.firstname _ " " _ request.patron.surname _ " [" _ request.patron.cardnumber _ "] [" _ request.patron.userid _ "]" %] @@ -588,7 +602,8 @@ Author Title - Patron + Patron name + Patron username Biblio ID Library Status -- 2.11.0