From a6549dd70762903d99ffc004f028375abf2bb77d 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 --- catalogue/detail.pl | 10 ++++++++++ .../atomicupdate/bug_19532_-_add_Recalls_syspref.sql | 2 +- installer/data/mysql/sysprefs.sql | 2 +- .../intranet-tmpl/prog/en/includes/recalls-reports.inc | 18 ++++++++++++++++++ .../intranet-tmpl/prog/en/modules/catalogue/detail.tt | 16 ++++++++++++++-- .../intranet-tmpl/prog/en/modules/circ/circulation.tt | 2 +- .../opac-tmpl/bootstrap/en/modules/opac-recall.tt | 3 ++- .../opac-tmpl/bootstrap/en/modules/opac-recalls.tt | 13 ++++++++++++- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt | 2 +- opac/opac-recall.pl | 3 ++- 10 files changed, 62 insertions(+), 9 deletions(-) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 58d4511..0f36d28 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -46,6 +46,7 @@ use Koha::Items; use Koha::ItemTypes; use Koha::Patrons; use Koha::Virtualshelves; +use Koha::Recalls; my $query = CGI->new(); @@ -319,6 +320,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) { @@ -396,6 +403,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")); @@ -405,6 +414,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 4381395..7a16ddf 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 3ff55f9..8c153d5 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -586,7 +586,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 851e565..4ff7674 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 69f098c..7bdb2bf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -305,6 +305,7 @@ [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %] [% END %] +[% IF ( Koha.Preference('UseRecalls') && recalls.count ) %]
  • Recalls
  • [% END %] [% items_table_block_iter = 0 %] @@ -439,7 +440,12 @@ [% 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 %] @@ -783,13 +789,18 @@ [% END %] - [% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectProfile') && Koha.Preference('NovelistSelectStaffView') == 'tab' ) %]
    [% END %] +[% IF ( Koha.Preference('UseRecalls') && recalls.count ) %] +
    + [% INCLUDE 'recalls-reports.inc' %] +
    +[% END %] +
    @@ -839,6 +850,7 @@ [% MACRO jsinclude BLOCK %] [% INCLUDE 'catalog-strings.inc' %] + [% INCLUDE 'greybox.inc' %]