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

(-)a/C4/Reserves.pm (-20 / +9 lines)
Lines 2094-2119 sub RevertWaitingStatus { Link Here
2094
                           ->update({ priority => \'priority + 1' }, { no_triggers => 1 });
2094
                           ->update({ priority => \'priority + 1' }, { no_triggers => 1 });
2095
2095
2096
    ## Fix up the currently waiting reserve
2096
    ## Fix up the currently waiting reserve
2097
    if ( C4::Context->preference('DisableReserveExpiration') ){
2097
    $hold->set(
2098
        $hold->set(
2098
        {
2099
            {
2099
            priority    => 1,
2100
                priority    => 1,
2100
            found       => undef,
2101
                found       => undef,
2101
            waitingdate => undef,
2102
                waitingdate => undef,
2102
            expirationdate => undef,
2103
                expirationdate => undef,
2103
            itemnumber  => $hold->item_level_hold ? $hold->itemnumber : undef,
2104
                itemnumber  => $hold->item_level_hold ? $hold->itemnumber : undef,
2104
        }
2105
            }
2105
    )->store();
2106
        )->store();
2107
    } else {
2108
        $hold->set(
2109
            {
2110
                priority    => 1,
2111
                found       => undef,
2112
                waitingdate => undef,
2113
                itemnumber  => $hold->item_level_hold ? $hold->itemnumber : undef,
2114
            }
2115
        )->store();
2116
    }
2117
2106
2118
    _FixPriority( { biblionumber => $hold->biblionumber } );
2107
    _FixPriority( { biblionumber => $hold->biblionumber } );
2119
2108
(-)a/installer/data/mysql/atomicupdate/bug24194-add-DisableReserveExpiration-syspref.perl (-1 / +1 lines)
Lines 1-6 Link Here
1
$DBversion = 'XXX';  # will be replaced by the RM
1
$DBversion = 'XXX';  # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
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 reserves module.", "YesNo" ) });
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
4
5
    SetVersion( $DBversion );
5
    SetVersion( $DBversion );
6
    print "Upgrade to $DBversion done (Bug 24194 - DisableReserveExpiration system preference)\n";
6
    print "Upgrade to $DBversion done (Bug 24194 - DisableReserveExpiration system preference)\n";
(-)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 reserves module.', 'YesNo'),
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'),
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'),
180
('DisplayClearScreenButton','0','','If set to ON, a clear screen button will appear on the circulation page.','YesNo'),
180
('DisplayClearScreenButton','0','','If set to ON, a clear screen button will appear on the circulation page.','YesNo'),
181
('displayFacetCount','0',NULL,NULL,'YesNo'),
181
('displayFacetCount','0',NULL,NULL,'YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-10 / +10 lines)
Lines 168-179 Circulation: Link Here
168
                  1: "Use"
168
                  1: "Use"
169
                  0: "Don't use"
169
                  0: "Don't use"
170
            - circulation desks with circulation.
170
            - circulation desks with circulation.
171
        -
172
            - pref: DisableReserveExpiration
173
              choices:
174
                  yes: Disable
175
                  no: "Don't disable"
176
            - the use of expiration dates in reserves.
177
171
178
    Checkout policy:
172
    Checkout policy:
179
        -
173
        -
Lines 733-750 Circulation: Link Here
733
            - 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
734
            - pref: ReservesMaxPickUpDelay
728
            - pref: ReservesMaxPickUpDelay
735
              class: integer
729
              class: integer
736
            - days.
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."
737
        -
731
        -
738
            - pref: ExpireReservesMaxPickUpDelay
732
            - pref: ExpireReservesMaxPickUpDelay
739
              choices:
733
              choices:
740
                  1: Allow
734
                  1: Allow
741
                  0: "Don't allow"
735
                  0: "Don't allow"
742
            - '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.'
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.'
743
        -
737
        -
744
            - 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
745
            - pref: ExpireReservesMaxPickUpDelayCharge
739
            - pref: ExpireReservesMaxPickUpDelayCharge
746
              class: currency
740
              class: currency
747
            - "."
741
            - ".<br><strong>NOTE:</strong> This will not apply if DisableReserveExpiration is enabled."
748
        -
742
        -
749
            - Satisfy holds using items from the libraries
743
            - Satisfy holds using items from the libraries
750
            - pref: StaticHoldsQueueWeight
744
            - pref: StaticHoldsQueueWeight
Lines 827-833 Circulation: Link Here
827
              choices:
821
              choices:
828
                  1: allow
822
                  1: allow
829
                  0: "don't allow"
823
                  0: "don't allow"
830
            - expired holds to be canceled on days the library is closed per the calendar.
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.
831
        -
825
        -
832
            - pref: ExcludeHolidaysFromMaxPickUpDelay
826
            - pref: ExcludeHolidaysFromMaxPickUpDelay
833
              choices:
827
              choices:
Lines 921-926 Circulation: Link Here
921
                  months: months
915
                  months: months
922
                  years: years
916
                  years: years
923
            - from reserve date.
917
            - from reserve date.
918
        -
919
            - pref: DisableReserveExpiration
920
              choices:
921
                  yes: Disable
922
                  no: "Don't 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.
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
                            [% IF !Koha.Preference('DisableReserveExpiration') %]
525
                            [% UNLESS Koha.Preference('DisableReserveExpiration') %]
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/misc/cronjobs/holds/cancel_expired_holds.pl (-1 / +3 lines)
Lines 80-83 pod2usage(1) if $help; Link Here
80
80
81
cronlogaction();
81
cronlogaction();
82
82
83
C4::Reserves::CancelExpiredReserves($reason);
83
unless( C4::Context->preference('DisableReserveExpiration') ) {
84
    C4::Reserves::CancelExpiredReserves($reason);
85
}
(-)a/t/db_dependent/Reserves.t (-2 / +1 lines)
Lines 1363-1369 subtest 'DisableReserveExpiration syspref tests' => sub { Link Here
1363
1363
1364
    $reverted = C4::Reserves::RevertWaitingStatus({ itemnumber => $hold->itemnumber });
1364
    $reverted = C4::Reserves::RevertWaitingStatus({ itemnumber => $hold->itemnumber });
1365
1365
1366
    is( $reverted->expirationdate, $expirationdate->ymd, "Expiration date remains as expected" );
1366
    is( $reverted->expirationdate, undef, "Expiration date is still removed because we can't reset to the original expiration date" );
1367
};
1367
};
1368
1368
1369
sub count_hold_print_messages {
1369
sub count_hold_print_messages {
1370
- 

Return to bug 24194