View | Details | Raw Unified | Return to bug 31391
Collapse All | Expand All

(-)a/C4/Circulation.pm (-6 / +6 lines)
Lines 386-392 sub transferbook { Link Here
386
    }
386
    }
387
387
388
    # find recall
388
    # find recall
389
    if ( C4::Context->preference('UseRecalls') ) {
389
    if ( C4::Context->preference('UseRecalls') ne "off" ) {
390
        my $recall = Koha::Recalls->find({ item_id => $itemnumber, status => 'in_transit' });
390
        my $recall = Koha::Recalls->find({ item_id => $itemnumber, status => 'in_transit' });
391
        if ( defined $recall ) {
391
        if ( defined $recall ) {
392
            # do a transfer if the recall branch is different to the item holding branch
392
            # do a transfer if the recall branch is different to the item holding branch
Lines 1143-1149 sub CanBookBeIssued { Link Here
1143
    # CHECK IF ITEM HAS BEEN RECALLED BY ANOTHER PATRON
1143
    # CHECK IF ITEM HAS BEEN RECALLED BY ANOTHER PATRON
1144
    # Only bother doing this if UseRecalls is enabled and the item is recallable
1144
    # Only bother doing this if UseRecalls is enabled and the item is recallable
1145
    # Don't look at recalls that are in transit
1145
    # Don't look at recalls that are in transit
1146
    if ( C4::Context->preference('UseRecalls') and $item_object->can_be_waiting_recall ) {
1146
    if ( C4::Context->preference('UseRecalls') ne "off" and $item_object->can_be_waiting_recall ) {
1147
        my @recalls = $biblio->recalls({},{ order_by => { -asc => 'created_date' } })->filter_by_current->as_list;
1147
        my @recalls = $biblio->recalls({},{ order_by => { -asc => 'created_date' } })->filter_by_current->as_list;
1148
1148
1149
        foreach my $r ( @recalls ) {
1149
        foreach my $r ( @recalls ) {
Lines 1648-1654 sub AddIssue { Link Here
1648
                $item_object->discard_changes;
1648
                $item_object->discard_changes;
1649
            }
1649
            }
1650
1650
1651
            if ( C4::Context->preference('UseRecalls') ) {
1651
            if ( C4::Context->preference('UseRecalls') ne "off" ) {
1652
                Koha::Recalls->move_recall(
1652
                Koha::Recalls->move_recall(
1653
                    {
1653
                    {
1654
                        action         => $cancel_recall,
1654
                        action         => $cancel_recall,
Lines 2426-2432 sub AddReturn { Link Here
2426
    }
2426
    }
2427
2427
2428
    # find recalls...
2428
    # find recalls...
2429
    if ( C4::Context->preference('UseRecalls') ) {
2429
    if ( C4::Context->preference('UseRecalls') ne "off" ) {
2430
        # check if this item is recallable first, which includes checking if UseRecalls syspref is enabled
2430
        # check if this item is recallable first, which includes checking if UseRecalls syspref is enabled
2431
        my $recall = undef;
2431
        my $recall = undef;
2432
        $recall = $item->check_recalls if $item->can_be_waiting_recall;
2432
        $recall = $item->check_recalls if $item->can_be_waiting_recall;
Lines 2503-2509 sub AddReturn { Link Here
2503
        $request->status('RET') if $request;
2503
        $request->status('RET') if $request;
2504
    }
2504
    }
2505
2505
2506
    if ( C4::Context->preference('UseRecalls') ) {
2506
    if ( C4::Context->preference('UseRecalls') ne "off" ) {
2507
        # all recalls that have triggered a transfer will have an allocated itemnumber
2507
        # all recalls that have triggered a transfer will have an allocated itemnumber
2508
        my $transfer_recall = Koha::Recalls->find({ item_id => $item->itemnumber, status => 'in_transit' });
2508
        my $transfer_recall = Koha::Recalls->find({ item_id => $item->itemnumber, status => 'in_transit' });
2509
        if ( $transfer_recall and $transfer_recall->pickup_library_id eq $branch ) {
2509
        if ( $transfer_recall and $transfer_recall->pickup_library_id eq $branch ) {
Lines 3061-3067 sub CanBookBeRenewed { Link Here
3061
3061
3062
    }
3062
    }
3063
3063
3064
    if ( C4::Context->preference('UseRecalls') ) {
3064
    if ( C4::Context->preference('UseRecalls') ne "off" ) {
3065
        my $recall = undef;
3065
        my $recall = undef;
3066
        $recall = $item->check_recalls if $item->can_be_waiting_recall;
3066
        $recall = $item->check_recalls if $item->can_be_waiting_recall;
3067
        if ( defined $recall ) {
3067
        if ( defined $recall ) {
(-)a/C4/Search.pm (-1 / +1 lines)
Lines 1936-1942 sub searchResults { Link Here
1936
                      )
1936
                      )
1937
                      : ( '', '', '' );
1937
                      : ( '', '', '' );
1938
                    $reservestatus = C4::Reserves::GetReserveStatus( $item->{itemnumber} );
1938
                    $reservestatus = C4::Reserves::GetReserveStatus( $item->{itemnumber} );
1939
                    if ( C4::Context->preference('UseRecalls') ) {
1939
                    if ( C4::Context->preference('UseRecalls') ne "off" ) {
1940
                        if ( Koha::Recalls->search({ item_id => $item->{itemnumber}, status => 'waiting' })->count ) {
1940
                        if ( Koha::Recalls->search({ item_id => $item->{itemnumber}, status => 'waiting' })->count ) {
1941
                            $recallstatus = 'Waiting';
1941
                            $recallstatus = 'Waiting';
1942
                        }
1942
                        }
(-)a/C4/XSLT.pm (-1 / +1 lines)
Lines 299-305 sub buildKohaItemsNamespace { Link Here
299
        my $substatus = '';
299
        my $substatus = '';
300
        my $recalls_count;
300
        my $recalls_count;
301
301
302
        if ( C4::Context->preference('UseRecalls') ) {
302
        if ( C4::Context->preference('UseRecalls') ne "off" ) {
303
            $recalls_count = Koha::Recalls->search({ item_id => $item->itemnumber, status => 'waiting' })->count;
303
            $recalls_count = Koha::Recalls->search({ item_id => $item->itemnumber, status => 'waiting' })->count;
304
        }
304
        }
305
305
(-)a/Koha/Biblio.pm (-1 / +1 lines)
Lines 1988-1994 if hold_convert $param is included, this is to say that this a check to convert Link Here
1988
sub can_be_recalled {
1988
sub can_be_recalled {
1989
    my ( $self, $params ) = @_;
1989
    my ( $self, $params ) = @_;
1990
1990
1991
    return 0 if !( C4::Context->preference('UseRecalls') );
1991
    return 0 if ( C4::Context->preference('UseRecalls') eq "off" );
1992
1992
1993
    my $patron = $params->{patron};
1993
    my $patron = $params->{patron};
1994
1994
(-)a/Koha/Item.pm (-2 / +2 lines)
Lines 2276-2282 if hold_convert $param is included, this is to say that this a check to convert Link Here
2276
sub can_be_recalled {
2276
sub can_be_recalled {
2277
    my ( $self, $params ) = @_;
2277
    my ( $self, $params ) = @_;
2278
2278
2279
    return 0 if !( C4::Context->preference('UseRecalls') );
2279
    return 0 if ( C4::Context->preference('UseRecalls') eq "off" );
2280
2280
2281
    # check if this item is not for loan, withdrawn or lost
2281
    # check if this item is not for loan, withdrawn or lost
2282
    return 0 if ( $self->notforloan != 0 );
2282
    return 0 if ( $self->notforloan != 0 );
Lines 2361-2367 At this point the item has already been recalled. We are now at the checkin and Link Here
2361
sub can_be_waiting_recall {
2361
sub can_be_waiting_recall {
2362
    my ( $self ) = @_;
2362
    my ( $self ) = @_;
2363
2363
2364
    return 0 if !( C4::Context->preference('UseRecalls') );
2364
    return 0 if ( C4::Context->preference('UseRecalls') eq "off" );
2365
2365
2366
    # check if this item is not for loan, withdrawn or lost
2366
    # check if this item is not for loan, withdrawn or lost
2367
    return 0 if ( $self->notforloan != 0 );
2367
    return 0 if ( $self->notforloan != 0 );
(-)a/circ/circulation.pl (-2 / +2 lines)
Lines 500-506 if (@$barcodes && $op eq 'cud-checkout') { Link Here
500
        }
500
        }
501
        unless ($confirm_required) {
501
        unless ($confirm_required) {
502
            my $switch_onsite_checkout = exists $messages->{ONSITE_CHECKOUT_WILL_BE_SWITCHED};
502
            my $switch_onsite_checkout = exists $messages->{ONSITE_CHECKOUT_WILL_BE_SWITCHED};
503
            if ( C4::Context->preference('UseRecalls') && !$recall_id ) {
503
            if ( C4::Context->preference('UseRecalls') ne "off" && !$recall_id ) {
504
                my $recall = Koha::Recalls->find(
504
                my $recall = Koha::Recalls->find(
505
                    {
505
                    {
506
                        biblio_id => $item->biblionumber,
506
                        biblio_id => $item->biblionumber,
Lines 576-582 if ($patron) { Link Here
576
        WaitingHolds => $waiting_holds,
576
        WaitingHolds => $waiting_holds,
577
    );
577
    );
578
578
579
    if ( C4::Context->preference('UseRecalls') ) {
579
    if ( C4::Context->preference('UseRecalls') ne "off" ) {
580
        my $waiting_recalls = $patron->recalls->search({ status => 'waiting' });
580
        my $waiting_recalls = $patron->recalls->search({ status => 'waiting' });
581
        $template->param(
581
        $template->param(
582
            recalls => $patron->recalls->filter_by_current->search({},{ order_by => { -asc => 'created_date' } }),
582
            recalls => $patron->recalls->filter_by_current->search({},{ order_by => { -asc => 'created_date' } }),
(-)a/circ/returns.pl (-2 / +2 lines)
Lines 262-268 if ($transit && $op eq 'cud-transfer') { Link Here
262
    my $transfer = Koha::Item::Transfers->find($transit);
262
    my $transfer = Koha::Item::Transfers->find($transit);
263
    if ( $canceltransfer ) {
263
    if ( $canceltransfer ) {
264
        $transfer->cancel({ reason => 'Manual', force => 1});
264
        $transfer->cancel({ reason => 'Manual', force => 1});
265
        if ( C4::Context->preference('UseRecalls') ) {
265
        if ( C4::Context->preference('UseRecalls') ne "off" ) {
266
            my $recall_transfer_deleted = Koha::Recalls->find({ item_id => $itemnumber, status => 'in_transit' });
266
            my $recall_transfer_deleted = Koha::Recalls->find({ item_id => $itemnumber, status => 'in_transit' });
267
            if ( defined $recall_transfer_deleted ) {
267
            if ( defined $recall_transfer_deleted ) {
268
                $recall_transfer_deleted->revert_transfer;
268
                $recall_transfer_deleted->revert_transfer;
Lines 276-282 if ($transit && $op eq 'cud-transfer') { Link Here
276
    my $item = Koha::Items->find($itemnumber);
276
    my $item = Koha::Items->find($itemnumber);
277
    my $transfer = $item->get_transfer;
277
    my $transfer = $item->get_transfer;
278
    $transfer->cancel({ reason => 'Manual', force => 1});
278
    $transfer->cancel({ reason => 'Manual', force => 1});
279
    if ( C4::Context->preference('UseRecalls') ) {
279
    if ( C4::Context->preference('UseRecalls') ne "off" ) {
280
        my $recall_transfer_deleted = Koha::Recalls->find({ item_id => $itemnumber, status => 'in_transit' });
280
        my $recall_transfer_deleted = Koha::Recalls->find({ item_id => $itemnumber, status => 'in_transit' });
281
        if ( defined $recall_transfer_deleted ) {
281
        if ( defined $recall_transfer_deleted ) {
282
            $recall_transfer_deleted->revert_transfer;
282
            $recall_transfer_deleted->revert_transfer;
(-)a/circ/transferstoreceive.pl (-1 / +1 lines)
Lines 111-117 while ( my $library = $libraries->next ) { Link Here
111
            }
111
            }
112
112
113
            # check for a recall for this transfer
113
            # check for a recall for this transfer
114
            if ( C4::Context->preference('UseRecalls') ) {
114
            if ( C4::Context->preference('UseRecalls') ne "off" ) {
115
                my $recall = $item->recall;
115
                my $recall = $item->recall;
116
                if ( defined $recall ) {
116
                if ( defined $recall ) {
117
                    $getransf{recall} = $recall;
117
                    $getransf{recall} = $recall;
(-)a/installer/data/mysql/atomicupdate/bug_31391_-_add_RecallsInterface_syspref.pl (-16 lines)
Lines 1-16 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "31391",
5
    description => "Staff-side recalls",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        $dbh->do(
11
            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') }
12
        );
13
14
        say $out "Added system preference 'RecallsInterface'";
15
    },
16
};
(-)a/installer/data/mysql/atomicupdate/bug_31391_-_update_UseRecalls_syspref.pl (+19 lines)
Line 0 Link Here
1
use Modern::Perl;
2
use Koha::Installer::Output qw(say_warning say_failure say_success say_info);
3
4
return {
5
    bug_number  => "31391",
6
    description => "Staff-side recalls",
7
    up          => sub {
8
        my ($args) = @_;
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
10
        try {
11
            $dbh->do(q{UPDATE systempreferences SET value = "off", options = "off|opac|staff|opac_and_staff", type="Choice" WHERE variable = "UseRecalls" AND value = "0"});
12
            $dbh->do(q{UPDATE systempreferences SET value = "opac", options = "off|opac|staff|opac_and_staff", type="Choice" WHERE variable = "UseRecalls" AND value = "1"});
13
            say_success( $out, "Updated system preference 'UseRecalls' to include interface choices" );
14
        }
15
        catch {
16
            say_failure( $out, "Database modification failed with errors: $_" );
17
        };
18
    },
19
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-2 / +1 lines)
Lines 640-646 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
640
('QuoteOfTheDay','','intranet,opac','Enable or disable display of Quote of the Day on the OPAC and staff interface home page','multiple'),
640
('QuoteOfTheDay','','intranet,opac','Enable or disable display of Quote of the Day on the OPAC and staff interface home page','multiple'),
641
('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'),
641
('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'),
642
('RealTimeHoldsQueue', '0', NULL, 'Enable updating the holds queue in real time', 'YesNo'),
642
('RealTimeHoldsQueue', '0', NULL, 'Enable updating the holds queue in real time', 'YesNo'),
643
('RecallsInterface','opac','opac|staff|both','The interface that recalls can be placed through','Choice'),
644
('RecallsLog','1',NULL,'If ON, log create/cancel/expire/fulfill actions on recalls','YesNo'),
643
('RecallsLog','1',NULL,'If ON, log create/cancel/expire/fulfill actions on recalls','YesNo'),
645
('RecallsMaxPickUpDelay','7',NULL,'Define the maximum time a recall can be awaiting pickup','Integer'),
644
('RecallsMaxPickUpDelay','7',NULL,'Define the maximum time a recall can be awaiting pickup','Integer'),
646
('RecordLocalUseOnReturn','0',NULL,'If ON, statistically record returns of unissued items as local use, instead of return','YesNo'),
645
('RecordLocalUseOnReturn','0',NULL,'If ON, statistically record returns of unissued items as local use, instead of return','YesNo'),
Lines 843-849 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
843
('UseICUStyleQuotes','0','1','Tell Koha whether to use ICU style quotes ({) or default (") when tracing subjects .','YesNo'),
842
('UseICUStyleQuotes','0','1','Tell Koha whether to use ICU style quotes ({) or default (") when tracing subjects .','YesNo'),
844
('UseLocationAsAQInSIP', '0', '', 'Use permanent_location instead of homebranch for AQ in SIP response', 'YesNo'),
843
('UseLocationAsAQInSIP', '0', '', 'Use permanent_location instead of homebranch for AQ in SIP response', 'YesNo'),
845
('UseOCLCEncodingLevels','0',NULL,'If enabled, include OCLC encoding levels in leader value builder dropdown for position 17.','YesNo'),
844
('UseOCLCEncodingLevels','0',NULL,'If enabled, include OCLC encoding levels in leader value builder dropdown for position 17.','YesNo'),
846
('UseRecalls','0',NULL,'Enable or disable recalls','YesNo'),
845
('UseRecalls','off','off|opac|staff|opac_and_staff','Enable or disable recalls','Choice'),
847
('UseTransportCostMatrix','0','','Use Transport Cost Matrix when filling holds','YesNo'),
846
('UseTransportCostMatrix','0','','Use Transport Cost Matrix when filling holds','YesNo'),
848
('UseWYSIWYGinSystemPreferences','0','','Show WYSIWYG editor when editing certain HTML system preferences.','YesNo'),
847
('UseWYSIWYGinSystemPreferences','0','','Show WYSIWYG editor when editing certain HTML system preferences.','YesNo'),
849
('viewISBD','1','','Allow display of ISBD view of bibiographic records','YesNo'),
848
('viewISBD','1','','Allow display of ISBD view of bibiographic records','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc (-1 / +1 lines)
Lines 124-130 Link Here
124
        </li>
124
        </li>
125
        [%- END -%]
125
        [%- END -%]
126
126
127
        [%- IF ( Koha.Preference('UseRecalls') && CAN_user_recalls ) -%]
127
        [%- IF ( Koha.Preference('UseRecalls') != "off" && CAN_user_recalls ) -%]
128
        [%- IF ( recallsview ) -%]
128
        [%- IF ( recallsview ) -%]
129
        <li class="active">
129
        <li class="active">
130
        [%- ELSE -%]
130
        [%- ELSE -%]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc (-1 / +1 lines)
Lines 243-249 Link Here
243
                    <a href="/cgi-bin/koha/members/ill-requests.pl?borrowernumber=[% patron.borrowernumber | uri %]">ILL requests history</a>
243
                    <a href="/cgi-bin/koha/members/ill-requests.pl?borrowernumber=[% patron.borrowernumber | uri %]">ILL requests history</a>
244
                </li>
244
                </li>
245
            [% END %]
245
            [% END %]
246
            [% IF Koha.Preference('UseRecalls') && CAN_user_recalls %]
246
            [% IF Koha.Preference('UseRecalls') != "off" && CAN_user_recalls %]
247
                [% IF recallsview %]<li class="active">[% ELSE %]<li>[% END %]
247
                [% IF recallsview %]<li class="active">[% ELSE %]<li>[% END %]
248
                    <a href="/cgi-bin/koha/members/recallshistory.pl?borrowernumber=[% patron.borrowernumber | uri %]">Recalls history</a>
248
                    <a href="/cgi-bin/koha/members/recallshistory.pl?borrowernumber=[% patron.borrowernumber | uri %]">Recalls history</a>
249
                </li>
249
                </li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc (-1 / +1 lines)
Lines 70-76 Link Here
70
70
71
71
72
        <div class="col-sm-6 col-md-12">
72
        <div class="col-sm-6 col-md-12">
73
        [% IF Koha.Preference('UseRecalls') and CAN_user_recalls %]
73
        [% IF Koha.Preference('UseRecalls') != "off" and CAN_user_recalls %]
74
        <h5>Recalls</h5>
74
        <h5>Recalls</h5>
75
        <ul>
75
        <ul>
76
            <li>
76
            <li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc (-3 / +3 lines)
Lines 73-79 Link Here
73
                                <option value="[% hold.priority | html %]" selected="selected">[% this_priority | html %]</option>
73
                                <option value="[% hold.priority | html %]" selected="selected">[% this_priority | html %]</option>
74
                            [% END %]
74
                            [% END %]
75
                                <option value="del">del</option>
75
                                <option value="del">del</option>
76
                                [% IF Koha.Preference('UseRecalls') AND Koha.Preference('RecallsInterface') != 'opac' %]
76
                                [% IF ( Koha.Preference('UseRecalls').match('staff') ) %]
77
                                    <option value="recall">recall</option>
77
                                    <option value="recall">recall</option>
78
                                [% END %]
78
                                [% END %]
79
                            </select>
79
                            </select>
Lines 91-97 Link Here
91
                            [% ELSE %]
91
                            [% ELSE %]
92
                                <option value="[% hold.priority | html %]" selected="selected">[% this_priority | html %]</option>
92
                                <option value="[% hold.priority | html %]" selected="selected">[% this_priority | html %]</option>
93
                            [% END %]
93
                            [% END %]
94
                                [% IF Koha.Preference('UseRecalls') AND Koha.Preference('RecallsInterface') != 'opac' %]
94
                                [% IF ( Koha.Preference('UseRecalls').match('staff') ) %]
95
                                    <option value="recall">recall</option>
95
                                    <option value="recall">recall</option>
96
                                [% END %]
96
                                [% END %]
97
                            </select>
97
                            </select>
Lines 277-283 Link Here
277
                    <td></td>
277
                    <td></td>
278
                [% END %]
278
                [% END %]
279
                <td>
279
                <td>
280
                    [% IF Koha.Preference('UseRecalls') AND Koha.Preference('RecallsInterface') != 'opac' %]
280
                    [% IF ( Koha.Preference('UseRecalls').match('staff') ) %]
281
                    <a class="convert-to-recall btn" title="Convert hold to recall" data-id="[% hold.reserve_id | html %]">Mark for conversion to recall</a>
281
                    <a class="convert-to-recall btn" title="Convert hold to recall" data-id="[% hold.reserve_id | html %]">Mark for conversion to recall</a>
282
                    [% END %]
282
                    [% END %]
283
                </td>
283
                </td>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc (-2 / +2 lines)
Lines 217-223 Link Here
217
    [% IF biblio.serial %]
217
    [% IF biblio.serial %]
218
        embed.push('serial_item.serial');
218
        embed.push('serial_item.serial');
219
    [% END %]
219
    [% END %]
220
    [% IF Koha.Preference('UseRecalls') %]
220
    [% IF Koha.Preference('UseRecalls') != "off" %]
221
        embed.push('recall', 'recall+strings', 'recall.patron')
221
        embed.push('recall', 'recall+strings', 'recall.patron')
222
    [% END %]
222
    [% END %]
223
    [% IF bundlesEnabled %]
223
    [% IF bundlesEnabled %]
Lines 511-517 Link Here
511
                        }
511
                        }
512
                    }
512
                    }
513
513
514
                    [% IF Koha.Preference('UseRecalls') %]
514
                    [% IF Koha.Preference('UseRecalls') != "off" %]
515
                        if ( row.recall ) {
515
                        if ( row.recall ) {
516
                            if ( row.recall.waiting_date ) {
516
                            if ( row.recall.waiting_date ) {
517
                                nodes += '<span>%s</span>'.format(_("Waiting at %s since %s").format(escape_str(row.recall.pickup_library_id.str), $date(row.recall.waiting_date)));
517
                                nodes += '<span>%s</span>'.format(_("Waiting at %s since %s").format(escape_str(row.recall.pickup_library_id.str), $date(row.recall.waiting_date)));
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc (-1 / +1 lines)
Lines 18-24 Link Here
18
    [% FOREACH messaging_preference IN messaging_preferences %]
18
    [% FOREACH messaging_preference IN messaging_preferences %]
19
    [% NEXT IF !Koha.Preference( 'ILLModule' ) && messaging_preference.message_name.match('^Ill_') %]
19
    [% NEXT IF !Koha.Preference( 'ILLModule' ) && messaging_preference.message_name.match('^Ill_') %]
20
    [% NEXT IF messaging_preference.Auto_Renewals && Koha.Preference('AutoRenewalNotices') != 'preferences' %]
20
    [% NEXT IF messaging_preference.Auto_Renewals && Koha.Preference('AutoRenewalNotices') != 'preferences' %]
21
    [% NEXT IF !Koha.Preference('UseRecalls') && messaging_preference.message_name.match('^Recall_') %]
21
    [% NEXT IF Koha.Preference('UseRecalls') != "off" && messaging_preference.message_name.match('^Recall_') %]
22
    <tr id="[% messaging_preference.message_name _ "_message" | lower | html %]">
22
    <tr id="[% messaging_preference.message_name _ "_message" | lower | html %]">
23
      <td>[% IF ( messaging_preference.Item_Due ) %]<span>Item due</span>
23
      <td>[% IF ( messaging_preference.Item_Due ) %]<span>Item due</span>
24
          [% ELSIF ( messaging_preference.Advance_Notice ) %]<span>Advance notice</span>
24
          [% ELSIF ( messaging_preference.Advance_Notice ) %]<span>Advance notice</span>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-detail-tabs.inc (-2 / +2 lines)
Lines 30-36 Link Here
30
            [% END %]
30
            [% END %]
31
        [% END %]
31
        [% END %]
32
32
33
        [% IF Koha.Preference('UseRecalls') %]
33
        [% IF Koha.Preference('UseRecalls') != "off" %]
34
            [% WRAPPER tab_item tabname= "recalls" %]
34
            [% WRAPPER tab_item tabname= "recalls" %]
35
                <span>Recalls</span> ([% recalls.count || 0 | html %])
35
                <span>Recalls</span> ([% recalls.count || 0 | html %])
36
            [% END %]
36
            [% END %]
Lines 230-236 Link Here
230
            [% END %]
230
            [% END %]
231
        [% END %]
231
        [% END %]
232
232
233
        [% IF Koha.Preference('UseRecalls') %]
233
        [% IF Koha.Preference('UseRecalls') != "off" %]
234
            [% WRAPPER tab_panel tabname="recalls" %]
234
            [% WRAPPER tab_panel tabname="recalls" %]
235
                [% INCLUDE 'recalls.inc' %]
235
                [% INCLUDE 'recalls.inc' %]
236
            [% END # /tab_panel# %]
236
            [% END # /tab_panel# %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-13 / +7 lines)
Lines 1444-1464 Circulation: Link Here
1444
            - class: integer
1444
            - class: integer
1445
            - days.
1445
            - days.
1446
        -
1446
        -
1447
            - Recalls
1447
            - pref: UseRecalls
1448
            - pref: UseRecalls
1448
              type: boolean
1449
              default: off
1449
              choices:
1450
              choices:
1450
                  1: Use
1451
                  off: are disabled
1451
                  0: "Don't use"
1452
                  opac: can be placed through the OPAC only
1452
            - recalls. Make sure you configure <a href="/cgi-bin/koha/admin/smart-rules.pl">circulation and fine rules</a> for recalls once enabled.
1453
                  staff: can be placed through the staff interface only
1453
        -
1454
                  opac_and_staff: can be placed through both the OPAC and staff interface
1454
            - Recalls can be placed through
1455
            - . Make sure you configure <a href="/cgi-bin/koha/admin/smart-rules.pl">circulation and fine rules</a> for recalls when enabled.
1455
            - pref: RecallsInterface
1456
              default: opac
1457
              choices:
1458
                  opac: the OPAC only
1459
                  staff: the staff interface only
1460
                  both: both the OPAC and the staff interface
1461
            - . (Requires <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=UseRecalls">UseRecalls</a>.)
1462
1456
1463
    SIP2:
1457
    SIP2:
1464
        -
1458
        -
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt (-4 / +4 lines)
Lines 147-153 Link Here
147
                            <th>Article requests</th>
147
                            <th>Article requests</th>
148
                            [% END %]
148
                            [% END %]
149
                            <th>Rental discount (%)</th>
149
                            <th>Rental discount (%)</th>
150
                            [% IF Koha.Preference('UseRecalls') %]
150
                            [% IF Koha.Preference('UseRecalls') != "off" %]
151
                                <th>Recalls allowed (total)</th>
151
                                <th>Recalls allowed (total)</th>
152
                                <th>Recalls per record (count)</th>
152
                                <th>Recalls per record (count)</th>
153
                                <th>On shelf recalls allowed</th>
153
                                <th>On shelf recalls allowed</th>
Lines 392-398 Link Here
392
                                                </td>
392
                                                </td>
393
                                                [% END %]
393
                                                [% END %]
394
                                                <td>[% rentaldiscount | html %]</td>
394
                                                <td>[% rentaldiscount | html %]</td>
395
                                                [% IF Koha.Preference('UseRecalls') %]
395
                                                [% IF Koha.Preference('UseRecalls') != "off" %]
396
                                                    <td>[% recalls_allowed | html %]</td>
396
                                                    <td>[% recalls_allowed | html %]</td>
397
                                                    <td>[% recalls_per_record | html %]</td>
397
                                                    <td>[% recalls_per_record | html %]</td>
398
                                                    <td data-code="[% on_shelf_recalls | html %]">
398
                                                    <td data-code="[% on_shelf_recalls | html %]">
Lines 539-545 Link Here
539
                                </td>
539
                                </td>
540
                                [% END %]
540
                                [% END %]
541
                                <td><input type="text" name="rentaldiscount" id="rentaldiscount" size="2" /></td>
541
                                <td><input type="text" name="rentaldiscount" id="rentaldiscount" size="2" /></td>
542
                                [% IF Koha.Preference('UseRecalls') %]
542
                                [% IF Koha.Preference('UseRecalls') != "off" %]
543
                                    <td><input type="text" name="recalls_allowed" id="recalls_allowed" size="3"></td>
543
                                    <td><input type="text" name="recalls_allowed" id="recalls_allowed" size="3"></td>
544
                                    <td><input type="text" name="recalls_per_record" id="recalls_per_record" size="3"></td>
544
                                    <td><input type="text" name="recalls_per_record" id="recalls_per_record" size="3"></td>
545
                                    <td>
545
                                    <td>
Lines 603-609 Link Here
603
                                  <th>Article requests</th>
603
                                  <th>Article requests</th>
604
                                  [% END %]
604
                                  [% END %]
605
                                  <th>Rental discount (%)</th>
605
                                  <th>Rental discount (%)</th>
606
                                  [% IF Koha.Preference('UseRecalls') %]
606
                                  [% IF Koha.Preference('UseRecalls') != "off" %]
607
                                    <th>Recalls allowed (total)</th>
607
                                    <th>Recalls allowed (total)</th>
608
                                    <th>Recalls per record (count)</th>
608
                                    <th>Recalls per record (count)</th>
609
                                    <th>On shelf recalls allowed</th>
609
                                    <th>On shelf recalls allowed</th>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt (-1 / +1 lines)
Lines 566-572 Link Here
566
                                                            <span>Holds ([% SEARCH_RESULT.biblio_object.holds.count | html %])</span>
566
                                                            <span>Holds ([% SEARCH_RESULT.biblio_object.holds.count | html %])</span>
567
                                                        [% END %]
567
                                                        [% END %]
568
                                                    [% END # /IF SEARCH_RESULT.norequests %]
568
                                                    [% END # /IF SEARCH_RESULT.norequests %]
569
                                                    [% IF Koha.Preference('UseRecalls') and CAN_user_recalls %]
569
                                                    [% IF Koha.Preference('UseRecalls') != "off" and CAN_user_recalls %]
570
                                                        | <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>
570
                                                        | <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>
571
                                                    [% END %]
571
                                                    [% END %]
572
572
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt (-1 / +1 lines)
Lines 100-106 Link Here
100
                            </li>
100
                            </li>
101
                        </ul>
101
                        </ul>
102
102
103
                        [% IF Koha.Preference('UseRecalls') and CAN_user_recalls %]
103
                        [% IF Koha.Preference('UseRecalls') != "off" and CAN_user_recalls %]
104
                            <h3>Recalls</h3>
104
                            <h3>Recalls</h3>
105
105
106
                            <ul class="buttons-list">
106
                            <ul class="buttons-list">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/recallshistory.tt (-1 / +1 lines)
Lines 30-36 Link Here
30
                    [% INCLUDE 'messages.inc' %]
30
                    [% INCLUDE 'messages.inc' %]
31
                    [% INCLUDE 'members-toolbar.inc' %]
31
                    [% INCLUDE 'members-toolbar.inc' %]
32
                    <h1>Recalls history</h1>
32
                    <h1>Recalls history</h1>
33
                    [% IF Koha.Preference('UseRecalls') %]
33
                    [% IF Koha.Preference('UseRecalls') != "off" %]
34
                        <input type="checkbox" id="hide_old" name="hide_old" checked="checked">
34
                        <input type="checkbox" id="hide_old" name="hide_old" checked="checked">
35
                        <label for="hide_old">Show old recalls</label>
35
                        <label for="hide_old">Show old recalls</label>
36
                        [% INCLUDE 'recalls.inc' %]
36
                        [% INCLUDE 'recalls.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_old_queue.tt (-1 / +1 lines)
Lines 39-45 Link Here
39
            [% INCLUDE 'messages.inc' %]
39
            [% INCLUDE 'messages.inc' %]
40
40
41
        <h1>Old recalls</h1>
41
        <h1>Old recalls</h1>
42
        [% IF Koha.Preference('UseRecalls') %]
42
        [% IF Koha.Preference('UseRecalls') != "off" %]
43
            <div class="page-section">
43
            <div class="page-section">
44
                [% INCLUDE 'recalls.inc' %]
44
                [% INCLUDE 'recalls.inc' %]
45
            </div> <!-- /.page-section -->
45
            </div> <!-- /.page-section -->
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_overdue.tt (-1 / +1 lines)
Lines 39-45 Link Here
39
            [% INCLUDE 'messages.inc' %]
39
            [% INCLUDE 'messages.inc' %]
40
40
41
        <h1>Overdue recalls</h1>
41
        <h1>Overdue recalls</h1>
42
        [% IF Koha.Preference('UseRecalls') %]
42
        [% IF Koha.Preference('UseRecalls') != "off" %]
43
            [% IF recalls.count %]
43
            [% IF recalls.count %]
44
                <div class="page-section">
44
                <div class="page-section">
45
                    <form method="post" action="/cgi-bin/koha/recalls/recalls_overdue.pl">
45
                    <form method="post" action="/cgi-bin/koha/recalls/recalls_overdue.pl">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_queue.tt (-1 / +1 lines)
Lines 39-45 Link Here
39
            [% INCLUDE 'messages.inc' %]
39
            [% INCLUDE 'messages.inc' %]
40
40
41
        <h1>Recalls queue</h1>
41
        <h1>Recalls queue</h1>
42
        [% IF Koha.Preference('UseRecalls') %]
42
        [% IF Koha.Preference('UseRecalls') != "off" %]
43
            [% IF recalls.count %]
43
            [% IF recalls.count %]
44
                <div class="page-section">
44
                <div class="page-section">
45
                    <form method="post" action="/cgi-bin/koha/recalls/recalls_queue.pl">
45
                    <form method="post" action="/cgi-bin/koha/recalls/recalls_queue.pl">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_to_pull.tt (-1 / +1 lines)
Lines 44-50 Link Here
44
        <h1>Recalls to pull</h1>
44
        <h1>Recalls to pull</h1>
45
        The following recalls could be fulfilled by available items.
45
        The following recalls could be fulfilled by available items.
46
46
47
        [% IF Koha.Preference('UseRecalls') %]
47
        [% IF Koha.Preference('UseRecalls') != "off" %]
48
            [% IF recalls %]
48
            [% IF recalls %]
49
                <div id="recalls" class="page-section">
49
                <div id="recalls" class="page-section">
50
                    <table id="recalls-table">
50
                    <table id="recalls-table">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_waiting.tt (-1 / +1 lines)
Lines 39-45 Link Here
39
            [% INCLUDE 'messages.inc' %]
39
            [% INCLUDE 'messages.inc' %]
40
                <h1>Recalls awaiting pickup</h1>
40
                <h1>Recalls awaiting pickup</h1>
41
41
42
                [% IF Koha.Preference('UseRecalls') %]
42
                [% IF Koha.Preference('UseRecalls') != "off" %]
43
43
44
                    [% WRAPPER tabs id= "results" %]
44
                    [% WRAPPER tabs id= "results" %]
45
                        [% WRAPPER tabs_nav %]
45
                        [% WRAPPER tabs_nav %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/request.tt (-3 / +3 lines)
Lines 199-207 Link Here
199
199
200
    [% ELSE %]
200
    [% ELSE %]
201
201
202
        [% IF Koha.Preference('RecallsInterface') == 'opac' %]
202
        [% IF Koha.Preference('UseRecalls') == 'opac' %]
203
        <div class="dialog alert">
203
        <div class="dialog alert">
204
            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.
204
            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.
205
        </div>
205
        </div>
206
        [% ELSE %]
206
        [% ELSE %]
207
207
Lines 226-232 Link Here
226
226
227
        <h2>Existing recalls</h2>
227
        <h2>Existing recalls</h2>
228
228
229
        [% IF Koha.Preference('UseRecalls') %]
229
        [% IF Koha.Preference('UseRecalls') != "off" %]
230
            [% IF recalls.count %]
230
            [% IF recalls.count %]
231
                <div class="page-section">
231
                <div class="page-section">
232
                    <form method="post" action="/cgi-bin/koha/recalls/request.pl">
232
                    <form method="post" action="/cgi-bin/koha/recalls/request.pl">
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc (-2 / +2 lines)
Lines 62-68 Link Here
62
            <span class="item-status checkedout">Checked out</span>
62
            <span class="item-status checkedout">Checked out</span>
63
        [% END %]
63
        [% END %]
64
    [% END %]
64
    [% END %]
65
    [% IF show_recall_link %]
65
    [% IF show_recall_link != "off" %]
66
        [% IF logged_in_user.borrowernumber != issue.borrowernumber %]
66
        [% IF logged_in_user.borrowernumber != issue.borrowernumber %]
67
            <a href="/cgi-bin/koha/opac-recall.pl?biblionumber=[% item.biblionumber | uri %]" class="btn btn-default btn-xs">Recall</a>
67
            <a href="/cgi-bin/koha/opac-recall.pl?biblionumber=[% item.biblionumber | uri %]" class="btn btn-default btn-xs">Recall</a>
68
        [% END %]
68
        [% END %]
Lines 129-135 Link Here
129
    <span class="item-status pendinghold">Pending hold</span>
129
    <span class="item-status pendinghold">Pending hold</span>
130
[% END %]
130
[% END %]
131
131
132
[% IF Koha.Preference('UseRecalls') && item.has_pending_recall %]
132
[% IF Koha.Preference('UseRecalls') != "off" && item.has_pending_recall %]
133
    [% SET itemavailable = 0 %]
133
    [% SET itemavailable = 0 %]
134
    <span class="item-status pendingrecall">Pending recall</span>
134
    <span class="item-status pendingrecall">Pending recall</span>
135
[% END %]
135
[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc (-1 / +1 lines)
Lines 9-15 Link Here
9
        [% END %]
9
        [% END %]
10
    [% END %]
10
    [% END %]
11
11
12
    [% IF Koha.Preference('UseRecalls') AND Koha.Preference('RecallsInterface') != 'staff' %]
12
    [% IF Koha.Preference('UseRecalls').match('opac') %]
13
        <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>
13
        <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>
14
        Place recall</a></li>
14
        Place recall</a></li>
15
    [% END %]
15
    [% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc (-1 / +1 lines)
Lines 84-90 Link Here
84
                <a href="/cgi-bin/koha/opac-holdshistory.pl">Holds history</a></li>
84
                <a href="/cgi-bin/koha/opac-holdshistory.pl">Holds history</a></li>
85
            [% END %]
85
            [% END %]
86
86
87
            [% IF Koha.Preference('UseRecalls') %]
87
            [% IF Koha.Preference('UseRecalls') != "off" %]
88
                [% IF ( recallsview ) %]
88
                [% IF ( recallsview ) %]
89
                    <li class="active">
89
                    <li class="active">
90
                [% ELSE %]
90
                [% ELSE %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt (-1 / +1 lines)
Lines 60-66 Link Here
60
                                    [% FOREACH messaging_preference IN messaging_preferences %]
60
                                    [% FOREACH messaging_preference IN messaging_preferences %]
61
                                        [% NEXT IF !Koha.Preference( 'ILLModule' ) && messaging_preference.message_name.match('^Ill_') %]
61
                                        [% NEXT IF !Koha.Preference( 'ILLModule' ) && messaging_preference.message_name.match('^Ill_') %]
62
                                        [% NEXT IF messaging_preference.Auto_Renewals && Koha.Preference('AutoRenewalNotices') != 'preferences' %]
62
                                        [% NEXT IF messaging_preference.Auto_Renewals && Koha.Preference('AutoRenewalNotices') != 'preferences' %]
63
                                        [% NEXT IF !Koha.Preference('UseRecalls') && messaging_preference.message_name.match('^Recall_') %]
63
                                        [% NEXT IF Koha.Preference('UseRecalls') == "off" && messaging_preference.message_name.match('^Recall_') %]
64
                                        <tr id="[% messaging_preference.message_name _ "_message" | lower | html %]">
64
                                        <tr id="[% messaging_preference.message_name _ "_message" | lower | html %]">
65
                                            <td>[% IF ( messaging_preference.Item_Due ) %]<span>Item due</span>
65
                                            <td>[% IF ( messaging_preference.Item_Due ) %]<span>Item due</span>
66
                                                [% ELSIF ( messaging_preference.Advance_Notice ) %]<span>Advance notice</span>
66
                                                [% ELSIF ( messaging_preference.Advance_Notice ) %]<span>Advance notice</span>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recalls.tt (-1 / +1 lines)
Lines 28-34 Link Here
28
            <div class="col-md-12 col-lg-10 order-1 order-lg-2">
28
            <div class="col-md-12 col-lg-10 order-1 order-lg-2">
29
                <div id="recalls" class="maincontent">
29
                <div id="recalls" class="maincontent">
30
                    <h2>Recalls history</h2>
30
                    <h2>Recalls history</h2>
31
                    [% IF Koha.Preference('UseRecalls') %]
31
                    [% IF Koha.Preference('UseRecalls') != "off" %]
32
                        [% IF RECALLS.count %]
32
                        [% IF RECALLS.count %]
33
                            <div id="opac-user-recalls">
33
                            <div id="opac-user-recalls">
34
                                <table id="recalls-table" class="table table-bordered table-striped">
34
                                <table id="recalls-table" class="table table-bordered table-striped">
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt (-1 / +1 lines)
Lines 11-17 Link Here
11
[% SET CartEnabled = ( Koha.Preference('opacbookbag') == 1 ) %]
11
[% SET CartEnabled = ( Koha.Preference('opacbookbag') == 1 ) %]
12
[% SET ListsEnabled = ( Koha.Preference('virtualshelves') == 1 ) && LoginEnabled %]
12
[% SET ListsEnabled = ( Koha.Preference('virtualshelves') == 1 ) && LoginEnabled %]
13
[% SET HoldsEnabled = ( Koha.Preference('OPACHoldRequests') == 1 ) && LoginEnabled %]
13
[% SET HoldsEnabled = ( Koha.Preference('OPACHoldRequests') == 1 ) && LoginEnabled %]
14
[% SET RecallsEnabled = ( Koha.Preference('UseRecalls') == 1 ) && LoginEnabled && ( Koha.Preference('RecallsInterface') != 'staff' ) %]
14
[% SET RecallsEnabled = ( Koha.Preference('UseRecalls').match('opac') ) && LoginEnabled %]
15
[% SET ArticleRequestsEnabled = ( Koha.Preference('ArticleRequests') == 1 ) && LoginEnabled %]
15
[% SET ArticleRequestsEnabled = ( Koha.Preference('ArticleRequests') == 1 ) && LoginEnabled %]
16
[% SET MultiHolds = ( Koha.Preference('DisplayMultiPlaceHold') == 1 ) && HoldsEnabled %]
16
[% SET MultiHolds = ( Koha.Preference('DisplayMultiPlaceHold') == 1 ) && HoldsEnabled %]
17
[% SET CoverImagePlugins = KohaPlugins.get_plugins_opac_cover_images %]
17
[% SET CoverImagePlugins = KohaPlugins.get_plugins_opac_cover_images %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt (-1 / +1 lines)
Lines 13-19 Link Here
13
[% SET CartEnabled = ( Koha.Preference('opacbookbag') == 1 ) %]
13
[% SET CartEnabled = ( Koha.Preference('opacbookbag') == 1 ) %]
14
[% SET ListsEnabled = ( Koha.Preference('virtualshelves') == 1 ) && LoginEnabled %]
14
[% SET ListsEnabled = ( Koha.Preference('virtualshelves') == 1 ) && LoginEnabled %]
15
[% SET HoldsEnabled = ( Koha.Preference('OPACHoldRequests') == 1 ) && LoginEnabled %]
15
[% SET HoldsEnabled = ( Koha.Preference('OPACHoldRequests') == 1 ) && LoginEnabled %]
16
[% SET RecallsEnabled = ( Koha.Preference('UseRecalls') == 1 ) && LoginEnabled && ( Koha.Preference('RecallsInterface') != 'staff' ) %]
16
[% SET RecallsEnabled = ( Koha.Preference('UseRecalls').match('opac') ) && LoginEnabled %]
17
[% SET ArticleRequestsEnabled = ( Koha.Preference('ArticleRequests') == 1 ) && LoginEnabled %]
17
[% SET ArticleRequestsEnabled = ( Koha.Preference('ArticleRequests') == 1 ) && LoginEnabled %]
18
[% SET MultiHolds = ( Koha.Preference('DisplayMultiPlaceHold') == 1 ) && HoldsEnabled %]
18
[% SET MultiHolds = ( Koha.Preference('DisplayMultiPlaceHold') == 1 ) && HoldsEnabled %]
19
19
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt (-1 / +1 lines)
Lines 12-18 Link Here
12
[% SET CartEnabled = ( Koha.Preference('opacbookbag') == 1 ) %]
12
[% SET CartEnabled = ( Koha.Preference('opacbookbag') == 1 ) %]
13
[% SET ListsEnabled = ( Koha.Preference('virtualshelves') == 1 ) && LoginEnabled %]
13
[% SET ListsEnabled = ( Koha.Preference('virtualshelves') == 1 ) && LoginEnabled %]
14
[% SET HoldsEnabled = ( Koha.Preference('OPACHoldRequests') == 1 ) && LoginEnabled %]
14
[% SET HoldsEnabled = ( Koha.Preference('OPACHoldRequests') == 1 ) && LoginEnabled %]
15
[% SET RecallsEnabled = ( Koha.Preference('UseRecalls') == 1 ) && LoginEnabled && ( Koha.Preference('RecallsInterface') != 'staff' ) %]
15
[% SET RecallsEnabled = ( Koha.Preference('UseRecalls').match('opac') ) && LoginEnabled %]
16
[% SET ArticleRequestsEnabled = ( Koha.Preference('ArticleRequests') == 1 ) && LoginEnabled %]
16
[% SET ArticleRequestsEnabled = ( Koha.Preference('ArticleRequests') == 1 ) && LoginEnabled %]
17
[% SET MultiHolds = ( Koha.Preference('DisplayMultiPlaceHold') == 1 ) && HoldsEnabled %]
17
[% SET MultiHolds = ( Koha.Preference('DisplayMultiPlaceHold') == 1 ) && HoldsEnabled %]
18
[% INCLUDE 'doc-head-open.inc' %]
18
[% INCLUDE 'doc-head-open.inc' %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt (-2 / +2 lines)
Lines 298-304 Link Here
298
                                    <span>Holds ([% RESERVES.count | html %])</span>
298
                                    <span>Holds ([% RESERVES.count | html %])</span>
299
                                [% END %]
299
                                [% END %]
300
                            [% END %]
300
                            [% END %]
301
                            [% IF Koha.Preference('UseRecalls') && RECALLS.count %]
301
                            [% IF Koha.Preference('UseRecalls') != "off" && RECALLS.count %]
302
                                [% WRAPPER tab_item tabname= "opac-user-recalls" %]
302
                                [% WRAPPER tab_item tabname= "opac-user-recalls" %]
303
                                    <span>Recalls ([% RECALLS.count | html %])</span>
303
                                    <span>Recalls ([% RECALLS.count | html %])</span>
304
                                [% END %]
304
                                [% END %]
Lines 843-849 Link Here
843
                                [% END # /tab_panel#opac-user-holds %]
843
                                [% END # /tab_panel#opac-user-holds %]
844
                            [% END # / #RESERVES.count %]
844
                            [% END # / #RESERVES.count %]
845
845
846
                            [% IF Koha.Preference('UseRecalls') && RECALLS.count %]
846
                            [% IF Koha.Preference('UseRecalls') != "off" && RECALLS.count %]
847
                                [% WRAPPER tab_panel tabname="opac-user-recalls" %]
847
                                [% WRAPPER tab_panel tabname="opac-user-recalls" %]
848
                                    <table id="recalls-table" class="table table-bordered table-striped">
848
                                    <table id="recalls-table" class="table table-bordered table-striped">
849
                                        <caption>Recalls <span class="count">([% RECALLS.count | html %])</span></caption>
849
                                        <caption>Recalls <span class="count">([% RECALLS.count | html %])</span></caption>
(-)a/members/moremember.pl (-2 / +2 lines)
Lines 213-219 $template->param( Link Here
213
    WaitingHolds => $waiting_holds,
213
    WaitingHolds => $waiting_holds,
214
);
214
);
215
215
216
if ( C4::Context->preference('UseRecalls') ) {
216
if ( C4::Context->preference('UseRecalls') ne "off" ) {
217
    my $waiting_recalls = $patron->recalls->search({ status => 'waiting' });
217
    my $waiting_recalls = $patron->recalls->search({ status => 'waiting' });
218
    $template->param( waiting_recalls => $waiting_recalls );
218
    $template->param( waiting_recalls => $waiting_recalls );
219
}
219
}
Lines 305-311 $template->param( Link Here
305
    patron_lists_count => $patron_lists_count,
305
    patron_lists_count => $patron_lists_count,
306
);
306
);
307
307
308
if ( C4::Context->preference('UseRecalls') ) {
308
if ( C4::Context->preference('UseRecalls') ne "off" ) {
309
    $template->param(
309
    $template->param(
310
        recalls         => $patron->recalls({},{ order_by => { -asc => 'recalldate' } })->filter_by_current,
310
        recalls         => $patron->recalls({},{ order_by => { -asc => 'recalldate' } })->filter_by_current,
311
        specific_patron => 1,
311
        specific_patron => 1,
(-)a/opac/opac-recall.pl (-1 / +1 lines)
Lines 42-48 if ($op eq 'cud-cancel'){ Link Here
42
    print $query->redirect('/cgi-bin/koha/opac-user.pl');
42
    print $query->redirect('/cgi-bin/koha/opac-user.pl');
43
}
43
}
44
44
45
if ( C4::Context->preference('UseRecalls') and C4::Context->preference('RecallsInterface') ne 'staff' ) {
45
if ( C4::Context->preference('UseRecalls') =~ m/opac/ ) {
46
46
47
    my $patron = Koha::Patrons->find( $borrowernumber );
47
    my $patron = Koha::Patrons->find( $borrowernumber );
48
    my $error;
48
    my $error;
(-)a/opac/opac-user.pl (-2 / +2 lines)
Lines 298-304 if ( $pending_checkouts->count ) { # Useless test Link Here
298
            $issue->{normalized_oclc} = GetNormalizedOCLCNumber( $marcrecord, C4::Context->preference('marcflavour') );
298
            $issue->{normalized_oclc} = GetNormalizedOCLCNumber( $marcrecord, C4::Context->preference('marcflavour') );
299
        }
299
        }
300
300
301
        if ( C4::Context->preference('UseRecalls') ) {
301
        if ( C4::Context->preference('UseRecalls') ne "off" ) {
302
            my $maybe_recalls = Koha::Recalls->search({ biblio_id => $issue->{biblionumber}, item_id => [ undef, $issue->{itemnumber} ], completed => 0 });
302
            my $maybe_recalls = Koha::Recalls->search({ biblio_id => $issue->{biblionumber}, item_id => [ undef, $issue->{itemnumber} ], completed => 0 });
303
            while( my $recall = $maybe_recalls->next ) {
303
            while( my $recall = $maybe_recalls->next ) {
304
                if ( $recall->checkout and $recall->checkout->issue_id == $issue->{issue_id} ) {
304
                if ( $recall->checkout and $recall->checkout->issue_id == $issue->{issue_id} ) {
Lines 334-340 $template->param( Link Here
334
    showpriority   => $show_priority,
334
    showpriority   => $show_priority,
335
);
335
);
336
336
337
if ( C4::Context->preference('UseRecalls') ) {
337
if ( C4::Context->preference('UseRecalls') ne "off" ) {
338
    my $recalls = Koha::Recalls->search( { patron_id => $borrowernumber, completed => 0 } );
338
    my $recalls = Koha::Recalls->search( { patron_id => $borrowernumber, completed => 0 } );
339
    $template->param( RECALLS => $recalls );
339
    $template->param( RECALLS => $recalls );
340
}
340
}
(-)a/recalls/request.pl (-5 / +2 lines)
Lines 49-57 if ( $op eq 'cud-cancel_multiple_recalls' ) { Link Here
49
    print $input->redirect( '/cgi-bin/koha/recalls/request.pl?biblionumber=' . $biblionumber );
49
    print $input->redirect( '/cgi-bin/koha/recalls/request.pl?biblionumber=' . $biblionumber );
50
} elsif ( $op eq 'cud-request' ) {
50
} elsif ( $op eq 'cud-request' ) {
51
51
52
    if (    C4::Context->preference('UseRecalls')
52
    if ( C4::Context->preference('UseRecalls') =~ m/staff/ and $borrowernumber )
53
        and C4::Context->preference('RecallsInterface') ne 'opac'
54
        and $borrowernumber )
55
    {
53
    {
56
        my $patron = Koha::Patrons->find($borrowernumber);
54
        my $patron = Koha::Patrons->find($borrowernumber);
57
55
Lines 130-137 if ( $op eq 'cud-cancel_multiple_recalls' ) { Link Here
130
if ($borrowernumber) {
128
if ($borrowernumber) {
131
    my $patron = Koha::Patrons->find($borrowernumber);
129
    my $patron = Koha::Patrons->find($borrowernumber);
132
130
133
    if (    C4::Context->preference('UseRecalls')
131
    if (    C4::Context->preference('UseRecalls') =~ m/staff/
134
        and C4::Context->preference('RecallsInterface') ne 'opac'
135
        and $patron
132
        and $patron
136
        and $patron->borrowernumber )
133
        and $patron->borrowernumber )
137
    {
134
    {
(-)a/svc/checkouts (-1 / +1 lines)
Lines 219-225 while ( my $c = $sth->fetchrow_hashref() ) { Link Here
219
    my @subtitles = split(/ \| /, $c->{'subtitle'} // '' );
219
    my @subtitles = split(/ \| /, $c->{'subtitle'} // '' );
220
220
221
    my $recalled = 0;
221
    my $recalled = 0;
222
    if ( C4::Context->preference('UseRecalls') ) {
222
    if ( C4::Context->preference('UseRecalls') ne "off" ) {
223
        my $item = Koha::Items->find( $c->{itemnumber} );
223
        my $item = Koha::Items->find( $c->{itemnumber} );
224
        my $recall = undef;
224
        my $recall = undef;
225
        $recall = $item->check_recalls if $item->can_be_waiting_recall;
225
        $recall = $item->check_recalls if $item->can_be_waiting_recall;
(-)a/t/db_dependent/Circulation.t (-4 / +4 lines)
Lines 1728-1734 subtest "CanBookBeRenewed tests" => sub { Link Here
1728
    );
1728
    );
1729
1729
1730
    # Recalls
1730
    # Recalls
1731
    t::lib::Mocks::mock_preference('UseRecalls', 1);
1731
    t::lib::Mocks::mock_preference('UseRecalls', 'opac');
1732
    Koha::CirculationRules->set_rules({
1732
    Koha::CirculationRules->set_rules({
1733
        categorycode => undef,
1733
        categorycode => undef,
1734
        branchcode => undef,
1734
        branchcode => undef,
Lines 2441-2447 subtest 'AddIssue & AllowReturnToBranch' => sub { Link Here
2441
subtest 'AddIssue | recalls' => sub {
2441
subtest 'AddIssue | recalls' => sub {
2442
    plan tests => 3;
2442
    plan tests => 3;
2443
2443
2444
    t::lib::Mocks::mock_preference("UseRecalls", 1);
2444
    t::lib::Mocks::mock_preference("UseRecalls", 'opac');
2445
    t::lib::Mocks::mock_preference("item-level_itypes", 1);
2445
    t::lib::Mocks::mock_preference("item-level_itypes", 1);
2446
    my $patron1 = $builder->build_object({ class => 'Koha::Patrons' });
2446
    my $patron1 = $builder->build_object({ class => 'Koha::Patrons' });
2447
    my $patron2 = $builder->build_object({ class => 'Koha::Patrons' });
2447
    my $patron2 = $builder->build_object({ class => 'Koha::Patrons' });
Lines 4786-4792 subtest 'CanBookBeIssued | notforloan' => sub { Link Here
4786
subtest 'CanBookBeIssued | recalls' => sub {
4786
subtest 'CanBookBeIssued | recalls' => sub {
4787
    plan tests => 3;
4787
    plan tests => 3;
4788
4788
4789
    t::lib::Mocks::mock_preference("UseRecalls", 1);
4789
    t::lib::Mocks::mock_preference("UseRecalls", 'opac');
4790
    t::lib::Mocks::mock_preference("item-level_itypes", 1);
4790
    t::lib::Mocks::mock_preference("item-level_itypes", 1);
4791
    my $patron1 = $builder->build_object({ class => 'Koha::Patrons' });
4791
    my $patron1 = $builder->build_object({ class => 'Koha::Patrons' });
4792
    my $patron2 = $builder->build_object({ class => 'Koha::Patrons' });
4792
    my $patron2 = $builder->build_object({ class => 'Koha::Patrons' });
Lines 4938-4944 subtest 'AddReturn should clear items.onloan for unissued items' => sub { Link Here
4938
subtest 'AddReturn | recalls' => sub {
4938
subtest 'AddReturn | recalls' => sub {
4939
    plan tests => 3;
4939
    plan tests => 3;
4940
4940
4941
    t::lib::Mocks::mock_preference("UseRecalls", 1);
4941
    t::lib::Mocks::mock_preference("UseRecalls", 'opac');
4942
    t::lib::Mocks::mock_preference("item-level_itypes", 1);
4942
    t::lib::Mocks::mock_preference("item-level_itypes", 1);
4943
    my $patron1 = $builder->build_object({ class => 'Koha::Patrons' });
4943
    my $patron1 = $builder->build_object({ class => 'Koha::Patrons' });
4944
    my $patron2 = $builder->build_object({ class => 'Koha::Patrons' });
4944
    my $patron2 = $builder->build_object({ class => 'Koha::Patrons' });
(-)a/t/db_dependent/Circulation/transferbook.t (-1 / +1 lines)
Lines 158-164 subtest 'transfer already at destination' => sub { Link Here
158
    is( $messages->{ResFound}->{itemnumber}, $item->itemnumber, "We got the reserve info");
158
    is( $messages->{ResFound}->{itemnumber}, $item->itemnumber, "We got the reserve info");
159
159
160
    # recalls
160
    # recalls
161
    t::lib::Mocks::mock_preference('UseRecalls', 1);
161
    t::lib::Mocks::mock_preference('UseRecalls', 'opac');
162
    my $recall = Koha::Recall->new(
162
    my $recall = Koha::Recall->new(
163
        {   biblio_id         => $item->biblionumber,
163
        {   biblio_id         => $item->biblionumber,
164
            item_id           => $item->itemnumber,
164
            item_id           => $item->itemnumber,
(-)a/t/db_dependent/Holds.t (-1 / +1 lines)
Lines 1922-1928 subtest 'ModReserve to convert a hold to a recall' => sub { Link Here
1922
        }
1922
        }
1923
    )->store;
1923
    )->store;
1924
1924
1925
    t::lib::Mocks::mock_preference( "UseRecalls", 1 );
1925
    t::lib::Mocks::mock_preference( "UseRecalls", 'opac' );
1926
    t::lib::Mocks::mock_userenv( { branchcode => $branch } );
1926
    t::lib::Mocks::mock_userenv( { branchcode => $branch } );
1927
1927
1928
    C4::Circulation::AddIssue( $patron2, $item->barcode );
1928
    C4::Circulation::AddIssue( $patron2, $item->barcode );
(-)a/t/db_dependent/Koha/Biblio.t (-2 / +2 lines)
Lines 1549-1558 subtest 'Recalls tests' => sub { Link Here
1549
    is( $recalls->count, 3, 'Correctly get number of recalls for biblio' );
1549
    is( $recalls->count, 3, 'Correctly get number of recalls for biblio' );
1550
    is( $recalls->filter_by_current->count, 1, 'Correctly get number of active recalls for biblio' );
1550
    is( $recalls->filter_by_current->count, 1, 'Correctly get number of active recalls for biblio' );
1551
1551
1552
    t::lib::Mocks::mock_preference('UseRecalls', 0);
1552
    t::lib::Mocks::mock_preference('UseRecalls', 'off');
1553
    is( $biblio->can_be_recalled({ patron => $patron1 }), 0, "Can't recall with UseRecalls disabled" );
1553
    is( $biblio->can_be_recalled({ patron => $patron1 }), 0, "Can't recall with UseRecalls disabled" );
1554
1554
1555
    t::lib::Mocks::mock_preference("UseRecalls", 1);
1555
    t::lib::Mocks::mock_preference("UseRecalls", 'opac');
1556
    $item1->update({ notforloan => 1 });
1556
    $item1->update({ notforloan => 1 });
1557
    is( $biblio->can_be_recalled({ patron => $patron1 }), 0, "Can't recall with no available items" );
1557
    is( $biblio->can_be_recalled({ patron => $patron1 }), 0, "Can't recall with no available items" );
1558
1558
(-)a/t/db_dependent/Koha/Item.t (-4 / +4 lines)
Lines 2393-2399 subtest 'Recalls tests' => sub { Link Here
2393
    );
2393
    );
2394
2394
2395
    t::lib::Mocks::mock_userenv( { patron => $patron1 } );
2395
    t::lib::Mocks::mock_userenv( { patron => $patron1 } );
2396
    t::lib::Mocks::mock_preference('UseRecalls', 1);
2396
    t::lib::Mocks::mock_preference('UseRecalls', 'opac');
2397
2397
2398
    my $recall1 = Koha::Recall->new(
2398
    my $recall1 = Koha::Recall->new(
2399
        {   patron_id         => $patron1->borrowernumber,
2399
        {   patron_id         => $patron1->borrowernumber,
Lines 2421-2430 subtest 'Recalls tests' => sub { Link Here
2421
2421
2422
    $recall2->set_cancelled;
2422
    $recall2->set_cancelled;
2423
2423
2424
    t::lib::Mocks::mock_preference('UseRecalls', 0);
2424
    t::lib::Mocks::mock_preference('UseRecalls', 'off');
2425
    is( $item1->can_be_recalled({ patron => $patron1 }), 0, "Can't recall with UseRecalls disabled" );
2425
    is( $item1->can_be_recalled({ patron => $patron1 }), 0, "Can't recall with UseRecalls disabled" );
2426
2426
2427
    t::lib::Mocks::mock_preference("UseRecalls", 1);
2427
    t::lib::Mocks::mock_preference("UseRecalls", 'opac');
2428
2428
2429
    $item1->update({ notforloan => 1 });
2429
    $item1->update({ notforloan => 1 });
2430
    is( $item1->can_be_recalled({ patron => $patron1 }), 0, "Can't recall that is not for loan" );
2430
    is( $item1->can_be_recalled({ patron => $patron1 }), 0, "Can't recall that is not for loan" );
Lines 2609-2615 subtest 'has_pending_recall() tests' => sub { Link Here
2609
    my $patron  = $builder->build_object({ class => 'Koha::Patrons' });
2609
    my $patron  = $builder->build_object({ class => 'Koha::Patrons' });
2610
2610
2611
    t::lib::Mocks::mock_userenv({ branchcode => $library->branchcode });
2611
    t::lib::Mocks::mock_userenv({ branchcode => $library->branchcode });
2612
    t::lib::Mocks::mock_preference( 'UseRecalls', 1 );
2612
    t::lib::Mocks::mock_preference( 'UseRecalls', 'opac' );
2613
2613
2614
    C4::Circulation::AddIssue( $patron, $item->barcode );
2614
    C4::Circulation::AddIssue( $patron, $item->barcode );
2615
2615
(-)a/t/db_dependent/SIP/Transaction.t (-1 / +1 lines)
Lines 1265-1271 subtest do_checkout_with_recalls => sub { Link Here
1265
        }
1265
        }
1266
    );
1266
    );
1267
1267
1268
    t::lib::Mocks::mock_preference( 'UseRecalls', 1 );
1268
    t::lib::Mocks::mock_preference( 'UseRecalls', 'opac' );
1269
    Koha::CirculationRules->set_rule(
1269
    Koha::CirculationRules->set_rule(
1270
        {
1270
        {
1271
            branchcode   => undef,
1271
            branchcode   => undef,
(-)a/t/db_dependent/Search.t (-1 / +1 lines)
Lines 155-161 $contextmodule->mock('preference', sub { Link Here
155
    } elsif ($pref eq 'SearchLimitLibrary') {
155
    } elsif ($pref eq 'SearchLimitLibrary') {
156
        return 'both';
156
        return 'both';
157
    } elsif ($pref eq 'UseRecalls') {
157
    } elsif ($pref eq 'UseRecalls') {
158
        return '0';
158
        return 'off';
159
    } elsif ( $pref eq 'ContentWarningField' ) {
159
    } elsif ( $pref eq 'ContentWarningField' ) {
160
        return q{};
160
        return q{};
161
    } elsif ( $pref eq 'AuthorLinkSortBy' ) {
161
    } elsif ( $pref eq 'AuthorLinkSortBy' ) {
(-)a/t/db_dependent/XSLT.t (-3 / +2 lines)
Lines 181-187 subtest 'buildKohaItemsNamespace status tests' => sub { Link Here
181
    my $library_name = $holdinglibrary->branchname;
181
    my $library_name = $holdinglibrary->branchname;
182
    like($xml,qr{<resultbranch>${library_name}</resultbranch>}, "Found resultbranch / holding branch" );
182
    like($xml,qr{<resultbranch>${library_name}</resultbranch>}, "Found resultbranch / holding branch" );
183
183
184
    t::lib::Mocks::mock_preference('UseRecalls', 1);
184
    t::lib::Mocks::mock_preference('UseRecalls', 'opac');
185
    my $recall = $builder->build_object(
185
    my $recall = $builder->build_object(
186
        {
186
        {
187
            class => 'Koha::Recalls',
187
            class => 'Koha::Recalls',
Lines 196-202 subtest 'buildKohaItemsNamespace status tests' => sub { Link Here
196
    $recall->set_waiting;
196
    $recall->set_waiting;
197
    $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]);
197
    $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]);
198
    like($xml,qr{<substatus>Recall waiting</substatus>},"Waiting status takes precedence over In transit (recalls)");
198
    like($xml,qr{<substatus>Recall waiting</substatus>},"Waiting status takes precedence over In transit (recalls)");
199
    t::lib::Mocks::mock_preference('UseRecalls', 0);
199
    t::lib::Mocks::mock_preference('UseRecalls', 'off');
200
200
201
    $schema->storage->txn_rollback;
201
    $schema->storage->txn_rollback;
202
};
202
};
203
- 

Return to bug 31391