Bugzilla – Attachment 72244 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: Extra fixes from Comment 68
Bug-19532-Extra-fixes-from-Comment-68.patch (text/plain), 31.23 KB, created by
Aleisha Amohia
on 2018-02-26 21:11:24 UTC
(
hide
)
Description:
Bug 19532: Extra fixes from Comment 68
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2018-02-26 21:11:24 UTC
Size:
31.23 KB
patch
obsolete
>From 1564376f879a101d6abd114dee5aa94978dd4287 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Mon, 19 Feb 2018 02:04:24 +0000 >Subject: [PATCH] Bug 19532: Extra fixes from Comment 68 > >This patch fixes the following: > >The db uppdate tries to insert after 'notes' in issuing rules, but this >doesn't exist > >When placing recall I always get a warning: > <p><strong>Warning</strong>: Your library does not allow recalls for > x item types.</p> > >Cancelling recall from 'Recall history tab' doesn't work > >If patron has no recalls there is 'Patron has no current recalls' >message at bottom of tabs on checkout and details tabs for patron > >When confirming a recall if the item is from another branch I get a >transfer generated as well as confirming hold for recall > Feature now checks if the recall branch is the same as the item > holding branch when checking in item to determine if transfer is > required > >On recalls awaiting pickup: >need to update recall.borrower to recall.patron - causing >internal server error > >When placing a recall - if I hit 'back' after confirming and >confirm again I get a second recall on the same item > >Recalls queue should have waiting date information >Recalls queue should have a way to hide cancelled, I would >expect closed recalls to be hidden by default > Recalls queue now hides old (cancelled/expired/finished) recalls by > default and has a checkbox to toggle this > >When viewing a patrons account in the staff side we should see >that a checkout has an active recall > >Checking out the recall doesn't seem to close the recall > Added an 'F' status for finished/closed recalls >--- > C4/Circulation.pm | 19 +++++++++++ > Koha/Recall.pm | 13 ++++++++ > Koha/Schema/Result/Biblio.pm | 19 +++++++++-- > Koha/Schema/Result/Borrower.pm | 19 +++++++++-- > Koha/Schema/Result/Branch.pm | 19 +++++++++-- > .../atomicupdate/bug_19532_-_add_recalls_table.sql | 4 +-- > .../bug_19532_-_adding_recalls_circ_rules.perl | 2 +- > installer/data/mysql/kohastructure.sql | 37 ++-------------------- > .../prog/en/includes/recalls-reports.inc | 13 +++++++- > .../intranet-tmpl/prog/en/includes/recalls.inc | 2 ++ > .../prog/en/modules/circ/recalls_overdue.tt | 2 +- > .../prog/en/modules/circ/recalls_queue.tt | 18 ++++++++--- > .../prog/en/modules/circ/recalls_waiting.tt | 6 ++-- > .../prog/en/modules/members/moremember.tt | 2 +- > .../prog/en/modules/members/recallshistory.tt | 2 +- > koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 4 +++ > koha-tmpl/intranet-tmpl/prog/js/recalls.js | 12 +++++-- > .../opac-tmpl/bootstrap/en/modules/opac-recall.tt | 4 +-- > opac/opac-recall.pl | 15 +++++---- > svc/checkouts | 6 ++++ > t/db_dependent/Koha/Recalls.t | 7 ++-- > 21 files changed, 158 insertions(+), 67 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index cf90063..e793a1a 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -356,6 +356,17 @@ sub transferbook { > $dotransfer = 1; > } > >+ # check if item has been recalled. do a transfer if the recall branch is different to the item holding branch, otherwise don't do a transfer >+ my $recall = Koha::Recalls->find({ itemnumber => $item->itemnumber, status => 'R' }); >+ if (defined $recall){ >+ if ($recall->branchcode eq $fbr){ >+ $dotransfer = 0; >+ $messages->{'RecallPlacedAtHoldingBranch'} = 1; >+ } else { >+ $dotransfer = 1; >+ } >+ } >+ > #actually do the transfer.... > if ($dotransfer) { > ModItemTransfer( $itemnumber, $fbr, $tbr ); >@@ -1371,6 +1382,14 @@ sub AddIssue { > } > ); > >+ # Check if a recall >+ if ( C4::Context->preference('UseRecalls') ) { >+ my $recall = Koha::Recalls->find({ itemnumber => $item->{'itemnumber'}, borrowernumber => $borrower->{'borrowernumber'} }); >+ if (defined $recall) { >+ $recall->update({ status => "F", old => 1 }); >+ } >+ } >+ > if ( C4::Context->preference('ReturnToShelvingCart') ) { > # ReturnToShelvingCart is on, anything issued should be taken off the cart. > CartToShelf( $item->{'itemnumber'} ); >diff --git a/Koha/Recall.pm b/Koha/Recall.pm >index ad51e36..c19329e 100644 >--- a/Koha/Recall.pm >+++ b/Koha/Recall.pm >@@ -178,6 +178,19 @@ sub is_cancelled { > return $status && $status eq 'C'; > } > >+=head3 is_finished >+ >+Returns true if recall is closed >+ >+=cut >+ >+sub is_finished { >+ my ($self) = @_; >+ >+ my $status = $self->status; >+ return $status && $status eq 'F'; >+} >+ > =head1 AUTHOR > > Aleisha Amohia <aleisha@catalyst.net.nz> >diff --git a/Koha/Schema/Result/Biblio.pm b/Koha/Schema/Result/Biblio.pm >index f4af407..f112a51 100644 >--- a/Koha/Schema/Result/Biblio.pm >+++ b/Koha/Schema/Result/Biblio.pm >@@ -272,6 +272,21 @@ __PACKAGE__->has_many( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >+=head2 recalls >+ >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::Recall> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "recalls", >+ "Koha::Schema::Result::Recall", >+ { "foreign.biblionumber" => "self.biblionumber" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ > =head2 reserves > > Type: has_many >@@ -348,7 +363,7 @@ __PACKAGE__->has_many( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-01-13 08:36:25 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jis7Sm5+9lVKav+o18JLtA >+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-25 21:48:11 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:IReqh9sf7I012bhIlwXHgw > > 1; >diff --git a/Koha/Schema/Result/Borrower.pm b/Koha/Schema/Result/Borrower.pm >index 21ad72f..849b8f3 100644 >--- a/Koha/Schema/Result/Borrower.pm >+++ b/Koha/Schema/Result/Borrower.pm >@@ -1190,6 +1190,21 @@ __PACKAGE__->has_many( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >+=head2 recalls >+ >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::Recall> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "recalls", >+ "Koha::Schema::Result::Recall", >+ { "foreign.borrowernumber" => "self.borrowernumber" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ > =head2 reserves > > Type: has_many >@@ -1386,8 +1401,8 @@ Composing rels: L</aqorder_users> -> ordernumber > __PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber"); > > >-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-13 14:08:33 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:pxhUnV9IMvVGml9HFheMLw >+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-25 21:48:11 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sHW5C2MCH5i42XDRs5ZMpg > > __PACKAGE__->belongs_to( > "guarantor", >diff --git a/Koha/Schema/Result/Branch.pm b/Koha/Schema/Result/Branch.pm >index 2d0276f..f1ac3d2 100644 >--- a/Koha/Schema/Result/Branch.pm >+++ b/Koha/Schema/Result/Branch.pm >@@ -563,6 +563,21 @@ __PACKAGE__->has_many( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >+=head2 recalls >+ >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::Recall> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "recalls", >+ "Koha::Schema::Result::Recall", >+ { "foreign.branchcode" => "self.branchcode" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ > =head2 reserves > > Type: has_many >@@ -609,8 +624,8 @@ __PACKAGE__->has_many( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-12-05 14:08:18 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:g+WicMjGntjAgcKrbn4IdQ >+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-25 21:48:11 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:DOlKnTMaCV7eFTbjQ92/BA > > > # You can replace this text with custom code or comments, and it will be preserved on regeneration >diff --git a/installer/data/mysql/atomicupdate/bug_19532_-_add_recalls_table.sql b/installer/data/mysql/atomicupdate/bug_19532_-_add_recalls_table.sql >index 56ad5cf..7f79a93 100644 >--- a/installer/data/mysql/atomicupdate/bug_19532_-_add_recalls_table.sql >+++ b/installer/data/mysql/atomicupdate/bug_19532_-_add_recalls_table.sql >@@ -9,13 +9,13 @@ CREATE TABLE `recalls` ( -- information related to recalls in Koha > `cancellationdate` date default NULL, -- the date this recall was cancelled > `recallnotes` mediumtext, -- notes related to this recall > `priority` smallint(6) default NULL, -- where in the queue the patron sits >- `status` varchar(1) default NULL, -- a one letter code defining what the status is of the recall is after it has been requested. R=requested, O=overdue, W=awaiting pickup, E=expired, C=cancelled >+ `status` varchar(1) default NULL, -- a one letter code defining what the status is of the recall is after it has been requested. R=requested, O=overdue, W=awaiting pickup, E=expired, C=cancelled, F=finished/completed > `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this recall was last updated > `itemnumber` int(11) default NULL, -- foreign key from the items table defining the specific item the recall request was placed on > `waitingdate` date default NULL, -- the date the item was marked as waiting for the patron at the library > `expirationdate` DATE DEFAULT NULL, -- the date the recall expires > `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- the optional itemtype of the item the patron is requesting >- `old` int(1) default null, -- flag if the recall is old and no longer active, i.e. expired or cancelled >+ `old` int(1) default null, -- flag if the recall is old and no longer active, i.e. expired, cancelled or completed > PRIMARY KEY (`recall_id`), > KEY `prioritystatusidx` (priority,status), > KEY `borrowernumber` (`borrowernumber`), >diff --git a/installer/data/mysql/atomicupdate/bug_19532_-_adding_recalls_circ_rules.perl b/installer/data/mysql/atomicupdate/bug_19532_-_adding_recalls_circ_rules.perl >index 3cf6a20..f0d6088 100644 >--- a/installer/data/mysql/atomicupdate/bug_19532_-_adding_recalls_circ_rules.perl >+++ b/installer/data/mysql/atomicupdate/bug_19532_-_adding_recalls_circ_rules.perl >@@ -1,7 +1,7 @@ > $DBversion = 'XXX'; > if( CheckVersion( $DBversion ) ) { > unless( column_exists( 'issuingrules', 'recall_due_date_interval' ) ) { >- $dbh->do(q|ALTER TABLE issuingrules ADD recall_due_date_interval int(11) default NULL AFTER note|); >+ $dbh->do(q|ALTER TABLE issuingrules ADD recall_due_date_interval int(11) default NULL AFTER article_requests|); > } > unless( column_exists( 'issuingrules', 'recall_overdue_fine' ) ) { > $dbh->do(q|ALTER TABLE issuingrules ADD recall_overdue_fine decimal(28,6) default NULL AFTER recall_due_date_interval|); >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 82221e2..dc45b4e 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1858,14 +1858,15 @@ CREATE TABLE `recalls` ( -- information related to recalls in Koha > `cancellationdate` date default NULL, -- the date this recall was cancelled > `recallnotes` mediumtext, -- notes related to this recall > `priority` smallint(6) default NULL, -- where in the queue the patron sits >- `found` varchar(1) default NULL, -- a one letter code defining what the status is of the recall is after it has been requested. R=requested, O=overdue, W=awaiting pickup, E=expired >+ `status` varchar(1) default NULL, -- a one letter code defining what the status is of the recall is after it has been requested. R=requested, O=overdue, W=awaiting pickup, E=expired, C=cancelled, F=finished/completed > `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this recall was last updated > `itemnumber` int(11) default NULL, -- foreign key from the items table defining the specific item the recall request was placed on > `waitingdate` date default NULL, -- the date the item was marked as waiting for the patron at the library > `expirationdate` DATE DEFAULT NULL, -- the date the recall expires > `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- the optional itemtype of the item the patron is requesting >+ `old` int(1) default NULL, -- flag if the recall is old and no longer active, i.e. expired, cancelled or completed > PRIMARY KEY (`recall_id`), >- KEY `priorityfoundidx` (priority,found), >+ KEY `prioritystatusidx` (priority,status), > KEY `borrowernumber` (`borrowernumber`), > KEY `biblionumber` (`biblionumber`), > KEY `itemnumber` (`itemnumber`), >@@ -1879,38 +1880,6 @@ CREATE TABLE `recalls` ( -- information related to recalls in Koha > ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; > > -- >--- Table structure for table `old_recalls` >--- >- >-DROP TABLE IF EXISTS `old_recalls`; >-CREATE TABLE `old_recalls` ( -- information related to recalls in Koha >- `recall_id` int(11) NOT NULL auto_increment, -- primary key >- `borrowernumber` int(11) NULL default 0, -- foreign key from the borrowers table defining which patron requested a recall >- `recalldate` date default NULL, -- the date the recall request was placed >- `biblionumber` int(11) NULL default 0, -- foreign key from the biblio table defining which bib record this request is for >- `branchcode` varchar(10) default NULL, -- foreign key from the branches table defining which branch the patron wishes to pick up their recall from >- `cancellationdate` date default NULL, -- the date this recall was cancelled >- `recallnotes` mediumtext, -- notes related to this recall >- `priority` smallint(6) default NULL, -- where in the queue the patron sits >- `found` varchar(1) default NULL, -- a one letter code defining what the status is of the recall is after it has been requested. R=requested, O=overdue, W=awaiting pickup, E=expired >- `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this recall was last updated >- `itemnumber` int(11) default NULL, -- foreign key from the items table defining the specific item the recall request was placed on >- `waitingdate` date default NULL, -- the date the item was marked as waiting for the patron at the library >- `expirationdate` DATE DEFAULT NULL, -- the date the recall expires >- `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- the optional itemtype of the item the patron is requesting >- PRIMARY KEY (`recall_id`), >- KEY `old_recalls_borrowernumber` (`borrowernumber`), >- KEY `old_recalls_biblionumber` (`biblionumber`), >- KEY `old_recalls_itemnumber` (`itemnumber`), >- KEY `old_recalls_branchcode` (`branchcode`), >- KEY `old_recalls_itemtype` (`itemtype`), >- CONSTRAINT `old_recalls_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE SET NULL, >- CONSTRAINT `old_recalls_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE SET NULL, >- CONSTRAINT `old_recalls_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE SET NULL, >- CONSTRAINT `old_recalls_ibfk_4` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE SET NULL ON UPDATE SET NULL >-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; >- >--- > -- Table structure for table `reserves` > -- > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/recalls-reports.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/recalls-reports.inc >index 4ff7674..bccc418 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/recalls-reports.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/recalls-reports.inc >@@ -8,6 +8,7 @@ > <th class="recall-title anti-the">Title</th> > <th class="recall-barcode">Barcode</th> > <th class="recall-date psort title-string">Placed on</th> >+ <th class="recall-waiting psort title-string">Waiting since</th> > <th class="recall-expiry title-string">Expires on</th> > <th class="recall-branch">Pickup location</th> > <th class="recall-status">Status</th> >@@ -18,7 +19,11 @@ > > <tbody> > [% FOREACH recall IN recalls %] >- <tr> >+ [% IF recall.is_cancelled || recall.has_expired || recall.is_finished %] >+ <tr class="old"> >+ [% ELSE %] >+ <tr> >+ [% END %] > <td> > [% IF recall.is_requested || recall.is_waiting || recall.is_overdue %] > <input type="checkbox" value="[% recall.recall_id %]" name="recall_ids"> >@@ -52,6 +57,10 @@ > [% recall.recalldate | $KohaDates %] > </td> > >+ <td class="recall-waiting"> >+ [% IF recall.waitingdate %][% recall.waitingdate | $KohaDates %][% ELSE %]Not waiting[% END %] >+ </td> >+ > <td class="recall-expiry"> > [% IF ( recall.is_waiting ) %] > [% IF ( recall.expirationdate ) %] >@@ -81,6 +90,8 @@ > Cancelled > [% ELSIF ( recall.is_overdue ) %] > Overdue to be returned >+ [% ELSIF ( recall.is_finished ) %] >+ Closed > [% END %] > </td> > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/recalls.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/recalls.inc >index 14d0436..3215544 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/recalls.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/recalls.inc >@@ -59,6 +59,8 @@ > Cancelled > [% ELSIF ( recall.is_overdue ) %] > Overdue to be returned >+ [% ELSIF ( recall.is_finished ) %] >+ Closed > [% END %] > </td> > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_overdue.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_overdue.tt >index 5a13b62..f8a7604 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_overdue.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_overdue.tt >@@ -5,7 +5,7 @@ > [% 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> >+<script type="text/javascript" src="[% interface %]/[% theme %]/js/recalls_[% KOHA_VERSION %].js"></script> > [% INCLUDE 'datatables.inc' %] > [% INCLUDE 'columns_settings.inc' %] > </head> >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 >index f51d149..d1810e2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_queue.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_queue.tt >@@ -1,13 +1,11 @@ > [% USE Koha %] > [% USE KohaDates %] >+[% 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" /> >-<script type="text/javascript" src="[% interface %]/[% theme %]/js/recalls.js"></script> >-[% INCLUDE 'datatables.inc' %] >-[% INCLUDE 'columns_settings.inc' %] > </head> > <body id="circ_recalls_queue" class="circ"> > [% INCLUDE 'header.inc' %] >@@ -35,7 +33,8 @@ > <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> >+ <input type="checkbox" id="select_all"> <span id="select_all_text">Select all</span> | >+ <input type="checkbox" id="hide_old"> <span id="hide_old_text">Show old recalls</span> > > [% INCLUDE 'recalls-reports.inc' %] > >@@ -67,4 +66,15 @@ > [% END %] > </div> > >+[% MACRO jsinclude BLOCK %] >+ [% INCLUDE 'datatables.inc' %] >+ [% INCLUDE 'columns_settings.inc' %] >+ <script type="text/javascript" src="[% interface %]/[% theme %]/js/recalls_[% KOHA_VERSION %].js"></script> >+ <script type="text/javascript"> >+ $(document).ready(function() { >+ $(".old").hide(); >+ }); >+ </script> >+[% END %] >+ > [% INCLUDE 'intranet-bottom.inc' %] >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 >index 738b544..c8ecaaa 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_waiting.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_waiting.tt >@@ -5,7 +5,7 @@ > [% 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> >+<script type="text/javascript" src="[% interface %]/[% theme %]/js/recalls_[% KOHA_VERSION %].js"></script> > [% INCLUDE 'datatables.inc' %] > <script type="text/javascript"> > $(document).ready(function() { >@@ -76,7 +76,7 @@ > <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> >+ <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% recall.borrowernumber %]">[% recall.patron.firstname %] [% recall.patron.surname %]</a> > [% IF ( recall.patron.phone ) %]<br />[% recall.patron.phone %][% END %] > [% IF ( recall.patron.email ) %]<br /><a href="mailto:[% recall.patron.email %]?subject=Recall waiting: [% recall.biblio.title %]">[% recall.patron.email %]</a>[% END %] > </td> >@@ -99,7 +99,7 @@ > </div> > > <div id="recallsover"> >- [% IF ( over.size > 0 ) %] >+ [% IF ( over.count ) %] > [% 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> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >index c6031c6..4a60663 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -652,7 +652,7 @@ function validate1(date) { > [% ELSE %]<p>Patron has nothing on hold.</p>[% END %] > </div> > >-[% IF Koha.Preference('UseRecalls') && recalls %] >+[% IF Koha.Preference('UseRecalls') && recalls.count %] > [% INCLUDE 'recalls.inc' %] > [% END %] > >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 e87c37d..0b274ab 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/recallshistory.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/recallshistory.tt >@@ -5,7 +5,7 @@ > [% INCLUDE 'doc-head-close.inc' %] > <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" src="[% interface %]/[% theme %]/js/recalls_[% KOHA_VERSION %].js"></script> > </head> > <body id="recalls_history" class="pat"> > [% INCLUDE 'header.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >index 1d16823..32f0463 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js >@@ -274,6 +274,10 @@ $(document).ready(function() { > onsite_checkout += " <span class='onsite_checkout'>(" + INHOUSE_USE + ")</span>"; > } > >+ if ( oObj.recalled == 1 ) { >+ title += " - <span class='circ-hlt item-recalled'>This item has been recalled and the due date updated.</span>"; >+ } >+ > title += " " > + "<a href='/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=" > + oObj.biblionumber >diff --git a/koha-tmpl/intranet-tmpl/prog/js/recalls.js b/koha-tmpl/intranet-tmpl/prog/js/recalls.js >index 1174286..d5d1705 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/recalls.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/recalls.js >@@ -17,9 +17,9 @@ $(document).ready(function() { > .done(function(data) { > var message = ""; > if(data.success == 0) { >- message = "The recall may have already been cancelled. Please refresh the page."; >+ message = _("The recall may have already been cancelled. Please refresh the page."); > } else { >- message = "Cancelled" >+ message = _("Cancelled"); > } > $self.parent().html(message); > }); >@@ -49,4 +49,12 @@ $(document).ready(function() { > $("input[name='recall_ids']").prop("checked", false); > } > }); >+ >+ $("#hide_old").click(function(){ >+ if ($("#hide_old").prop("checked")){ >+ $(".old").show(); >+ } else { >+ $(".old").hide(); >+ } >+ }); > }); >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recall.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recall.tt >index 5a4dc93..9753b21 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recall.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recall.tt >@@ -45,8 +45,8 @@ > <p>You will be notified when your item is waiting to be picked up at the library.</p> > [% ELSIF not error %] > <p>All borrowable material is subject to recall if checked out and needed by someone else. We will ask the person who has checked out this item to return it so you may use it.</p> >- <p><strong>Warning</strong>: Your library does not allow recalls for x item types.</p> >-<hr> >+ <hr> >+ > [% IF loggedinusername %] > <div class="dialog"> > <p>Place a recall on [% biblio.title %] ([% biblio.author %])?</p> <a href="/cgi-bin/koha/opac-recall.pl?op=request&itemnumber=[% itemnumber %]" class="btn btn-default btn-sm">Confirm</a> <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber %]">Cancel</a> >diff --git a/opac/opac-recall.pl b/opac/opac-recall.pl >index 6efe79f..b9ef914 100755 >--- a/opac/opac-recall.pl >+++ b/opac/opac-recall.pl >@@ -23,6 +23,7 @@ use DateTime; > use C4::Auth; > use C4::Output; > use C4::Context; >+use C4::Letters; > use Koha::Items; > use Koha::Recall; > use Koha::Recalls; >@@ -48,16 +49,18 @@ my $biblio = Koha::Biblios->find($item->biblionumber); > my $recalled = Koha::Recalls->find({ itemnumber => $itemnumber }); > my $error; > >+if ( defined $recalled && $recalled->borrowernumber == $borrowernumber && ($recalled->is_requested || $recalled->is_waiting || $recalled->is_overdue) ){ >+ # can't place a recall on an item that this borrower has already recalled >+ # if recall is expired or cancelled, user may recall again >+ $error = 'duplicate'; >+} >+ > if ($op eq 'request'){ >- if (!defined($borrowernumber)){ >+ if (!defined $borrowernumber){ > # can't place recall if not logged in > $error = 'notloggedin'; > print $query->redirect('/cgi-bin/koha/opac-detail.pl?biblionumber='.$item->biblionumber); >- } elsif ( defined $recalled && $recalled->borrowernumber == $borrowernumber && ($recalled->is_requested || $recalled->is_waiting || $recalled->is_overdue) ){ >- # can't place a recall on an item that this borrower has already recalled >- # if recall is expired or cancelled, user may recall again >- $error = 'duplicate'; >- } else { >+ } elsif (!defined $error) { > # can recall > my $borrower = Koha::Patrons->find($borrowernumber); > my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule({ categorycode => $borrower->categorycode, itemtype => $item->itype, branchcode => $item->holdingbranch }); >diff --git a/svc/checkouts b/svc/checkouts >index fefadee..ae9754f 100755 >--- a/svc/checkouts >+++ b/svc/checkouts >@@ -164,6 +164,11 @@ while ( my $c = $sth->fetchrow_hashref() ) { > my $av = Koha::AuthorisedValues->search({ category => 'DAMAGED', authorised_value => $c->{damaged} }); > $damaged = $av->count ? $av->next->lib : ''; > } >+ my $recall = Koha::Recalls->find({ itemnumber => $c->{itemnumber}, biblionumber => $c->{biblionumber}, status => { '=', ['R','O'] } }); >+ my $recalled = 0; >+ if ( defined $recall ){ >+ $recalled = 1; >+ } > my $checkout = { > DT_RowId => $c->{itemnumber} . '-' . $c->{borrowernumber}, > title => $c->{title}, >@@ -220,6 +225,7 @@ while ( my $c = $sth->fetchrow_hashref() ) { > cardnumber => $c->{cardnumber}, > }, > issued_today => !$c->{not_issued_today}, >+ recalled => $recalled, > }; > > if ( $c->{not_issued_today} ) { >diff --git a/t/db_dependent/Koha/Recalls.t b/t/db_dependent/Koha/Recalls.t >index 76ad08f..1b421ff 100644 >--- a/t/db_dependent/Koha/Recalls.t >+++ b/t/db_dependent/Koha/Recalls.t >@@ -62,9 +62,12 @@ is( $recall->is_waiting, 1, 'Recall is waiting for pickup' ); > $recall->update({ status => 'C', cancellationdate => dt_from_string(), old => 1 }); > is( $recall->is_cancelled, 1, 'Recall has been cancelled' ); > >-$recall->update({ status => 'E', expirationdate => dt_from_string() }); >+$recall->update({ status => 'E', expirationdate => dt_from_string(), old => 1 }); > is( $recall->has_expired, 1, 'Recall has expired' ); > >+$recall->update({ status => 'F', old => 1 }); >+is ($recall->is_finished, 1, 'Recall is closed'); >+ > is( $biblio->{biblionumber}, $recall->biblio->biblionumber, 'Can access biblio from recall' ); > > is( $patron->{borrowernumber}, $recall->patron->borrowernumber, 'Can access borrower from recall' ); >@@ -73,6 +76,4 @@ is( $item->{itemnumber}, $recall->item->itemnumber, 'Can access item from recall > > is( $library->{branchcode}, $recall->library->branchcode, 'Can access branch from recall' ); > >-is( $checkout->{issue_id}, $recall->checkout->issue_id, 'Can access checkout from recall' ); >- > $schema->storage->txn_rollback; >-- >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
|
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