Bug 31391: Implement UseRecalls choices on OPAC
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
parent
0f35039974
commit
6091466f51
|
|
@ -63,7 +63,7 @@
|
|||
<span class="item-status checkedout">Checked out</span>
|
||||
[% END %]
|
||||
[% END %]
|
||||
[% IF show_recall_link %]
|
||||
[% IF show_recall_link != "off" %]
|
||||
[% IF logged_in_user.borrowernumber != issue.borrowernumber %]
|
||||
<a href="/cgi-bin/koha/opac-recall.pl?biblionumber=[% item.biblionumber | uri %]" class="btn btn-default btn-xs">Recall</a>
|
||||
[% END %]
|
||||
|
|
@ -129,7 +129,7 @@
|
|||
<span class="item-status pendinghold">Pending hold</span>
|
||||
[% END %]
|
||||
|
||||
[% IF Koha.Preference('UseRecalls') && item.has_pending_recall %]
|
||||
[% IF Koha.Preference('UseRecalls') != "off" && item.has_pending_recall %]
|
||||
[% SET itemavailable = 0 %]
|
||||
<span class="item-status pendingrecall">Pending recall</span>
|
||||
[% END %]
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
[% END %]
|
||||
[% END %]
|
||||
|
||||
[% IF Koha.Preference('UseRecalls') %]
|
||||
[% IF Koha.Preference('UseRecalls').match('opac') %]
|
||||
<li
|
||||
><a class="recall btn btn-link btn-lg" href="/cgi-bin/koha/opac-recall.pl?biblionumber=[% biblio.biblionumber | html %]"><i class="fa fa-solid fa-fw fa-book-bookmark" aria-hidden="true"></i> Place recall</a></li
|
||||
>
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@
|
|||
<li [% IF holdshistoryview %]class="active"[% END %]> <a href="/cgi-bin/koha/opac-holdshistory.pl">Holds history</a></li>
|
||||
[% END %]
|
||||
|
||||
[% IF Koha.Preference('UseRecalls') %]
|
||||
[% IF Koha.Preference('UseRecalls') != "off" %]
|
||||
<li [% IF recallsview %]class="active"[% END %]> <a href="/cgi-bin/koha/opac-recalls.pl">Recalls history</a> </li>
|
||||
[% END %]
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@
|
|||
[% NEXT IF !Koha.Preference('MembershipExpiryDaysNotice') && messaging_preference.Patron_Expiry %]
|
||||
[% NEXT IF messaging_preference.Patron_Expiry && enforce_expiry_notice %]
|
||||
[% NEXT IF messaging_preference.Auto_Renewals && Koha.Preference('AutoRenewalNotices') != 'preferences' %]
|
||||
[% NEXT IF !Koha.Preference('UseRecalls') && messaging_preference.message_name.match('^Recall_') %]
|
||||
[% NEXT IF Koha.Preference('UseRecalls') != "off" && messaging_preference.message_name.match('^Recall_') %]
|
||||
<tr id="[% messaging_preference.message_name _ "_message" | lower | html %]">
|
||||
<td
|
||||
>[% IF ( messaging_preference.Item_Due ) %]
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
<div class="col-md-12 col-lg-10 order-1 order-lg-2">
|
||||
<div id="recalls" class="maincontent">
|
||||
<h1>Recalls history</h1>
|
||||
[% IF Koha.Preference('UseRecalls') %]
|
||||
[% IF Koha.Preference('UseRecalls') != "off" %]
|
||||
[% IF RECALLS.count %]
|
||||
<div id="opac-user-recalls">
|
||||
<table id="recalls-table" class="table table-bordered table-striped">
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
[% SET CartEnabled = ( Koha.Preference('opacbookbag') == 1 ) %]
|
||||
[% SET ListsEnabled = ( Koha.Preference('virtualshelves') == 1 ) && LoginEnabled %]
|
||||
[% SET HoldsEnabled = ( Koha.Preference('OPACHoldRequests') == 1 ) && LoginEnabled %]
|
||||
[% SET RecallsEnabled = ( Koha.Preference('UseRecalls') == 1 ) && LoginEnabled %]
|
||||
[% SET RecallsEnabled = ( Koha.Preference('UseRecalls').match('opac') ) && LoginEnabled %]
|
||||
[% SET ArticleRequestsEnabled = ( Koha.Preference('ArticleRequests') == 1 ) && LoginEnabled %]
|
||||
[% SET MultiHolds = ( Koha.Preference('DisplayMultiPlaceHold') == 1 ) && HoldsEnabled %]
|
||||
[% SET CoverImagePlugins = KohaPlugins.get_plugins_opac_cover_images %]
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
[% SET CartEnabled = ( Koha.Preference('opacbookbag') == 1 ) %]
|
||||
[% SET ListsEnabled = ( Koha.Preference('virtualshelves') == 1 ) && LoginEnabled %]
|
||||
[% SET HoldsEnabled = ( Koha.Preference('OPACHoldRequests') == 1 ) && LoginEnabled %]
|
||||
[% SET RecallsEnabled = ( Koha.Preference('UseRecalls') == 1 ) && LoginEnabled %]
|
||||
[% SET RecallsEnabled = ( Koha.Preference('UseRecalls').match('opac') ) && LoginEnabled %]
|
||||
[% SET ArticleRequestsEnabled = ( Koha.Preference('ArticleRequests') == 1 ) && LoginEnabled %]
|
||||
[% SET MultiHolds = ( Koha.Preference('DisplayMultiPlaceHold') == 1 ) && HoldsEnabled %]
|
||||
[% SET CoverImagePlugins = KohaPlugins.get_plugins_opac_cover_images %]
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
[% SET CartEnabled = ( Koha.Preference('opacbookbag') == 1 ) %]
|
||||
[% SET ListsEnabled = ( Koha.Preference('virtualshelves') == 1 ) && LoginEnabled %]
|
||||
[% SET HoldsEnabled = ( Koha.Preference('OPACHoldRequests') == 1 ) && LoginEnabled %]
|
||||
[% SET RecallsEnabled = ( Koha.Preference('UseRecalls') == 1 ) && LoginEnabled %]
|
||||
[% SET RecallsEnabled = ( Koha.Preference('UseRecalls').match('opac') ) && LoginEnabled %]
|
||||
[% SET ArticleRequestsEnabled = ( Koha.Preference('ArticleRequests') == 1 ) && LoginEnabled %]
|
||||
[% SET MultiHolds = ( Koha.Preference('DisplayMultiPlaceHold') == 1 ) && HoldsEnabled %]
|
||||
[% INCLUDE 'doc-head-open.inc' %]
|
||||
|
|
|
|||
|
|
@ -305,7 +305,7 @@
|
|||
<span>Holds ([% reserves_count | html %])</span>
|
||||
[% END %]
|
||||
[% END %]
|
||||
[% IF Koha.Preference('UseRecalls') && RECALLS.count %]
|
||||
[% IF Koha.Preference('UseRecalls') != "off" && RECALLS.count %]
|
||||
[% WRAPPER tab_item tabname= "opac-user-recalls" %]
|
||||
<span>Recalls ([% RECALLS.count | html %])</span>
|
||||
[% END %]
|
||||
|
|
@ -840,7 +840,7 @@
|
|||
[% END # /tab_panel#opac-user-holds %]
|
||||
[% END # / #RESERVES.count %]
|
||||
|
||||
[% IF Koha.Preference('UseRecalls') && RECALLS.count %]
|
||||
[% IF Koha.Preference('UseRecalls') != "off" && RECALLS.count %]
|
||||
[% WRAPPER tab_panel tabname="opac-user-recalls" %]
|
||||
<table id="recalls-table" class="table table-bordered table-striped">
|
||||
<caption>Recalls <span class="count">([% RECALLS.count | html %])</span></caption>
|
||||
|
|
|
|||
|
|
@ -36,7 +36,13 @@ my $op = $query->param('op') || '';
|
|||
my $biblionumber = $query->param('biblionumber');
|
||||
my $biblio = Koha::Biblios->find($biblionumber);
|
||||
|
||||
if ( C4::Context->preference('UseRecalls') ) {
|
||||
if ( $op eq 'cud-cancel' ) {
|
||||
my $recall_id = $query->param('recall_id');
|
||||
Koha::Recalls->find($recall_id)->set_cancelled;
|
||||
print $query->redirect('/cgi-bin/koha/opac-user.pl');
|
||||
}
|
||||
|
||||
if ( C4::Context->preference('UseRecalls') =~ m/opac/ ) {
|
||||
|
||||
my $patron = Koha::Patrons->find($borrowernumber);
|
||||
my $error;
|
||||
|
|
@ -123,10 +129,6 @@ if ( C4::Context->preference('UseRecalls') ) {
|
|||
$error = 'failed';
|
||||
}
|
||||
}
|
||||
} elsif ( $op eq 'cud-cancel' ) {
|
||||
my $recall_id = $query->param('recall_id');
|
||||
Koha::Recalls->find($recall_id)->set_cancelled;
|
||||
print $query->redirect('/cgi-bin/koha/opac-user.pl');
|
||||
}
|
||||
|
||||
my $branches = Koha::Libraries->search();
|
||||
|
|
|
|||
|
|
@ -311,7 +311,7 @@ if ( $pending_checkouts->count ) { # Useless test
|
|||
$issue->{normalized_oclc} = $extractor->get_normalized_oclc;
|
||||
}
|
||||
|
||||
if ( C4::Context->preference('UseRecalls') ) {
|
||||
if ( C4::Context->preference('UseRecalls') ne "off" ) {
|
||||
my $maybe_recalls = Koha::Recalls->search(
|
||||
{ biblio_id => $issue->{biblionumber}, item_id => [ undef, $issue->{itemnumber} ], completed => 0 } );
|
||||
while ( my $recall = $maybe_recalls->next ) {
|
||||
|
|
@ -350,7 +350,7 @@ $template->param(
|
|||
showpriority => $show_priority,
|
||||
);
|
||||
|
||||
if ( C4::Context->preference('UseRecalls') ) {
|
||||
if ( C4::Context->preference('UseRecalls') ne "off" ) {
|
||||
my $recalls = Koha::Recalls->search( { patron_id => $borrowernumber, completed => 0 } );
|
||||
$template->param( RECALLS => $recalls );
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue