Bugzilla – Attachment 79692 Details for
Bug 18589
Show ILLs as part of patron profile
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18589: Show ILLs as part of patron profile
Bug-18589-Show-ILLs-as-part-of-patron-profile.patch (text/plain), 26.98 KB, created by
PTFS Europe Sandboxes
on 2018-10-01 07:54:22 UTC
(
hide
)
Description:
Bug 18589: Show ILLs as part of patron profile
Filename:
MIME Type:
Creator:
PTFS Europe Sandboxes
Created:
2018-10-01 07:54:22 UTC
Size:
26.98 KB
patch
obsolete
>From a3546e2deed1bb246a57a4eab27a985376738245 Mon Sep 17 00:00:00 2001 >From: Andrew Isherwood <andrew.isherwood@ptfs-europe.com> >Date: Tue, 24 Apr 2018 14:15:19 +0100 >Subject: [PATCH] Bug 18589: Show ILLs as part of patron profile > >This patch moves the display of a patron's ILL requests to be inline in >the Patron Profile page, as per all other patron information. > >It includes a substantial refactor of >koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt in that it >moves the display of the illlist table (which is populated by an API >request) into it's own separate include file. It also moves the >datatable related Javascript for this table into it's own JS file. Doing >this allows us to reuse both in both the new members/ill-requests.tt >template and the pre-existing ill/ill-requests.tt template. > >To test: >1) Ensure ILL is enabled and your user has sufficient permissions >2) Ensure your user has some ILL requests >3) Navigate to the user's patron profile page >4) Click on the "Interlibrary loans" tab >5) Observe that the requests table is displayed inline >6) Observe that only your user's requests are displayed > >Signed-off-by: Niamh.Walker-Headon@it-tallaght.ie >--- > ill/ill-requests.pl | 5 +- > .../intranet-tmpl/prog/en/includes/circ-menu.inc | 2 +- > .../prog/en/includes/ill-list-table.inc | 17 ++ > .../prog/en/modules/ill/ill-requests.tt | 292 +-------------------- > .../prog/en/modules/members/ill-requests.tt | 41 +++ > koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js | 272 +++++++++++++++++++ > members/ill-requests.pl | 54 ++++ > 7 files changed, 390 insertions(+), 293 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/ill-list-table.inc > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/members/ill-requests.tt > create mode 100644 koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js > create mode 100755 members/ill-requests.pl > >diff --git a/ill/ill-requests.pl b/ill/ill-requests.pl >index 47cfc97050..c4fc2b2f22 100755 >--- a/ill/ill-requests.pl >+++ b/ill/ill-requests.pl >@@ -223,13 +223,12 @@ if ( $backends_available ) { > my $active_filters = []; > foreach my $filter(@{$possible_filters}) { > if ($params->{$filter}) { >- push @{$active_filters}, >- { name => $filter, value => $params->{$filter}}; >+ push @{$active_filters}, "$filter=$params->{$filter}"; > } > } > if (scalar @{$active_filters} > 0) { > $template->param( >- prefilters => $active_filters >+ prefilters => join(",", @{$active_filters}) > ); > } > } else { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >index a69d099e92..b69046e789 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >@@ -122,7 +122,7 @@ > [% IF houseboundview %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/housebound.pl?borrowernumber=[% patron.borrowernumber | html %]">Housebound</a></li> > [% END %] > [% IF Koha.Preference('ILLModule') && CAN_user_ill %] >- <li><a href="/cgi-bin/koha/ill/ill-requests.pl?borrowernumber=[% patron.borrowernumber | html %]">Interlibrary loans</a></li> >+ [% IF illview %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/ill-requests.pl?borrowernumber=[% patron.borrowernumber %]">Interlibrary loans</a></li> > [% END %] > </ul></div> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/ill-list-table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/ill-list-table.inc >new file mode 100644 >index 0000000000..19ef765b89 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/ill-list-table.inc >@@ -0,0 +1,17 @@ >+<table id="ill-requests"[% IF prefilters.length > 0 %] data-prefilters="[% prefilters %]"[% END %]> >+ <thead> >+ <tr id="illview-header"> >+ <th>Author</th> >+ <th>Title</th> >+ <th>Patron</th> >+ <th>Biblio ID</th> >+ <th>Library</th> >+ <th>Status</th> >+ <th>Updated on</th> >+ <th>Request number</th> >+ <th class="actions"></th> >+ </tr> >+ </thead> >+ <tbody id="illview-body"> >+ </tbody> >+</table> >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 6d435255d7..ff726ec25f 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 >@@ -10,277 +10,7 @@ > [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %] > [% Asset.css("css/datatables.css") | $raw %] > [% INCLUDE 'datatables.inc' %] >-<script type="text/javascript"> >- //<![CDATA[ >- $(document).ready(function() { >- >- // Illview Datatable setup >- >- // Fields we don't want to display >- var ignore = [ >- 'accessurl', >- 'backend', >- 'branchcode', >- 'completed', >- 'capabilities', >- 'cost', >- 'medium', >- 'notesopac', >- 'notesstaff', >- 'placed', >- 'replied' >- ]; >- >- // Fields we need to expand (flatten) >- var expand = [ >- 'metadata', >- 'patron' >- ]; >- >- // Expanded fields >- // This is auto populated >- var expanded = {}; >- >- // The core fields that should be displayed first >- var core = [ >- 'metadata_Author', >- 'metadata_Title', >- 'borrowername', >- 'biblio_id', >- 'library', >- 'status', >- 'updated', >- 'illrequest_id', >- 'action' >- ]; >- >- // Remove any fields we're ignoring >- var removeIgnore = function(dataObj) { >- dataObj.forEach(function(thisRow) { >- ignore.forEach(function(thisIgnore) { >- if (thisRow.hasOwnProperty(thisIgnore)) { >- delete thisRow[thisIgnore]; >- } >- }); >- }); >- }; >- >- // Expand any fields we're expanding >- var expandExpand = function(row) { >- expand.forEach(function(thisExpand) { >- if (row.hasOwnProperty(thisExpand)) { >- if (!expanded.hasOwnProperty(thisExpand)) { >- expanded[thisExpand] = []; >- } >- var expandObj = row[thisExpand]; >- Object.keys(expandObj).forEach( >- function(thisExpandCol) { >- var expColName = thisExpand + '_' + thisExpandCol; >- // Keep a list of fields that have been expanded >- // so we can create toggle links for them >- if (expanded[thisExpand].indexOf(expColName) == -1) { >- expanded[thisExpand].push(expColName); >- } >- expandObj[expColName] = >- expandObj[thisExpandCol]; >- delete expandObj[thisExpandCol]; >- } >- ); >- $.extend(true, row, expandObj); >- delete row[thisExpand]; >- } >- }); >- }; >- >- // Build a de-duped list of all column names >- var allCols = {}; >- core.map(function(thisCore) { >- allCols[thisCore] = 1; >- }); >- >- // Strip the expand prefix if it exists, we do this for display >- var stripPrefix = function(value) { >- expand.forEach(function(thisExpand) { >- var regex = new RegExp(thisExpand + '_', 'g'); >- value = value.replace(regex, ''); >- }); >- return value; >- }; >- >- // Our 'render' function for borrowerlink >- var createPatronLink = function(data, type, row) { >- return '<a title="' + _("View borrower details") + '" ' + >- 'href="/cgi-bin/koha/members/moremember.pl?' + >- 'borrowernumber='+row.borrowernumber+'">' + >- row.patron_firstname + ' ' + row.patron_surname + >- '</a>'; >- }; >- >- // Our 'render' function for the library name >- var createLibrary = function(data, type, row) { >- return row.library.branchname; >- }; >- >- // Render function for request ID >- var createRequestId = function(data, type, row) { >- return row.id_prefix + row.illrequest_id; >- }; >- >- // Render function for request status >- var createStatus = function(data, type, row, meta) { >- var origData = meta.settings.oInit.originalData; >- if (origData.length > 0) { >- var status_name = meta.settings.oInit.originalData[0].capabilities[ >- row.status >- ].name; >- switch( status_name ) { >- case "New request": >- return _("New request"); >- case "Requested": >- return _("Requested"); >- case "Requested from partners": >- return _("Requested from partners"); >- case "Request reverted": >- return _("Request reverted"); >- case "Queued request": >- return _("Queued request"); >- case "Cancellation requested": >- return _("Cancellation requested"); >- case "Completed": >- return _("Completed"); >- case "Delete request": >- return _("Delete request"); >- default: >- return status_name; >- } >- } else { >- return ''; >- } >- }; >- >- // Render function for creating a row's action link >- var createActionLink = function(data, type, row) { >- return '<a class="btn btn-default btn-sm" ' + >- 'href="/cgi-bin/koha/ill/ill-requests.pl?' + >- 'method=illview&illrequest_id=' + >- row.illrequest_id + >- '">' + _("Manage request") + '</a>'; >- }; >- >- // Columns that require special treatment >- var specialCols = { >- action: { >- name: '', >- func: createActionLink >- }, >- borrowername: { >- name: _("Patron"), >- func: createPatronLink >- }, >- illrequest_id: { >- name: _("Request number"), >- func: createRequestId >- }, >- status: { >- name: _("Status"), >- func: createStatus >- }, >- biblio_id: { >- name: _("Bibliograpic Record ID") >- }, >- library: { >- name: _("Library"), >- func: createLibrary >- } >- }; >- >- // Filter partner list >- $('#partner_filter').keyup(function() { >- var needle = $('#partner_filter').val(); >- $('#partners > option').each(function() { >- var regex = new RegExp(needle, 'i'); >- if ( >- needle.length == 0 || >- $(this).is(':selected') || >- $(this).text().match(regex) >- ) { >- $(this).show(); >- } else { >- $(this).hide(); >- } >- }); >- }); >- >- // Display the modal containing request supplier metadata >- $('#ill-request-display-metadata').on('click', function(e) { >- e.preventDefault(); >- $('#dataPreview').modal({show:true}); >- }); >- >- // Get our data from the API and process it prior to passing >- // it to datatables >- var ajax = $.ajax( >- '/api/v1/illrequests?embed=metadata,patron,capabilities,library' >- ).done(function() { >- var data = JSON.parse(ajax.responseText); >- // Make a copy, we'll be removing columns next and need >- // to be able to refer to data that has been removed >- var dataCopy = $.extend(true, [], data); >- // Remove all columns we're not interested in >- removeIgnore(dataCopy); >- // Expand columns that need it and create an array >- // of all column names >- $.each(dataCopy, function(k, row) { >- expandExpand(row); >- }); >- >- // Assemble an array of column definitions for passing >- // to datatables >- var colData = []; >- Object.keys(allCols).forEach(function(thisCol) { >- // Create the base column object >- var colObj = { >- name: thisCol, >- className: thisCol >- }; >- // We may need to process the data going in this >- // column, so do it if necessary >- if ( >- specialCols.hasOwnProperty(thisCol) && >- specialCols[thisCol].hasOwnProperty('func') >- ) { >- colObj.render = specialCols[thisCol].func; >- } else { >- colObj.data = thisCol; >- } >- colData.push(colObj); >- }); >- >- // Initialise the datatable >- $('#ill-requests').DataTable($.extend(true, {}, dataTablesDefaults, { >- 'aoColumnDefs': [ // Last column shouldn't be sortable or searchable >- { >- 'aTargets': [ 'actions' ], >- 'bSortable': false, >- 'bSearchable': false >- }, >- ], >- 'aaSorting': [[ 6, 'desc' ]], // Default sort, updated descending >- 'processing': true, // Display a message when manipulating >- 'iDisplayLength': 10, // 10 results per page >- 'sPaginationType': "full_numbers", // Pagination display >- 'deferRender': true, // Improve performance on big datasets >- 'data': dataCopy, >- 'columns': colData, >- 'originalData': data // Enable render functions to access >- // our original data >- })); >- } >- ); >- >- }); >- //]]> >-</script> >+[% Asset.js("js/ill-list-table.js") %] > </head> > > <body id="illrequests" class="ill"> >@@ -597,26 +327,10 @@ > [% ELSIF query_type == 'illlist' %] > <!-- illlist --> > <h1>View ILL requests</h1> >+ [% prefilter_arr = %] > <div id="results"> > <h3>Details for all requests</h3> >- >- <table id="ill-requests"> >- <thead> >- <tr id="illview-header"> >- <th>Author</th> >- <th>Title</th> >- <th>Patron</th> >- <th>Bibliographic record ID</th> >- <th>Library</th> >- <th>Status</th> >- <th>Updated on</th> >- <th>Request number</th> >- <th class="actions"></th> >- </tr> >- </thead> >- <tbody id="illview-body"> >- </tbody> >- </table> >+ [% INCLUDE 'ill-list-table.inc' %] > </div> > [% ELSE %] > <!-- Custom Backend Action --> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/ill-requests.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/ill-requests.tt >new file mode 100644 >index 0000000000..5f739fa999 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/ill-requests.tt >@@ -0,0 +1,41 @@ >+[% USE Asset %] >+[% USE Branches %] >+[% USE Koha %] >+[% USE KohaDates %] >+ >+[% INCLUDE 'doc-head-open.inc' %] >+<title>Koha › Patrons › ILL requests for [% INCLUDE 'patron-title.inc' no_html = 1 %]</title> >+[% INCLUDE 'doc-head-close.inc' %] >+[% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") %] >+[% Asset.css("css/datatables.css") %] >+[% INCLUDE 'datatables.inc' %] >+[% Asset.js("js/ill-list-table.js") %] >+</head> >+ >+<body id="pat_ill_requests"> >+ [% INCLUDE 'header.inc' %] >+ [% INCLUDE 'patron-search.inc' %] >+ >+ <div id="breadcrumbs"> >+ <a href="/cgi-bin/koha/mainpage.pl">Home</a> >+ › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> >+ › ILL requests for [% INCLUDE 'patron-title.inc' %] >+ </div> >+ >+ <div id="doc3" class="yui-t1"> >+ >+ <div id="bd"> >+ <div id="yui-main"> >+ <div class="yui-b"> >+ <div class="yui-g"> >+ <h2>ILL requests</h2> >+ [% INCLUDE 'ill-list-table.inc' %] >+ </div> >+ </div> >+ </div> >+ <div class="yui-b"> >+ [% INCLUDE 'circ-menu.inc' %] >+ </div> >+ </div> >+ >+[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js b/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js >new file mode 100644 >index 0000000000..083eca4453 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js >@@ -0,0 +1,272 @@ >+$(document).ready(function() { >+ >+ // Illview Datatable setup >+ >+ // Get any prefilters >+ var prefilters = $('table#ill-requests').data('prefilters'); >+ >+ // Fields we don't want to display >+ var ignore = [ >+ 'accessurl', >+ 'backend', >+ 'branchcode', >+ 'completed', >+ 'capabilities', >+ 'cost', >+ 'medium', >+ 'notesopac', >+ 'notesstaff', >+ 'placed', >+ 'replied' >+ ]; >+ >+ // Fields we need to expand (flatten) >+ var expand = [ >+ 'metadata', >+ 'patron' >+ ]; >+ >+ // Expanded fields >+ // This is auto populated >+ var expanded = {}; >+ >+ // The core fields that should be displayed first >+ var core = [ >+ 'metadata_Author', >+ 'metadata_Title', >+ 'borrowername', >+ 'biblio_id', >+ 'library', >+ 'status', >+ 'updated', >+ 'illrequest_id', >+ 'action' >+ ]; >+ >+ // Remove any fields we're ignoring >+ var removeIgnore = function(dataObj) { >+ dataObj.forEach(function(thisRow) { >+ ignore.forEach(function(thisIgnore) { >+ if (thisRow.hasOwnProperty(thisIgnore)) { >+ delete thisRow[thisIgnore]; >+ } >+ }); >+ }); >+ }; >+ >+ // Expand any fields we're expanding >+ var expandExpand = function(row) { >+ expand.forEach(function(thisExpand) { >+ if (row.hasOwnProperty(thisExpand)) { >+ if (!expanded.hasOwnProperty(thisExpand)) { >+ expanded[thisExpand] = []; >+ } >+ var expandObj = row[thisExpand]; >+ Object.keys(expandObj).forEach( >+ function(thisExpandCol) { >+ var expColName = thisExpand + '_' + thisExpandCol; >+ // Keep a list of fields that have been expanded >+ // so we can create toggle links for them >+ if (expanded[thisExpand].indexOf(expColName) == -1) { >+ expanded[thisExpand].push(expColName); >+ } >+ expandObj[expColName] = >+ expandObj[thisExpandCol]; >+ delete expandObj[thisExpandCol]; >+ } >+ ); >+ $.extend(true, row, expandObj); >+ delete row[thisExpand]; >+ } >+ }); >+ }; >+ >+ // Build a de-duped list of all column names >+ var allCols = {}; >+ core.map(function(thisCore) { >+ allCols[thisCore] = 1; >+ }); >+ >+ // Strip the expand prefix if it exists, we do this for display >+ var stripPrefix = function(value) { >+ expand.forEach(function(thisExpand) { >+ var regex = new RegExp(thisExpand + '_', 'g'); >+ value = value.replace(regex, ''); >+ }); >+ return value; >+ }; >+ >+ // Our 'render' function for borrowerlink >+ var createPatronLink = function(data, type, row) { >+ return '<a title="' + _("View borrower details") + '" ' + >+ 'href="/cgi-bin/koha/members/moremember.pl?' + >+ 'borrowernumber='+row.borrowernumber+'">' + >+ row.patron_firstname + ' ' + row.patron_surname + >+ '</a>'; >+ }; >+ >+ // Our 'render' function for the library name >+ var createLibrary = function(data, type, row) { >+ return row.library.branchname; >+ }; >+ >+ // Render function for request ID >+ var createRequestId = function(data, type, row) { >+ return row.id_prefix + row.illrequest_id; >+ }; >+ >+ // Render function for request status >+ var createStatus = function(data, type, row, meta) { >+ var origData = meta.settings.oInit.originalData; >+ if (origData.length > 0) { >+ var status_name = meta.settings.oInit.originalData[0].capabilities[ >+ row.status >+ ].name; >+ switch( status_name ) { >+ case "New request": >+ return _("New request"); >+ case "Requested": >+ return _("Requested"); >+ case "Requested from partners": >+ return _("Requested from partners"); >+ case "Request reverted": >+ return _("Request reverted"); >+ case "Queued request": >+ return _("Queued request"); >+ case "Cancellation requested": >+ return _("Cancellation requested"); >+ case "Completed": >+ return _("Completed"); >+ case "Delete request": >+ return _("Delete request"); >+ default: >+ return status_name; >+ } >+ } else { >+ return ''; >+ } >+ }; >+ >+ // Render function for creating a row's action link >+ var createActionLink = function(data, type, row) { >+ return '<a class="btn btn-default btn-sm" ' + >+ 'href="/cgi-bin/koha/ill/ill-requests.pl?' + >+ 'method=illview&illrequest_id=' + >+ row.illrequest_id + >+ '">' + _("Manage request") + '</a>'; >+ }; >+ >+ // Columns that require special treatment >+ var specialCols = { >+ action: { >+ name: '', >+ func: createActionLink >+ }, >+ borrowername: { >+ name: _("Patron"), >+ func: createPatronLink >+ }, >+ illrequest_id: { >+ name: _("Request number"), >+ func: createRequestId >+ }, >+ status: { >+ name: _("Status"), >+ func: createStatus >+ }, >+ biblio_id: { >+ name: _("Biblio ID") >+ }, >+ library: { >+ name: _("Library"), >+ func: createLibrary >+ } >+ }; >+ >+ // Toggle request attributes in Illview >+ $('#toggle_requestattributes').on('click', function(e) { >+ e.preventDefault(); >+ $('#requestattributes').toggleClass('content_hidden'); >+ }); >+ >+ // Filter partner list >+ $('#partner_filter').keyup(function() { >+ var needle = $('#partner_filter').val(); >+ $('#partners > option').each(function() { >+ var regex = new RegExp(needle, 'i'); >+ if ( >+ needle.length == 0 || >+ $(this).is(':selected') || >+ $(this).text().match(regex) >+ ) { >+ $(this).show(); >+ } else { >+ $(this).hide(); >+ } >+ }); >+ }); >+ >+ // Get our data from the API and process it prior to passing >+ // it to datatables >+ var filterParam = prefilters ? '&' + prefilters : ''; >+ var ajax = $.ajax( >+ '/api/v1/illrequests?embed=metadata,patron,capabilities,library' >+ + filterParam >+ ).done(function() { >+ var data = JSON.parse(ajax.responseText); >+ // Make a copy, we'll be removing columns next and need >+ // to be able to refer to data that has been removed >+ var dataCopy = $.extend(true, [], data); >+ // Remove all columns we're not interested in >+ removeIgnore(dataCopy); >+ // Expand columns that need it and create an array >+ // of all column names >+ $.each(dataCopy, function(k, row) { >+ expandExpand(row); >+ }); >+ >+ // Assemble an array of column definitions for passing >+ // to datatables >+ var colData = []; >+ Object.keys(allCols).forEach(function(thisCol) { >+ // Create the base column object >+ var colObj = { >+ name: thisCol, >+ className: thisCol >+ }; >+ // We may need to process the data going in this >+ // column, so do it if necessary >+ if ( >+ specialCols.hasOwnProperty(thisCol) && >+ specialCols[thisCol].hasOwnProperty('func') >+ ) { >+ colObj.render = specialCols[thisCol].func; >+ } else { >+ colObj.data = thisCol; >+ } >+ colData.push(colObj); >+ }); >+ >+ // Initialise the datatable >+ $('#ill-requests').DataTable($.extend(true, {}, dataTablesDefaults, { >+ 'aoColumnDefs': [ // Last column shouldn't be sortable or searchable >+ { >+ 'aTargets': [ 'actions' ], >+ 'bSortable': false, >+ 'bSearchable': false >+ }, >+ ], >+ 'aaSorting': [[ 6, 'desc' ]], // Default sort, updated descending >+ 'processing': true, // Display a message when manipulating >+ 'iDisplayLength': 10, // 10 results per page >+ 'sPaginationType': "full_numbers", // Pagination display >+ 'deferRender': true, // Improve performance on big datasets >+ 'data': dataCopy, >+ 'columns': colData, >+ 'originalData': data // Enable render functions to access >+ // our original data >+ })); >+ } >+ ); >+ >+}); >diff --git a/members/ill-requests.pl b/members/ill-requests.pl >new file mode 100755 >index 0000000000..461437745b >--- /dev/null >+++ b/members/ill-requests.pl >@@ -0,0 +1,54 @@ >+#!/usr/bin/perl >+ >+# This file is part of Koha. >+# >+# Copyright 2018 PTFS Europe >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use CGI qw ( -utf8 ); >+use C4::Auth; >+use C4::Output; >+use C4::Members; >+use C4::Members::Attributes qw(GetBorrowerAttributes); >+use Koha::Patrons; >+ >+my $input = new CGI; >+ >+my ( $template, $loggedinuser, $cookie ) = get_template_and_user( >+ { template_name => "members/ill-requests.tt", >+ query => $input, >+ type => "intranet", >+ authnotrequired => 0, >+ flagsrequired => { borrowers => 'edit_borrowers' }, >+ debug => 1, >+ } >+); >+ >+my $borrowernumber = $input->param('borrowernumber'); >+ >+my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; >+my $patron = Koha::Patrons->find( $borrowernumber ); >+output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); >+ >+my $category = $patron->category; >+$template->param( >+ prefilters => "borrowernumber=$borrowernumber", >+ patron => $patron, >+ illview => 1, >+); >+ >+output_html_with_http_headers $input, $cookie, $template->output; >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18589
:
74809
|
79692
|
82177
|
82513
|
84197
|
84199
|
84204
|
84792
|
84796
|
86432
|
86433
|
86456
|
86465
|
86504
|
86506
|
86507
|
86714
|
86715
|
86716
|
86717
|
86718
|
86719
|
86720
|
86721
|
86722
|
86735
|
86736
|
86737