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

(-)a/C4/Reserves.pm (-20 / +9 lines)
Lines 2048-2073 sub RevertWaitingStatus { Link Here
2048
                           ->update({ priority => \'priority + 1' }, { no_triggers => 1 });
2048
                           ->update({ priority => \'priority + 1' }, { no_triggers => 1 });
2049
2049
2050
    ## Fix up the currently waiting reserve
2050
    ## Fix up the currently waiting reserve
2051
    if ( C4::Context->preference('DisableReserveExpiration') ){
2051
    $hold->set(
2052
        $hold->set(
2052
        {
2053
            {
2053
            priority    => 1,
2054
                priority    => 1,
2054
            found       => undef,
2055
                found       => undef,
2055
            waitingdate => undef,
2056
                waitingdate => undef,
2056
            expirationdate => undef,
2057
                expirationdate => undef,
2057
            itemnumber  => $hold->item_level_hold ? $hold->itemnumber : undef,
2058
                itemnumber  => $hold->item_level_hold ? $hold->itemnumber : undef,
2058
        }
2059
            }
2059
    )->store();
2060
        )->store();
2061
    } else {
2062
        $hold->set(
2063
            {
2064
                priority    => 1,
2065
                found       => undef,
2066
                waitingdate => undef,
2067
                itemnumber  => $hold->item_level_hold ? $hold->itemnumber : undef,
2068
            }
2069
        )->store();
2070
    }
2071
2060
2072
    _FixPriority( { biblionumber => $hold->biblionumber } );
2061
    _FixPriority( { biblionumber => $hold->biblionumber } );
2073
2062
(-)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 163-169 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
163
('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'),
163
('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
('DefaultToLoggedInLibraryOverdueTriggers',  '0', NULL ,  'If enabled, overdue status triggers editor will default to the logged in library''s rules, rather than the ''default'' rules.',  'YesNo'),
164
('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
('delimiter',';',';|tabulation|,|/|\\|#||','Define the default separator character for exporting reports','Choice'),
165
('delimiter',';',';|tabulation|,|/|\\|#||','Define the default separator character for exporting reports','Choice'),
166
('DisableReserveExpiration', 0, NULL, 'Disable the use of expiration date in reserves module.', 'YesNo'),
166
('DisableReserveExpiration', 0, NULL, 'Disable the use of expiration date in holds module.', 'YesNo'),
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'),
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'),
168
('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'),
169
('displayFacetCount','0',NULL,NULL,'YesNo'),
169
('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 718-735 Circulation: Link Here
718
            - Mark a hold as problematic if it has been waiting for more than
712
            - Mark a hold as problematic if it has been waiting for more than
719
            - pref: ReservesMaxPickUpDelay
713
            - pref: ReservesMaxPickUpDelay
720
              class: integer
714
              class: integer
721
            - days.
715
            - "days.<br><strong>NOTE:</strong> If DisableReserveExpiration is enabled, holds marked as problematic must be dealt with manually as they will never automatically expire."
722
        -
716
        -
723
            - pref: ExpireReservesMaxPickUpDelay
717
            - pref: ExpireReservesMaxPickUpDelay
724
              choices:
718
              choices:
725
                  yes: Allow
719
                  yes: Allow
726
                  no: "Don't allow"
720
                  no: "Don't allow"
727
            - "holds to expire automatically if they have not been picked by within the time period specified in the ReservesMaxPickUpDelay 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."
721
            - "holds to expire automatically if they have not been picked by within the time period specified in the ReservesMaxPickUpDelay 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."
728
        -
722
        -
729
            - If using ExpireReservesMaxPickUpDelay, charge a patron who allows their waiting hold to expire a fee of
723
            - If using ExpireReservesMaxPickUpDelay, charge a patron who allows their waiting hold to expire a fee of
730
            - pref: ExpireReservesMaxPickUpDelayCharge
724
            - pref: ExpireReservesMaxPickUpDelayCharge
731
              class: currency
725
              class: currency
732
            - "."
726
            - ".<br><strong>NOTE:</strong> This will not apply if DisableReserveExpiration is enabled."
733
        -
727
        -
734
            - Satisfy holds using items from the libraries
728
            - Satisfy holds using items from the libraries
735
            - pref: StaticHoldsQueueWeight
729
            - pref: StaticHoldsQueueWeight
Lines 811-817 Circulation: Link Here
811
              choices:
805
              choices:
812
                  yes: Allow
806
                  yes: Allow
813
                  no: "Don't allow"
807
                  no: "Don't allow"
814
            - expired holds to be canceled on days the library is closed.
808
            - expired holds to be canceled on days the library is closed.<br><strong>NOTE:</strong> This will not apply if DisableReserveExpiration is enabled.
815
        -
809
        -
816
            - pref: ExcludeHolidaysFromMaxPickUpDelay
810
            - pref: ExcludeHolidaysFromMaxPickUpDelay
817
              choices:
811
              choices:
Lines 885-890 Circulation: Link Here
885
            - pref: UpdateItemWhenLostFromHoldList
879
            - pref: UpdateItemWhenLostFromHoldList
886
              type: textarea
880
              type: textarea
887
              syntax: text/x-yaml
881
              syntax: text/x-yaml
882
        -
883
            - pref: DisableReserveExpiration
884
              choices:
885
                  yes: Disable
886
                  no: "Don't disable"
887
            - 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.
888
    Interlibrary loans:
888
    Interlibrary loans:
889
        -
889
        -
890
            - pref: ILLModule
890
            - pref: ILLModule
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-1 / +1 lines)
Lines 445-451 Link Here
445
                                </li>
445
                                </li>
446
                            [% END %]
446
                            [% END %]
447
447
448
                            [% IF !Koha.Preference('DisableReserveExpiration') %]
448
                            [% UNLESS Koha.Preference('DisableReserveExpiration') %]
449
                                <li>
449
                                <li>
450
                                    <label for="to">Hold expires on date:</label>
450
                                    <label for="to">Hold expires on date:</label>
451
                                    <input name="expiration_date" id="to" size="10" class="datepickerto" type="text" />
451
                                    <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 1221-1227 subtest 'DisableReserveExpiration syspref tests' => sub { Link Here
1221
1221
1222
    $reverted = C4::Reserves::RevertWaitingStatus({ itemnumber => $hold->itemnumber });
1222
    $reverted = C4::Reserves::RevertWaitingStatus({ itemnumber => $hold->itemnumber });
1223
1223
1224
    is( $reverted->expirationdate, $expirationdate->ymd, "Expiration date remains as expected" );
1224
    is( $reverted->expirationdate, undef, "Expiration date is still removed because we can't reset to the original expiration date" );
1225
};
1225
};
1226
1226
1227
sub count_hold_print_messages {
1227
sub count_hold_print_messages {
1228
- 

Return to bug 24194