Bugzilla – Attachment 172174 Details for
Bug 31391
Staff-side recalls
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31391: Update the UseRecalls system preference to have choices
Bug-31391-Update-the-UseRecalls-system-preference-.patch (text/plain), 54.73 KB, created by
Aleisha Amohia
on 2024-09-27 20:10:16 UTC
(
hide
)
Description:
Bug 31391: Update the UseRecalls system preference to have choices
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2024-09-27 20:10:16 UTC
Size:
54.73 KB
patch
obsolete
>From 82160999a36eea229c7a380d7455f7103dfd07be Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleisha@catalyst.net.nz> >Date: Fri, 27 Sep 2024 18:07:17 +0000 >Subject: [PATCH] Bug 31391: Update the UseRecalls system preference to have > choices > >Options are: >* off >* opac >* staff >* opac_and_staff > >This patch implements this all over the place. > >All recalls things should still work including the above test plan. > >Tests should pass: > >* t/db_dependent/Circulation.t >* t/db_dependent/Circulation/transferbook.t >* t/db_dependent/Holds.t >* t/db_dependent/Koha/Biblio.t >* t/db_dependent/Koha/Item.t >* t/db_dependent/SIP/Transaction.t >* t/db_dependent/Search.t >* t/db_dependent/XSLT.t > >Sponsored-by: Auckland University of Technology >Sponsored-by: Catalyst IT >--- > C4/Circulation.pm | 12 +++++------ > C4/Search.pm | 2 +- > C4/XSLT.pm | 2 +- > Koha/Biblio.pm | 2 +- > Koha/Item.pm | 4 ++-- > circ/circulation.pl | 4 ++-- > circ/returns.pl | 4 ++-- > circ/transferstoreceive.pl | 2 +- > ...ug_31391_-_add_RecallsInterface_syspref.pl | 16 --------------- > .../bug_31391_-_update_UseRecalls_syspref.pl | 19 ++++++++++++++++++ > installer/data/mysql/mandatory/sysprefs.sql | 3 +-- > .../prog/en/includes/biblio-view-menu.inc | 2 +- > .../prog/en/includes/circ-menu.inc | 2 +- > .../prog/en/includes/circ-nav.inc | 2 +- > .../prog/en/includes/holds_table.inc | 6 +++--- > .../tables/items/catalogue_detail.inc | 4 ++-- > .../en/includes/messaging-preference-form.inc | 2 +- > .../prog/en/includes/patron-detail-tabs.inc | 4 ++-- > .../admin/preferences/circulation.pref | 20 +++++++------------ > .../prog/en/modules/admin/smart-rules.tt | 8 ++++---- > .../prog/en/modules/catalogue/results.tt | 2 +- > .../prog/en/modules/circ/circulation-home.tt | 2 +- > .../prog/en/modules/members/recallshistory.tt | 2 +- > .../en/modules/recalls/recalls_old_queue.tt | 2 +- > .../en/modules/recalls/recalls_overdue.tt | 2 +- > .../prog/en/modules/recalls/recalls_queue.tt | 2 +- > .../en/modules/recalls/recalls_to_pull.tt | 2 +- > .../en/modules/recalls/recalls_waiting.tt | 2 +- > .../prog/en/modules/recalls/request.tt | 6 +++--- > .../bootstrap/en/includes/item-status.inc | 4 ++-- > .../en/includes/opac-detail-sidebar.inc | 2 +- > .../bootstrap/en/includes/usermenu.inc | 2 +- > .../bootstrap/en/modules/opac-messaging.tt | 2 +- > .../bootstrap/en/modules/opac-recalls.tt | 2 +- > .../bootstrap/en/modules/opac-results.tt | 2 +- > .../bootstrap/en/modules/opac-shelves.tt | 2 +- > .../bootstrap/en/modules/opac-tags.tt | 2 +- > .../bootstrap/en/modules/opac-user.tt | 4 ++-- > members/moremember.pl | 4 ++-- > opac/opac-recall.pl | 2 +- > opac/opac-user.pl | 4 ++-- > recalls/request.pl | 7 ++----- > svc/checkouts | 2 +- > t/db_dependent/Circulation.t | 8 ++++---- > t/db_dependent/Circulation/transferbook.t | 2 +- > t/db_dependent/Holds.t | 2 +- > t/db_dependent/Koha/Biblio.t | 4 ++-- > t/db_dependent/Koha/Item.t | 8 ++++---- > t/db_dependent/SIP/Transaction.t | 2 +- > t/db_dependent/Search.t | 2 +- > t/db_dependent/XSLT.t | 4 ++-- > 51 files changed, 104 insertions(+), 111 deletions(-) > delete mode 100755 installer/data/mysql/atomicupdate/bug_31391_-_add_RecallsInterface_syspref.pl > create mode 100755 installer/data/mysql/atomicupdate/bug_31391_-_update_UseRecalls_syspref.pl > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index bd8ecfc58fa..598c791c064 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -386,7 +386,7 @@ sub transferbook { > } > > # find recall >- if ( C4::Context->preference('UseRecalls') ) { >+ if ( C4::Context->preference('UseRecalls') ne "off" ) { > my $recall = Koha::Recalls->find({ item_id => $itemnumber, status => 'in_transit' }); > if ( defined $recall ) { > # do a transfer if the recall branch is different to the item holding branch >@@ -1143,7 +1143,7 @@ sub CanBookBeIssued { > # CHECK IF ITEM HAS BEEN RECALLED BY ANOTHER PATRON > # Only bother doing this if UseRecalls is enabled and the item is recallable > # Don't look at recalls that are in transit >- if ( C4::Context->preference('UseRecalls') and $item_object->can_be_waiting_recall ) { >+ if ( C4::Context->preference('UseRecalls') ne "off" and $item_object->can_be_waiting_recall ) { > my @recalls = $biblio->recalls({},{ order_by => { -asc => 'created_date' } })->filter_by_current->as_list; > > foreach my $r ( @recalls ) { >@@ -1648,7 +1648,7 @@ sub AddIssue { > $item_object->discard_changes; > } > >- if ( C4::Context->preference('UseRecalls') ) { >+ if ( C4::Context->preference('UseRecalls') ne "off" ) { > Koha::Recalls->move_recall( > { > action => $cancel_recall, >@@ -2426,7 +2426,7 @@ sub AddReturn { > } > > # find recalls... >- if ( C4::Context->preference('UseRecalls') ) { >+ if ( C4::Context->preference('UseRecalls') ne "off" ) { > # check if this item is recallable first, which includes checking if UseRecalls syspref is enabled > my $recall = undef; > $recall = $item->check_recalls if $item->can_be_waiting_recall; >@@ -2503,7 +2503,7 @@ sub AddReturn { > $request->status('RET') if $request; > } > >- if ( C4::Context->preference('UseRecalls') ) { >+ if ( C4::Context->preference('UseRecalls') ne "off" ) { > # all recalls that have triggered a transfer will have an allocated itemnumber > my $transfer_recall = Koha::Recalls->find({ item_id => $item->itemnumber, status => 'in_transit' }); > if ( $transfer_recall and $transfer_recall->pickup_library_id eq $branch ) { >@@ -3061,7 +3061,7 @@ sub CanBookBeRenewed { > > } > >- if ( C4::Context->preference('UseRecalls') ) { >+ if ( C4::Context->preference('UseRecalls') ne "off" ) { > my $recall = undef; > $recall = $item->check_recalls if $item->can_be_waiting_recall; > if ( defined $recall ) { >diff --git a/C4/Search.pm b/C4/Search.pm >index ca8e79ab0f1..89534c12db3 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -1936,7 +1936,7 @@ sub searchResults { > ) > : ( '', '', '' ); > $reservestatus = C4::Reserves::GetReserveStatus( $item->{itemnumber} ); >- if ( C4::Context->preference('UseRecalls') ) { >+ if ( C4::Context->preference('UseRecalls') ne "off" ) { > if ( Koha::Recalls->search({ item_id => $item->{itemnumber}, status => 'waiting' })->count ) { > $recallstatus = 'Waiting'; > } >diff --git a/C4/XSLT.pm b/C4/XSLT.pm >index 458d732d23c..d0bcc8ff209 100644 >--- a/C4/XSLT.pm >+++ b/C4/XSLT.pm >@@ -299,7 +299,7 @@ sub buildKohaItemsNamespace { > my $substatus = ''; > my $recalls_count; > >- if ( C4::Context->preference('UseRecalls') ) { >+ if ( C4::Context->preference('UseRecalls') ne "off" ) { > $recalls_count = Koha::Recalls->search({ item_id => $item->itemnumber, status => 'waiting' })->count; > } > >diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm >index 9be761d0e19..183b0ae7608 100644 >--- a/Koha/Biblio.pm >+++ b/Koha/Biblio.pm >@@ -1988,7 +1988,7 @@ if hold_convert $param is included, this is to say that this a check to convert > sub can_be_recalled { > my ( $self, $params ) = @_; > >- return 0 if !( C4::Context->preference('UseRecalls') ); >+ return 0 if ( C4::Context->preference('UseRecalls') eq "off" ); > > my $patron = $params->{patron}; > >diff --git a/Koha/Item.pm b/Koha/Item.pm >index a011c5563ee..1b68b441c22 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -2276,7 +2276,7 @@ if hold_convert $param is included, this is to say that this a check to convert > sub can_be_recalled { > my ( $self, $params ) = @_; > >- return 0 if !( C4::Context->preference('UseRecalls') ); >+ return 0 if ( C4::Context->preference('UseRecalls') eq "off" ); > > # check if this item is not for loan, withdrawn or lost > return 0 if ( $self->notforloan != 0 ); >@@ -2361,7 +2361,7 @@ At this point the item has already been recalled. We are now at the checkin and > sub can_be_waiting_recall { > my ( $self ) = @_; > >- return 0 if !( C4::Context->preference('UseRecalls') ); >+ return 0 if ( C4::Context->preference('UseRecalls') eq "off" ); > > # check if this item is not for loan, withdrawn or lost > return 0 if ( $self->notforloan != 0 ); >diff --git a/circ/circulation.pl b/circ/circulation.pl >index 9230347ce01..16051a3bc27 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -500,7 +500,7 @@ if (@$barcodes && $op eq 'cud-checkout') { > } > unless ($confirm_required) { > my $switch_onsite_checkout = exists $messages->{ONSITE_CHECKOUT_WILL_BE_SWITCHED}; >- if ( C4::Context->preference('UseRecalls') && !$recall_id ) { >+ if ( C4::Context->preference('UseRecalls') ne "off" && !$recall_id ) { > my $recall = Koha::Recalls->find( > { > biblio_id => $item->biblionumber, >@@ -576,7 +576,7 @@ if ($patron) { > WaitingHolds => $waiting_holds, > ); > >- if ( C4::Context->preference('UseRecalls') ) { >+ if ( C4::Context->preference('UseRecalls') ne "off" ) { > my $waiting_recalls = $patron->recalls->search({ status => 'waiting' }); > $template->param( > recalls => $patron->recalls->filter_by_current->search({},{ order_by => { -asc => 'created_date' } }), >diff --git a/circ/returns.pl b/circ/returns.pl >index b57e64a9204..0a12b01e1c2 100755 >--- a/circ/returns.pl >+++ b/circ/returns.pl >@@ -262,7 +262,7 @@ if ($transit && $op eq 'cud-transfer') { > my $transfer = Koha::Item::Transfers->find($transit); > if ( $canceltransfer ) { > $transfer->cancel({ reason => 'Manual', force => 1}); >- if ( C4::Context->preference('UseRecalls') ) { >+ if ( C4::Context->preference('UseRecalls') ne "off" ) { > my $recall_transfer_deleted = Koha::Recalls->find({ item_id => $itemnumber, status => 'in_transit' }); > if ( defined $recall_transfer_deleted ) { > $recall_transfer_deleted->revert_transfer; >@@ -276,7 +276,7 @@ if ($transit && $op eq 'cud-transfer') { > my $item = Koha::Items->find($itemnumber); > my $transfer = $item->get_transfer; > $transfer->cancel({ reason => 'Manual', force => 1}); >- if ( C4::Context->preference('UseRecalls') ) { >+ if ( C4::Context->preference('UseRecalls') ne "off" ) { > my $recall_transfer_deleted = Koha::Recalls->find({ item_id => $itemnumber, status => 'in_transit' }); > if ( defined $recall_transfer_deleted ) { > $recall_transfer_deleted->revert_transfer; >diff --git a/circ/transferstoreceive.pl b/circ/transferstoreceive.pl >index 0116278145e..113e54f1457 100755 >--- a/circ/transferstoreceive.pl >+++ b/circ/transferstoreceive.pl >@@ -111,7 +111,7 @@ while ( my $library = $libraries->next ) { > } > > # check for a recall for this transfer >- if ( C4::Context->preference('UseRecalls') ) { >+ if ( C4::Context->preference('UseRecalls') ne "off" ) { > my $recall = $item->recall; > if ( defined $recall ) { > $getransf{recall} = $recall; >diff --git a/installer/data/mysql/atomicupdate/bug_31391_-_add_RecallsInterface_syspref.pl b/installer/data/mysql/atomicupdate/bug_31391_-_add_RecallsInterface_syspref.pl >deleted file mode 100755 >index 17c0896d332..00000000000 >--- a/installer/data/mysql/atomicupdate/bug_31391_-_add_RecallsInterface_syspref.pl >+++ /dev/null >@@ -1,16 +0,0 @@ >-use Modern::Perl; >- >-return { >- bug_number => "31391", >- description => "Staff-side recalls", >- up => sub { >- my ($args) = @_; >- my ( $dbh, $out ) = @$args{qw(dbh out)}; >- >- $dbh->do( >- q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('RecallsInterface','opac','opac|staff|both','The interface that recalls can be placed through','Choice') } >- ); >- >- say $out "Added system preference 'RecallsInterface'"; >- }, >-}; >diff --git a/installer/data/mysql/atomicupdate/bug_31391_-_update_UseRecalls_syspref.pl b/installer/data/mysql/atomicupdate/bug_31391_-_update_UseRecalls_syspref.pl >new file mode 100755 >index 00000000000..9af3394519f >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_31391_-_update_UseRecalls_syspref.pl >@@ -0,0 +1,19 @@ >+use Modern::Perl; >+use Koha::Installer::Output qw(say_warning say_failure say_success say_info); >+ >+return { >+ bug_number => "31391", >+ description => "Staff-side recalls", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ try { >+ $dbh->do(q{UPDATE systempreferences SET value = "off", options = "off|opac|staff|opac_and_staff", type="Choice" WHERE variable = "UseRecalls" AND value = "0"}); >+ $dbh->do(q{UPDATE systempreferences SET value = "opac", options = "off|opac|staff|opac_and_staff", type="Choice" WHERE variable = "UseRecalls" AND value = "1"}); >+ say_success( $out, "Updated system preference 'UseRecalls' to include interface choices" ); >+ } >+ catch { >+ say_failure( $out, "Database modification failed with errors: $_" ); >+ }; >+ }, >+}; >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index d0499a28c5b..3ad73b12c07 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -640,7 +640,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('QuoteOfTheDay','','intranet,opac','Enable or disable display of Quote of the Day on the OPAC and staff interface home page','multiple'), > ('RandomizeHoldsQueueWeight','0',NULL,'if ON, the holds queue in circulation will be randomized, either based on all location codes, or by the location codes specified in StaticHoldsQueueWeight','YesNo'), > ('RealTimeHoldsQueue', '0', NULL, 'Enable updating the holds queue in real time', 'YesNo'), >-('RecallsInterface','opac','opac|staff|both','The interface that recalls can be placed through','Choice'), > ('RecallsLog','1',NULL,'If ON, log create/cancel/expire/fulfill actions on recalls','YesNo'), > ('RecallsMaxPickUpDelay','7',NULL,'Define the maximum time a recall can be awaiting pickup','Integer'), > ('RecordLocalUseOnReturn','0',NULL,'If ON, statistically record returns of unissued items as local use, instead of return','YesNo'), >@@ -843,7 +842,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('UseICUStyleQuotes','0','1','Tell Koha whether to use ICU style quotes ({) or default (") when tracing subjects .','YesNo'), > ('UseLocationAsAQInSIP', '0', '', 'Use permanent_location instead of homebranch for AQ in SIP response', 'YesNo'), > ('UseOCLCEncodingLevels','0',NULL,'If enabled, include OCLC encoding levels in leader value builder dropdown for position 17.','YesNo'), >-('UseRecalls','0',NULL,'Enable or disable recalls','YesNo'), >+('UseRecalls','off','off|opac|staff|opac_and_staff','Enable or disable recalls','Choice'), > ('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/biblio-view-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc >index 3e5625eff0a..407f35de3c0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc >@@ -124,7 +124,7 @@ > </li> > [%- END -%] > >- [%- IF ( Koha.Preference('UseRecalls') && CAN_user_recalls ) -%] >+ [%- IF ( Koha.Preference('UseRecalls') != "off" && CAN_user_recalls ) -%] > [%- IF ( recallsview ) -%] > <li class="active"> > [%- ELSE -%] >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 56d4e923afa..bb7b7852af8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >@@ -243,7 +243,7 @@ > <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 Koha.Preference('UseRecalls') != "off" && 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> >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 86ca5d18ce2..60e532cc822 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc >@@ -70,7 +70,7 @@ > > > <div class="col-sm-6 col-md-12"> >- [% IF Koha.Preference('UseRecalls') and CAN_user_recalls %] >+ [% IF Koha.Preference('UseRecalls') != "off" and CAN_user_recalls %] > <h5>Recalls</h5> > <ul> > <li> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >index f75ea3713e5..dbd906a5142 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >@@ -73,7 +73,7 @@ > <option value="[% hold.priority | html %]" selected="selected">[% this_priority | html %]</option> > [% END %] > <option value="del">del</option> >- [% IF Koha.Preference('UseRecalls') AND Koha.Preference('RecallsInterface') != 'opac' %] >+ [% IF ( Koha.Preference('UseRecalls').match('staff') ) %] > <option value="recall">recall</option> > [% END %] > </select> >@@ -91,7 +91,7 @@ > [% ELSE %] > <option value="[% hold.priority | html %]" selected="selected">[% this_priority | html %]</option> > [% END %] >- [% IF Koha.Preference('UseRecalls') AND Koha.Preference('RecallsInterface') != 'opac' %] >+ [% IF ( Koha.Preference('UseRecalls').match('staff') ) %] > <option value="recall">recall</option> > [% END %] > </select> >@@ -277,7 +277,7 @@ > <td></td> > [% END %] > <td> >- [% IF Koha.Preference('UseRecalls') AND Koha.Preference('RecallsInterface') != 'opac' %] >+ [% IF ( Koha.Preference('UseRecalls').match('staff') ) %] > <a class="convert-to-recall btn" title="Convert hold to recall" data-id="[% hold.reserve_id | html %]">Mark for conversion to recall</a> > [% END %] > </td> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >index 099cfdd6fd1..73728ea0786 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >@@ -217,7 +217,7 @@ > [% IF biblio.serial %] > embed.push('serial_item.serial'); > [% END %] >- [% IF Koha.Preference('UseRecalls') %] >+ [% IF Koha.Preference('UseRecalls') != "off" %] > embed.push('recall', 'recall+strings', 'recall.patron') > [% END %] > [% IF bundlesEnabled %] >@@ -511,7 +511,7 @@ > } > } > >- [% IF Koha.Preference('UseRecalls') %] >+ [% IF Koha.Preference('UseRecalls') != "off" %] > if ( row.recall ) { > if ( row.recall.waiting_date ) { > nodes += '<span>%s</span>'.format(_("Waiting at %s since %s").format(escape_str(row.recall.pickup_library_id.str), $date(row.recall.waiting_date))); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc >index ecf35310f3f..f9c6b70f57c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc >@@ -18,7 +18,7 @@ > [% FOREACH messaging_preference IN messaging_preferences %] > [% NEXT IF !Koha.Preference( 'ILLModule' ) && messaging_preference.message_name.match('^Ill_') %] > [% 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 ) %]<span>Item due</span> > [% ELSIF ( messaging_preference.Advance_Notice ) %]<span>Advance notice</span> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-detail-tabs.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-detail-tabs.inc >index bf6de17daf8..f6820ccb0dd 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-detail-tabs.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-detail-tabs.inc >@@ -30,7 +30,7 @@ > [% END %] > [% END %] > >- [% IF Koha.Preference('UseRecalls') %] >+ [% IF Koha.Preference('UseRecalls') != "off" %] > [% WRAPPER tab_item tabname= "recalls" %] > <span>Recalls</span> ([% recalls.count || 0 | html %]) > [% END %] >@@ -230,7 +230,7 @@ > [% END %] > [% END %] > >- [% IF Koha.Preference('UseRecalls') %] >+ [% IF Koha.Preference('UseRecalls') != "off" %] > [% WRAPPER tab_panel tabname="recalls" %] > [% INCLUDE 'recalls.inc' %] > [% END # /tab_panel# %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >index bd09f91011c..327ee09e47a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >@@ -1444,21 +1444,15 @@ Circulation: > - class: integer > - days. > - >+ - Recalls > - pref: UseRecalls >- type: boolean >+ default: off > choices: >- 1: Use >- 0: "Don't use" >- - recalls. Make sure you configure <a href="/cgi-bin/koha/admin/smart-rules.pl">circulation and fine rules</a> for recalls once enabled. >- - >- - Recalls can be placed through >- - pref: RecallsInterface >- default: opac >- choices: >- opac: the OPAC only >- staff: the staff interface only >- both: both the OPAC and the staff interface >- - . (Requires <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=UseRecalls">UseRecalls</a>.) >+ off: are disabled >+ opac: can be placed through the OPAC only >+ staff: can be placed through the staff interface only >+ opac_and_staff: can be placed through both the OPAC and staff interface >+ - . Make sure you configure <a href="/cgi-bin/koha/admin/smart-rules.pl">circulation and fine rules</a> for recalls when enabled. > > SIP2: > - >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >index 370bd7b17ad..bc08ec6a79b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >@@ -147,7 +147,7 @@ > <th>Article requests</th> > [% END %] > <th>Rental discount (%)</th> >- [% IF Koha.Preference('UseRecalls') %] >+ [% IF Koha.Preference('UseRecalls') != "off" %] > <th>Recalls allowed (total)</th> > <th>Recalls per record (count)</th> > <th>On shelf recalls allowed</th> >@@ -392,7 +392,7 @@ > </td> > [% END %] > <td>[% rentaldiscount | html %]</td> >- [% IF Koha.Preference('UseRecalls') %] >+ [% IF Koha.Preference('UseRecalls') != "off" %] > <td>[% recalls_allowed | html %]</td> > <td>[% recalls_per_record | html %]</td> > <td data-code="[% on_shelf_recalls | html %]"> >@@ -539,7 +539,7 @@ > </td> > [% END %] > <td><input type="text" name="rentaldiscount" id="rentaldiscount" size="2" /></td> >- [% IF Koha.Preference('UseRecalls') %] >+ [% IF Koha.Preference('UseRecalls') != "off" %] > <td><input type="text" name="recalls_allowed" id="recalls_allowed" size="3"></td> > <td><input type="text" name="recalls_per_record" id="recalls_per_record" size="3"></td> > <td> >@@ -603,7 +603,7 @@ > <th>Article requests</th> > [% END %] > <th>Rental discount (%)</th> >- [% IF Koha.Preference('UseRecalls') %] >+ [% IF Koha.Preference('UseRecalls') != "off" %] > <th>Recalls allowed (total)</th> > <th>Recalls per record (count)</th> > <th>On shelf recalls allowed</th> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >index e2dcdb6ff87..5f112bbb596 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >@@ -566,7 +566,7 @@ > <span>Holds ([% SEARCH_RESULT.biblio_object.holds.count | html %])</span> > [% END %] > [% END # /IF SEARCH_RESULT.norequests %] >- [% IF Koha.Preference('UseRecalls') and CAN_user_recalls %] >+ [% IF Koha.Preference('UseRecalls') != "off" and CAN_user_recalls %] > | <a id="recall_[% SEARCH_RESULT.biblionumber | html %]" href="/cgi-bin/koha/recalls/request.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %]">Recalls ([% SEARCH_RESULT.biblio_object.recalls.search( completed => 0 ).count | html %])</a> > [% END %] > >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 b7f0c5b1dec..ecbfc04a6ee 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 >@@ -100,7 +100,7 @@ > </li> > </ul> > >- [% IF Koha.Preference('UseRecalls') and CAN_user_recalls %] >+ [% IF Koha.Preference('UseRecalls') != "off" and CAN_user_recalls %] > <h3>Recalls</h3> > > <ul class="buttons-list"> >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 9e30b0fec25..1c02c5d3f0d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/recallshistory.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/recallshistory.tt >@@ -30,7 +30,7 @@ > [% INCLUDE 'messages.inc' %] > [% INCLUDE 'members-toolbar.inc' %] > <h1>Recalls history</h1> >- [% IF Koha.Preference('UseRecalls') %] >+ [% IF Koha.Preference('UseRecalls') != "off" %] > <input type="checkbox" id="hide_old" name="hide_old" checked="checked"> > <label for="hide_old">Show old recalls</label> > [% INCLUDE 'recalls.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_old_queue.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_old_queue.tt >index 9488a6580bc..7aab33f70f5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_old_queue.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_old_queue.tt >@@ -39,7 +39,7 @@ > [% INCLUDE 'messages.inc' %] > > <h1>Old recalls</h1> >- [% IF Koha.Preference('UseRecalls') %] >+ [% IF Koha.Preference('UseRecalls') != "off" %] > <div class="page-section"> > [% INCLUDE 'recalls.inc' %] > </div> <!-- /.page-section --> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_overdue.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_overdue.tt >index 61bbb246e83..4c8e163623c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_overdue.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_overdue.tt >@@ -39,7 +39,7 @@ > [% INCLUDE 'messages.inc' %] > > <h1>Overdue recalls</h1> >- [% IF Koha.Preference('UseRecalls') %] >+ [% IF Koha.Preference('UseRecalls') != "off" %] > [% IF recalls.count %] > <div class="page-section"> > <form method="post" action="/cgi-bin/koha/recalls/recalls_overdue.pl"> >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 >index 112bdaa7fb7..378d9a6f2c5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_queue.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_queue.tt >@@ -39,7 +39,7 @@ > [% INCLUDE 'messages.inc' %] > > <h1>Recalls queue</h1> >- [% IF Koha.Preference('UseRecalls') %] >+ [% IF Koha.Preference('UseRecalls') != "off" %] > [% IF recalls.count %] > <div class="page-section"> > <form method="post" action="/cgi-bin/koha/recalls/recalls_queue.pl"> >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 >index b2af89c0521..9d88f7fa09d 100644 >--- 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 >@@ -44,7 +44,7 @@ > <h1>Recalls to pull</h1> > The following recalls could be fulfilled by available items. > >- [% IF Koha.Preference('UseRecalls') %] >+ [% IF Koha.Preference('UseRecalls') != "off" %] > [% IF recalls %] > <div id="recalls" class="page-section"> > <table id="recalls-table"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_waiting.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_waiting.tt >index a2adf81e9b8..0705b8d212f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_waiting.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_waiting.tt >@@ -39,7 +39,7 @@ > [% INCLUDE 'messages.inc' %] > <h1>Recalls awaiting pickup</h1> > >- [% IF Koha.Preference('UseRecalls') %] >+ [% IF Koha.Preference('UseRecalls') != "off" %] > > [% WRAPPER tabs id= "results" %] > [% WRAPPER tabs_nav %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/request.tt >index 44758f5a833..709dc57197f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/request.tt >@@ -199,9 +199,9 @@ > > [% ELSE %] > >- [% IF Koha.Preference('RecallsInterface') == 'opac' %] >+ [% IF Koha.Preference('UseRecalls') == 'opac' %] > <div class="dialog alert"> >- Due to the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=RecallsInterface">RecallsInterface</a> system preference, recalls cannot be placed through the staff interface. >+ Due to the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=UseRecalls">UseRecalls</a> system preference, recalls cannot be placed through the staff interface. > </div> > [% ELSE %] > >@@ -226,7 +226,7 @@ > > <h2>Existing recalls</h2> > >- [% IF Koha.Preference('UseRecalls') %] >+ [% IF Koha.Preference('UseRecalls') != "off" %] > [% IF recalls.count %] > <div class="page-section"> > <form method="post" action="/cgi-bin/koha/recalls/request.pl"> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >index 2d19d918cea..3e214b82a15 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >@@ -62,7 +62,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 %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc >index 8cb9a0f51d4..7aea2c9796a 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc >@@ -9,7 +9,7 @@ > [% END %] > [% END %] > >- [% IF Koha.Preference('UseRecalls') AND Koha.Preference('RecallsInterface') != 'staff' %] >+ [% 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> > [% END %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc >index d088f48ab7d..44ba662f07a 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc >@@ -84,7 +84,7 @@ > <a href="/cgi-bin/koha/opac-holdshistory.pl">Holds history</a></li> > [% END %] > >- [% IF Koha.Preference('UseRecalls') %] >+ [% IF Koha.Preference('UseRecalls') != "off" %] > [% IF ( recallsview ) %] > <li class="active"> > [% ELSE %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt >index c25147453d1..06387fb3f32 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt >@@ -60,7 +60,7 @@ > [% FOREACH messaging_preference IN messaging_preferences %] > [% NEXT IF !Koha.Preference( 'ILLModule' ) && messaging_preference.message_name.match('^Ill_') %] > [% 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 ) %]<span>Item due</span> > [% ELSIF ( messaging_preference.Advance_Notice ) %]<span>Advance notice</span> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recalls.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recalls.tt >index 445854d0cf9..eb54cce5f67 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recalls.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recalls.tt >@@ -28,7 +28,7 @@ > <div class="col-md-12 col-lg-10 order-1 order-lg-2"> > <div id="recalls" class="maincontent"> > <h2>Recalls history</h2> >- [% 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"> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >index fcaf00e51c0..e4875f98c69 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >@@ -11,7 +11,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 && ( Koha.Preference('RecallsInterface') != 'staff' ) %] >+[% 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 %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >index a9df061992b..161d14bbbdc 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >@@ -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 && ( Koha.Preference('RecallsInterface') != 'staff' ) %] >+[% SET RecallsEnabled = ( Koha.Preference('UseRecalls').match('opac') ) && LoginEnabled %] > [% SET ArticleRequestsEnabled = ( Koha.Preference('ArticleRequests') == 1 ) && LoginEnabled %] > [% SET MultiHolds = ( Koha.Preference('DisplayMultiPlaceHold') == 1 ) && HoldsEnabled %] > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt >index bd0923d33eb..7a4030ffbeb 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt >@@ -12,7 +12,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 && ( Koha.Preference('RecallsInterface') != 'staff' ) %] >+[% 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' %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >index 89e2b1dd0ad..febfbdc07ba 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >@@ -298,7 +298,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 %] >@@ -843,7 +843,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> >diff --git a/members/moremember.pl b/members/moremember.pl >index 773bc4190d8..f9eaaceb558 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -213,7 +213,7 @@ $template->param( > WaitingHolds => $waiting_holds, > ); > >-if ( C4::Context->preference('UseRecalls') ) { >+if ( C4::Context->preference('UseRecalls') ne "off" ) { > my $waiting_recalls = $patron->recalls->search({ status => 'waiting' }); > $template->param( waiting_recalls => $waiting_recalls ); > } >@@ -305,7 +305,7 @@ $template->param( > patron_lists_count => $patron_lists_count, > ); > >-if ( C4::Context->preference('UseRecalls') ) { >+if ( C4::Context->preference('UseRecalls') ne "off" ) { > $template->param( > recalls => $patron->recalls({},{ order_by => { -asc => 'recalldate' } })->filter_by_current, > specific_patron => 1, >diff --git a/opac/opac-recall.pl b/opac/opac-recall.pl >index 66cf3dad00a..3e7e2f16091 100755 >--- a/opac/opac-recall.pl >+++ b/opac/opac-recall.pl >@@ -42,7 +42,7 @@ if ($op eq 'cud-cancel'){ > print $query->redirect('/cgi-bin/koha/opac-user.pl'); > } > >-if ( C4::Context->preference('UseRecalls') and C4::Context->preference('RecallsInterface') ne 'staff' ) { >+if ( C4::Context->preference('UseRecalls') =~ m/opac/ ) { > > my $patron = Koha::Patrons->find( $borrowernumber ); > my $error; >diff --git a/opac/opac-user.pl b/opac/opac-user.pl >index a1b8b9f9100..ad7ece4db5b 100755 >--- a/opac/opac-user.pl >+++ b/opac/opac-user.pl >@@ -298,7 +298,7 @@ if ( $pending_checkouts->count ) { # Useless test > $issue->{normalized_oclc} = GetNormalizedOCLCNumber( $marcrecord, C4::Context->preference('marcflavour') ); > } > >- 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 ) { > if ( $recall->checkout and $recall->checkout->issue_id == $issue->{issue_id} ) { >@@ -334,7 +334,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 ); > } >diff --git a/recalls/request.pl b/recalls/request.pl >index 35b0e3e80f0..efe57dcdce9 100755 >--- a/recalls/request.pl >+++ b/recalls/request.pl >@@ -49,9 +49,7 @@ if ( $op eq 'cud-cancel_multiple_recalls' ) { > print $input->redirect( '/cgi-bin/koha/recalls/request.pl?biblionumber=' . $biblionumber ); > } elsif ( $op eq 'cud-request' ) { > >- if ( C4::Context->preference('UseRecalls') >- and C4::Context->preference('RecallsInterface') ne 'opac' >- and $borrowernumber ) >+ if ( C4::Context->preference('UseRecalls') =~ m/staff/ and $borrowernumber ) > { > my $patron = Koha::Patrons->find($borrowernumber); > >@@ -130,8 +128,7 @@ if ( $op eq 'cud-cancel_multiple_recalls' ) { > if ($borrowernumber) { > my $patron = Koha::Patrons->find($borrowernumber); > >- if ( C4::Context->preference('UseRecalls') >- and C4::Context->preference('RecallsInterface') ne 'opac' >+ if ( C4::Context->preference('UseRecalls') =~ m/staff/ > and $patron > and $patron->borrowernumber ) > { >diff --git a/svc/checkouts b/svc/checkouts >index dd8d1d0f820..382034a665e 100755 >--- a/svc/checkouts >+++ b/svc/checkouts >@@ -219,7 +219,7 @@ while ( my $c = $sth->fetchrow_hashref() ) { > my @subtitles = split(/ \| /, $c->{'subtitle'} // '' ); > > my $recalled = 0; >- if ( C4::Context->preference('UseRecalls') ) { >+ if ( C4::Context->preference('UseRecalls') ne "off" ) { > my $item = Koha::Items->find( $c->{itemnumber} ); > my $recall = undef; > $recall = $item->check_recalls if $item->can_be_waiting_recall; >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index 009c968c445..6d81b1547b4 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -1728,7 +1728,7 @@ subtest "CanBookBeRenewed tests" => sub { > ); > > # Recalls >- t::lib::Mocks::mock_preference('UseRecalls', 1); >+ t::lib::Mocks::mock_preference('UseRecalls', 'opac'); > Koha::CirculationRules->set_rules({ > categorycode => undef, > branchcode => undef, >@@ -2441,7 +2441,7 @@ subtest 'AddIssue & AllowReturnToBranch' => sub { > subtest 'AddIssue | recalls' => sub { > plan tests => 3; > >- t::lib::Mocks::mock_preference("UseRecalls", 1); >+ t::lib::Mocks::mock_preference("UseRecalls", 'opac'); > t::lib::Mocks::mock_preference("item-level_itypes", 1); > my $patron1 = $builder->build_object({ class => 'Koha::Patrons' }); > my $patron2 = $builder->build_object({ class => 'Koha::Patrons' }); >@@ -4786,7 +4786,7 @@ subtest 'CanBookBeIssued | notforloan' => sub { > subtest 'CanBookBeIssued | recalls' => sub { > plan tests => 3; > >- t::lib::Mocks::mock_preference("UseRecalls", 1); >+ t::lib::Mocks::mock_preference("UseRecalls", 'opac'); > t::lib::Mocks::mock_preference("item-level_itypes", 1); > my $patron1 = $builder->build_object({ class => 'Koha::Patrons' }); > my $patron2 = $builder->build_object({ class => 'Koha::Patrons' }); >@@ -4938,7 +4938,7 @@ subtest 'AddReturn should clear items.onloan for unissued items' => sub { > subtest 'AddReturn | recalls' => sub { > plan tests => 3; > >- t::lib::Mocks::mock_preference("UseRecalls", 1); >+ t::lib::Mocks::mock_preference("UseRecalls", 'opac'); > t::lib::Mocks::mock_preference("item-level_itypes", 1); > my $patron1 = $builder->build_object({ class => 'Koha::Patrons' }); > my $patron2 = $builder->build_object({ class => 'Koha::Patrons' }); >diff --git a/t/db_dependent/Circulation/transferbook.t b/t/db_dependent/Circulation/transferbook.t >index 78ca0b34c88..d8ec03fc26c 100755 >--- a/t/db_dependent/Circulation/transferbook.t >+++ b/t/db_dependent/Circulation/transferbook.t >@@ -158,7 +158,7 @@ subtest 'transfer already at destination' => sub { > is( $messages->{ResFound}->{itemnumber}, $item->itemnumber, "We got the reserve info"); > > # recalls >- t::lib::Mocks::mock_preference('UseRecalls', 1); >+ t::lib::Mocks::mock_preference('UseRecalls', 'opac'); > my $recall = Koha::Recall->new( > { biblio_id => $item->biblionumber, > item_id => $item->itemnumber, >diff --git a/t/db_dependent/Holds.t b/t/db_dependent/Holds.t >index 201ab70a415..dfc765538cd 100755 >--- a/t/db_dependent/Holds.t >+++ b/t/db_dependent/Holds.t >@@ -1922,7 +1922,7 @@ subtest 'ModReserve to convert a hold to a recall' => sub { > } > )->store; > >- t::lib::Mocks::mock_preference( "UseRecalls", 1 ); >+ t::lib::Mocks::mock_preference( "UseRecalls", 'opac' ); > t::lib::Mocks::mock_userenv( { branchcode => $branch } ); > > C4::Circulation::AddIssue( $patron2, $item->barcode ); >diff --git a/t/db_dependent/Koha/Biblio.t b/t/db_dependent/Koha/Biblio.t >index 7226421d232..f358d3488ec 100755 >--- a/t/db_dependent/Koha/Biblio.t >+++ b/t/db_dependent/Koha/Biblio.t >@@ -1549,10 +1549,10 @@ subtest 'Recalls tests' => sub { > is( $recalls->count, 3, 'Correctly get number of recalls for biblio' ); > is( $recalls->filter_by_current->count, 1, 'Correctly get number of active recalls for biblio' ); > >- t::lib::Mocks::mock_preference('UseRecalls', 0); >+ t::lib::Mocks::mock_preference('UseRecalls', 'off'); > is( $biblio->can_be_recalled({ patron => $patron1 }), 0, "Can't recall with UseRecalls disabled" ); > >- t::lib::Mocks::mock_preference("UseRecalls", 1); >+ t::lib::Mocks::mock_preference("UseRecalls", 'opac'); > $item1->update({ notforloan => 1 }); > is( $biblio->can_be_recalled({ patron => $patron1 }), 0, "Can't recall with no available items" ); > >diff --git a/t/db_dependent/Koha/Item.t b/t/db_dependent/Koha/Item.t >index 9fa642be693..9af04d420bf 100755 >--- a/t/db_dependent/Koha/Item.t >+++ b/t/db_dependent/Koha/Item.t >@@ -2393,7 +2393,7 @@ subtest 'Recalls tests' => sub { > ); > > t::lib::Mocks::mock_userenv( { patron => $patron1 } ); >- t::lib::Mocks::mock_preference('UseRecalls', 1); >+ t::lib::Mocks::mock_preference('UseRecalls', 'opac'); > > my $recall1 = Koha::Recall->new( > { patron_id => $patron1->borrowernumber, >@@ -2421,10 +2421,10 @@ subtest 'Recalls tests' => sub { > > $recall2->set_cancelled; > >- t::lib::Mocks::mock_preference('UseRecalls', 0); >+ t::lib::Mocks::mock_preference('UseRecalls', 'off'); > is( $item1->can_be_recalled({ patron => $patron1 }), 0, "Can't recall with UseRecalls disabled" ); > >- t::lib::Mocks::mock_preference("UseRecalls", 1); >+ t::lib::Mocks::mock_preference("UseRecalls", 'opac'); > > $item1->update({ notforloan => 1 }); > is( $item1->can_be_recalled({ patron => $patron1 }), 0, "Can't recall that is not for loan" ); >@@ -2609,7 +2609,7 @@ subtest 'has_pending_recall() tests' => sub { > my $patron = $builder->build_object({ class => 'Koha::Patrons' }); > > t::lib::Mocks::mock_userenv({ branchcode => $library->branchcode }); >- t::lib::Mocks::mock_preference( 'UseRecalls', 1 ); >+ t::lib::Mocks::mock_preference( 'UseRecalls', 'opac' ); > > C4::Circulation::AddIssue( $patron, $item->barcode ); > >diff --git a/t/db_dependent/SIP/Transaction.t b/t/db_dependent/SIP/Transaction.t >index 65c5060093e..8de722204c5 100755 >--- a/t/db_dependent/SIP/Transaction.t >+++ b/t/db_dependent/SIP/Transaction.t >@@ -1265,7 +1265,7 @@ subtest do_checkout_with_recalls => sub { > } > ); > >- t::lib::Mocks::mock_preference( 'UseRecalls', 1 ); >+ t::lib::Mocks::mock_preference( 'UseRecalls', 'opac' ); > Koha::CirculationRules->set_rule( > { > branchcode => undef, >diff --git a/t/db_dependent/Search.t b/t/db_dependent/Search.t >index 00ce65abdab..b01fe00dee6 100755 >--- a/t/db_dependent/Search.t >+++ b/t/db_dependent/Search.t >@@ -155,7 +155,7 @@ $contextmodule->mock('preference', sub { > } elsif ($pref eq 'SearchLimitLibrary') { > return 'both'; > } elsif ($pref eq 'UseRecalls') { >- return '0'; >+ return 'off'; > } elsif ( $pref eq 'ContentWarningField' ) { > return q{}; > } elsif ( $pref eq 'AuthorLinkSortBy' ) { >diff --git a/t/db_dependent/XSLT.t b/t/db_dependent/XSLT.t >index 5f79b35b135..cd3a82bf5f8 100755 >--- a/t/db_dependent/XSLT.t >+++ b/t/db_dependent/XSLT.t >@@ -181,7 +181,7 @@ subtest 'buildKohaItemsNamespace status tests' => sub { > my $library_name = $holdinglibrary->branchname; > like($xml,qr{<resultbranch>${library_name}</resultbranch>}, "Found resultbranch / holding branch" ); > >- t::lib::Mocks::mock_preference('UseRecalls', 1); >+ t::lib::Mocks::mock_preference('UseRecalls', 'opac'); > my $recall = $builder->build_object( > { > class => 'Koha::Recalls', >@@ -196,7 +196,7 @@ subtest 'buildKohaItemsNamespace status tests' => sub { > $recall->set_waiting; > $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); > like($xml,qr{<substatus>Recall waiting</substatus>},"Waiting status takes precedence over In transit (recalls)"); >- t::lib::Mocks::mock_preference('UseRecalls', 0); >+ t::lib::Mocks::mock_preference('UseRecalls', 'off'); > > $schema->storage->txn_rollback; > }; >-- >2.39.5
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 31391
:
139442
|
139443
|
139444
|
139446
|
139642
|
139643
|
139644
|
139645
|
141474
|
142594
|
143155
|
144104
|
144105
|
144131
|
144132
|
144133
|
144134
|
144135
|
144136
|
147581
|
147582
|
150485
|
150486
|
150487
|
150488
|
150489
|
150490
|
150491
|
156995
|
156996
|
156997
|
156998
|
156999
|
157000
|
157001
|
158691
|
158692
|
158693
|
158694
|
158695
|
158825
|
158826
|
158827
|
158828
|
158829
|
158830
|
158831
|
158832
|
172166
|
172167
|
172168
|
172169
|
172170
|
172171
|
172172
|
172173
|
172174
|
172175
|
173839
|
173840
|
173841
|
173842
|
173843
|
173844
|
173845
|
173846
|
173847
|
174396
|
174822
|
174823
|
174824
|
174825
|
174826
|
174827
|
174828
|
174829
|
174830
|
174831