From 7e7e64245ac48ddc41830d772867b1e404af090e 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 cc61a870e5..71d9a99b67 100644 --- a/Koha/Illrequest.pm +++ b/Koha/Illrequest.pm @@ -1007,7 +1007,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 584616263d..318de563df 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 @@ -46,6 +46,7 @@ 'metadata_Author', 'metadata_Title', 'borrowername', + 'borroweruserid', 'biblio_id', 'library', 'status', @@ -107,8 +108,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 '' + @@ -116,6 +117,15 @@ ''; }; + // Our 'render' function for patron userid + var createPatronUserID = function(data, type, row) { + return '' + + row.patron_userid + + ''; + }; + // Our 'render' function for biblio_id var createBiblioLink = function(data, type, row) { return (row.biblio_id) ? @@ -184,8 +194,12 @@ func: createActionLink }, borrowername: { - name: _("Patron"), - func: createPatronLink + name: _("Patron name"), + func: createPatronName + }, + borroweruserid: { + name: _("Patron username"), + func: createPatronUserID }, illrequest_id: { name: _("Request number"), @@ -276,7 +290,7 @@ 'bSearchable': false }, ], - 'aaSorting': [[ 6, 'desc' ]], // Default sort, updated descending + 'aaSorting': [[ 8, 'desc' ]], // Default sort, updated descending 'processing': true, // Display a message when manipulating 'iDisplayLength': 10, // 10 results per page 'sPaginationType': "full_numbers", // Pagination display @@ -519,7 +533,7 @@ Patron: [% borrowerlink = "/cgi-bin/koha/members/moremember.pl" _ "?borrowernumber=" _ request.patron.borrowernumber %] - [% request.patron.firstname _ " " _ request.patron.surname _ " [" _ request.patron.cardnumber _ "]" | html %] + [% request.patron.firstname _ " " _ request.patron.surname _ " [" _ request.patron.cardnumber _ "] [" _ request.patron.userid _ "]" | html %] @@ -616,6 +630,7 @@ Author Title Patron + Patron username Bibliographic record ID Library Status -- 2.11.0