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

(-)a/C4/Circulation.pm (-6 / +6 lines)
Lines 385-391 sub transferbook { Link Here
385
    }
385
    }
386
386
387
    # find recall
387
    # find recall
388
    if ( C4::Context->preference('UseRecalls') ) {
388
    if ( C4::Context->preference('UseRecalls') ne "off" ) {
389
        my $recall = Koha::Recalls->find({ item_id => $itemnumber, status => 'in_transit' });
389
        my $recall = Koha::Recalls->find({ item_id => $itemnumber, status => 'in_transit' });
390
        if ( defined $recall ) {
390
        if ( defined $recall ) {
391
            # do a transfer if the recall branch is different to the item holding branch
391
            # do a transfer if the recall branch is different to the item holding branch
Lines 1142-1148 sub CanBookBeIssued { Link Here
1142
    # CHECK IF ITEM HAS BEEN RECALLED BY ANOTHER PATRON
1142
    # CHECK IF ITEM HAS BEEN RECALLED BY ANOTHER PATRON
1143
    # Only bother doing this if UseRecalls is enabled and the item is recallable
1143
    # Only bother doing this if UseRecalls is enabled and the item is recallable
1144
    # Don't look at recalls that are in transit
1144
    # Don't look at recalls that are in transit
1145
    if ( C4::Context->preference('UseRecalls') and $item_object->can_be_waiting_recall ) {
1145
    if ( C4::Context->preference('UseRecalls') ne "off" and $item_object->can_be_waiting_recall ) {
1146
        my @recalls = $biblio->recalls({},{ order_by => { -asc => 'created_date' } })->filter_by_current->as_list;
1146
        my @recalls = $biblio->recalls({},{ order_by => { -asc => 'created_date' } })->filter_by_current->as_list;
1147
1147
1148
        foreach my $r ( @recalls ) {
1148
        foreach my $r ( @recalls ) {
Lines 1647-1653 sub AddIssue { Link Here
1647
                $item_object->discard_changes;
1647
                $item_object->discard_changes;
1648
            }
1648
            }
1649
1649
1650
            if ( C4::Context->preference('UseRecalls') ) {
1650
            if ( C4::Context->preference('UseRecalls') ne "off" ) {
1651
                Koha::Recalls->move_recall(
1651
                Koha::Recalls->move_recall(
1652
                    {
1652
                    {
1653
                        action         => $cancel_recall,
1653
                        action         => $cancel_recall,
Lines 2427-2433 sub AddReturn { Link Here
2427
    }
2427
    }
2428
2428
2429
    # find recalls...
2429
    # find recalls...
2430
    if ( C4::Context->preference('UseRecalls') ) {
2430
    if ( C4::Context->preference('UseRecalls') ne "off" ) {
2431
        # check if this item is recallable first, which includes checking if UseRecalls syspref is enabled
2431
        # check if this item is recallable first, which includes checking if UseRecalls syspref is enabled
2432
        my $recall = undef;
2432
        my $recall = undef;
2433
        $recall = $item->check_recalls if $item->can_be_waiting_recall;
2433
        $recall = $item->check_recalls if $item->can_be_waiting_recall;
Lines 2504-2510 sub AddReturn { Link Here
2504
        $request->status('RET') if $request;
2504
        $request->status('RET') if $request;
2505
    }
2505
    }
2506
2506
2507
    if ( C4::Context->preference('UseRecalls') ) {
2507
    if ( C4::Context->preference('UseRecalls') ne "off" ) {
2508
        # all recalls that have triggered a transfer will have an allocated itemnumber
2508
        # all recalls that have triggered a transfer will have an allocated itemnumber
2509
        my $transfer_recall = Koha::Recalls->find({ item_id => $item->itemnumber, status => 'in_transit' });
2509
        my $transfer_recall = Koha::Recalls->find({ item_id => $item->itemnumber, status => 'in_transit' });
2510
        if ( $transfer_recall and $transfer_recall->pickup_library_id eq $branch ) {
2510
        if ( $transfer_recall and $transfer_recall->pickup_library_id eq $branch ) {
Lines 3067-3073 sub CanBookBeRenewed { Link Here
3067
3067
3068
    }
3068
    }
3069
3069
3070
    if ( C4::Context->preference('UseRecalls') ) {
3070
    if ( C4::Context->preference('UseRecalls') ne "off" ) {
3071
        my $recall = undef;
3071
        my $recall = undef;
3072
        $recall = $item->check_recalls if $item->can_be_waiting_recall;
3072
        $recall = $item->check_recalls if $item->can_be_waiting_recall;
3073
        if ( defined $recall ) {
3073
        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 2081-2087 if hold_convert $param is included, this is to say that this a check to convert Link Here
2081
sub can_be_recalled {
2081
sub can_be_recalled {
2082
    my ( $self, $params ) = @_;
2082
    my ( $self, $params ) = @_;
2083
2083
2084
    return 0 if !( C4::Context->preference('UseRecalls') );
2084
    return 0 if ( C4::Context->preference('UseRecalls') eq "off" );
2085
2085
2086
    my $patron = $params->{patron};
2086
    my $patron = $params->{patron};
2087
2087
(-)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 269-275 if ($transit && $op eq 'cud-transfer') { Link Here
269
    my $transfer = Koha::Item::Transfers->find($transit);
269
    my $transfer = Koha::Item::Transfers->find($transit);
270
    if ( $canceltransfer ) {
270
    if ( $canceltransfer ) {
271
        $transfer->cancel({ reason => 'Manual', force => 1});
271
        $transfer->cancel({ reason => 'Manual', force => 1});
272
        if ( C4::Context->preference('UseRecalls') ) {
272
        if ( C4::Context->preference('UseRecalls') ne "off" ) {
273
            my $recall_transfer_deleted = Koha::Recalls->find({ item_id => $itemnumber, status => 'in_transit' });
273
            my $recall_transfer_deleted = Koha::Recalls->find({ item_id => $itemnumber, status => 'in_transit' });
274
            if ( defined $recall_transfer_deleted ) {
274
            if ( defined $recall_transfer_deleted ) {
275
                $recall_transfer_deleted->revert_transfer;
275
                $recall_transfer_deleted->revert_transfer;
Lines 283-289 if ($transit && $op eq 'cud-transfer') { Link Here
283
    my $item = Koha::Items->find($itemnumber);
283
    my $item = Koha::Items->find($itemnumber);
284
    my $transfer = $item->get_transfer;
284
    my $transfer = $item->get_transfer;
285
    $transfer->cancel({ reason => 'Manual', force => 1});
285
    $transfer->cancel({ reason => 'Manual', force => 1});
286
    if ( C4::Context->preference('UseRecalls') ) {
286
    if ( C4::Context->preference('UseRecalls') ne "off" ) {
287
        my $recall_transfer_deleted = Koha::Recalls->find({ item_id => $itemnumber, status => 'in_transit' });
287
        my $recall_transfer_deleted = Koha::Recalls->find({ item_id => $itemnumber, status => 'in_transit' });
288
        if ( defined $recall_transfer_deleted ) {
288
        if ( defined $recall_transfer_deleted ) {
289
            $recall_transfer_deleted->revert_transfer;
289
            $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 649-655 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
649
('QuoteOfTheDay','','intranet,opac','Enable or disable display of Quote of the Day on the OPAC and staff interface home page','multiple'),
649
('QuoteOfTheDay','','intranet,opac','Enable or disable display of Quote of the Day on the OPAC and staff interface home page','multiple'),
650
('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'),
650
('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'),
651
('RealTimeHoldsQueue', '0', NULL, 'Enable updating the holds queue in real time', 'YesNo'),
651
('RealTimeHoldsQueue', '0', NULL, 'Enable updating the holds queue in real time', 'YesNo'),
652
('RecallsInterface','opac','opac|staff|both','The interface that recalls can be placed through','Choice'),
653
('RecallsLog','1',NULL,'If ON, log create/cancel/expire/fulfill actions on recalls','YesNo'),
652
('RecallsLog','1',NULL,'If ON, log create/cancel/expire/fulfill actions on recalls','YesNo'),
654
('RecallsMaxPickUpDelay','7',NULL,'Define the maximum time a recall can be awaiting pickup','Integer'),
653
('RecallsMaxPickUpDelay','7',NULL,'Define the maximum time a recall can be awaiting pickup','Integer'),
655
('RecordLocalUseOnReturn','0',NULL,'If ON, statistically record returns of unissued items as local use, instead of return','YesNo'),
654
('RecordLocalUseOnReturn','0',NULL,'If ON, statistically record returns of unissued items as local use, instead of return','YesNo'),
Lines 857-863 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
857
('UseICUStyleQuotes','0','1','Tell Koha whether to use ICU style quotes ({) or default (") when tracing subjects .','YesNo'),
856
('UseICUStyleQuotes','0','1','Tell Koha whether to use ICU style quotes ({) or default (") when tracing subjects .','YesNo'),
858
('UseLocationAsAQInSIP', '0', '', 'Use permanent_location instead of homebranch for AQ in SIP response', 'YesNo'),
857
('UseLocationAsAQInSIP', '0', '', 'Use permanent_location instead of homebranch for AQ in SIP response', 'YesNo'),
859
('UseOCLCEncodingLevels','0',NULL,'If enabled, include OCLC encoding levels in leader value builder dropdown for position 17.','YesNo'),
858
('UseOCLCEncodingLevels','0',NULL,'If enabled, include OCLC encoding levels in leader value builder dropdown for position 17.','YesNo'),
860
('UseRecalls','0',NULL,'Enable or disable recalls','YesNo'),
859
('UseRecalls','off','off|opac|staff|opac_and_staff','Enable or disable recalls','Choice'),
861
('UseTransportCostMatrix','0','','Use Transport Cost Matrix when filling holds','YesNo'),
860
('UseTransportCostMatrix','0','','Use Transport Cost Matrix when filling holds','YesNo'),
862
('UseWYSIWYGinSystemPreferences','0','','Show WYSIWYG editor when editing certain HTML system preferences.','YesNo'),
861
('UseWYSIWYGinSystemPreferences','0','','Show WYSIWYG editor when editing certain HTML system preferences.','YesNo'),
863
('viewISBD','1','','Allow display of ISBD view of bibiographic records','YesNo'),
862
('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 237-243 Link Here
237
    [% IF biblio.serial %]
237
    [% IF biblio.serial %]
238
        embed.push('serial_item.serial');
238
        embed.push('serial_item.serial');
239
    [% END %]
239
    [% END %]
240
    [% IF Koha.Preference('UseRecalls') %]
240
    [% IF Koha.Preference('UseRecalls') != "off" %]
241
        embed.push('recall', 'recall+strings', 'recall.patron')
241
        embed.push('recall', 'recall+strings', 'recall.patron')
242
    [% END %]
242
    [% END %]
243
    [% IF bundlesEnabled %]
243
    [% IF bundlesEnabled %]
Lines 540-546 Link Here
540
                        }
540
                        }
541
                    }
541
                    }
542
542
543
                    [% IF Koha.Preference('UseRecalls') %]
543
                    [% IF Koha.Preference('UseRecalls') != "off" %]
544
                        if ( row.recall ) {
544
                        if ( row.recall ) {
545
                            if ( row.recall.waiting_date ) {
545
                            if ( row.recall.waiting_date ) {
546
                                nodes += '<span>%s</span>'.format(_("Waiting at %s since %s").format(escape_str(row.recall.pickup_library_id.str), $date(row.recall.waiting_date)));
546
                                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 232-238 Link Here
232
            [% END %]
232
            [% END %]
233
        [% END %]
233
        [% END %]
234
234
235
        [% IF Koha.Preference('UseRecalls') %]
235
        [% IF Koha.Preference('UseRecalls') != "off" %]
236
            [% WRAPPER tab_panel tabname="recalls" %]
236
            [% WRAPPER tab_panel tabname="recalls" %]
237
                [% INCLUDE 'recalls.inc' %]
237
                [% INCLUDE 'recalls.inc' %]
238
            [% END # /tab_panel# %]
238
            [% 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 568-574 Link Here
568
                                                            <span>Holds ([% SEARCH_RESULT.biblio_object.holds.count | html %])</span>
568
                                                            <span>Holds ([% SEARCH_RESULT.biblio_object.holds.count | html %])</span>
569
                                                        [% END %]
569
                                                        [% END %]
570
                                                    [% END # /IF SEARCH_RESULT.norequests %]
570
                                                    [% END # /IF SEARCH_RESULT.norequests %]
571
                                                    [% IF Koha.Preference('UseRecalls') and CAN_user_recalls %]
571
                                                    [% IF Koha.Preference('UseRecalls') != "off" and CAN_user_recalls %]
572
                                                        | <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>
572
                                                        | <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>
573
                                                    [% END %]
573
                                                    [% END %]
574
574
(-)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 11-17 Link Here
11
        [% END %]
11
        [% END %]
12
    [% END %]
12
    [% END %]
13
13
14
    [% IF Koha.Preference('UseRecalls') AND Koha.Preference('RecallsInterface') != 'staff' %]
14
    [% IF Koha.Preference('UseRecalls').match('opac') %]
15
        <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>
15
        <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>
16
        Place recall</a></li>
16
        Place recall</a></li>
17
    [% END %]
17
    [% 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 299-305 Link Here
299
                                    <span>Holds ([% RESERVES.count | html %])</span>
299
                                    <span>Holds ([% RESERVES.count | html %])</span>
300
                                [% END %]
300
                                [% END %]
301
                            [% END %]
301
                            [% END %]
302
                            [% IF Koha.Preference('UseRecalls') && RECALLS.count %]
302
                            [% IF Koha.Preference('UseRecalls') != "off" && RECALLS.count %]
303
                                [% WRAPPER tab_item tabname= "opac-user-recalls" %]
303
                                [% WRAPPER tab_item tabname= "opac-user-recalls" %]
304
                                    <span>Recalls ([% RECALLS.count | html %])</span>
304
                                    <span>Recalls ([% RECALLS.count | html %])</span>
305
                                [% END %]
305
                                [% END %]
Lines 844-850 Link Here
844
                                [% END # /tab_panel#opac-user-holds %]
844
                                [% END # /tab_panel#opac-user-holds %]
845
                            [% END # / #RESERVES.count %]
845
                            [% END # / #RESERVES.count %]
846
846
847
                            [% IF Koha.Preference('UseRecalls') && RECALLS.count %]
847
                            [% IF Koha.Preference('UseRecalls') != "off" && RECALLS.count %]
848
                                [% WRAPPER tab_panel tabname="opac-user-recalls" %]
848
                                [% WRAPPER tab_panel tabname="opac-user-recalls" %]
849
                                    <table id="recalls-table" class="table table-bordered table-striped">
849
                                    <table id="recalls-table" class="table table-bordered table-striped">
850
                                        <caption>Recalls <span class="count">([% RECALLS.count | html %])</span></caption>
850
                                        <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 304-310 if ( $pending_checkouts->count ) { # Useless test Link Here
304
            $issue->{normalized_oclc} = GetNormalizedOCLCNumber( $marcrecord, C4::Context->preference('marcflavour') );
304
            $issue->{normalized_oclc} = GetNormalizedOCLCNumber( $marcrecord, C4::Context->preference('marcflavour') );
305
        }
305
        }
306
306
307
        if ( C4::Context->preference('UseRecalls') ) {
307
        if ( C4::Context->preference('UseRecalls') ne "off" ) {
308
            my $maybe_recalls = Koha::Recalls->search({ biblio_id => $issue->{biblionumber}, item_id => [ undef, $issue->{itemnumber} ], completed => 0 });
308
            my $maybe_recalls = Koha::Recalls->search({ biblio_id => $issue->{biblionumber}, item_id => [ undef, $issue->{itemnumber} ], completed => 0 });
309
            while( my $recall = $maybe_recalls->next ) {
309
            while( my $recall = $maybe_recalls->next ) {
310
                if ( $recall->checkout and $recall->checkout->issue_id == $issue->{issue_id} ) {
310
                if ( $recall->checkout and $recall->checkout->issue_id == $issue->{issue_id} ) {
Lines 340-346 $template->param( Link Here
340
    showpriority   => $show_priority,
340
    showpriority   => $show_priority,
341
);
341
);
342
342
343
if ( C4::Context->preference('UseRecalls') ) {
343
if ( C4::Context->preference('UseRecalls') ne "off" ) {
344
    my $recalls = Koha::Recalls->search( { patron_id => $borrowernumber, completed => 0 } );
344
    my $recalls = Koha::Recalls->search( { patron_id => $borrowernumber, completed => 0 } );
345
    $template->param( RECALLS => $recalls );
345
    $template->param( RECALLS => $recalls );
346
}
346
}
(-)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 2459-2465 subtest 'Recalls tests' => sub { Link Here
2459
    );
2459
    );
2460
2460
2461
    t::lib::Mocks::mock_userenv( { patron => $patron1 } );
2461
    t::lib::Mocks::mock_userenv( { patron => $patron1 } );
2462
    t::lib::Mocks::mock_preference('UseRecalls', 1);
2462
    t::lib::Mocks::mock_preference('UseRecalls', 'opac');
2463
2463
2464
    my $recall1 = Koha::Recall->new(
2464
    my $recall1 = Koha::Recall->new(
2465
        {   patron_id         => $patron1->borrowernumber,
2465
        {   patron_id         => $patron1->borrowernumber,
Lines 2487-2496 subtest 'Recalls tests' => sub { Link Here
2487
2487
2488
    $recall2->set_cancelled;
2488
    $recall2->set_cancelled;
2489
2489
2490
    t::lib::Mocks::mock_preference('UseRecalls', 0);
2490
    t::lib::Mocks::mock_preference('UseRecalls', 'off');
2491
    is( $item1->can_be_recalled({ patron => $patron1 }), 0, "Can't recall with UseRecalls disabled" );
2491
    is( $item1->can_be_recalled({ patron => $patron1 }), 0, "Can't recall with UseRecalls disabled" );
2492
2492
2493
    t::lib::Mocks::mock_preference("UseRecalls", 1);
2493
    t::lib::Mocks::mock_preference("UseRecalls", 'opac');
2494
2494
2495
    $item1->update({ notforloan => 1 });
2495
    $item1->update({ notforloan => 1 });
2496
    is( $item1->can_be_recalled({ patron => $patron1 }), 0, "Can't recall that is not for loan" );
2496
    is( $item1->can_be_recalled({ patron => $patron1 }), 0, "Can't recall that is not for loan" );
Lines 2675-2681 subtest 'has_pending_recall() tests' => sub { Link Here
2675
    my $patron  = $builder->build_object({ class => 'Koha::Patrons' });
2675
    my $patron  = $builder->build_object({ class => 'Koha::Patrons' });
2676
2676
2677
    t::lib::Mocks::mock_userenv({ branchcode => $library->branchcode });
2677
    t::lib::Mocks::mock_userenv({ branchcode => $library->branchcode });
2678
    t::lib::Mocks::mock_preference( 'UseRecalls', 1 );
2678
    t::lib::Mocks::mock_preference( 'UseRecalls', 'opac' );
2679
2679
2680
    C4::Circulation::AddIssue( $patron, $item->barcode );
2680
    C4::Circulation::AddIssue( $patron, $item->barcode );
2681
2681
(-)a/t/db_dependent/SIP/Transaction.t (-1 / +1 lines)
Lines 1280-1286 subtest do_checkout_with_recalls => sub { Link Here
1280
        }
1280
        }
1281
    );
1281
    );
1282
1282
1283
    t::lib::Mocks::mock_preference( 'UseRecalls', 1 );
1283
    t::lib::Mocks::mock_preference( 'UseRecalls', 'opac' );
1284
    Koha::CirculationRules->set_rule(
1284
    Koha::CirculationRules->set_rule(
1285
        {
1285
        {
1286
            branchcode   => undef,
1286
            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 193-199 subtest 'buildKohaItemsNamespace status tests' => sub { Link Here
193
    my $library_name = $holdinglibrary->branchname;
193
    my $library_name = $holdinglibrary->branchname;
194
    like($xml,qr{<resultbranch>${library_name}</resultbranch>}, "Found resultbranch / holding branch" );
194
    like($xml,qr{<resultbranch>${library_name}</resultbranch>}, "Found resultbranch / holding branch" );
195
195
196
    t::lib::Mocks::mock_preference('UseRecalls', 1);
196
    t::lib::Mocks::mock_preference('UseRecalls', 'opac');
197
    my $recall = $builder->build_object(
197
    my $recall = $builder->build_object(
198
        {
198
        {
199
            class => 'Koha::Recalls',
199
            class => 'Koha::Recalls',
Lines 208-214 subtest 'buildKohaItemsNamespace status tests' => sub { Link Here
208
    $recall->set_waiting;
208
    $recall->set_waiting;
209
    $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]);
209
    $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]);
210
    like($xml,qr{<substatus>Recall waiting</substatus>},"Waiting status takes precedence over In transit (recalls)");
210
    like($xml,qr{<substatus>Recall waiting</substatus>},"Waiting status takes precedence over In transit (recalls)");
211
    t::lib::Mocks::mock_preference('UseRecalls', 0);
211
    t::lib::Mocks::mock_preference('UseRecalls', 'off');
212
212
213
    $schema->storage->txn_rollback;
213
    $schema->storage->txn_rollback;
214
};
214
};
215
- 

Return to bug 31391