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 2428-2434 sub AddReturn { Link Here
2428
    }
2428
    }
2429
2429
2430
    # find recalls...
2430
    # find recalls...
2431
    if ( C4::Context->preference('UseRecalls') ) {
2431
    if ( C4::Context->preference('UseRecalls') ne "off" ) {
2432
        # check if this item is recallable first, which includes checking if UseRecalls syspref is enabled
2432
        # check if this item is recallable first, which includes checking if UseRecalls syspref is enabled
2433
        my $recall = undef;
2433
        my $recall = undef;
2434
        $recall = $item->check_recalls if $item->can_be_waiting_recall;
2434
        $recall = $item->check_recalls if $item->can_be_waiting_recall;
Lines 2505-2511 sub AddReturn { Link Here
2505
        $request->status('RET') if $request;
2505
        $request->status('RET') if $request;
2506
    }
2506
    }
2507
2507
2508
    if ( C4::Context->preference('UseRecalls') ) {
2508
    if ( C4::Context->preference('UseRecalls') ne "off" ) {
2509
        # all recalls that have triggered a transfer will have an allocated itemnumber
2509
        # all recalls that have triggered a transfer will have an allocated itemnumber
2510
        my $transfer_recall = Koha::Recalls->find({ item_id => $item->itemnumber, status => 'in_transit' });
2510
        my $transfer_recall = Koha::Recalls->find({ item_id => $item->itemnumber, status => 'in_transit' });
2511
        if ( $transfer_recall and $transfer_recall->pickup_library_id eq $branch ) {
2511
        if ( $transfer_recall and $transfer_recall->pickup_library_id eq $branch ) {
Lines 3063-3069 sub CanBookBeRenewed { Link Here
3063
3063
3064
    }
3064
    }
3065
3065
3066
    if ( C4::Context->preference('UseRecalls') ) {
3066
    if ( C4::Context->preference('UseRecalls') ne "off" ) {
3067
        my $recall = undef;
3067
        my $recall = undef;
3068
        $recall = $item->check_recalls if $item->can_be_waiting_recall;
3068
        $recall = $item->check_recalls if $item->can_be_waiting_recall;
3069
        if ( defined $recall ) {
3069
        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 2016-2022 if hold_convert $param is included, this is to say that this a check to convert Link Here
2016
sub can_be_recalled {
2016
sub can_be_recalled {
2017
    my ( $self, $params ) = @_;
2017
    my ( $self, $params ) = @_;
2018
2018
2019
    return 0 if !( C4::Context->preference('UseRecalls') );
2019
    return 0 if ( C4::Context->preference('UseRecalls') eq "off" );
2020
2020
2021
    my $patron = $params->{patron};
2021
    my $patron = $params->{patron};
2022
2022
(-)a/Koha/Item.pm (-2 / +2 lines)
Lines 2331-2337 if hold_convert $param is included, this is to say that this a check to convert Link Here
2331
sub can_be_recalled {
2331
sub can_be_recalled {
2332
    my ( $self, $params ) = @_;
2332
    my ( $self, $params ) = @_;
2333
2333
2334
    return 0 if !( C4::Context->preference('UseRecalls') );
2334
    return 0 if ( C4::Context->preference('UseRecalls') eq "off" );
2335
2335
2336
    # check if this item is not for loan, withdrawn or lost
2336
    # check if this item is not for loan, withdrawn or lost
2337
    return 0 if ( $self->notforloan != 0 );
2337
    return 0 if ( $self->notforloan != 0 );
Lines 2416-2422 At this point the item has already been recalled. We are now at the checkin and Link Here
2416
sub can_be_waiting_recall {
2416
sub can_be_waiting_recall {
2417
    my ( $self ) = @_;
2417
    my ( $self ) = @_;
2418
2418
2419
    return 0 if !( C4::Context->preference('UseRecalls') );
2419
    return 0 if ( C4::Context->preference('UseRecalls') eq "off" );
2420
2420
2421
    # check if this item is not for loan, withdrawn or lost
2421
    # check if this item is not for loan, withdrawn or lost
2422
    return 0 if ( $self->notforloan != 0 );
2422
    return 0 if ( $self->notforloan != 0 );
(-)a/circ/circulation.pl (-2 / +2 lines)
Lines 519-525 if ( @$barcodes && $op eq 'cud-checkout' ) { Link Here
519
            }
519
            }
520
            unless ($confirm_required) {
520
            unless ($confirm_required) {
521
                my $switch_onsite_checkout = exists $messages->{ONSITE_CHECKOUT_WILL_BE_SWITCHED};
521
                my $switch_onsite_checkout = exists $messages->{ONSITE_CHECKOUT_WILL_BE_SWITCHED};
522
                if ( C4::Context->preference('UseRecalls') && !$recall_id ) {
522
                if ( C4::Context->preference('UseRecalls') ne "off" && !$recall_id ) {
523
                    my $recall = Koha::Recalls->find(
523
                    my $recall = Koha::Recalls->find(
524
                        {
524
                        {
525
                            biblio_id => $item->biblionumber,
525
                            biblio_id => $item->biblionumber,
Lines 598-604 if ($patron) { Link Here
598
        WaitingHolds => $waiting_holds,
598
        WaitingHolds => $waiting_holds,
599
    );
599
    );
600
600
601
    if ( C4::Context->preference('UseRecalls') ) {
601
    if ( C4::Context->preference('UseRecalls') ne "off" ) {
602
        my $waiting_recalls = $patron->recalls->search( { status => 'waiting' } );
602
        my $waiting_recalls = $patron->recalls->search( { status => 'waiting' } );
603
        $template->param(
603
        $template->param(
604
            recalls => $patron->recalls->filter_by_current->search( {}, { order_by => { -asc => 'created_date' } } ),
604
            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 645-651 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
645
('QuoteOfTheDay','','intranet,opac','Enable or disable display of Quote of the Day on the OPAC and staff interface home page','multiple'),
645
('QuoteOfTheDay','','intranet,opac','Enable or disable display of Quote of the Day on the OPAC and staff interface home page','multiple'),
646
('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'),
646
('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'),
647
('RealTimeHoldsQueue', '0', NULL, 'Enable updating the holds queue in real time', 'YesNo'),
647
('RealTimeHoldsQueue', '0', NULL, 'Enable updating the holds queue in real time', 'YesNo'),
648
('RecallsInterface','opac','opac|staff|both','The interface that recalls can be placed through','Choice'),
649
('RecallsLog','1',NULL,'If ON, log create/cancel/expire/fulfill actions on recalls','YesNo'),
648
('RecallsLog','1',NULL,'If ON, log create/cancel/expire/fulfill actions on recalls','YesNo'),
650
('RecallsMaxPickUpDelay','7',NULL,'Define the maximum time a recall can be awaiting pickup','Integer'),
649
('RecallsMaxPickUpDelay','7',NULL,'Define the maximum time a recall can be awaiting pickup','Integer'),
651
('RecordLocalUseOnReturn','0',NULL,'If ON, statistically record returns of unissued items as local use, instead of return','YesNo'),
650
('RecordLocalUseOnReturn','0',NULL,'If ON, statistically record returns of unissued items as local use, instead of return','YesNo'),
Lines 853-859 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
853
('UseICUStyleQuotes','0','1','Tell Koha whether to use ICU style quotes ({) or default (") when tracing subjects .','YesNo'),
852
('UseICUStyleQuotes','0','1','Tell Koha whether to use ICU style quotes ({) or default (") when tracing subjects .','YesNo'),
854
('UseLocationAsAQInSIP', '0', '', 'Use permanent_location instead of homebranch for AQ in SIP response', 'YesNo'),
853
('UseLocationAsAQInSIP', '0', '', 'Use permanent_location instead of homebranch for AQ in SIP response', 'YesNo'),
855
('UseOCLCEncodingLevels','0',NULL,'If enabled, include OCLC encoding levels in leader value builder dropdown for position 17.','YesNo'),
854
('UseOCLCEncodingLevels','0',NULL,'If enabled, include OCLC encoding levels in leader value builder dropdown for position 17.','YesNo'),
856
('UseRecalls','0',NULL,'Enable or disable recalls','YesNo'),
855
('UseRecalls','off','off|opac|staff|opac_and_staff','Enable or disable recalls','Choice'),
857
('UseTransportCostMatrix','0','','Use Transport Cost Matrix when filling holds','YesNo'),
856
('UseTransportCostMatrix','0','','Use Transport Cost Matrix when filling holds','YesNo'),
858
('UseWYSIWYGinSystemPreferences','0','','Show WYSIWYG editor when editing certain HTML system preferences.','YesNo'),
857
('UseWYSIWYGinSystemPreferences','0','','Show WYSIWYG editor when editing certain HTML system preferences.','YesNo'),
859
('viewISBD','1','','Allow display of ISBD view of bibiographic records','YesNo'),
858
('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 279-285 Link Here
279
                    <td></td>
279
                    <td></td>
280
                [% END %]
280
                [% END %]
281
                <td>
281
                <td>
282
                    [% IF Koha.Preference('UseRecalls') AND Koha.Preference('RecallsInterface') != 'opac' %]
282
                    [% IF ( Koha.Preference('UseRecalls').match('staff') ) %]
283
                    <a class="convert-to-recall btn" title="Convert hold to recall" data-id="[% hold.reserve_id | html %]">Mark for conversion to recall</a>
283
                    <a class="convert-to-recall btn" title="Convert hold to recall" data-id="[% hold.reserve_id | html %]">Mark for conversion to recall</a>
284
                    [% END %]
284
                    [% END %]
285
                </td>
285
                </td>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc (-2 / +2 lines)
Lines 236-242 Link Here
236
    [% IF biblio.serial %]
236
    [% IF biblio.serial %]
237
        embed.push('serial_item.serial');
237
        embed.push('serial_item.serial');
238
    [% END %]
238
    [% END %]
239
    [% IF Koha.Preference('UseRecalls') %]
239
    [% IF Koha.Preference('UseRecalls') != "off" %]
240
        embed.push('recall', 'recall+strings', 'recall.patron')
240
        embed.push('recall', 'recall+strings', 'recall.patron')
241
    [% END %]
241
    [% END %]
242
    [% IF bundlesEnabled %]
242
    [% IF bundlesEnabled %]
Lines 539-545 Link Here
539
                        }
539
                        }
540
                    }
540
                    }
541
541
542
                    [% IF Koha.Preference('UseRecalls') %]
542
                    [% IF Koha.Preference('UseRecalls') != "off" %]
543
                        if ( row.recall ) {
543
                        if ( row.recall ) {
544
                            if ( row.recall.waiting_date ) {
544
                            if ( row.recall.waiting_date ) {
545
                                nodes += '<span>%s</span>'.format(_("Waiting at %s since %s").format(escape_str(row.recall.pickup_library_id.str), $date(row.recall.waiting_date)));
545
                                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 1463-1483 Circulation: Link Here
1463
            - class: integer
1463
            - class: integer
1464
            - days.
1464
            - days.
1465
        -
1465
        -
1466
            - Recalls
1466
            - pref: UseRecalls
1467
            - pref: UseRecalls
1467
              type: boolean
1468
              default: off
1468
              choices:
1469
              choices:
1469
                  1: Use
1470
                  off: are disabled
1470
                  0: "Don't use"
1471
                  opac: can be placed through the OPAC only
1471
            - recalls. Make sure you configure <a href="/cgi-bin/koha/admin/smart-rules.pl">circulation and fine rules</a> for recalls once enabled.
1472
                  staff: can be placed through the staff interface only
1472
        -
1473
                  opac_and_staff: can be placed through both the OPAC and staff interface
1473
            - Recalls can be placed through
1474
            - . Make sure you configure <a href="/cgi-bin/koha/admin/smart-rules.pl">circulation and fine rules</a> for recalls when enabled.
1474
            - pref: RecallsInterface
1475
              default: opac
1476
              choices:
1477
                  opac: the OPAC only
1478
                  staff: the staff interface only
1479
                  both: both the OPAC and the staff interface
1480
            - . (Requires <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=UseRecalls">UseRecalls</a>.)
1481
1475
1482
    SIP2:
1476
    SIP2:
1483
        -
1477
        -
(-)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 103-109 Link Here
103
                            </li>
103
                            </li>
104
                        </ul>
104
                        </ul>
105
105
106
                        [% IF Koha.Preference('UseRecalls') and CAN_user_recalls %]
106
                        [% IF Koha.Preference('UseRecalls') != "off" and CAN_user_recalls %]
107
                            <h3>Recalls</h3>
107
                            <h3>Recalls</h3>
108
108
109
                            <ul class="buttons-list">
109
                            <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 (-6 / +6 lines)
Lines 53-65 Link Here
53
    [% IF patron %]
53
    [% IF patron %]
54
54
55
        [% IF error %]
55
        [% IF error %]
56
            <div class="dialog alert">
56
            <div class="alert alert-warning">
57
                Unable to place a recall. Check your circulation rules.
57
                <strong>Cannot place recalls:</strong> check your circulation rules.
58
            </div>
58
            </div>
59
        [% END %]
59
        [% END %]
60
60
61
        [% IF patron_holds_count %]
61
        [% IF patron_holds_count %]
62
            <div class="dialog alert alert-info">
62
            <div class="alert alert-info">
63
                Patron has placed one or more record-level holds. <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblio.biblionumber | uri %]">Convert a hold to a recall</a>.
63
                Patron has placed one or more record-level holds. <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblio.biblionumber | uri %]">Convert a hold to a recall</a>.
64
            </div>
64
            </div>
65
        [% END %]
65
        [% END %]
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 4800-4806 subtest 'CanBookBeIssued | notforloan' => sub { Link Here
4800
subtest 'CanBookBeIssued | recalls' => sub {
4800
subtest 'CanBookBeIssued | recalls' => sub {
4801
    plan tests => 3;
4801
    plan tests => 3;
4802
4802
4803
    t::lib::Mocks::mock_preference("UseRecalls", 1);
4803
    t::lib::Mocks::mock_preference("UseRecalls", 'opac');
4804
    t::lib::Mocks::mock_preference("item-level_itypes", 1);
4804
    t::lib::Mocks::mock_preference("item-level_itypes", 1);
4805
    my $patron1 = $builder->build_object({ class => 'Koha::Patrons' });
4805
    my $patron1 = $builder->build_object({ class => 'Koha::Patrons' });
4806
    my $patron2 = $builder->build_object({ class => 'Koha::Patrons' });
4806
    my $patron2 = $builder->build_object({ class => 'Koha::Patrons' });
Lines 4952-4958 subtest 'AddReturn should clear items.onloan for unissued items' => sub { Link Here
4952
subtest 'AddReturn | recalls' => sub {
4952
subtest 'AddReturn | recalls' => sub {
4953
    plan tests => 3;
4953
    plan tests => 3;
4954
4954
4955
    t::lib::Mocks::mock_preference("UseRecalls", 1);
4955
    t::lib::Mocks::mock_preference("UseRecalls", 'opac');
4956
    t::lib::Mocks::mock_preference("item-level_itypes", 1);
4956
    t::lib::Mocks::mock_preference("item-level_itypes", 1);
4957
    my $patron1 = $builder->build_object({ class => 'Koha::Patrons' });
4957
    my $patron1 = $builder->build_object({ class => 'Koha::Patrons' });
4958
    my $patron2 = $builder->build_object({ class => 'Koha::Patrons' });
4958
    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 1914-1920 subtest 'ModReserve to convert a hold to a recall' => sub { Link Here
1914
        }
1914
        }
1915
    )->store;
1915
    )->store;
1916
1916
1917
    t::lib::Mocks::mock_preference( "UseRecalls", 1 );
1917
    t::lib::Mocks::mock_preference( "UseRecalls", 'opac' );
1918
    t::lib::Mocks::mock_userenv( { branchcode => $branch } );
1918
    t::lib::Mocks::mock_userenv( { branchcode => $branch } );
1919
1919
1920
    C4::Circulation::AddIssue( $patron2, $item->barcode );
1920
    C4::Circulation::AddIssue( $patron2, $item->barcode );
(-)a/t/db_dependent/Koha/Biblio.t (-2 / +2 lines)
Lines 1581-1590 subtest 'Recalls tests' => sub { Link Here
1581
    is( $recalls->count, 3, 'Correctly get number of recalls for biblio' );
1581
    is( $recalls->count, 3, 'Correctly get number of recalls for biblio' );
1582
    is( $recalls->filter_by_current->count, 1, 'Correctly get number of active recalls for biblio' );
1582
    is( $recalls->filter_by_current->count, 1, 'Correctly get number of active recalls for biblio' );
1583
1583
1584
    t::lib::Mocks::mock_preference('UseRecalls', 0);
1584
    t::lib::Mocks::mock_preference('UseRecalls', 'off');
1585
    is( $biblio->can_be_recalled({ patron => $patron1 }), 0, "Can't recall with UseRecalls disabled" );
1585
    is( $biblio->can_be_recalled({ patron => $patron1 }), 0, "Can't recall with UseRecalls disabled" );
1586
1586
1587
    t::lib::Mocks::mock_preference("UseRecalls", 1);
1587
    t::lib::Mocks::mock_preference("UseRecalls", 'opac');
1588
    $item1->update({ notforloan => 1 });
1588
    $item1->update({ notforloan => 1 });
1589
    is( $biblio->can_be_recalled({ patron => $patron1 }), 0, "Can't recall with no available items" );
1589
    is( $biblio->can_be_recalled({ patron => $patron1 }), 0, "Can't recall with no available items" );
1590
1590
(-)a/t/db_dependent/Koha/Item.t (-4 / +4 lines)
Lines 2449-2455 subtest 'Recalls tests' => sub { Link Here
2449
    );
2449
    );
2450
2450
2451
    t::lib::Mocks::mock_userenv( { patron => $patron1 } );
2451
    t::lib::Mocks::mock_userenv( { patron => $patron1 } );
2452
    t::lib::Mocks::mock_preference('UseRecalls', 1);
2452
    t::lib::Mocks::mock_preference('UseRecalls', 'opac');
2453
2453
2454
    my $recall1 = Koha::Recall->new(
2454
    my $recall1 = Koha::Recall->new(
2455
        {   patron_id         => $patron1->borrowernumber,
2455
        {   patron_id         => $patron1->borrowernumber,
Lines 2477-2486 subtest 'Recalls tests' => sub { Link Here
2477
2477
2478
    $recall2->set_cancelled;
2478
    $recall2->set_cancelled;
2479
2479
2480
    t::lib::Mocks::mock_preference('UseRecalls', 0);
2480
    t::lib::Mocks::mock_preference('UseRecalls', 'off');
2481
    is( $item1->can_be_recalled({ patron => $patron1 }), 0, "Can't recall with UseRecalls disabled" );
2481
    is( $item1->can_be_recalled({ patron => $patron1 }), 0, "Can't recall with UseRecalls disabled" );
2482
2482
2483
    t::lib::Mocks::mock_preference("UseRecalls", 1);
2483
    t::lib::Mocks::mock_preference("UseRecalls", 'opac');
2484
2484
2485
    $item1->update({ notforloan => 1 });
2485
    $item1->update({ notforloan => 1 });
2486
    is( $item1->can_be_recalled({ patron => $patron1 }), 0, "Can't recall that is not for loan" );
2486
    is( $item1->can_be_recalled({ patron => $patron1 }), 0, "Can't recall that is not for loan" );
Lines 2665-2671 subtest 'has_pending_recall() tests' => sub { Link Here
2665
    my $patron  = $builder->build_object({ class => 'Koha::Patrons' });
2665
    my $patron  = $builder->build_object({ class => 'Koha::Patrons' });
2666
2666
2667
    t::lib::Mocks::mock_userenv({ branchcode => $library->branchcode });
2667
    t::lib::Mocks::mock_userenv({ branchcode => $library->branchcode });
2668
    t::lib::Mocks::mock_preference( 'UseRecalls', 1 );
2668
    t::lib::Mocks::mock_preference( 'UseRecalls', 'opac' );
2669
2669
2670
    C4::Circulation::AddIssue( $patron, $item->barcode );
2670
    C4::Circulation::AddIssue( $patron, $item->barcode );
2671
2671
(-)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