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

(-)a/Koha/Hold.pm (-1 / +1 lines)
Lines 185-191 sub set_waiting { Link Here
185
        desk_id => $desk_id,
185
        desk_id => $desk_id,
186
    };
186
    };
187
187
188
    if ( C4::Context->preference('DisableReserveExpiration') ){
188
    if ( !C4::Context->preference('ReserveExpiration') ){
189
        $values->{expirationdate} = undef;
189
        $values->{expirationdate} = undef;
190
    } else {
190
    } else {
191
        my $requested_expiration;
191
        my $requested_expiration;
(-)a/installer/data/mysql/atomicupdate/bug24194-add-DisableReserveExpiration-syspref.perl (-7 lines)
Lines 1-7 Link Here
1
$DBversion = 'XXX';  # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do(q{ INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ( "DisableReserveExpiration", 0, NULL, "Disable the use of expiration date in holds module.", "YesNo" ) });
4
5
    SetVersion( $DBversion );
6
    print "Upgrade to $DBversion done (Bug 24194 - DisableReserveExpiration system preference)\n";
7
}
(-)a/installer/data/mysql/atomicupdate/bug24194-add-ReserveExpiration-syspref.perl (+7 lines)
Line 0 Link Here
1
$DBversion = 'XXX';  # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do(q{ INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ( "ReserveExpiration", 1, NULL, "Disable the use of expiration date in holds module.", "YesNo" ) });
4
5
    SetVersion( $DBversion );
6
    print "Upgrade to $DBversion done (Bug 24194 - ReserveExpiration system preference)\n";
7
}
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 / +1 lines)
Lines 175-181 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
175
('DefaultToLoggedInLibraryNoticesSlips',  '0', NULL ,  'If enabled,slips and notices editor will default to the logged in library''s rules, rather than the ''all libraries'' rules.',  'YesNo'),
175
('DefaultToLoggedInLibraryNoticesSlips',  '0', NULL ,  'If enabled,slips and notices editor will default to the logged in library''s rules, rather than the ''all libraries'' rules.',  'YesNo'),
176
('DefaultToLoggedInLibraryOverdueTriggers',  '0', NULL ,  'If enabled, overdue status triggers editor will default to the logged in library''s rules, rather than the ''default'' rules.',  'YesNo'),
176
('DefaultToLoggedInLibraryOverdueTriggers',  '0', NULL ,  'If enabled, overdue status triggers editor will default to the logged in library''s rules, rather than the ''default'' rules.',  'YesNo'),
177
('CSVDelimiter',';',';|tabulation|,|/|\\|#||','Define the default separator character for exporting reports','Choice'),
177
('CSVDelimiter',';',';|tabulation|,|/|\\|#||','Define the default separator character for exporting reports','Choice'),
178
('DisableReserveExpiration', 0, NULL, 'Disable the use of expiration date in holds module.', 'YesNo'),
179
('Display856uAsImage','OFF','OFF|Details|Results|Both','Display the URI in the 856u field as an image, the corresponding staff interface XSLT option must be on','Choice'),
178
('Display856uAsImage','OFF','OFF|Details|Results|Both','Display the URI in the 856u field as an image, the corresponding staff interface XSLT option must be on','Choice'),
180
('DisplayClearScreenButton','0','','If set to ON, a clear screen button will appear on the circulation page.','YesNo'),
179
('DisplayClearScreenButton','0','','If set to ON, a clear screen button will appear on the circulation page.','YesNo'),
181
('displayFacetCount','0',NULL,NULL,'YesNo'),
180
('displayFacetCount','0',NULL,NULL,'YesNo'),
Lines 564-569 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
564
('ReplyToDefault','',NULL,'Use this email address as the replyto in emails','Free'),
563
('ReplyToDefault','',NULL,'Use this email address as the replyto in emails','Free'),
565
('ReportsLog','0',NULL,'If ON, log information about reports.','YesNo'),
564
('ReportsLog','0',NULL,'If ON, log information about reports.','YesNo'),
566
('RequireStrongPassword','1','','Require a strong login password for staff and patrons','YesNo'),
565
('RequireStrongPassword','1','','Require a strong login password for staff and patrons','YesNo'),
566
('ReserveExpiration', 1, NULL, 'Disable the use of expiration date in holds module.', 'YesNo'),
567
('ReservesControlBranch','PatronLibrary','ItemHomeLibrary|PatronLibrary','Branch checked for members reservations rights','Choice'),
567
('ReservesControlBranch','PatronLibrary','ItemHomeLibrary|PatronLibrary','Branch checked for members reservations rights','Choice'),
568
('ReservesMaxPickUpDelay','7','','Define the Maximum delay to pick up an item on hold','Integer'),
568
('ReservesMaxPickUpDelay','7','','Define the Maximum delay to pick up an item on hold','Integer'),
569
('ReservesNeedReturns','1','','If ON, a hold placed on an item available in this library must be checked-in, otherwise, a hold on a specific item, that is in the library & available is considered available','YesNo'),
569
('ReservesNeedReturns','1','','If ON, a hold placed on an item available in this library must be checked-in, otherwise, a hold on a specific item, that is in the library & available is considered available','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-8 / +8 lines)
Lines 727-744 Circulation: Link Here
727
            - Mark a hold as problematic if it has been waiting for more than
727
            - Mark a hold as problematic if it has been waiting for more than
728
            - pref: ReservesMaxPickUpDelay
728
            - pref: ReservesMaxPickUpDelay
729
              class: integer
729
              class: integer
730
            - "days.<br><strong>NOTE:</strong> If DisableReserveExpiration is enabled, holds marked as problematic must be dealt with manually as they will never automatically expire."
730
            - "days.<br><strong>NOTE:</strong> If ReserveExpiration is disabled, holds marked as problematic must be dealt with manually as they will never automatically expire."
731
        -
731
        -
732
            - pref: ExpireReservesMaxPickUpDelay
732
            - pref: ExpireReservesMaxPickUpDelay
733
              choices:
733
              choices:
734
                  1: Allow
734
                  1: Allow
735
                  0: "Don't allow"
735
                  0: "Don't allow"
736
            - 'holds to expire automatically if they have not been picked by within the time period specified in the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ReservesMaxPickUpDelay">ReservesMaxPickUpDelay</a> system preference.<br><strong>NOTE:</strong> This system preference requires the <code>misc/cronjobs/holds/cancel_expired_holds.pl</code> cronjob. Ask your system administrator to schedule it.<br><strong>NOTE:</strong> This will not apply if DisableReserveExpiration is enabled.'
736
            - 'holds to expire automatically if they have not been picked by within the time period specified in the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ReservesMaxPickUpDelay">ReservesMaxPickUpDelay</a> system preference.<br><strong>NOTE:</strong> This system preference requires the <code>misc/cronjobs/holds/cancel_expired_holds.pl</code> cronjob. Ask your system administrator to schedule it.<br><strong>NOTE:</strong> This will not apply if ReserveExpiration is disabled."'
737
        -
737
        -
738
            - If using <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ExpireReservesMaxPickUpDelay">ExpireReservesMaxPickUpDelay</a>, charge a patron who allows their waiting hold to expire a fee of
738
            - If using <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ExpireReservesMaxPickUpDelay">ExpireReservesMaxPickUpDelay</a>, charge a patron who allows their waiting hold to expire a fee of
739
            - pref: ExpireReservesMaxPickUpDelayCharge
739
            - pref: ExpireReservesMaxPickUpDelayCharge
740
              class: currency
740
              class: currency
741
            - ".<br><strong>NOTE:</strong> This will not apply if DisableReserveExpiration is enabled."
741
            - ".<br><strong>NOTE:</strong> This will not apply if ReserveExpiration is disabled."
742
        -
742
        -
743
            - Satisfy holds using items from the libraries
743
            - Satisfy holds using items from the libraries
744
            - pref: StaticHoldsQueueWeight
744
            - pref: StaticHoldsQueueWeight
Lines 821-827 Circulation: Link Here
821
              choices:
821
              choices:
822
                  1: allow
822
                  1: allow
823
                  0: "don't allow"
823
                  0: "don't allow"
824
            - expired holds to be canceled on days the library is closed per the calendar.<br><strong>NOTE:</strong> This will not apply if DisableReserveExpiration is enabled.
824
            - expired holds to be canceled on days the library is closed per the calendar.<br><strong>NOTE:</strong> This will not apply if ReserveExpiration is disabled.
825
        -
825
        -
826
            - pref: ExcludeHolidaysFromMaxPickUpDelay
826
            - pref: ExcludeHolidaysFromMaxPickUpDelay
827
              choices:
827
              choices:
Lines 916-926 Circulation: Link Here
916
                  years: years
916
                  years: years
917
            - from reserve date.
917
            - from reserve date.
918
        -
918
        -
919
            - pref: DisableReserveExpiration
919
            - pref: ReserveExpiration
920
              choices:
920
              choices:
921
                  yes: Disable
921
                  yes: Enable
922
                  no: "Don't disable"
922
                  no: "Disable"
923
            - the use of expiration dates in holds. This means patrons will not be able to specify a date when their hold is not needed, and any hold awaiting pickup will not automatically expire after it has been waiting for a problematic number of days. The expiration date will be hidden from both the OPAC and staff interface.
923
            - the use of expiration dates in holds. When enabled, patrons can specify a date when their hold is not needed, any hold awaiting pickup will automatically expire after it has been waiting for a problematic number of days, and expiration dates will show on both the OPAC and staff interface.
924
    Interlibrary loans:
924
    Interlibrary loans:
925
        -
925
        -
926
            - pref: ILLModule
926
            - pref: ILLModule
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-1 / +1 lines)
Lines 522-528 Link Here
522
                                </li>
