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 164-170 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
164
('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'),
164
('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
('DefaultToLoggedInLibraryOverdueTriggers',  '0', NULL ,  'If enabled, overdue status triggers editor will default to the logged in library''s rules, rather than the ''default'' rules.',  'YesNo'),
165
('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
('CSVDelimiter',';',';|tabulation|,|/|\\|#||','Define the default separator character for exporting reports','Choice'),
166
('CSVDelimiter',';',';|tabulation|,|/|\\|#||','Define the default separator character for exporting reports','Choice'),
167
('DisableReserveExpiration', 0, NULL, 'Disable the use of expiration date in holds module.', 'YesNo'),
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'),
167
('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'),
169
('DisplayClearScreenButton','0','','If set to ON, a clear screen button will appear on the circulation page.','YesNo'),
168
('DisplayClearScreenButton','0','','If set to ON, a clear screen button will appear on the circulation page.','YesNo'),
170
('displayFacetCount','0',NULL,NULL,'YesNo'),
169
('displayFacetCount','0',NULL,NULL,'YesNo'),
Lines 557-562 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
557
('ReportsLog','0',NULL,'If ON, log information about reports.','YesNo'),
556
('ReportsLog','0',NULL,'If ON, log information about reports.','YesNo'),
558
('RequestOnOpac','1',NULL,'If ON, globally enables patron holds on OPAC','YesNo'),
557
('RequestOnOpac','1',NULL,'If ON, globally enables patron holds on OPAC','YesNo'),
559
('RequireStrongPassword','1','','Require a strong login password for staff and patrons','YesNo'),
558
('RequireStrongPassword','1','','Require a strong login password for staff and patrons','YesNo'),
559
('ReserveExpiration', 1, NULL, 'Disable the use of expiration date in holds module.', 'YesNo'),
560
('ReservesControlBranch','PatronLibrary','ItemHomeLibrary|PatronLibrary','Branch checked for members reservations rights','Choice'),
560
('ReservesControlBranch','PatronLibrary','ItemHomeLibrary|PatronLibrary','Branch checked for members reservations rights','Choice'),
561
('ReservesMaxPickUpDelay','7','','Define the Maximum delay to pick up an item on hold','Integer'),
561
('ReservesMaxPickUpDelay','7','','Define the Maximum delay to pick up an item on hold','Integer'),
562
('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'),
562
('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
                  yes: Allow
733
                  yes: Allow
734
                  no: "Don't allow"
734
                  no: "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
                  yes: Allow
820
                  yes: Allow
821
                  no: "Don't allow"
821
                  no: "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 895-905 Circulation: Link Here
895
              type: textarea
895
              type: textarea
896
              syntax: text/x-yaml
896
              syntax: text/x-yaml
897
        -
897
        -
898
            - pref: DisableReserveExpiration
898
            - pref: ReserveExpiration
899
              choices:
899
              choices:
900
                  yes: Disable
900
                  yes: Enable
901
                  no: "Don't disable"
901
                  no: "Disable"
902
            - 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.
902
            - 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.
903
    Interlibrary loans:
903
    Interlibrary loans:
904
        -
904
        -
905
            - pref: ILLModule
905
            - pref: ILLModule
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-1 / +1 lines)
Lines 449-455 Link Here
449
                                </li>
449
                                </li>
450
                            [% END %]
450
                            [% END %]
451
451
452
                            [% UNLESS Koha.Preference('DisableReserveExpiration') %]
452
                            [% IF Koha.Preference('ReserveExpiration') %]
453
                                <li>
453
                                <li>
454
                                    <label for="to">Hold expires on date:</label>
454
                                    <label for="to">Hold expires on date:</label>
455
                                    <input name="expiration_date" id="to" size="10" class="datepickerto" type="text" />
455
                                    <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 1217-1227 subtest 'MergeHolds' => sub { Link Here
1217
    is( $biblio_2->holds->count, 1, 'Hold has been transferred' );
1217
    is( $biblio_2->holds->count, 1, 'Hold has been transferred' );
1218
};
1218
};
1219
1219
1220
subtest 'DisableReserveExpiration syspref tests' => sub {
1220
subtest 'ReserveExpiration syspref tests' => sub {
1221
1221
1222
    plan tests => 2;
1222
    plan tests => 2;
1223
1223
1224
    t::lib::Mocks::mock_preference( 'DisableReserveExpiration', 0 );
1224
    t::lib::Mocks::mock_preference( 'ReserveExpiration', 1 );
1225
1225
1226
    my $expirationdate = dt_from_string->add( days => 1 );
1226
    my $expirationdate = dt_from_string->add( days => 1 );
1227
    my $hold = $builder->build_object(
1227
    my $hold = $builder->build_object(
Lines 1231-1244 subtest 'DisableReserveExpiration syspref tests' => sub { Link Here
1231
    );
1231
    );
1232
1232
1233
    # Disable expiration date for reserves
1233
    # Disable expiration date for reserves
1234
    t::lib::Mocks::mock_preference( 'DisableReserveExpiration', 1 );
1234
    t::lib::Mocks::mock_preference( 'ReserveExpiration', 0 );
1235
1235
1236
    my $reverted = C4::Reserves::RevertWaitingStatus({ itemnumber => $hold->itemnumber });
1236
    my $reverted = C4::Reserves::RevertWaitingStatus({ itemnumber => $hold->itemnumber });
1237
1237
1238
    is( $reverted->expirationdate, undef, "Expiration date should be removed with reserve expiration disabled" );
1238
    is( $reverted->expirationdate, undef, "Expiration date should be removed with reserve expiration disabled" );
1239
1239
1240
    # Re-enable expiration date for reserves
1240
    # Re-enable expiration date for reserves
1241
    t::lib::Mocks::mock_preference( 'DisableReserveExpiration', 0 );
1241
    t::lib::Mocks::mock_preference( 'ReserveExpiration', 1 );
1242
1242
1243
    $hold = $builder->build_object(
1243
    $hold = $builder->build_object(
1244
        {   class => 'Koha::Holds',
1244
        {   class => 'Koha::Holds',
1245
- 

Return to bug 24194