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

(-)a/C4/Circulation.pm (-3 / +3 lines)
Lines 3327-3333 sub CanBookBeRenewed { Link Here
3327
    # CHECK FOR BOOKINGS
3327
    # CHECK FOR BOOKINGS
3328
    if ( $item->bookings->count ) {
3328
    if ( $item->bookings->count ) {
3329
        my $startdate =
3329
        my $startdate =
3330
            ( C4::Context->preference('RenewalPeriodBase') eq 'date_due' )
3330
            ( C4::Context->preference('ManualRenewalPeriodBase') eq 'date_due' )
3331
            ? dt_from_string( $issue->date_due, 'sql' )
3331
            ? dt_from_string( $issue->date_due, 'sql' )
3332
            : dt_from_string();
3332
            : dt_from_string();
3333
        my $datedue = CalcDateDue( $startdate, $item->effective_itemtype, $branchcode, $patron, 'is a renewal' );
3333
        my $datedue = CalcDateDue( $startdate, $item->effective_itemtype, $branchcode, $patron, 'is a renewal' );
Lines 3467-3478 sub AddRenewal { Link Here
3467
3467
3468
            # If the due date wasn't specified, calculate it by adding the
3468
            # If the due date wasn't specified, calculate it by adding the
3469
            # book's loan length to today's date or the current due date
3469
            # book's loan length to today's date or the current due date
3470
            # based on the value of the RenewalPeriodBase syspref.
3470
            # based on the value of the ManualRenewalPeriodBase syspref.
3471
            my $itemtype = $item_object->effective_itemtype;
3471
            my $itemtype = $item_object->effective_itemtype;
3472
            unless ($datedue) {
3472
            unless ($datedue) {
3473
3473
3474
                $datedue =
3474
                $datedue =
3475
                    ( C4::Context->preference('RenewalPeriodBase') eq 'date_due' )
3475
                    ( C4::Context->preference('ManualRenewalPeriodBase') eq 'date_due' )
3476
                    ? dt_from_string( $issue->date_due, 'sql' )
3476
                    ? dt_from_string( $issue->date_due, 'sql' )
3477
                    : dt_from_string();
3477
                    : dt_from_string();
3478
                $datedue = CalcDateDue( $datedue, $itemtype, $circ_library->branchcode, $patron, 'is a renewal' );
3478
                $datedue = CalcDateDue( $datedue, $itemtype, $circ_library->branchcode, $patron, 'is a renewal' );
(-)a/C4/UsageStats.pm (-1 / +2 lines)
Lines 180-186 sub _shared_preferences { Link Here
180
        IssueLostItem
180
        IssueLostItem
181
        IssuingInProcess
181
        IssuingInProcess
182
        OverduesBlockCirc
182
        OverduesBlockCirc
183
        RenewalPeriodBase
183
        ManualRenewalPeriodBase
184
        AutomaticRenewalPeriodBase
184
        RenewalSendNotice
185
        RenewalSendNotice
185
        ReturnBeforeExpiry
186
        ReturnBeforeExpiry
186
        TransfersMaxDaysWarning
187
        TransfersMaxDaysWarning
(-)a/installer/data/mysql/atomicupdate/bug_30331.pl (+32 lines)
Line 0 Link Here
1
use Modern::Perl;
2
use Koha::Installer::Output qw(say_warning say_success say_info);
3
4
return {
5
    bug_number  => "30331",
6
    description =>
7
        "Rename RenewalPeriodBase as ManualRenewalPeriodBase AND add new AutomaticRenewalPeriodBase system preference",
8
    up => sub {
9
        my ($args) = @_;
10
        my ( $dbh, $out ) = @$args{qw(dbh out)};
11
12
        #Get the old value before changing anything
13
        my $base_period = C4::Context->preference('RenewalPeriodBase');
14
15
        $dbh->do(
16
            q{
17
            UPDATE systempreferences SET variable = 'ManualRenewalPeriodBase' WHERE variable = 'RenewalPeriodBase'
18
        }
19
        );
20
21
        say_success( $out, "System preference RenewalPeriodBase updated to ManualRenewalPeriodBase" );
22
23
        $dbh->do(
24
            q{
25
            INSERT IGNORE INTO systempreferences (`variable`,`value`,`options`,`explanation`,`type`)
26
            VALUES ('AutomaticRenewalPeriodBase', ? ,'date_due|now','Set whether the renewal date should be counted from the date_due or from the moment the Patron asks for renewal, for automatic renewals','Choice')
27
        }, undef, $base_period
28
        );
29
30
        say_success( $out, "System preference AutomaticRenewalPeriodBase added." );
31
    },
32
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 / +2 lines)
Lines 100-105 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
100
('AutomaticConfirmTransfer','0',NULL,'Defines whether transfers should be automatically confirmed at checkin if modal dismissed','YesNo'),
100
('AutomaticConfirmTransfer','0',NULL,'Defines whether transfers should be automatically confirmed at checkin if modal dismissed','YesNo'),
101
('AutomaticEmailReceipts','0','','Send email receipts for payments and write-offs','YesNo'),
101
('AutomaticEmailReceipts','0','','Send email receipts for payments and write-offs','YesNo'),
102
('AutomaticItemReturn','1',NULL,'If ON, Koha will automatically set up a transfer of this item to its homebranch','YesNo'),
102
('AutomaticItemReturn','1',NULL,'If ON, Koha will automatically set up a transfer of this item to its homebranch','YesNo'),
103
('AutomaticRenewalPeriodBase','date_due','date_due|now','Set whether the renewal date should be counted from the date_due or from the moment the Patron asks for renewal, for automatic renewals ','Choice'),
103
('autoMemberNum','0','','If ON, patron number is auto-calculated','YesNo'),
104
('autoMemberNum','0','','If ON, patron number is auto-calculated','YesNo'),
104
('AutoRemoveOverduesRestrictions','no','no|when_no_overdue|when_no_overdue_causing_debarment', 'Defines if and on what conditions OVERDUES debarments should automatically be lifted when overdue items are returned by the patron.','Choice'),
105
('AutoRemoveOverduesRestrictions','no','no|when_no_overdue|when_no_overdue_causing_debarment', 'Defines if and on what conditions OVERDUES debarments should automatically be lifted when overdue items are returned by the patron.','Choice'),
105
('AutoRenewalNotices','preferences','cron|preferences|never','How should Koha determine whether to end autorenewal notices','Choice'),
106
('AutoRenewalNotices','preferences','cron|preferences|never','How should Koha determine whether to end autorenewal notices','Choice'),
Lines 406-411 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
406
('makePreviousSerialAvailable','0','','make previous serial automatically available when collecting a new serial. Please note that the item-level_itypes syspref must be set to specific item.','YesNo'),
407
('makePreviousSerialAvailable','0','','make previous serial automatically available when collecting a new serial. Please note that the item-level_itypes syspref must be set to specific item.','YesNo'),
407
('Mana','2',NULL,'request to Mana Webservice. Mana centralize common information between other Koha to facilitate the creation of new subscriptions, vendors, report queries etc... You can search, share, import and comment the content of Mana.','Choice'),
408
('Mana','2',NULL,'request to Mana Webservice. Mana centralize common information between other Koha to facilitate the creation of new subscriptions, vendors, report queries etc... You can search, share, import and comment the content of Mana.','Choice'),
408
('ManaToken','',NULL,'Security token used for authentication on Mana KB service (anti spam)','Textarea'),
409
('ManaToken','',NULL,'Security token used for authentication on Mana KB service (anti spam)','Textarea'),
410
('ManualRenewalPeriodBase','date_due','date_due|now','Set whether the renewal date should be counted from the date_due or from the moment the Patron asks for renewal, for manual renewals ','Choice'),
409
('MARCAuthorityControlField008','|| aca||aabn           | a|a     d',NULL,'Define the contents of MARC21 authority control field 008 position 06-39','Textarea'),
411
('MARCAuthorityControlField008','|| aca||aabn           | a|a     d',NULL,'Define the contents of MARC21 authority control field 008 position 06-39','Textarea'),
410
('MarcFieldDocURL', '', NULL, 'URL used for MARC field documentation. Following substitutions are available: {MARC} = marc flavour, eg. "MARC21" or "UNIMARC". {FIELD} = field number, eg. "000" or "048". {LANG} = user language, eg. "en" or "fi-FI"', 'free'),
412
('MarcFieldDocURL', '', NULL, 'URL used for MARC field documentation. Following substitutions are available: {MARC} = marc flavour, eg. "MARC21" or "UNIMARC". {FIELD} = field number, eg. "000" or "048". {LANG} = user language, eg. "en" or "fi-FI"', 'free'),
411
('MarcFieldForCreatorId','',NULL,'Where to store the borrowernumber of the record''s creator','Free'),
413
('MarcFieldForCreatorId','',NULL,'Where to store the borrowernumber of the record''s creator','Free'),
Lines 679-685 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
679
('RenewAccruingItemInOpac','0','','If enabled, when the fines on an item accruing is paid off in the OPAC via a payment plugin, attempt to renew that item. If the syspref "RenewalPeriodBase" is set to "due date", renewed items may still be overdue','YesNo'),
681
('RenewAccruingItemInOpac','0','','If enabled, when the fines on an item accruing is paid off in the OPAC via a payment plugin, attempt to renew that item. If the syspref "RenewalPeriodBase" is set to "due date", renewed items may still be overdue','YesNo'),
680
('RenewAccruingItemWhenPaid','0','','If enabled, when the fines on an item accruing is paid off, attempt to renew that item. If the syspref "RenewalPeriodBase" is set to "due date", renewed items may still be overdue','YesNo'),
682
('RenewAccruingItemWhenPaid','0','','If enabled, when the fines on an item accruing is paid off, attempt to renew that item. If the syspref "RenewalPeriodBase" is set to "due date", renewed items may still be overdue','YesNo'),
681
('RenewalLog','0','','If ON, log information about renewals','YesNo'),
683
('RenewalLog','0','','If ON, log information about renewals','YesNo'),
682
('RenewalPeriodBase','date_due','date_due|now','Set whether the renewal date should be counted from the date_due or from the moment the Patron asks for renewal ','Choice'),
683
('RenewalSendNotice','0','',NULL,'YesNo'),
684
('RenewalSendNotice','0','',NULL,'YesNo'),
684
('RenewSerialAddsSuggestion','0',NULL,'If ON, adds a new suggestion at serial subscription renewal','YesNo'),
685
('RenewSerialAddsSuggestion','0',NULL,'If ON, adds a new suggestion at serial subscription renewal','YesNo'),
685
('RentalFeesCheckoutConfirmation', '0', NULL , 'Allow user to confirm when checking out an item with rental fees.', 'YesNo'),
686
('RentalFeesCheckoutConfirmation', '0', NULL , 'Allow user to confirm when checking out an item with rental fees.', 'YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-3 / +9 lines)
Lines 345-352 Circulation: Link Here
345
                  exact_time: exact time
345
                  exact_time: exact time
346
            - . Only relevant for loans calculated in days, hourly loans are not affected.
346
            - . Only relevant for loans calculated in days, hourly loans are not affected.
347
        -
347
        -
348
            - When renewing checkouts, base the new due date on
348
            - When renewing checkouts manually, base the new due date on
349
            - pref: RenewalPeriodBase
349
            - pref: ManualRenewalPeriodBase
350
              choices:
351
                  date_due: the old due date of the checkout
352
                  now: the current date
353
            - .
354
        -
355
            - When renewing checkouts automaticaly, base the new due date on
356
            - pref: AutomaticRenewalPeriodBase
350
              choices:
357
              choices:
351
                  date_due: the old due date of the checkout
358
                  date_due: the old due date of the checkout
352
                  now: the current date
359
                  now: the current date
353
- 

Return to bug 30331