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

(-)a/C4/Reserves.pm (-20 / +9 lines)
Lines 2071-2096 sub RevertWaitingStatus { Link Here
2071
                           ->update({ priority => \'priority + 1' }, { no_triggers => 1 });
2071
                           ->update({ priority => \'priority + 1' }, { no_triggers => 1 });
2072
2072
2073
    ## Fix up the currently waiting reserve
2073
    ## Fix up the currently waiting reserve
2074
    if ( C4::Context->preference('DisableReserveExpiration') ){
2074
    $hold->set(
2075
        $hold->set(
2075
        {
2076
            {
2076
            priority    => 1,
2077
                priority    => 1,
2077
            found       => undef,
2078
                found       => undef,
2078
            waitingdate => undef,
2079
                waitingdate => undef,
2079
            expirationdate => undef,
2080
                expirationdate => undef,
2080
            itemnumber  => $hold->item_level_hold ? $hold->itemnumber : undef,
2081
                itemnumber  => $hold->item_level_hold ? $hold->itemnumber : undef,
2081
        }
2082
            }
2082
    )->store();
2083
        )->store();
2084
    } else {
2085
        $hold->set(
2086
            {
2087
                priority    => 1,
2088
                found       => undef,
2089
                waitingdate => undef,
2090
                itemnumber  => $hold->item_level_hold ? $hold->itemnumber : undef,
2091
            }
2092
        )->store();
2093
    }
2094
2083
2095
    _FixPriority( { biblionumber => $hold->biblionumber } );
2084
    _FixPriority( { biblionumber => $hold->biblionumber } );
2096
2085
(-)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 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 reserves module.', 'YesNo'),
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'),
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'),
170
('DisplayClearScreenButton','0','','If set to ON, a clear screen button will appear on the circulation page.','YesNo'),
170
('DisplayClearScreenButton','0','','If set to ON, a clear screen button will appear on the circulation page.','YesNo'),
171
('displayFacetCount','0',NULL,NULL,'YesNo'),
171
('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 732-749 Circulation: Link Here
732
            - 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
733
            - pref: ReservesMaxPickUpDelay
727
            - pref: ReservesMaxPickUpDelay
734
              class: integer
728
              class: integer
735
            - days.
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."
736
        -
730
        -
737
            - pref: ExpireReservesMaxPickUpDelay
731
            - pref: ExpireReservesMaxPickUpDelay
738
              choices:
732
              choices:
739
                  1: Allow
733
                  1: Allow
740
                  0: "Don't allow"
734
                  0: "Don't allow"
741
            - '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.'
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.'
742
        -
736
        -
743
            - 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
744
            - pref: ExpireReservesMaxPickUpDelayCharge
738
            - pref: ExpireReservesMaxPickUpDelayCharge
745
              class: currency
739
              class: currency
746
            - "."
740
            - ".<br><strong>NOTE:</strong> This will not apply if DisableReserveExpiration is enabled."
747
        -
741
        -
748
            - Satisfy holds using items from the libraries
742
            - Satisfy holds using items from the libraries
749
            - pref: StaticHoldsQueueWeight
743
            - pref: StaticHoldsQueueWeight
Lines 825-831 Circulation: Link Here
825
              choices:
819
              choices:
826
                  1: Allow
820
                  1: Allow
827
                  0: "Don't allow"
821
                  0: "Don't allow"
828
            - expired holds to be canceled on days the library is closed.
822
            - expired holds to be canceled on days the library is closed.<br><strong>NOTE:</strong> This will not apply if DisableReserveExpiration is enabled.
829
        -
823
        -
830
            - pref: ExcludeHolidaysFromMaxPickUpDelay
824
            - pref: ExcludeHolidaysFromMaxPickUpDelay
831
              choices:
825
              choices:
Lines 901-906 Circulation: Link Here
901
            - pref: UpdateItemWhenLostFromHoldList
895
            - pref: UpdateItemWhenLostFromHoldList
902
              type: textarea
896
              type: textarea
903
              syntax: text/x-yaml
897
              syntax: text/x-yaml
898
        -
899
            - pref: DisableReserveExpiration
900
              choices:
901
                  yes: Disable
902
                  no: "Don't 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.
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
                            [% IF !Koha.Preference('DisableReserveExpiration') %]
450
                            [% UNLESS Koha.Preference('DisableReserveExpiration') %]
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/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
CancelExpiredReserves($reason);
83
unless( C4::Context->preference('DisableReserveExpiration') ) {
84
    CancelExpiredReserves($reason);
85
}
(-)a/t/db_dependent/Reserves.t (-2 / +1 lines)
Lines 1249-1255 subtest 'DisableReserveExpiration syspref tests' => sub { Link Here
1249
1249
1250
    $reverted = C4::Reserves::RevertWaitingStatus({ itemnumber => $hold->itemnumber });
1250
    $reverted = C4::Reserves::RevertWaitingStatus({ itemnumber => $hold->itemnumber });
1251
1251
1252
    is( $reverted->expirationdate, $expirationdate->ymd, "Expiration date remains as expected" );
1252
    is( $reverted->expirationdate, undef, "Expiration date is still removed because we can't reset to the original expiration date" );
1253
};
1253
};
1254
1254
1255
sub count_hold_print_messages {
1255
sub count_hold_print_messages {
1256
- 

Return to bug 24194