Bugzilla – Attachment 69881 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 awaiting pickup report
Bug-19532-Recalls-awaiting-pickup-report.patch (text/plain), 15.27 KB, created by
Aleisha Amohia
on 2017-12-19 01:44:52 UTC
(
hide
)
Description:
Bug 19532: Recalls awaiting pickup report
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2017-12-19 01:44:52 UTC
Size:
15.27 KB
patch
obsolete
>From 54b92e3049376a94006132306aa90063ff7a6f29 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Sun, 19 Nov 2017 22:04:32 +0000 >Subject: [PATCH] Bug 19532: Recalls awaiting pickup report > >this patch adds reports for all recalls awaiting pickup, and recalls >that have been waiting more than X days. a syspref, >RecallsMaxPickUpDelay, is added to give a general max shelf time for >recalls >--- > circ/recalls_waiting.pl | 71 +++++++++ > ...g_19532_-_add_RecallsMaxPickUpDelay_syspref.sql | 1 + > installer/data/mysql/sysprefs.sql | 1 + > .../en/modules/admin/preferences/circulation.pref | 5 + > .../prog/en/modules/circ/recalls_waiting.tt | 163 +++++++++++++++++++++ > 5 files changed, 241 insertions(+) > create mode 100755 circ/recalls_waiting.pl > create mode 100644 installer/data/mysql/atomicupdate/bug_19532_-_add_RecallsMaxPickUpDelay_syspref.sql > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_waiting.tt > >diff --git a/circ/recalls_waiting.pl b/circ/recalls_waiting.pl >new file mode 100755 >index 0000000..1eafdd8 >--- /dev/null >+++ b/circ/recalls_waiting.pl >@@ -0,0 +1,71 @@ >+#!/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; >+use Koha::Patrons; >+ >+my $query = new CGI; >+my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( >+ { >+ template_name => "circ/recalls_waiting.tt", >+ query => $query, >+ type => "intranet", >+ authnotrequired => 0, >+ flagsrequired => { circulate => "circulate_remaining_permissions" }, >+ debug => 1, >+ } >+); >+ >+my $op = $query->param('op') || 'list'; >+ >+if ($op eq 'expire_recall') { >+ my $recall_id = $query->param('recall_id'); >+ Koha::Recalls->find($recall_id)->update({ expirationdate => dt_from_string(), status => 'E' }); >+ $op = 'list'; >+} >+ >+if ($op eq 'list') { >+ my @recalls = Koha::Recalls->search({ status => 'W' }); >+ my $borrower = Koha::Patrons->find($loggedinuser); >+ my @over; >+ my $maxdelay = C4::Context->preference('RecallsMaxPickUpDelay') || 7; >+ my $today = dt_from_string(); >+ foreach my $r (@recalls){ >+ my $lastwaitingday = dt_from_string($r->waitingdate)->add( days => $maxdelay ); >+ if ( $today > $lastwaitingday ){ >+ push @over, $r; >+ } >+ } >+ $template->param( >+ recalls => \@recalls, >+ over => \@over, >+ ); >+} >+ >+# 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/installer/data/mysql/atomicupdate/bug_19532_-_add_RecallsMaxPickUpDelay_syspref.sql b/installer/data/mysql/atomicupdate/bug_19532_-_add_RecallsMaxPickUpDelay_syspref.sql >new file mode 100644 >index 0000000..0cd21dd >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_19532_-_add_RecallsMaxPickUpDelay_syspref.sql >@@ -0,0 +1 @@ >+INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ('RecallsMaxPickUpDelay','7','','Define the maximum time a recall can be waiting for pickup','Integer'); >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 23cefb8..2853708 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -444,6 +444,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('QueryWeightFields','1',NULL,'If ON, enables field weighting','YesNo'), > ('QuoteOfTheDay','0',NULL,'Enable or disable display of Quote of the Day on the OPAC home page','YesNo'), > ('RandomizeHoldsQueueWeight','0',NULL,'if ON, the holds queue in circulation will be randomized, either based on all location codes, or by the location codes specified in StaticHoldsQueueWeight','YesNo'), >+('RecallsMaxPickUpDelay','7','','Define the maximum time a recall can be waiting for pickup','Integer'), > ('RecordLocalUseOnReturn','0',NULL,'If ON, statistically record returns of unissued items as local use, instead of return','YesNo'), > ('RefundLostOnReturnControl','CheckinLibrary','CheckinLibrary|ItemHomeBranch|ItemHoldingBranch','If a lost item is returned, choose which branch to pick rules for refunding.','Choice'), > ('RenewalLog','0','','If ON, log information about renewals','YesNo'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >index 6589e3e..1c3b686 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >@@ -153,6 +153,11 @@ Circulation: > > Checkout Policy: > - >+ - Mark a recall as problematic if it has been waiting to be picked up for >+ - pref: RecallsMaxPickUpDelay >+ - class: integer >+ - days. >+ - > - pref: AllowTooManyOverride > choices: > yes: Allow >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_waiting.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_waiting.tt >new file mode 100644 >index 0000000..effb431 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_waiting.tt >@@ -0,0 +1,163 @@ >+[% USE Koha %] >+[% USE KohaDates %] >+[% INCLUDE 'doc-head-open.inc' %] >+<title>Koha › Circulation › Recalls awaiting pickup</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' %] >+<script type="text/javascript"> >+ $(document).ready(function() { >+ $('#results').tabs(); >+ >+ $("#recallswaiting-table, #recallsover-table").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "autoWidth": false, >+ "aoColumnDefs": [ >+ { "aTargets": [ 'nosort' ], "bSortable": false, "bSearchable": false }, >+ ], >+ "sPaginationType": "four_button" >+ })); >+ }); >+</script> >+</head> >+<body id="circ_recalls_awaiting_pickup" 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_waiting.pl">Recalls awaiting pickup</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 awaiting pickup</h1> >+ >+ [% IF recalls.size > 0 %] >+ >+ <div id="results" class="toptabs"> >+ >+ <ul> >+ <li><a href="#recallswaiting">Recalls waiting: [% recalls.count %]</a></li> >+ <li><a href="#recallsover">Recalls waiting over [% Koha.Preference('RecallsMaxPickUpDelay') %] days: [% over.count %]</a></li> >+ </ul> >+ >+ <div id="recallswaiting"> >+ [% IF ( recalls.size > 0 ) %] >+ <table id="recallswaiting-table"> >+ <thead><tr> >+ <th class="title-string">Available since</th> >+ <th class="anti-the">Title</th> >+ <th>Requested by</th> >+ <th>Pickup location</th> >+ <th class="nosort">Expire</th> >+ </tr></thead> >+ <tbody> >+ [% FOREACH recall IN recalls %]<tr> >+ <td>[% recall.waitingdate | $KohaDates %]</td> >+ <td> >+ <a 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 %] >+ <br><i>Barcode: [% recall.item.barcode %]</i> >+ </td> >+ <td> >+ <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% recall.borrowernumber %]">[% recall.borrower.firstname %] [% recall.borrower.surname %]</a> >+ [% IF ( recall.borrower.phone ) %]<br />[% recall.borrower.phone %][% END %] >+ [% IF ( recall.borrower.email ) %]<br /><a href="mailto:[% recall.borrower.email %]?subject=Recall waiting: [% recall.biblio.title %]">[% recall.borrower.email %]</a>[% END %] >+ </td> >+ <td>[% recall.branch.branchname %]</td> >+ <td> >+ <form action="/cgi-bin/koha/circ/recalls_waiting.pl" method="post"> >+ <input type="hidden" name="recall_id" value="[% recall.recall_id %]"> >+ <input type="hidden" name="op" value="expire_recall"> >+ <fieldset class="action"> >+ <button type="submit" class="btn btn-default btn-xs" id="expire_recall"><i class="fa fa-times"></i> Expire</button> >+ </fieldset> >+ </form> >+ </td> >+ </tr>[% END %] >+ </tbody> >+ </table> >+ [% ELSE %] >+ <div class="dialog message">No recalls waiting.</div> >+ [% END %] >+ </div> >+ >+ <div id="recallsover"> >+ [% IF ( over.size > 0 ) %] >+ [% IF ( Koha.Preference('RecallsMaxPickUpDelay') ) %]<p>Recalls listed here have been awaiting pickup for more than [% Koha.Preference('RecallsMaxPickUpDelay') %] days.</p>[% END %] >+ <table id="recallsover-table"> >+ <thead><tr> >+ <th class="title-string">Available since</th> >+ <th class="anti-the">Title</th> >+ <th>Requested by</th> >+ <th>Pickup location</th> >+ <th class="nosort">Expire</th> >+ </tr></thead> >+ <tbody> >+ [% FOREACH recall IN over %]<tr> >+ <td>[% recall.waitingdate | $KohaDates %]</td> >+ <td> >+ <a 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 %] >+ <br><i>Barcode: [% recall.item.barcode %]</i> >+ </td> >+ <td> >+ <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% recall.borrowernumber %]">[% recall.borrower.firstname %] [% recall.borrower.surname %]</a> >+ [% IF ( recall.borrower.phone ) %]<br />[% recall.borrower.phone %][% END %] >+ [% IF ( recall.borrower.email ) %]<br /><a href="mailto:[% recall.borrower.email %]?subject=Recall waiting: [% recall.biblio.title %]">[% recall.borrower.email %]</a>[% END %] >+ </td> >+ <td>[% recall.branch.branchname %]</td> >+ <td> >+ <form action="/cgi-bin/koha/circ/recalls_waiting.pl" method="post"> >+ <input type="hidden" name="recall_id" value="[% recall.recall_id %]"> >+ <input type="hidden" name="op" value="expire_recall"> >+ <fieldset class="action"> >+ <button type="submit" class="btn btn-default btn-xs" id="expire_recall"><i class="fa fa-times"></i> Expire</button> >+ </fieldset> >+ </form> >+ </td> >+ </tr>[% END %] >+ </tbody> >+ </table> >+ [% ELSE %] >+ <div class="dialog message">No recalls waiting.</div> >+ [% END %] >+ </div> >+ >+ </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' %] >-- >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