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

(-)a/Koha/Hold.pm (-1 / +1 lines)
Lines 187-193 sub set_waiting { Link Here
187
        desk_id => $desk_id,
187
        desk_id => $desk_id,
188
    };
188
    };
189
189
190
    if ( C4::Context->preference('DisableReserveExpiration') ){
190
    if ( !C4::Context->preference('ReserveExpiration') ){
191
        $values->{expirationdate} = undef;
191
        $values->{expirationdate} = undef;
192
    } else {
192
    } else {
193
        my $requested_expiration;
193
        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 165-171 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
165
('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'),
165
('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'),
166
('DefaultToLoggedInLibraryOverdueTriggers',  '0', NULL ,  'If enabled, overdue status triggers editor will default to the logged in library''s rules, rather than the ''default'' rules.',  'YesNo'),
166
('DefaultToLoggedInLibraryOverdueTriggers',  '0', NULL ,  'If enabled, overdue status triggers editor will default to the logged in library''s rules, rather than the ''default'' rules.',  'YesNo'),
167
('CSVDelimiter',';',';|tabulation|,|/|\\|#||','Define the default separator character for exporting reports','Choice'),
167
('CSVDelimiter',';',';|tabulation|,|/|\\|#||','Define the default separator character for exporting reports','Choice'),
168
('DisableReserveExpiration', 0, NULL, 'Disable the use of expiration date in holds module.', 'YesNo'),
169
('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'),
168
('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'),
170
('DisplayClearScreenButton','0','','If set to ON, a clear screen button will appear on the circulation page.','YesNo'),
169
('DisplayClearScreenButton','0','','If set to ON, a clear screen button will appear on the circulation page.','YesNo'),
171
('displayFacetCount','0',NULL,NULL,'YesNo'),
170
('displayFacetCount','0',NULL,NULL,'YesNo'),
Lines 558-563 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
558
('ReportsLog','0',NULL,'If ON, log information about reports.','YesNo'),
557
('ReportsLog','0',NULL,'If ON, log information about reports.','YesNo'),
559
('RequestOnOpac','1',NULL,'If ON, globally enables patron holds on OPAC','YesNo'),
558
('RequestOnOpac','1',NULL,'If ON, globally enables patron holds on OPAC','YesNo'),
560
('RequireStrongPassword','1','','Require a strong login password for staff and patrons','YesNo'),
559
('RequireStrongPassword','1','','Require a strong login password for staff and patrons','YesNo'),
560
('ReserveExpiration', 1, NULL, 'Disable the use of expiration date in holds module.', 'YesNo'),
561
('ReservesControlBranch','PatronLibrary','ItemHomeLibrary|PatronLibrary','Branch checked for members reservations rights','Choice'),
561
('ReservesControlBranch','PatronLibrary','ItemHomeLibrary|PatronLibrary','Branch checked for members reservations rights','Choice'),
562
('ReservesMaxPickUpDelay','7','','Define the Maximum delay to pick up an item on hold','Integer'),
562
('ReservesMaxPickUpDelay','7','','Define the Maximum delay to pick up an item on hold','Integer'),
563
('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'),
563
('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 726-743 Circulation: Link Here
726
            - Mark a hold as problematic if it has been waiting for more than
726
            - Mark a hold as problematic if it has been waiting for more than
727
            - pref: ReservesMaxPickUpDelay
727
            - pref: ReservesMaxPickUpDelay
728
              class: integer
728
              class: integer
729
            - "days.<br><strong>NOTE:</strong> If DisableReserveExpiration is enabled, holds marked as problematic must be dealt with manually as they will never automatically expire."
729
            - "days.<br><strong>NOTE:</strong> If ReserveExpiration is disabled, holds marked as problematic must be dealt with manually as they will never automatically expire."
730
        -
730
        -
731
            - pref: ExpireReservesMaxPickUpDelay
731
            - pref: ExpireReservesMaxPickUpDelay
732
              choices:
732
              choices:
733
                  1: Allow
733
                  1: Allow
734
                  0: "Don't allow"
734
                  0: "Don't allow"
735
            - '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.'
735
            - '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."'
736
        -
736
        -
737
            - 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
737
            - 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
            - pref: ExpireReservesMaxPickUpDelayCharge
738
            - pref: ExpireReservesMaxPickUpDelayCharge
739
              class: currency
739
              class: currency
740
            - ".<br><strong>NOTE:</strong> This will not apply if DisableReserveExpiration is enabled."
740
            - ".<br><strong>NOTE:</strong> This will not apply if ReserveExpiration is disabled."
741
        -
741
        -
742
            - Satisfy holds using items from the libraries
742
            - Satisfy holds using items from the libraries
743
            - pref: StaticHoldsQueueWeight
743
            - pref: StaticHoldsQueueWeight
Lines 819-825 Circulation: Link Here
819
              choices:
819
              choices:
820
                  1: Allow
820
                  1: Allow
821
                  0: "Don't allow"
821
                  0: "Don't allow"
822
            - expired holds to be canceled on days the library is closed.<br><strong>NOTE:</strong> This will not apply if DisableReserveExpiration is enabled.
822
            - expired holds to be canceled on days the library is closed.<br><strong>NOTE:</strong> This will not apply if ReserveExpiration is disabled.
823
        -
823
        -
824
            - pref: ExcludeHolidaysFromMaxPickUpDelay
824
            - pref: ExcludeHolidaysFromMaxPickUpDelay
825
              choices:
825
              choices:
Lines 896-906 Circulation: Link Here
896
              type: textarea
896
              type: textarea
897
              syntax: text/x-yaml
897
              syntax: text/x-yaml
898
        -
898
        -
899
            - pref: DisableReserveExpiration
899
            - pref: ReserveExpiration
900
              choices:
900
              choices:
901
                  yes: Disable
901
                  yes: Enable
902
                  no: "Don't disable"
902
                  no: "Disable"
903
            - 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.
903
            - 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.
904
    Interlibrary loans:
904
    Interlibrary loans:
905
        -
905
        -
906
            - pref: ILLModule
906
            - pref: ILLModule
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-1 / +1 lines)
Lines 447-453 Link Here
447
                                </li>
447
                                </li>
448
                            [% END %]
448
                            [% END %]
449
449
450
                            [% UNLESS Koha.Preference('DisableReserveExpiration') %]
450
                            [% IF Koha.Preference('ReserveExpiration') %]
451
                                <li>
451
                                <li>
452
                                    <label for="to">Hold expires on date:</label>
452
                                    <label for="to">Hold expires on date:</label>
453
                                    <input name="expiration_date" id="to" size="10" class="datepickerto" type="text" />
453
                                    <input name="expiration_date" id="to" size="10" class="datepickerto" type="text" />
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt (-1 / +1 lines)
Lines 284-290 Link Here
284
                                                    </li>
284
                                                    </li>
285
                                                [% END %]
285
                                                [% END %]
286
286
287
                                                [% IF !Koha.Preference('DisableReserveExpiration') %]
287
                                                [% IF Koha.Preference('ReserveExpiration') %]
288
                                                    <li>
288
                                                    <li>
289
                                                        <label for="to[% bibitemloo.biblionumber | html %]">Hold not needed after:</label>
289
                                                        <label for="to[% bibitemloo.biblionumber | html %]">Hold not needed after:</label>
290
                                                        <input type="text" name="expiration_date_[% bibitemloo.biblionumber | html %]" id="to[% bibitemloo.biblionumber | html %]" size="10" class="holddateto" />
290
                                                        <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
    CancelExpiredReserves($reason);
84
    CancelExpiredReserves($reason);
85
}
85
}
(-)a/t/db_dependent/Hold.t (-3 / +3 lines)
Lines 287-300 subtest 'suspend() tests' => sub { Link Here
287
    $schema->storage->txn_rollback;
287
    $schema->storage->txn_rollback;
288
};
288
};
289
289
290
subtest 'DisableReserveExpiration syspref tests' => sub {
290
subtest 'ReserveExpiration syspref tests' => sub {
291
291
292
    plan tests => 2;
292
    plan tests => 2;
293
293
294
    $schema->storage->txn_begin;
294
    $schema->storage->txn_begin;
295
295
296
    # Disable expiration date for reserves
296
    # Disable expiration date for reserves
297
    t::lib::Mocks::mock_preference( 'DisableReserveExpiration', 1 );
297
    t::lib::Mocks::mock_preference( 'ReserveExpiration', 0 );
298
298
299
    my $expirationdate = dt_from_string->add( days => 1 );
299
    my $expirationdate = dt_from_string->add( days => 1 );
300
    my $hold = $builder->build_object(
300
    my $hold = $builder->build_object(
Lines 307-313 subtest 'DisableReserveExpiration syspref tests' => sub { Link Here
307
    is( $hold->expirationdate, undef, "No expiration date should be set with reserve expiration disabled" );
307
    is( $hold->expirationdate, undef, "No expiration date should be set with reserve expiration disabled" );
308
308
309
    # Re-enable expiration date for reserves
309
    # Re-enable expiration date for reserves
310
    t::lib::Mocks::mock_preference( 'DisableReserveExpiration', 0 );
310
    t::lib::Mocks::mock_preference( 'ReserveExpiration', 1 );
311
311
312
    $hold = $builder->build_object(
312
    $hold = $builder->build_object(
313
        {   class => 'Koha::Holds',
313
        {   class => 'Koha::Holds',
(-)a/t/db_dependent/Reserves.t (-5 / +4 lines)
Lines 1218-1228 subtest 'MergeHolds' => sub { Link Here
1218
    is( $biblio_2->holds->count, 1, 'Hold has been transferred' );
1218
    is( $biblio_2->holds->count, 1, 'Hold has been transferred' );
1219
};
1219
};
1220
1220
1221
subtest 'DisableReserveExpiration syspref tests' => sub {
1221
subtest 'ReserveExpiration syspref tests' => sub {
1222
1222
1223
    plan tests => 2;
1223
    plan tests => 2;
1224
1224
1225
    t::lib::Mocks::mock_preference( 'DisableReserveExpiration', 0 );
1225
    t::lib::Mocks::mock_preference( 'ReserveExpiration', 1 );
1226
1226
1227
    my $expirationdate = dt_from_string->add( days => 1 );
1227
    my $expirationdate = dt_from_string->add( days => 1 );
1228
    my $hold = $builder->build_object(
1228
    my $hold = $builder->build_object(
Lines 1232-1245 subtest 'DisableReserveExpiration syspref tests' => sub { Link Here
1232
    );
1232
    );
1233
1233
1234
    # Disable expiration date for reserves
1234
    # Disable expiration date for reserves
1235
    t::lib::Mocks::mock_preference( 'DisableReserveExpiration', 1 );
1235
    t::lib::Mocks::mock_preference( 'ReserveExpiration', 0 );
1236
1236
1237
    my $reverted = C4::Reserves::RevertWaitingStatus({ itemnumber => $hold->itemnumber });
1237
    my $reverted = C4::Reserves::RevertWaitingStatus({ itemnumber => $hold->itemnumber });
1238
1238
1239
    is( $reverted->expirationdate, undef, "Expiration date should be removed with reserve expiration disabled" );
1239
    is( $reverted->expirationdate, undef, "Expiration date should be removed with reserve expiration disabled" );
1240
1240
1241
    # Re-enable expiration date for reserves
1241
    # Re-enable expiration date for reserves
1242
    t::lib::Mocks::mock_preference( 'DisableReserveExpiration', 0 );
1242
    t::lib::Mocks::mock_preference( 'ReserveExpiration', 1 );
1243
1243
1244
    $hold = $builder->build_object(
1244
    $hold = $builder->build_object(
1245
        {   class => 'Koha::Holds',
1245
        {   class => 'Koha::Holds',
1246
- 

Return to bug 24194