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

(-)a/C4/Reserves.pm (-20 / +9 lines)
Lines 2063-2088 sub RevertWaitingStatus { Link Here
2063
                           ->update({ priority => \'priority + 1' }, { no_triggers => 1 });
2063
                           ->update({ priority => \'priority + 1' }, { no_triggers => 1 });
2064
2064
2065
    ## Fix up the currently waiting reserve
2065
    ## Fix up the currently waiting reserve
2066
    if ( C4::Context->preference('DisableReserveExpiration') ){
2066
    $hold->set(
2067
        $hold->set(
2067
        {
2068
            {
2068
            priority    => 1,
2069
                priority    => 1,
2069
            found       => undef,
2070
                found       => undef,
2070
            waitingdate => undef,
2071
                waitingdate => undef,
2071
            expirationdate => undef,
2072
                expirationdate => undef,
2072
            itemnumber  => $hold->item_level_hold ? $hold->itemnumber : undef,
2073
                itemnumber  => $hold->item_level_hold ? $hold->itemnumber : undef,
2073
        }
2074
            }
2074
    )->store();
2075
        )->store();
2076
    } else {
2077
        $hold->set(
2078
            {
2079
                priority    => 1,
2080
                found       => undef,
2081
                waitingdate => undef,
2082
                itemnumber  => $hold->item_level_hold ? $hold->itemnumber : undef,
2083
            }
2084
        )->store();
2085
    }
2086
2075
2087
    _FixPriority( { biblionumber => $hold->biblionumber } );
2076
    _FixPriority( { biblionumber => $hold->biblionumber } );
2088
2077
(-)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 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 reserves module.', 'YesNo'),
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'),
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'),
169
('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'),
170
('displayFacetCount','0',NULL,NULL,'YesNo'),
170
('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
                  yes: "Use"
168
                  yes: "Use"
169
                  no: "Don't use"
169
                  no: "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
                  yes: Allow
733
                  yes: Allow
740
                  no: "Don't allow"
734
                  no: "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
                  yes: Allow
820
                  yes: Allow
827
                  no: "Don't allow"
821
                  no: "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 900-905 Circulation: Link Here
900
            - pref: UpdateItemWhenLostFromHoldList
894
            - pref: UpdateItemWhenLostFromHoldList
901
              type: textarea
895
              type: textarea
902
              syntax: text/x-yaml
896
              syntax: text/x-yaml
897
        -
898
            - pref: DisableReserveExpiration
899
              choices:
900
                  yes: Disable
901
                  no: "Don't 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.
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
                            [% IF !Koha.Preference('DisableReserveExpiration') %]
452
                            [% UNLESS Koha.Preference('DisableReserveExpiration') %]
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/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 1248-1254 subtest 'DisableReserveExpiration syspref tests' => sub { Link Here
1248
1248
1249
    $reverted = C4::Reserves::RevertWaitingStatus({ itemnumber => $hold->itemnumber });
1249
    $reverted = C4::Reserves::RevertWaitingStatus({ itemnumber => $hold->itemnumber });
1250
1250
1251
    is( $reverted->expirationdate, $expirationdate->ymd, "Expiration date remains as expected" );
1251
    is( $reverted->expirationdate, undef, "Expiration date is still removed because we can't reset to the original expiration date" );
1252
};
1252
};
1253
1253
1254
sub count_hold_print_messages {
1254
sub count_hold_print_messages {
1255
- 

Return to bug 24194