522
                                </li>
523
                            [% END %]
523
                            [% END %]
524
524
525
                            [% UNLESS Koha.Preference('DisableReserveExpiration') %]
525
                            [% IF Koha.Preference('ReserveExpiration') %]
526
                                <li>
526
                                <li>
527
                                    <label for="to">Hold expires on date:</label>
527
                                    <label for="to">Hold expires on date:</label>
528
                                    <input id="expiration_date" name="expiration_date" id="to" size="10" type="text" class="flatpickr" data-flatpickr-futuredate="true" />
528
                                    <input id="expiration_date" name="expiration_date" id="to" size="10" type="text" class="flatpickr" data-flatpickr-futuredate="true" />
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt (-1 / +1 lines)
Lines 286-292 Link Here
286
                                                    </li>
286
                                                    </li>
287
                                                [% END %]
287
                                                [% END %]
288
288
289
                                                [% IF !Koha.Preference('DisableReserveExpiration') %]
289
                                                [% IF Koha.Preference('ReserveExpiration') %]
290
                                                    <li>
290
                                                    <li>
291
                                                        <label for="to[% bibitemloo.biblionumber | html %]">Hold not needed after:</label>
291
                                                        <label for="to[% bibitemloo.biblionumber | html %]">Hold not needed after:</label>
