Bugzilla – Attachment 104398 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 on intranet
Bug-19532-Recalls-on-intranet.patch (text/plain), 39.21 KB, created by
Aleisha Amohia
on 2020-05-06 06:46:39 UTC
(
hide
)
Description:
Bug 19532: Recalls on intranet
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2020-05-06 06:46:39 UTC
Size:
39.21 KB
patch
obsolete
>From 27a0a642ab168e7840162070e6e3ae0f42f3eb9f Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Thu, 23 Apr 2020 15:35:33 +0000 >Subject: [PATCH] Bug 19532: Recalls on intranet > >--- > circ/circulation.pl | 2 + > .../intranet-tmpl/prog/en/includes/circ-menu.inc | 3 + > .../intranet-tmpl/prog/en/includes/circ-nav.inc | 8 ++ > .../intranet-tmpl/prog/en/includes/recalls.inc | 114 ++++++++++++++++ > .../prog/en/modules/circ/circulation-home.tt | 12 ++ > .../prog/en/modules/circ/circulation.tt | 15 ++ > .../prog/en/modules/members/recallshistory.tt | 45 ++++++ > .../prog/en/modules/recalls/recalls_queue.tt | 68 ++++++++++ > .../prog/en/modules/recalls/recalls_to_pull.tt | 151 +++++++++++++++++++++ > koha-tmpl/intranet-tmpl/prog/js/recalls.js | 136 +++++++++++++++++++ > members/recallshistory.pl | 46 +++++++ > recalls/recalls_queue.pl | 57 ++++++++ > recalls/recalls_to_pull.pl | 95 +++++++++++++ > tools/letter.pl | 2 +- > 14 files changed, 753 insertions(+), 1 deletion(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/recalls.inc > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/members/recallshistory.tt > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_queue.tt > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_to_pull.tt > create mode 100644 koha-tmpl/intranet-tmpl/prog/js/recalls.js > create mode 100755 members/recallshistory.pl > create mode 100755 recalls/recalls_queue.pl > create mode 100755 recalls/recalls_to_pull.pl > >diff --git a/circ/circulation.pl b/circ/circulation.pl >index 81c3bcdf561..993a145331b 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -453,9 +453,11 @@ if (@$barcodes) { > if ($patron) { > my $holds = Koha::Holds->search( { borrowernumber => $borrowernumber } ); # FIXME must be Koha::Patron->holds > my $waiting_holds = $holds->waiting; >+ my $recalls = Koha::Recalls->search({ borrowernumber => $borrowernumber, old => undef }); > $template->param( > holds_count => $holds->count(), > WaitingHolds => $waiting_holds, >+ recalls => $recalls, > ); > } > >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 d665e811045..8f5d996c936 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >@@ -139,6 +139,9 @@ > [% IF Koha.Preference('ILLModule') && CAN_user_ill %] > [% IF illview %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/ill-requests.pl?borrowernumber=[% patron.borrowernumber | uri %]">ILL requests history</a></li> > [% END %] >+ [% IF Koha.Preference('UseRecalls') && CAN_user_recalls %] >+ [% IF recallsview %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/recallshistory.pl?borrowernumber=[% patron.borrowernumber | uri %]">Recalls history</a></li> >+ [% END %] > </ul></div> > > <!-- Modal --> >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 979871a0b99..535ba7be900 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc >@@ -39,6 +39,14 @@ > [% IF Koha.Preference('OnSiteCheckouts') %] > <li><a href="/cgi-bin/koha/circ/on-site_checkouts.pl">Pending on-site checkouts</a></li> > [% END %] >+ >+ [% IF Koha.Preference('UseRecalls') and CAN_user_recalls %] >+ <li><a href="/cgi-bin/koha/recalls/recalls_queue.pl" title="All active recalls">Recalls queue</a></li> >+ <li><a href="/cgi-bin/koha/recalls/recalls_to_pull.pl" title="Recalls that could be filled but have not been set waiting">Recalls to pull</a></li> >+ <li><a href="/cgi-bin/koha/recalls/recalls_overdue.pl" title="Recalled items that are overdue to be returned">Overdue recalls</a></li> >+ <li><a href="/cgi-bin/koha/recalls/recalls_waiting.pl" title="Recalled items awaiting pickup">Recalls awaiting pickup</a></li> >+ <li><a href="/cgi-bin/koha/recalls/recalls_old_queue.pl" title="Inactive recalls">Old recalls</a></li> >+ [% END %] > </ul> > > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/recalls.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/recalls.inc >new file mode 100644 >index 00000000000..1556e246541 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/recalls.inc >@@ -0,0 +1,114 @@ >+<div id="recalls"> >+[% IF recalls.count %] >+ <table id="recalls-table"> >+ <thead> >+ <tr> >+ [% IF checkboxes %]<th class="recall-checkbox nosort"> </th>[% END %] >+ <th class="recall-title anti-the">Title</th> >+ <th class="recall-date psort">Placed on</th> >+ <th class="recall-expiry">Expires on</th> >+ <th class="recall-branch">Pickup location</th> >+ <th class="recall-status">Status</th> >+ <th class="recall-duedate">Due date</th> >+ [% UNLESS viewing_old %]<th class="recall-actions nosort"> </th>[% END %] >+ </tr> >+ </thead> >+ >+ <tbody> >+ [% FOREACH recall IN recalls %] >+ [% IF recall.old %]<tr class="old">[% ELSE %]<tr>[% END %] >+ [% IF checkboxes %] >+ <td class="recall-checkbox"> >+ [% IF recall.old %] >+ >+ [% ELSE %] >+ <input type="checkbox" value="[% recall.recall_id %]" name="recall_ids"> >+ [% END %] >+ </td> >+ [% END %] >+ <td class="recall-title"> >+ <b><a class="recall-title" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% recall.biblionumber %]"> >+ [% recall.biblio.title %] >+ [% FOREACH s IN recall.biblio.subtitle %] >+ [% s %] >+ [% END %] >+ </a></b> >+ [% IF recall.item %][% recall.item.barcode %][% END %] >+ [% recall.biblio.author %] >+ </td> >+ >+ <td class="recall-date"> >+ [% recall.recalldate | $KohaDates %] >+ </td> >+ >+ <td class="recall-expiry"> >+ [% IF ( recall.expirationdate ) %] >+ [% recall.expirationdate | $KohaDates %] >+ [% ELSIF ( !recall.old ) %] >+ Never expires >+ [% ELSE %] >+ - >+ [% END %] >+ </td> >+ >+ <td class="recall-branch"> >+ [% recall.library.branchname %] >+ </td> >+ >+ <td class="recall-status"> >+ [% IF ( recall.in_transit ) %] >+ In transit to [% recall.library.branchname %] >+ [% ELSIF ( recall.waiting ) %] >+ Ready for pickup >+ [% ELSIF ( recall.expired ) %] >+ Expired on [% recall.expirationdate | $KohaDates %] >+ [% ELSIF ( recall.cancelled ) %] >+ Cancelled on [% recall.cancellationdate | $KohaDates %] >+ [% ELSIF ( recall.overdue ) %] >+ Overdue to be returned >+ [% ELSIF ( recall.finished ) %] >+ Fulfilled >+ [% ELSE %] >+ Requested >+ [% END %] >+ </td> >+ >+ <td class="recall-duedate"> >+ [% IF recall.requested %] >+ Due to be returned by [% recall.checkout.date_due | $KohaDates %] >+ [% ELSIF recall.waiting and RECALL.expirationdate %] >+ Pick up by [% RECALL.expirationdate | $KohaDates %] >+ [% ELSE %] >+ - >+ [% END %] >+ </td> >+ >+ [% UNLESS viewing_old %] >+ <td class="recall-cancel actions"> >+ <div class="btn-group"> >+ <a class="btn btn-sm dropdown-toggle" data-toggle="dropdown" href="#"> Actions <span class="caret"></span></a> >+ <ul class="dropdown-menu"> >+ [% IF ( recall.requested or recall.overdue ) %] >+ <li><a class="cancel_recall" data-id="[% recall.recall_id %]" data-action="cancel" data-parent="one"><i class="fa fa-times"></i> Cancel</a></li> >+ <li><a class="checkin_recall" data-id="[% recall.recall_id %]" data-action="checkin" data-parent="one"><i class="fa fa-download"></i> Check in and set waiting</a></li> >+ [% ELSIF ( recall.waiting ) %] >+ <li><a class="revert_recall" data-id="[% recall.recall_id %]" data-action="revert" data-parent="one"><i class="fa fa-undo"></i> Revert waiting</a></li> >+ <li><a class="expire_recall" data-id="[% recall.recall_id %]" data-action="expire" data-parent="one"><i class="fa fa-times"></i> Expire</a></li> >+ [% END %] >+ </ul> >+ </div> >+ </td> >+ [% END %] >+ >+ </tr> >+ [% END %] >+ </tbody> >+ </table> >+ [% ELSE %] >+ [% IF patron.borrowernumber %] >+ Patron has no current recalls. >+ [% ELSE %] >+ There are no recalls to show. >+ [% END %] >+ [% END %] >+</div> >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 fbabec67457..429a595367b 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 >@@ -70,6 +70,18 @@ > <a class="circ-button" href="/cgi-bin/koha/circ/reserveratios.pl"><i class="fa fa-line-chart"></i> Hold ratios</a> > </li> > </ul> >+ >+ [% IF Koha.Preference('UseRecalls') and CAN_user_recalls %] >+ <h3>Recalls</h3> >+ >+ <ul class="buttons-list"> >+ <li><a class="circ-button" href="/cgi-bin/koha/recalls/recalls_queue.pl" title="All active recalls"><i class="fa fa-tasks"></i> Recalls queue</a></li> >+ <li><a class="circ-button" href="/cgi-bin/koha/recalls/recalls_to_pull.pl" title="Recalls that could be filled but have not been set waiting"><i class="fa fa-hand-grab-o"></i> Recalls to pull</a></li> >+ <li><a class="circ-button" href="/cgi-bin/koha/recalls/recalls_overdue.pl" title="Recalled items that are overdue to be returned"><i class="fa fa-clock-o"></i> Overdue recalls</a></li> >+ <li><a class="circ-button" href="/cgi-bin/koha/recalls/recalls_waiting.pl" title="Recalled items awaiting pickup"><i class="fa fa-calendar"></i> Recalls awaiting pickup</a></li> >+ <li><a class="circ-button" href="/cgi-bin/koha/recalls/recalls_old_queue.pl" title="Inactive recalls"><i class="fa fa-tasks"></i> Old recalls</a></li> >+ </ul> >+ [% END %] > </div> > > <!-- Add the extra clearfix for only the required viewport --> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index 74231648506..6e002440421 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -900,6 +900,14 @@ > </a> > </li> > [% END %] >+ >+ [% IF Koha.Preference('UseRecalls') %] >+ <li> >+ <a href="#recalls" id="recalls-tab"> >+ [% recalls.count %] Recalls >+ </a> >+ </li> >+ [% END %] > </ul> > > <!-- SUMMARY : TODAY & PREVIOUS ISSUES --> >@@ -914,6 +922,12 @@ > </div> <!-- /#clubs-tab --> > [% END %] > >+ [% IF Koha.Preference('UseRecalls') %] >+ <div id="recalls"> >+ [% INCLUDE 'recalls.inc' %] >+ </div> >+ [% END %] >+ > [% INCLUDE borrower_debarments.inc %] > > <div id="reserves"> >@@ -1154,6 +1168,7 @@ > </script> > [% INCLUDE 'str/members-menu.inc' %] > [% Asset.js("js/members-menu.js") | $raw %] >+ [% Asset.js("js/recalls.js") %] > [% END %] > > [% 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 >new file mode 100644 >index 00000000000..860d2653341 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/recallshistory.tt >@@ -0,0 +1,45 @@ >+[% USE KohaDates %] >+[% USE Koha %] >+[% USE Asset %] >+[% SET footerjs = 1 %] >+[% INCLUDE 'doc-head-open.inc' %] >+<title>Recalls history for [% INCLUDE 'patron-title.inc' %]</title> >+[% INCLUDE 'doc-head-close.inc' %] >+<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> >+</head> >+ >+<body id="recalls_history" class="pat"> >+ [% 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> › >+ Recalls history for [% INCLUDE 'patron-title.inc' %] >+ </div> >+ <div class="main container-fluid"> >+ <div class="row"> >+ <div class="col-sm-10 col-sm-push-2"> >+ <main> >+ [% INCLUDE 'members-toolbar.inc' %] >+ <h1>Recalls history</h1> >+ [% IF Koha.Preference('UseRecalls') %] >+ [% INCLUDE 'recalls.inc' %] >+ [% ELSE %] >+ <div class="dialog message">Recalls have not been enabled. Enable the <a href="/cgi-bin/koha/admin/preferences.pl?tab=circulation">UseRecalls</a> system preference to use recalls.</div> >+ [% END %] >+ </main> >+ </div> >+ <div class="col-sm-2 col-sm-pull-10"> >+ <aside> >+ [% INCLUDE 'circ-menu.inc' %] >+ </aside> >+ </div> >+ </div> >+ >+[% MACRO jsinclude BLOCK %] >+ [% INCLUDE 'datatables.inc' %] >+ [% Asset.js("js/recalls.js") %] >+[% END %] >+ >+[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_queue.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_queue.tt >new file mode 100644 >index 00000000000..70f4cb5dfe6 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_queue.tt >@@ -0,0 +1,68 @@ >+[% USE Koha %] >+[% USE KohaDates %] >+[% USE Asset %] >+[% SET footerjs = 1 %] >+[% 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" /> >+</head> >+<body id="circ_recalls_queue" 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/recalls/recalls_queue.pl">Recalls queue</a> >+</div> >+ >+<div class="main container-fluid"> >+ <div class="row"> >+ [% IF Koha.Preference('CircSidebar') %] >+ <div class="col-sm-10 col-sm-push-2"> >+ [% ELSE %] >+ <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2"> >+ [% END %] >+ <main> >+ >+ <h1>Recalls queue</h1> >+ [% IF Koha.Preference('UseRecalls') %] >+ [% IF recalls.count %] >+ <form method="post" action="/cgi-bin/koha/recalls/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.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 %] >+ [% ELSE %] >+ <div class="dialog message">Recalls have not been enabled. Enable the <a href="/cgi-bin/koha/admin/preferences.pl?tab=circulation">UseRecalls</a> system preference to use recalls.</div> >+ [% END %] >+ >+ </main> >+ </div> <!-- /.col-etc --> >+ >+ [% IF Koha.Preference('CircSidebar') %] >+ <div class="col-sm-2 col-sm-pull-10"> >+ <aside> >+ [% INCLUDE 'circ-nav.inc' %] >+ </aside> >+ </div> <!-- /.col-sm-2.col-sm-pull-10 --> >+ [% END %] >+ >+ </div> <!-- /.row --> >+</div> >+ >+[% MACRO jsinclude BLOCK %] >+ [% INCLUDE 'datatables.inc' %] >+ [% INCLUDE 'columns_settings.inc' %] >+ [% Asset.js("js/recalls.js") %] >+[% END %] >+ >+[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_to_pull.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_to_pull.tt >new file mode 100644 >index 00000000000..460d5551753 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_to_pull.tt >@@ -0,0 +1,151 @@ >+[% USE Koha %] >+[% USE KohaDates %] >+[% USE AuthorisedValues %] >+[% USE Branches %] >+[% USE ItemTypes %] >+[% USE Asset %] >+[% SET footerjs = 1 %] >+[% INCLUDE 'doc-head-open.inc' %] >+<title>Koha › Circulation › Recalls to pull</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" /> >+</head> >+<body id="circ_recalls_to_pull" 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/recalls/recalls_to_pull.pl">Recalls to pull</a> >+</div> >+ >+<div class="main container-fluid"> >+ <div class="row"> >+ [% IF Koha.Preference('CircSidebar') %] >+ <div class="col-sm-10 col-sm-push-2"> >+ [% ELSE %] >+ <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2"> >+ [% END %] >+ <main> >+ >+ <h1>Recalls to pull</h1> >+ [% IF Koha.Preference('UseRecalls') %] >+ <div id="recalls"> >+ [% IF recalls.count %] >+ <table id="recalls-table"> >+ <thead> >+ <tr> >+ <th class="recall-topull">Pull this many items</th> >+ <th class="recall-items">Items available</th> >+ <th class="recall-patrons">Patrons with recalls</th> >+ <th class="recall-firstpatron">First patron</th> >+ <th class="recall-title anti-the">Title</th> >+ <th class="recall-libraries string-sort">Libraries</th> >+ <th class="recall-callnumbers">Available call numbers</th> >+ <th class="recall-copynumbers">Available copy numbers</th> >+ <th class="recall-enumeration">Available enumeration</th> >+ <th class="recall-itemtypes string-sort">Available item types</th> >+ <th class="recall-locations string-sort">Available locations</th> >+ <th class="recall-date title-string">Earlier recall date</th> >+ <th class="recall-action"> </th> >+ </tr> >+ </thead> >+ <tbody> >+ [% FOREACH recall IN recalls %] >+ <tr> >+ <td class="recall-topull"><b>[% recall.pull_count %]</b></td> >+ <td class="recall-items">[% recall.items_count %]</td> >+ <td class="recall-patrons">[% recall.patrons_count %]</td> >+ <td class="recall-firstpatron"><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% recall.first_patron.borrowernumber %]">[% recall.first_patron.firstname %] [% recall.first_patron.surname %]</a></td> >+ <td class="recall-title"> >+ [% INCLUDE 'biblio-default-view.inc' biblionumber=recall.biblio.biblionumber %] >+ [% INCLUDE 'biblio-title.inc' biblio=recall.biblio %] >+ [% IF recall.biblio.author %] by [% recall.biblio.author %][% END %] >+ </td> >+ <td class="recall-libraries"> >+ <ul> >+ [% FOREACH library IN recall.libraries %] >+ <li>[% Branches.GetName( library ) %]</li> >+ [% END %] >+ </ul> >+ </td> >+ <td class="recall-callnumbers"> >+ <ul> >+ [% FOREACH callnumber IN recall.callnumbers %] >+ <li>[% callnumber %]</li> >+ [% END %] >+ </ul> >+ </td> >+ <td class="recall-copynumbers"> >+ <ul> >+ [% FOREACH copyno IN recall.copynumbers %] >+ <li>[% copyno %]</li> >+ [% END %] >+ </ul> >+ </td> >+ <td class="recall-enumeration"> >+ <ul> >+ [% FOREACH enumchron IN recall.enumchrons %] >+ <li>[% enumchron %]</li> >+ [% END %] >+ </ul> >+ </td> >+ <td class="recall-itemtypes"> >+ <ul> >+ [% FOREACH itemtype IN recall.itemtypes %] >+ <li>[% ItemTypes.GetDescription( itemtype ) %]</li> >+ [% END %] >+ </ul> >+ </td> >+ <td class="recall-locations"> >+ <ul> >+ [% FOREACH loc IN recall.locations %] >+ <li>[% AuthorisedValues.GetByCode('LOC', loc) %]</li> >+ [% END %] >+ </ul> >+ </td> >+ <td class="recall-date"> >+ <span title="[% recall.first_date %]">[% recall.first_date | $KohaDates %] in [% recall.first_library.branchname %]</span> >+ </td> >+ <td class="recall-action"> >+ <form action="/cgi-bin/koha/recalls/recalls_to_pull.pl" method="post"> >+ <input type="hidden" name="op" value="cancel"> >+ <input type="hidden" name="recall_id" value="[% recall.recall_id %]"> >+ <input type="submit" value="Cancel recall"> >+ </form> >+ </td> >+ </tr> >+ [% END %] >+ </tbody> >+ </table> >+ [% ELSE %] >+ <div class="dialog message">There are no recalls to pull.</div> >+ [% END %] >+ </div> >+ [% ELSE %] >+ <div class="dialog message">Recalls have not been enabled. Enable the <a href="/cgi-bin/koha/admin/preferences.pl?tab=circulation">UseRecalls</a> system preference to use recalls.</div> >+ [% END %] >+ >+ </main> >+ </div> <!-- /.col-etc --> >+ >+ [% IF Koha.Preference('CircSidebar') %] >+ <div class="col-sm-2 col-sm-pull-10"> >+ <aside> >+ [% INCLUDE 'circ-nav.inc' %] >+ </aside> >+ </div> <!-- /.col-sm-2.col-sm-pull-10 --> >+ [% END %] >+ >+ </div> <!-- /.row --> >+</div> >+ >+[% MACRO jsinclude BLOCK %] >+ [% INCLUDE 'datatables.inc' %] >+ [% INCLUDE 'columns_settings.inc' %] >+ [% Asset.js("js/recalls.js") %] >+[% END %] >+ >+[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/recalls.js b/koha-tmpl/intranet-tmpl/prog/js/recalls.js >new file mode 100644 >index 00000000000..0c77102a246 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/js/recalls.js >@@ -0,0 +1,136 @@ >+$(document).ready(function() { >+ >+ $(".cancel_recall").click(function(e){ >+ if (confirmDelete(_("Are you sure you want to remove this recall?"))){ >+ var $self = $(this); >+ var $recall_id = $(this).data('id'); >+ var $action = $(this).data('action'); >+ var ajaxData = { >+ 'recall_id': $recall_id, >+ 'action' : $action, >+ }; >+ var $howmanyparents = $(this).data('parent'); >+ >+ $.ajax({ >+ url: '/cgi-bin/koha/svc/recall', >+ type: 'POST', >+ dataType: 'json', >+ data: ajaxData, >+ }) >+ .done(function(data) { >+ var message = ""; >+ if(data.success == 0) { >+ message = _("The recall may have already been cancelled. Please refresh the page."); >+ } else { >+ message = _("Cancelled"); >+ } >+ if ( $howmanyparents == "one" ){ >+ $self.parent().html(message); >+ } else { >+ $self.parent().parent().parent().parent().html(message); >+ } >+ }); >+ } >+ }); >+ >+ $(".checkin_recall").click(function(e){ >+ if (confirmDelete(_("Are you sure you want to check in this item and confirm the recall as 'waiting'?"))){ >+ var $self = $(this); >+ var $recall_id = $(this).data('id'); >+ var $action = $(this).data('action'); >+ var ajaxData = { >+ 'recall_id': $recall_id, >+ 'action' : $action, >+ }; >+ >+ $.ajax({ >+ url: '/cgi-bin/koha/svc/recall', >+ type: 'POST', >+ dataType: 'json', >+ data: ajaxData, >+ }) >+ .done(function(data) { >+ var message = ""; >+ if(data.success == 0) { >+ message = _("The recall may have already been checked in. Please refresh the page."); >+ } else { >+ message = _("Completed"); >+ } >+ $self.parent().parent().parent().parent().html(message); >+ }); >+ } >+ }); >+ >+ $(".expire_recall").click(function(e){ >+ if (confirmDelete(_("Are you sure you want to expire this recall?"))){ >+ var $self = $(this); >+ var $recall_id = $(this).data('id'); >+ var $action = $(this).data('action'); >+ var ajaxData = { >+ 'recall_id': $recall_id, >+ 'action' : $action, >+ }; >+ >+ var $howmanyparents = $(this).data('parent'); >+ >+ $.ajax({ >+ url: '/cgi-bin/koha/svc/recall', >+ type: 'POST', >+ dataType: 'json', >+ data: ajaxData, >+ }) >+ .done(function(data) { >+ var message = ""; >+ if(data.success == 0) { >+ message = _("The recall may have already been expired. Please refresh the page."); >+ } else { >+ message = _("Expired"); >+ } >+ if ( $howmanyparents == "one" ){ >+ $self.parent().html(message); >+ } else { >+ $self.parent().parent().parent().parent().html(message); >+ } >+ }); >+ } >+ }); >+ >+ $("#recalls-table").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "aoColumnDefs": [ >+ { "aTargets": [ 'nosort' ], "bSortable": false, "bSearchable": false }, >+ ], >+ "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.")); >+ } >+ }); >+ >+ $("#expire_selected").click(function(e){ >+ if ($("input[name='recall_ids']:checked").length > 0){ >+ return confirmDelete(_("Are you sure you want to expire 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); >+ } >+ }); >+ >+ $("#hide_old").click(function(){ >+ if ($("#hide_old").prop("checked")){ >+ $(".old").show(); >+ } else { >+ $(".old").hide(); >+ } >+ }); >+}); >diff --git a/members/recallshistory.pl b/members/recallshistory.pl >new file mode 100755 >index 00000000000..d3edc62d2f2 >--- /dev/null >+++ b/members/recallshistory.pl >@@ -0,0 +1,46 @@ >+#!/usr/bin/perl >+ >+# Copyright 2020 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; >+ >+my $input = CGI->new; >+my ($template, $loggedinuser, $cookie)= get_template_and_user( >+ { >+ template_name => "members/recallshistory.tt", >+ query => $input, >+ type => "intranet", >+ authnotrequired => 0, >+ flagsrequired => { recalls => 1 }, >+ debug => 1, >+ } >+); >+ >+my $borrowernumber = $input->param('borrowernumber'); >+my $recalls = Koha::Recalls->search({ borrowernumber => $borrowernumber }); >+my $patron = Koha::Patrons->find($borrowernumber); >+ >+$template->param( >+ patron => $patron, >+ recalls => $recalls, >+ recallsview => 1, >+); >+ >+output_html_with_http_headers $input, $cookie, $template->output; >diff --git a/recalls/recalls_queue.pl b/recalls/recalls_queue.pl >new file mode 100755 >index 00000000000..05349f74003 >--- /dev/null >+++ b/recalls/recalls_queue.pl >@@ -0,0 +1,57 @@ >+#!/usr/bin/perl >+ >+# Copyright 2020 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::BiblioFrameworks; >+ >+my $query = new CGI; >+my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( >+ { >+ template_name => "recalls/recalls_queue.tt", >+ query => $query, >+ type => "intranet", >+ authnotrequired => 0, >+ flagsrequired => { recalls => 'manage_recalls' }, >+ debug => 1, >+ } >+); >+ >+my $op = $query->param('op') || 'list'; >+my @recall_ids = $query->multi_param('recall_ids'); >+if ( $op eq 'cancel_multiple_recalls' ) { >+ foreach my $id (@recall_ids) { >+ $id->set_cancelled; >+ } >+ $op = 'list' >+} >+elsif ( $op eq 'list' ) { >+ my $recalls = Koha::Recalls->search({ old => undef }); >+ $template->param( >+ recalls => $recalls, >+ checkboxes => 1, >+ ); >+} >+ >+# 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/recalls/recalls_to_pull.pl b/recalls/recalls_to_pull.pl >new file mode 100755 >index 00000000000..e6e37fae040 >--- /dev/null >+++ b/recalls/recalls_to_pull.pl >@@ -0,0 +1,95 @@ >+#!/usr/bin/perl >+ >+# Copyright 2020 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::BiblioFrameworks; >+ >+my $query = new CGI; >+my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( >+ { >+ template_name => "recalls/recalls_to_pull.tt", >+ query => $query, >+ type => "intranet", >+ authnotrequired => 0, >+ flagsrequired => { recalls => 'manage_recalls' }, >+ debug => 1, >+ } >+); >+ >+my $op = $query->param('op') || 'list'; >+my $recall_id = $query->param('recall_id'); >+if ( $op eq 'cancel' ) { >+ Koha::Recalls->find( $recall_id )->set_cancelled; >+ $op = 'list'; >+} >+elsif ( $op eq 'list' ) { >+ my @recalls = Koha::Recalls->search({ status => [ 'R','O' ] }); >+ my @pull_list; >+ foreach my $recall ( @recalls ) { >+ my @items = Koha::Items->search({ biblionumber => $recall->biblionumber }); >+ my $distinct_recalls = Koha::Recalls->search({ biblionumber => $recall->biblionumber, status => [ 'R','O' ] }, { columns => [ 'borrowernumber' ], distinct => 1, order_by => { -asc => 'recalldate' } }); >+ my $recalls_count = $distinct_recalls->count; >+ my $first_recall = $distinct_recalls->next; >+ my $items_count; >+ my @callnumbers; >+ my @copynumbers; >+ my @enumchrons; >+ my @itemtypes; >+ my @locations; >+ my @libraries; >+ foreach my $item ( @items ) { >+ if ( $item->can_be_waiting_recall ) { >+ $items_count++; >+ push( @callnumbers, $item->itemcallnumber ); >+ push( @copynumbers, $item->copynumber ); >+ push( @enumchrons, $item->enumchron ); >+ push( @itemtypes, $item->effective_itemtype ); >+ push( @locations, $item->location ); >+ push( @libraries, $item->holdingbranch ); >+ } >+ } >+ push( @pull_list, { >+ recall => $recall, >+ biblio => $recall->biblio, >+ items_count => $items_count, >+ recalls_count => $recalls_count, >+ pull_count => $items_count <= $recalls_count ? $items_count : $recalls_count, >+ first_patron => $first_recall->patron, >+ first_date => $first_recall->recalldate, >+ #first_library => $first_recall->library, >+ callnumbers => @callnumbers, >+ copynumbers => @copynumbers, >+ enumchrons => @enumchrons, >+ itemtypes => @itemtypes, >+ locations => @locations, >+ libraries => @libraries, >+ }); >+ } >+ $template->param( >+ recalls => \@pull_list, >+ ); >+} >+ >+# 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/tools/letter.pl b/tools/letter.pl >index 6044243c090..e95746e1e21 100755 >--- a/tools/letter.pl >+++ b/tools/letter.pl >@@ -248,7 +248,7 @@ sub add_form { > {value => 'items.fine', text => 'items.fine'}, > add_fields('borrowers'); > if ($module eq 'circulation') { >- push @{$field_selection}, add_fields('opac_news'); >+ push @{$field_selection}, add_fields('opac_news', 'recalls'); > > } > >-- >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 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
|
76817
|
76818
|
76819
|
76820
|
76821
|
76822
|
76823
|
76824
|
76825
|
76826
|
76827
|
76828
|
76829
|
76830
|
76831
|
76832
|
76833
|
76834
|
76835
|
76836
|
76837
|
76838
|
76839
|
76840
|
76841
|
76842
|
76843
|
76844
|
76845
|
76846
|
76847
|
77177
|
77178
|
77179
|
78755
|
78757
|
78759
|
78761
|
78763
|
78765
|
78766
|
78768
|
78770
|
78772
|
78773
|
78774
|
78775
|
78776
|
78777
|
78778
|
78780
|
78782
|
78785
|
78787
|
78789
|
78790
|
78792
|
78794
|
78797
|
78800
|
78801
|
78802
|
78803
|
78804
|
78805
|
78806
|
78807
|
78808
|
80763
|
80764
|
80765
|
80766
|
80767
|
80768
|
80769
|
80770
|
80771
|
80772
|
80773
|
80774
|
80775
|
80776
|
80777
|
80778
|
80779
|
80780
|
80781
|
80782
|
80783
|
80784
|
80785
|
80786
|
80787
|
80788
|
80789
|
80793
|
80878
|
81204
|
81205
|
81206
|
81207
|
81208
|
81209
|
81210
|
81211
|
81212
|
81213
|
81214
|
81215
|
81216
|
81217
|
81218
|
81219
|
81220
|
81221
|
81222
|
81223
|
81224
|
81225
|
81226
|
81227
|
81228
|
81229
|
81230
|
81231
|
81232
|
81233
|
81234
|
81235
|
81236
|
81237
|
81238
|
81239
|
81240
|
81241
|
81242
|
81243
|
81244
|
81245
|
81246
|
81247
|
81547
|
81548
|
81549
|
81550
|
81551
|
81552
|
81553
|
81554
|
81555
|
81556
|
81557
|
81558
|
81559
|
81560
|
81561
|
81562
|
81563
|
81564
|
81565
|
81566
|
81567
|
81568
|
81569
|
81583
|
81584
|
81585
|
81586
|
81587
|
81588
|
81595
|
81618
|
81652
|
81653
|
81654
|
81655
|
81656
|
81657
|
81658
|
81659
|
81660
|
81661
|
81662
|
81663
|
81664
|
81665
|
81666
|
81667
|
81668
|
81669
|
81670
|
81671
|
81672
|
81673
|
81674
|
81675
|
81676
|
81677
|
81678
|
81679
|
81680
|
81681
|
81682
|
81683
|
103887
|
103888
|
103890
|
103899
|
103900
|
103901
|
103999
|
104000
|
104001
|
104002
|
104005
|
104006
|
104007
|
104066
|
104067
|
104068
|
104069
|
104070
|
104071
|
104246
|
104247
|
104248
|
104249
|
104250
|
104322
|
104323
|
104324
|
104325
|
104326
|
104327
|
104328
|
104329
|
104330
|
104331
|
104332
|
104333
|
104334
|
104335
|
104336
|
104391
|
104392
|
104393
|
104394
|
104395
|
104396
|
104397
|
104398
|
104474
|
104475
|
104476
|
104477
|
104478
|
104479
|
104480
|
104481
|
104545
|
104546
|
104547
|
104548
|
104549
|
104550
|
104551
|
104552
|
104646
|
104647
|
104648
|
104649
|
104650
|
104651
|
104652
|
104653
|
104722
|
104723
|
104724
|
104725
|
104726
|
104727
|
104728
|
104729
|
104806
|
104807
|
104808
|
104809
|
104810
|
104811
|
104812
|
104813
|
104814
|
104815
|
104816
|
104817
|
104818
|
104819
|
104820
|
104821
|
104863
|
104864
|
104865
|
104866
|
104867
|
104868
|
104869
|
104870
|
104902
|
104903
|
104904
|
104905
|
104906
|
104907
|
104908
|
104909
|
104910
|
104913
|
104914
|
104915
|
104916
|
104917
|
104918
|
104919
|
104920
|
104988
|
104989
|
104990
|
104991
|
104992
|
106268
|
106269
|
106371
|
106372
|
106373
|
106374
|
106375
|
106376
|
106377
|
106378
|
106810
|
106811
|
106812
|
106813
|
106814
|
106815
|
106816
|
106817
|
106857
|
107198
|
107199
|
107200
|
107201
|
107202
|
107203
|
107204
|
107205
|
107807
|
107808
|
107809
|
107810
|
107811
|
107812
|
107813
|
107814
|
107918
|
107919
|
107920
|
107921
|
107922
|
107923
|
107924
|
107925
|
108222
|
108223
|
108224
|
108225
|
108226
|
108227
|
108228
|
108229
|
108980
|
108981
|
108982
|
109306
|
109307
|
109308
|
109309
|
109310
|
109311
|
109312
|
109313
|
109314
|
109315
|
109316
|
109317
|
109318
|
109463
|
109464
|
109465
|
109466
|
109467
|
109468
|
109469
|
109775
|
109776
|
109777
|
109778
|
109779
|
109780
|
109781
|
109782
|
109783
|
109784
|
109785
|
111199
|
111200
|
111201
|
111202
|
111203
|
111204
|
111205
|
111206
|
112316
|
112317
|
112321
|
112322
|
112323
|
112324
|
112325
|
112326
|
112346
|
112472
|
112491
|
112540
|
112612
|
112613
|
112614
|
112615
|
112616
|
112617
|
112618
|
112619
|
112620
|
112621
|
112622
|
113195
|
113196
|
113197
|
113198
|
113199
|
113200
|
113201
|
113202
|
113203
|
113204
|
113205
|
113286
|
113287
|
113288
|
113289
|
113290
|
113291
|
113292
|
113293
|
113294
|
113295
|
113296
|
113297
|
113298
|
113335
|
113351
|
113352
|
113353
|
113354
|
113355
|
113356
|
113357
|
113358
|
113359
|
113361
|
113362
|
113363
|
113364
|
113365
|
113430
|
113431
|
113432
|
113433
|
113434
|
113435
|
113436
|
113437
|
113438
|
113439
|
113440
|
113441
|
113442
|
113443
|
113444
|
113445
|
116121
|
116122
|
116123
|
116124
|
116125
|
116126
|
116127
|
116128
|
116129
|
116130
|
116131
|
116132
|
116133
|
116134
|
118267
|
118268
|
118269
|
118270
|
118271
|
118272
|
118273
|
118274
|
118275
|
118276
|
118277
|
118278
|
118279
|
118280
|
122993
|
122994
|
122995
|
122996
|
122997
|
122998
|
122999
|
123000
|
123001
|
123002
|
123003
|
123004
|
123005
|
126244
|
126245
|
126246
|
126247
|
126248
|
126249
|
126250
|
126251
|
126252
|
126253
|
126254
|
126255
|
126256
|
126257
|
126453
|
126454
|
126455
|
126456
|
126457
|
126458
|
126459
|
126460
|
126469
|
126470
|
126565
|
126566
|
126568
|
126569
|
126570
|
126571
|
126572
|
126573
|
126574
|
126575
|
126576
|
126577
|
126578
|
126579
|
126580
|
129305
|
129306
|
129307
|
129308
|
129309
|
129310
|
129311
|
129312
|
129313
|
129314
|
129315
|
129316
|
129317
|
129318
|
129319
|
130641
|
130642
|
130643
|
130644
|
130645
|
130646
|
130647
|
130648
|
130649
|
130650
|
130651
|
130652
|
130653
|
130654
|
130655
|
130656
|
131108
|
131156
|
131157
|
131158
|
131159
|
131160
|
131193
|
131213
|
131257
|
131260
|
131261
|
131262
|
131263
|
131264
|
131265
|
131266
|
131267
|
131268
|
131269
|
131270
|
131271
|
131272
|
131273
|
131274
|
131275
|
131276
|
131277
|
131278
|
131279
|
131280
|
131281
|
131282
|
131330
|
131629
|
131630
|
131631
|
131664
|
131665
|
131666
|
131701
|
132332