From 56009cd1d90b6a4c2aee03587bc71e10ab3f74f3 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Fri, 22 Dec 2017 00:47:10 +0000 Subject: [PATCH] Bug 19532: Extra fixes This patch addresses some of Liz's comments in Comment 37 - shows new due date on opac-recall.pl when the recall is requested - shows new due date on opac-recalls.pl recalls history - shows new due date on circ/recalls_queue.pl - syspref is default off - recalls tab on catalogue/detail.pl - show that there is a recall on an item on catalogue/detail.pl Signed-off-by: Nick Clemens --- catalogue/detail.pl | 10 ++++++++++ .../bug_19532_-_add_Recalls_syspref.sql | 2 +- installer/data/mysql/sysprefs.sql | 2 +- .../prog/en/includes/recalls-reports.inc | 18 ++++++++++++++++++ .../prog/en/modules/catalogue/detail.tt | 13 ++++++++++++- .../prog/en/modules/circ/circulation.tt | 2 +- .../bootstrap/en/modules/opac-recall.tt | 3 ++- .../bootstrap/en/modules/opac-recalls.tt | 14 +++++++++++++- .../bootstrap/en/modules/opac-user.tt | 2 +- opac/opac-recall.pl | 3 ++- 10 files changed, 61 insertions(+), 8 deletions(-) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index fe59fa12cc..be601bf874 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -45,6 +45,7 @@ use Koha::Items; use Koha::ItemTypes; use Koha::Patrons; use Koha::Virtualshelves; +use Koha::Recalls; my $query = CGI->new(); @@ -333,6 +334,12 @@ foreach my $item (@items) { } } + my $recall = Koha::Recalls->find({ itemnumber => $item->{itemnumber} }); + if (defined $recall){ + $item->{recalled} = 1; + $item->{recall} = $recall; + } + if ($currentbranch and $currentbranch ne "NO_LIBRARY_SET" and C4::Context->preference('SeparateHoldings')) { if ($itembranchcode and $itembranchcode eq $currentbranch) { @@ -410,6 +417,8 @@ foreach ( keys %{$dat} ) { $template->param( "$_" => defined $dat->{$_} ? $dat->{$_} : '' ); } +my $recalls = Koha::Recalls->search({ biblionumber => $biblionumber }); + # does not work: my %views_enabled = map { $_ => 1 } $template->query(loop => 'EnableViews'); # method query not found?!?! $template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("AmazonCoverImages")); @@ -419,6 +428,7 @@ $template->param( biblionumber => $biblionumber, ($analyze? 'analyze':'detailview') =>1, subscriptions => \@subs, + recalls => $recalls, subscriptionsnumber => $subscriptionsnumber, subscriptiontitle => $dat->{title}, searchid => scalar $query->param('searchid'), diff --git a/installer/data/mysql/atomicupdate/bug_19532_-_add_Recalls_syspref.sql b/installer/data/mysql/atomicupdate/bug_19532_-_add_Recalls_syspref.sql index 43813957de..7a16ddf641 100644 --- a/installer/data/mysql/atomicupdate/bug_19532_-_add_Recalls_syspref.sql +++ b/installer/data/mysql/atomicupdate/bug_19532_-_add_Recalls_syspref.sql @@ -1 +1 @@ -INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ('UseRecalls','1',NULL,'Enable or disable recalls','YesNo'); +INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ('UseRecalls','0',NULL,'Enable or disable recalls','YesNo'); diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index bb65bb856a..2b58a45ac9 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -611,7 +611,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('UseICU','0','1','Tell Koha if ICU indexing is in use for Zebra or not.','YesNo'), ('UseKohaPlugins','0','','Enable or disable the ability to use Koha Plugins.','YesNo'), ('UseQueryParser','0',NULL,'If enabled, try to use QueryParser for queries.','YesNo'), -('UseRecalls', '1', NULL, 'Enable or disable recalls', 'YesNo'), +('UseRecalls', '0', NULL, 'Enable or disable recalls', 'YesNo'), ('UseTransportCostMatrix','0','','Use Transport Cost Matrix when filling holds','YesNo'), ('UseWYSIWYGinSystemPreferences','0','','Show WYSIWYG editor when editing certain HTML system preferences.','YesNo'), ('viewISBD','1','','Allow display of ISBD view of bibiographic records','YesNo'), 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 851e565f3c..0097a2724f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/recalls-reports.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/recalls-reports.inc @@ -6,10 +6,12 @@   Requested by Title + Barcode Placed on Expires on Pickup location Status + Due date Cancel @@ -40,6 +42,12 @@ [% recall.biblio.author %] + + + [% recall.item.barcode %] + + + [% recall.recalldate | $KohaDates %] @@ -76,6 +84,16 @@ [% END %] + + [% IF ( recall.is_requested ) %] + Due to be returned by [% recall.checkout.date_due | $KohaDates %] + [% ELSIF ( recall.is_waiting && recall.expirationdate ) %] + Pick up by [% recall.expirationdate | $KohaDates %] + [% ELSE %] + - + [% END %] + + [% IF ( !recall.cancellationdate && ( recall.is_requested || recall.is_overdue ) ) %] Cancel diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index d3f499fc57..3f97b786ff 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -324,6 +324,7 @@ [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %] [% END %] +[% IF ( Koha.Preference('UseRecalls') && recalls.count ) %]
  • Recalls
  • [% END %] [% items_table_block_iter = 0 %] @@ -487,7 +488,10 @@ [% INCLUDE 'patron-title.inc' patron=item.ReservedFor hide_patron_infos_if_needed=1 %] [% END %] [% END %] - [% UNLESS ( item.itemnotforloan || item.notforloan_per_itemtype || item.onloan || item.itemlost || item.withdrawn || item.damaged || item.transfertwhen || item.reservedate ) %] + [% IF ( item.recalled ) %] + Item recalled (placed [% item.recall.recalldate | $KohaDates %]) by [% item.recall.patron.firstname %] [% item.recall.patron.surname %] ([% item.recall.patron.cardnumber %]) + [% END %] + [% UNLESS ( item.itemnotforloan || item.notforloan_per_itemtype || item.onloan || item.itemlost || item.withdrawn || item.damaged || item.transfertwhen || item.reservedate || item.recalled ) %] Available [% END %] @@ -844,6 +848,12 @@ [% END %] +[% IF ( Koha.Preference('UseRecalls') && recalls.count ) %] +
    + [% INCLUDE 'recalls-reports.inc' %] +
    +[% END %] +
    @@ -893,6 +903,7 @@ [% MACRO jsinclude BLOCK %] [% INCLUDE 'catalog-strings.inc' %] [% Asset.js("js/catalog.js") | $raw %] + [% Asset.js("js/recalls.js") | $raw %] [% INCLUDE 'greybox.inc' %]