292
                                                        <input type="text" name="expiration_date_[% bibitemloo.biblionumber | html %]" id="to[% bibitemloo.biblionumber | html %]" size="10" class="holddateto" />
292
                                                        <input type="text" name="expiration_date_[% bibitemloo.biblionumber | html %]" id="to[% bibitemloo.biblionumber | html %]" size="10" class="holddateto" />
(-)a/misc/cronjobs/holds/cancel_expired_holds.pl (-1 / +1 lines)
Lines 80-85 pod2usage(1) if $help; Link Here
80
80
81
cronlogaction();
81
cronlogaction();
82
82
83
unless( C4::Context->preference('DisableReserveExpiration') ) {
83
if( C4::Context->preference('ReserveExpiration') ) {
84
    C4::Reserves::CancelExpiredReserves($reason);
84
    C4::Reserves::CancelExpiredReserves($reason);
85
}
85
}
(-)a/t/db_dependent/Hold.t (-3 / +3 lines)
Lines 368-381 subtest 'suspend() tests' => sub { Link Here
368
    $schema->storage->txn_rollback;
368
    $schema->storage->txn_rollback;
369
};
369
};
370
370
371
subtest 'DisableReserveExpiration syspref tests' => sub {
371
subtest 'ReserveExpiration syspref tests' => sub {
372
372
373
    plan tests => 2;
373
    plan tests => 2;
374
374
375
    $schema->storage->txn_begin;
375
    $schema->storage->txn_begin;
376
376
377
    # Disable expiration date for reserves
377
    # Disable expiration date for reserves
378
    t::lib::Mocks::mock_preference( 'DisableReserveExpiration', 1 );
378
    t::lib::Mocks::mock_preference( 'ReserveExpiration', 0 );
379
379
380
    my $expirationdate = dt_from_string->add( days => 1 );
380
    my $expirationdate = dt_from_string->add( days => 1 );
381
    my $hold = $builder->build_object(
381
    my $hold = $builder->build_object(
Lines 388-394 subtest 'DisableReserveExpiration syspref tests' => sub { Link Here
388
    is( $hold->expirationdate, undef, "No expiration date should be set with reserve expiration disabled" );
388
    is( $hold->expirationdate, undef, "No expiration date should be set with reserve expiration disabled" );
389
389
390
    # Re-enable expiration date for reserves
390
    # Re-enable expiration date for reserves
391
    t::lib::Mocks::mock_preference( 'DisableReserveExpiration', 0 );
391
    t::lib::Mocks::mock_preference( 'ReserveExpiration', 1 );
392
392
393
    $hold = $builder->build_object(
393
    $hold = $builder->build_object(
394
        {   class => 'Koha::Holds',
394
        {   class => 'Koha::Holds',
(-)a/t/db_dependent/Reserves.t (-5 / +4 lines)
Lines 1332-1342 subtest 'ModReserveAffect logging' => sub { Link Here
1332
    like( $log->info, qr{$expected}, 'Timestamp logged is the current one' );
1332
    like( $log->info, qr{$expected}, 'Timestamp logged is the current one' );
1333
};
1333
};
1334
1334
1335
subtest 'DisableReserveExpiration syspref tests' => sub {
1335
subtest 'ReserveExpiration syspref tests' => sub {
1336
1336
1337
    plan tests => 2;
1337
    plan tests => 2;
1338
1338
1339
    t::lib::Mocks::mock_preference( 'DisableReserveExpiration', 0 );
1339
    t::lib::Mocks::mock_preference( 'ReserveExpiration', 1 );
1340
1340
1341
    my $expirationdate = dt_from_string->add( days => 1 );
1341
    my $expirationdate = dt_from_string->add( days => 1 );
1342
    my $hold = $builder->build_object(
1342
    my $hold = $builder->build_object(
Lines 1346-1359 subtest 'DisableReserveExpiration syspref tests' => sub { Link Here
1346
    );
1346
    );
1347
1347
1348
    # Disable expiration date for reserves
1348
    # Disable expiration date for reserves
1349
    t::lib::Mocks::mock_preference( 'DisableReserveExpiration', 1 );
1349
    t::lib::Mocks::mock_preference( 'ReserveExpiration', 0 );
1350
1350
1351
    my $reverted = C4::Reserves::RevertWaitingStatus({ itemnumber => $hold->itemnumber });
1351
    my $reverted = C4::Reserves::RevertWaitingStatus({ itemnumber => $hold->itemnumber });
1352
1352
1353
    is( $reverted->expirationdate, undef, "Expiration date should be removed with reserve expiration disabled" );
1353
    is( $reverted->expirationdate, undef, "Expiration date should be removed with reserve expiration disabled" );
1354
1354
1355
    # Re-enable expiration date for reserves
1355
    # Re-enable expiration date for reserves
1356
    t::lib::Mocks::mock_preference( 'DisableReserveExpiration', 0 );
1356
    t::lib::Mocks::mock_preference( 'ReserveExpiration', 1 );
1357
1357
1358
    $hold = $builder->build_object(
1358
    $hold = $builder->build_object(
1359
        {   class => 'Koha::Holds',
1359
        {   class => 'Koha::Holds',
1360
- 

Return to bug 24194