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

(-)a/C4/UsageStats.pm (+1 lines)
Lines 206-211 sub _shared_preferences { Link Here
206
        ExpireReservesMaxPickUpDelay
206
        ExpireReservesMaxPickUpDelay
207
        OPACAllowHoldDateInFuture
207
        OPACAllowHoldDateInFuture
208
        OPACAllowUserToChooseBranch
208
        OPACAllowUserToChooseBranch
209
        ReserveExpiration
209
        ReservesControlBranch
210
        ReservesControlBranch
210
        ReservesNeedReturns
211
        ReservesNeedReturns
211
        SuspendHoldsIntranet
212
        SuspendHoldsIntranet
(-)a/Koha/Club/Hold.pm (-1 / +1 lines)
Lines 70-76 sub add { Link Here
70
        unless scalar @enrollments;
70
        unless scalar @enrollments;
71
71
72
    my $biblio = Koha::Biblios->find( $params->{biblio_id} );
72
    my $biblio = Koha::Biblios->find( $params->{biblio_id} );
73
    
73
74
    if ( !C4::Context->preference('ReserveExpiration') and $params->{expiration_date} ) {
74
    if ( !C4::Context->preference('ReserveExpiration') and $params->{expiration_date} ) {
75
        Koha::Exceptions::Hold::ExpirationDateDisabled->throw;
75
        Koha::Exceptions::Hold::ExpirationDateDisabled->throw;
76
    }
76
    }
(-)a/Koha/REST/V1/Clubs/Holds.pm (-1 / +1 lines)
Lines 53-59 sub add { Link Here
53
        my $pickup_library_id   = $body->{pickup_library_id};
53
        my $pickup_library_id   = $body->{pickup_library_id};
54
        my $item_id             = $body->{item_id};
54
        my $item_id             = $body->{item_id};
55
        my $item_type           = $body->{item_type};
55
        my $item_type           = $body->{item_type};
56
        my $expiration_date   = C4::Context->preference('ReserveExpiration') ? $body->{expiration_date} : undef;
56
        my $expiration_date     = C4::Context->preference('ReserveExpiration') ? $body->{expiration_date} : undef;
57
        my $notes               = $body->{notes};
57
        my $notes               = $body->{notes};
58
        my $default_patron_home = $body->{default_patron_home};
58
        my $default_patron_home = $body->{default_patron_home};
59
59
(-)a/circ/waitingreserves.pl (-3 / +4 lines)
Lines 104-113 my $today = Date_to_Days(&Today); Link Here
104
while ( my $hold = $holds->next ) {
104
while ( my $hold = $holds->next ) {
105
    next unless $hold->waitingdate;
105
    next unless $hold->waitingdate;
106
106
107
    my ( $expire_year, $expire_month, $expire_day ) = split (/-/, $hold->expirationdate);
107
    my ( $expire_year, $expire_month, $expire_day ) = split( /-/, $hold->expirationdate );
108
    my $calcDate = Date_to_Days( $expire_year, $expire_month, $expire_day ) if $hold->expirationdate;
108
    my $calcDate;
109
    $calcDate = Date_to_Days( $expire_year, $expire_month, $expire_day ) if $hold->expirationdate;
109
110
110
    if ($calcDate and $today > $calcDate) {
111
    if ( $calcDate and $today > $calcDate ) {
111
        if ( $op eq 'cud-cancelall' ) {
112
        if ( $op eq 'cud-cancelall' ) {
112
            my $res = cancel(
113
            my $res = cancel(
113
                $hold->item->itemnumber, $hold->borrowernumber, $hold->item->holdingbranch,
114
                $hold->item->itemnumber, $hold->borrowernumber, $hold->item->holdingbranch,
(-)a/installer/data/mysql/atomicupdate/bug24194-add-ReserveExpiration-syspref.pl (-4 / +6 lines)
Lines 1-12 Link Here
1
use Modern::Perl;
1
use Modern::Perl;
2
2
3
return {
3
return {
4
    bug_number => "24194",
4
    bug_number  => "24194",
5
    description => "Add new system preference ReserveExpiration",
5
    description => "Add new system preference ReserveExpiration",
6
    up => sub {
6
    up          => sub {
7
        my ($args) = @_;
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
9
10
        $dbh->do(q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ("ReserveExpiration", 1, NULL, "Enable the use of expiration date in holds module.", "YesNo") });
10
        $dbh->do(
11
            q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ("ReserveExpiration", 1, NULL, "Enable the use of expiration date in holds module.", "YesNo") }
12
        );
11
    },
13
    },
12
};
14
};
(-)a/koha-tmpl/intranet-tmpl/prog/js/holds.js (-2 / +5 lines)
Lines 339-346 $(document).ready(function () { Link Here
339
                            },
339
                            },
340
                        },
340
                        },
341
                        {
341
                        {
342
                            "visible": ReserveExpiration,
342
                            visible: ReserveExpiration,
343
                            "data": { _: "expirationdate_formatted", "sort": "expirationdate" }
343
                            data: {
344
                                _: "expirationdate_formatted",
345
                                sort: "expirationdate",
346
                            },
344
                        },
347
                        },
345
                        {
348
                        {
346
                            data: function (oObj) {
349
                            data: function (oObj) {
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc (-3 / +2 lines)
Lines 93-104 Link Here
93
                            [% ELSE %]
93
                            [% ELSE %]
94
                                Never expires
94
                                Never expires
95
                            [% END %]
95
                            [% END %]
96
                        </td>
96
                    [% ELSE %]
97
                    [% ELSE %]
97
                        <td class="expirationdate" data-order="0000-00-00">
98
                        <td class="expirationdate" data-order="0000-00-00"> - </td>
98
                            -
99
                    [% END %]
99
                    [% END %]
100
                [% END %]
100
                [% END %]
101
                </td>
102
                [% UNLESS( singleBranchMode) %]
101
                [% UNLESS( singleBranchMode) %]
103
                    <td class="branch">
102
                    <td class="branch">
104
                        [% HOLD.branch.branchname | html %]
103
                        [% HOLD.branch.branchname | html %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt (-13 / +13 lines)
Lines 291-309 Link Here
291
                                                [% END %]
291
                                                [% END %]
292
292
293
                                                [% IF Koha.Preference('ReserveExpiration') %]
293
                                                [% IF Koha.Preference('ReserveExpiration') %]
294
                                                <li>
294
                                                    <li>
295
                                                    <label for="to[% bibitemloo.biblionumber | html %]">Hold not needed after:</label>
295
                                                        <label for="to[% bibitemloo.biblionumber | html %]">Hold not needed after:</label>
296
                                                    <input
296
                                                        <input
297
                                                        type="text"
297
                                                            type="text"
298
                                                        name="expiration_date_[% bibitemloo.biblionumber | html %]"
298
                                                            name="expiration_date_[% bibitemloo.biblionumber | html %]"
299
                                                        id="to[% bibitemloo.biblionumber | html %]"
299
                                                            id="to[% bibitemloo.biblionumber | html %]"
300
                                                        size="10"
300
                                                            size="10"
301
                                                        data-flatpickr-future="true"
301
                                                            data-flatpickr-future="true"
302
                                                        class="flatpickr futuredate"
302
                                                            class="flatpickr futuredate"
303
                                                    />
303
                                                        />
304
                                                    <span class="date-format to" data-biblionumber="[% bibitemloo.biblionumber | html %]">[% INCLUDE 'date-format.inc' %]</span>
304
                                                        <span class="date-format to" data-biblionumber="[% bibitemloo.biblionumber | html %]">[% INCLUDE 'date-format.inc' %]</span>
305
                                                    <div class="required_label" style="display:none;">Required</div>
305
                                                        <div class="required_label" style="display:none;">Required</div>
306
                                                </li>
306
                                                    </li>
307
                                                [% END %]
307
                                                [% END %]
308
308
309
                                                [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
309
                                                [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
(-)a/misc/cronjobs/holds/cancel_expired_holds.pl (-1 / +1 lines)
Lines 74-80 GetOptions( Link Here
74
) or pod2usage(1);
74
) or pod2usage(1);
75
pod2usage(1) if $help;
75
pod2usage(1) if $help;
76
76
77
if( C4::Context->preference('ReserveExpiration') ) {
77
if ( C4::Context->preference('ReserveExpiration') ) {
78
    C4::Reserves::CancelExpiredReserves($reason);
78
    C4::Reserves::CancelExpiredReserves($reason);
79
}
79
}
80
80
(-)a/t/db_dependent/Reserves.t (-3 lines)
Lines 1456-1463 subtest 'ReserveExpiration syspref tests' => sub { Link Here
1456
            }
1456
            }
1457
        }
1457
        }
1458
    );
1458
    );
1459
1460
    $hold->set_waiting();
1461
    $hold->revert_found();
1459
    $hold->revert_found();
1462
1460
1463
    is(
1461
    is(
1464
- 

Return to bug 24194