Bugzilla – Attachment 69170 Details for
Bug 19532
Recalls for Koha
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19532: Recalls queue
Bug-19532-Recalls-queue.patch (text/plain), 15.29 KB, created by
Aleisha Amohia
on 2017-11-15 22:27:20 UTC
(
hide
)
Description:
Bug 19532: Recalls queue
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2017-11-15 22:27:20 UTC
Size:
15.29 KB
patch
obsolete
>From 99c483bd9d6a8bf4fed0b61f7e408857bd1c00fe Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Wed, 15 Nov 2017 22:10:37 +0000 >Subject: [PATCH] Bug 19532: Recalls queue > >This patch adds a recalls queue page to the circulation reports > >You can see all recalls made in the system, who requested them, their >status and other relevant info. you can cancel individual or multiple >recalls. >--- > Koha/Recall.pm | 14 ++++ > circ/recalls_queue.pl | 61 ++++++++++++++ > .../intranet-tmpl/prog/en/includes/circ-nav.inc | 3 + > .../prog/en/includes/recalls-reports.inc | 92 ++++++++++++++++++++++ > .../intranet-tmpl/prog/en/includes/recalls.inc | 4 +- > .../prog/en/modules/circ/circulation-home.tt | 3 + > .../prog/en/modules/circ/recalls_queue.tt | 63 +++++++++++++++ > .../prog/en/modules/members/recallshistory.tt | 13 --- > koha-tmpl/intranet-tmpl/prog/js/recalls.js | 23 ++++++ > 9 files changed, 261 insertions(+), 15 deletions(-) > create mode 100755 circ/recalls_queue.pl > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/recalls-reports.inc > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_queue.tt > >diff --git a/Koha/Recall.pm b/Koha/Recall.pm >index dccb069..3df902d 100644 >--- a/Koha/Recall.pm >+++ b/Koha/Recall.pm >@@ -70,6 +70,20 @@ sub item { > return $self->{_item}; > } > >+=head3 borrower >+ >+Returns the related Koha::Patron object for this Hold >+ >+=cut >+ >+sub borrower { >+ >+ my ($self) = @_; >+ >+ $self->{_borrower} ||= Koha::Patrons->find( $self->borrowernumber() ); >+ >+ return $self->{_borrower}; >+} > =head3 branch > > Returns the related Koha::Library object for this Hold >diff --git a/circ/recalls_queue.pl b/circ/recalls_queue.pl >new file mode 100755 >index 0000000..06c7c66 >--- /dev/null >+++ b/circ/recalls_queue.pl >@@ -0,0 +1,61 @@ >+#!/usr/bin/perl >+ >+# Copyright 2017 Aleisha Amohia <aleisha@catalyst.net.nz> >+# >+# This file is part of Koha. >+# >+# 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 Koha::Recalls; >+use Koha::BiblioFrameworks; >+use Koha::DateUtils; >+ >+my $query = new CGI; >+my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( >+ { >+ template_name => "circ/recalls_queue.tt", >+ query => $query, >+ type => "intranet", >+ authnotrequired => 0, >+ flagsrequired => { circulate => "circulate_remaining_permissions" }, >+ debug => 1, >+ } >+); >+ >+my $op = $query->param('op') || 'list'; >+my @recall_ids = $query->multi_param('recall_ids'); >+warn($op); >+ >+if ($op eq 'cancel_multiple_recalls') { >+ foreach my $id (@recall_ids) { >+ warn($id); >+ Koha::Recalls->find($id)->update({ cancellationdate => dt_from_string(), status => 'C' }); >+ $op = 'list' >+ } >+} >+ >+if ($op eq 'list') { >+ my $recalls = Koha::Recalls->search({}); >+ $template->param( recalls => $recalls ); >+} >+ >+# Checking if there is a Fast Cataloging Framework >+$template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' ); >+ >+# writing the template >+output_html_with_http_headers $query, $cookie, $template->output; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc >index 844926c..9835d13 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc >@@ -49,6 +49,9 @@ > [% IF Koha.Preference('OnSiteCheckouts') %] > <li><a href="/cgi-bin/koha/circ/on-site_checkouts.pl">Pending on-site checkouts</a></li> > [% END %] >+ <li><a href="/cgi-bin/koha/circ/recalls_queue.pl">Recalls queue</a></li> >+ <li><a href="/cgi-bin/koha/circ/recalls_overdue.pl">Overdue recalls</a></li> >+ <li><a href="/cgi-bin/koha/circ/recalls_waiting.pl">Recalls awaiting pickup</a></li> > </ul> > > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/recalls-reports.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/recalls-reports.inc >new file mode 100644 >index 0000000..1685b7b >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/recalls-reports.inc >@@ -0,0 +1,92 @@ >+<div id="recalls"> >+[% IF recalls.count %] >+ <table id="recalls-table"> >+ <thead> >+ <tr> >+ <th class="nosort"> </th> >+ <th class="recall-borrower anti-the">Borrower</th> >+ <th class="recall-title anti-the">Title</th> >+ <th class="recall-date psort title-string">Placed on</th> >+ <th class="recall-expiry title-string">Expires on</th> >+ <th class="recall-branch">Pickup location</th> >+ <th class="recall-status">Status</th> >+ <th class="recall-cancel nosort">Cancel</th> >+ </tr> >+ </thead> >+ >+ <tbody> >+ [% FOREACH recall IN recalls %] >+ <tr> >+ <td> >+ [% IF recall.is_requested || recall.is_waiting || recall.is_overdue %] >+ <input type="checkbox" value="[% recall.recall_id %]" name="recall_ids"> >+ [% ELSE %] >+ >+ [% END %] >+ </td> >+ <td class="recall-borrower"> >+ <a class="recall-borrower" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% recall.borrowernumber %]"> >+ [% recall.borrower.firstname %] [% recall.borrower.surname %] ([% recall.borrowernumber %]) >+ </a> >+ </td> >+ <td class="recall-title"> >+ <a class="recall-title" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% recall.biblionumber %]"> >+ [% recall.biblio.title %] >+ [% FOREACH s IN recall.biblio.subtitles %] >+ [% s %] >+ [% END %] >+ [% recall.item.enumchron %] >+ </a> >+ [% recall.biblio.author %] >+ </td> >+ >+ <td class="recall-date"> >+ [% recall.recalldate | $KohaDates %] >+ </td> >+ >+ <td class="recall-expiry"> >+ [% IF ( recall.is_waiting ) %] >+ [% IF ( recall.expirationdate ) %] >+ [% recall.expirationdate | $KohaDates %] >+ [% ELSE %] >+ Never expires >+ [% END %] >+ [% ELSIF ( recall.has_expired && recall.expirationdate ) %] >+ [% recall.expirationdate | $KohaDates %] >+ [% ELSE %] >+ - >+ [% END %] >+ </td> >+ >+ <td class="recall-branch"> >+ [% recall.branch.branchname %] >+ </td> >+ >+ <td class="recall-status"> >+ [% IF ( recall.is_requested ) %] >+ Requested >+ [% ELSIF ( recall.is_waiting ) %] >+ Ready for pickup >+ [% ELSIF ( recall.has_expired ) %] >+ Expired >+ [% ELSIF ( recall.is_cancelled ) %] >+ Cancelled >+ [% ELSIF ( recall.is_overdue ) %] >+ Overdue to be returned >+ [% END %] >+ </td> >+ >+ <td class="recall-cancel"> >+ [% IF ( !recall.cancellationdate && ( recall.is_requested || recall.is_overdue ) ) %] >+ <a class="btn btn-xs btn-default" id="cancel_recall" data-id="[% recall.recall_id %]"><i class="fa fa-times"></i> Cancel</a> >+ [% END %] >+ </td> >+ >+ </tr> >+ [% END %] >+ </tbody> >+ </table> >+ [% ELSE %] >+ No recalls have been made. >+ [% END %] >+</div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/recalls.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/recalls.inc >index 2608e75..b17288b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/recalls.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/recalls.inc >@@ -1,6 +1,6 @@ > <div id="recalls"> > [% IF recalls.count %] >- <table id="recalls-table" class="table table-bordered table-striped"> >+ <table id="recalls-table"> > <thead> > <tr> > <th class="recall-title anti-the">Title</th> >@@ -64,7 +64,7 @@ > > <td class="recall-cancel"> > [% IF ( !recall.cancellationdate && ( recall.is_requested || recall.is_overdue ) ) %] >- <a class="btn btn-sm btn-danger" id="cancel_recall" data-id="[% recall.recall_id %]"><i class="fa fa-times"></i> Cancel</a> >+ <a class="btn btn-xs btn-default" id="cancel_recall" data-id="[% recall.recall_id %]"><i class="fa fa-times"></i> Cancel</a> > [% END %] > </td> > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt >index fa49df9..c212257 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt >@@ -55,6 +55,9 @@ > [% IF Koha.Preference('OnSiteCheckouts') %] > <li><a href="/cgi-bin/koha/circ/on-site_checkouts.pl">Pending on-site checkouts</a></li> > [% END %] >+ <li><a href="/cgi-bin/koha/circ/recalls_queue.pl">Recalls queue</a></li> >+ <li><a href="/cgi-bin/koha/circ/recalls_overdue.pl">Overdue recalls</a></li> >+ <li><a href="/cgi-bin/koha/circ/recalls_waiting.pl">Recalls awaiting pickup</a></li> > </ul> > > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_queue.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_queue.tt >new file mode 100644 >index 0000000..274f1d9 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_queue.tt >@@ -0,0 +1,63 @@ >+[% USE Koha %] >+[% USE KohaDates %] >+[% INCLUDE 'doc-head-open.inc' %] >+<title>Koha › Circulation › Recalls queue</title> >+[% INCLUDE 'doc-head-close.inc' %] >+<style type="text/css"> p { margin-top: 0; }</style> >+<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> >+<script type="text/javascript" src="[% interface %]/[% theme %]/js/recalls.js"></script> >+[% INCLUDE 'datatables.inc' %] >+[% INCLUDE 'columns_settings.inc' %] >+</head> >+<body id="circ_view_holdsqueue" class="circ"> >+[% INCLUDE 'header.inc' %] >+[% INCLUDE 'cat-search.inc' %] >+ >+<div id="breadcrumbs"> >+ <a href="/cgi-bin/koha/mainpage.pl">Home</a> >+ › <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> >+ › <a href="/cgi-bin/koha/circ/recalls_queue.pl">Recalls queue</a> >+</div> >+ >+[% IF Koha.Preference('CircSidebar') %]<div id="doc3" class="yui-t2">[% ELSE %]<div id="doc2" class="yui-t7">[% END %] >+ >+<div id="bd"> >+ <div id="yui-main"> >+ [% IF Koha.Preference('CircSidebar') %]<div class="yui-b">[% END %] >+ <div class="yui-g"> >+ >+ <h1>Recalls queue</h1> >+ >+ [% IF recalls.count %] >+ >+ <form method="post" action="/cgi-bin/koha/circ/recalls_queue.pl"> >+ <input type="hidden" name="op" value="cancel_multiple_recalls"> >+ >+ <input type="checkbox" id="select_all"> <span id="select_all_text">Select all</span> >+ >+ [% INCLUDE 'recalls-reports.inc' %] >+ >+ <fieldset class="action"> >+ <button type="submit" id="cancel_selected" class="btn btn-default btn-sm">Cancel selected recalls</button> >+ </fieldset> >+ </form> >+ >+ [% ELSE %] >+ >+ <div class="dialog message">No recalls have been made.</div> >+ >+ [% END %] >+ >+ </div> >+ </div> >+ >+ </div> >+ >+ [% IF Koha.Preference('CircSidebar') %] >+ <div class="yui-b noprint"> >+ [% INCLUDE 'circ-nav.inc' %] >+ </div> >+ [% END %] >+</div> >+ >+[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/recallshistory.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/recallshistory.tt >index 7d21bbe..a7ee266 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/recallshistory.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/recallshistory.tt >@@ -6,19 +6,6 @@ > <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> > [% INCLUDE 'datatables.inc' %] > <script type="text/javascript" src="[% interface %]/[% theme %]/js/recalls.js"></script> >-<script type="text/javascript" id="js"> >-//<![CDATA[ >-$(document).ready(function() { >- $("#recalls-table").dataTable($.extend(true, {}, dataTablesDefaults, { >- "aoColumnDefs": [ >- { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, >- ], >- "aaSorting": [[ 1, "asc" ]], >- "sPaginationType": "full_numbers" >- })); >- }); >-//]]> >-</script> > </head> > <body id="recalls_history" class="pat"> > [% INCLUDE 'header.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/recalls.js b/koha-tmpl/intranet-tmpl/prog/js/recalls.js >index 1d29668..1174286 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/recalls.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/recalls.js >@@ -26,4 +26,27 @@ $(document).ready(function() { > } > }); > >+ $("#recalls-table").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "aoColumnDefs": [ >+ { "aTargets": [ 'nosort' ], "bSortable": false, "bSearchable": false }, >+ ], >+ "aaSorting": [[ 1, "asc" ]], >+ "sPaginationType": "full_numbers" >+ })); >+ >+ $("#cancel_selected").click(function(e){ >+ if ($("input[name='recall_ids']:checked").length > 0){ >+ return confirmDelete(_("Are you sure you want to remove the selected recall(s)?")); >+ } else { >+ alert(_("Please make a selection.")); >+ } >+ }); >+ >+ $("#select_all").click(function(){ >+ if ($("#select_all").prop("checked")){ >+ $("input[name='recall_ids']").prop("checked", true); >+ } else { >+ $("input[name='recall_ids']").prop("checked", false); >+ } >+ }); > }); >-- >2.1.4
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 19532
:
68569
|
68570
|
68571
|
68572
|
68642
|
68643
|
68644
|
68645
|
68653
|
69100
|
69102
|
69147
|
69148
|
69149
|
69170
|
69172
|
69221
|
69222
|
69223
|
69322
|
69353
|
69354
|
69405
|
69409
|
69410
|
69411
|
69841
|
69872
|
69873
|
69874
|
69875
|
69876
|
69877
|
69878
|
69879
|
69880
|
69881
|
69882
|
69883
|
69884
|
69885
|
69886
|
69887
|
69888
|
69889
|
69890
|
69986
|
70093
|
71409
|
71574
|
71575
|
71576
|
71577
|
71578
|
71579
|
71580
|
71581
|
71582
|
71583
|
71584
|
71585
|
71586
|
71587
|
71588
|
71589
|
71590
|
71591
|
71592
|
72244
|
72311
|
72312
|
72313
|
72314
|
72315
|
72316
|
72317
|
72318
|
72319
|
72320
|
72321
|
72322
|
72323
|
72324
|
72325
|
72326
|
72327
|
72328
|
72329
|
72330
|
72331
|
72332
|
72333
|
72334
|
72335
|
72336
|
72337
|
72338
|
72527