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

(-)a/installer/data/mysql/atomicupdate/bug_24083_UnseenRenewals_syspref.perl (+6 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do( q| INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) VALUES ('UnseenRenewals', '0', 'If enabled, a renewal can be recorded as "unseen" by the library and count against the borrowers unseen renewals limit', '', 'YesNo'); | );
4
    SetVersion( $DBversion );
5
    print "Upgrade to $DBversion done (Bug 24083 - Add UnseenRenewals syspref)\n";
6
}
(-)a/installer/data/mysql/atomicupdate/bug_24083_add_issues_unseen_renewals.perl (+12 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    if( !column_exists( 'issues', 'unseen_renewals' ) ) {
4
        $dbh->do( q| ALTER TABLE issues ADD unseen_renewals TINYINT(4) DEFAULT 0 NOT NULL AFTER renewals | );
5
    }
6
    if( !column_exists( 'old_issues', 'unseen_renewals' ) ) {
7
        $dbh->do( q| ALTER TABLE old_issues ADD unseen_renewals TINYINT(4) DEFAULT 0 NOT NULL AFTER renewals | );
8
    }
9
10
    SetVersion( $DBversion );
11
    print "Upgrade to $DBversion done (Bug 24083 - Add issues.unseen_renewals & old_issues.unseen_renewals)\n";
12
}
(-)a/installer/data/mysql/atomicupdate/bug_24083_add_issuingrules_unseen_renewals_allowed.perl (+9 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    if( !column_exists( 'issuingrules', 'unseen_renewals_allowed' ) ) {
4
        $dbh->do( q| ALTER TABLE issuingrules ADD unseen_renewals_allowed SMALLINT(6) DEFAULT NULL AFTER renewalsallowed | );
5
    }
6
7
    SetVersion( $DBversion );
8
    print "Upgrade to $DBversion done (Bug 24083 - Add issuingrules.unseen_renewals_allowed)\n";
9
}
(-)a/installer/data/mysql/atomicupdate/bug_24083_update_auto_renewals_letter.perl (+29 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    my ($text) = $dbh->selectrow_array('SELECT content FROM letter WHERE module = "circulation" AND code = "AUTO_RENEWALS" AND content NOT LIKE "%too_unseen%"');
4
5
    if ($text) {
6
        my $find = qr/^\[\% (IF|ELSIF) checkout.auto_renew_error == 'too_many' \%\]$/;
7
        my @lines_in = split /^/, $text;
8
        my @lines_out = ();
9
        foreach my $line(@lines_in) {
10
            if ($line =~ $find) {
11
                if ($1) {
12
                    my $newline_test = $1 eq 'IF' ? 'IF' : 'ELSIF';
13
                    $line =~ s/\bIF\b/ELSIF/;
14
                    push @lines_out, "[% $newline_test checkout.auto_renew_error == 'too_unseen' %]\n";
15
                    push @lines_out, "You have reach the maximum of consecutive renewals without visiting the library.\n";
16
                }
17
            }
18
            push @lines_out, $line;
19
        }
20
        if (scalar @lines_out > 0) {
21
            my $joined = join "", @lines_out;
22
            $dbh->do(q{UPDATE letter SET content = ? WHERE module = "circulation" AND code = "AUTO_RENEWALS"}, undef, ($joined));
23
        }
24
    }
25
26
27
    SetVersion( $DBversion );
28
    print "Upgrade to $DBversion done (Bug 24083 - Add issues.unseen_renewals & old_issues.unseen_renewals)\n";
29
}
(-)a/installer/data/mysql/kohastructure.sql (+3 lines)
Lines 824-829 CREATE TABLE `issuingrules` ( -- circulation and fine rules Link Here
824
  `hardduedate` date default NULL, -- hard due date
824
  `hardduedate` date default NULL, -- hard due date
825
  `hardduedatecompare` tinyint NOT NULL default "0", -- type of hard due date (1 = after, 0 = on, -1 = before)
825
  `hardduedatecompare` tinyint NOT NULL default "0", -- type of hard due date (1 = after, 0 = on, -1 = before)
826
  `renewalsallowed` smallint(6) NOT NULL default "0", -- how many renewals are allowed
826
  `renewalsallowed` smallint(6) NOT NULL default "0", -- how many renewals are allowed
827
  `unseen_renewals_allowed` smallint(6) default NULL, -- how many consecutive renewals are allowed without seeing the item in the library
827
  `renewalperiod` int(4) default NULL, -- renewal period in the unit set in issuingrules.lengthunit
828
  `renewalperiod` int(4) default NULL, -- renewal period in the unit set in issuingrules.lengthunit
828
  `norenewalbefore` int(4) default NULL, -- no renewal allowed until X days or hours before due date.
829
  `norenewalbefore` int(4) default NULL, -- no renewal allowed until X days or hours before due date.
829
  `auto_renew` BOOLEAN default FALSE, -- automatic renewal
830
  `auto_renew` BOOLEAN default FALSE, -- automatic renewal
Lines 1668-1673 CREATE TABLE `issues` ( -- information related to check outs or issues Link Here
1668
  `returndate` datetime default NULL, -- date the item was returned, will be NULL until moved to old_issues
1669
  `returndate` datetime default NULL, -- date the item was returned, will be NULL until moved to old_issues
1669
  `lastreneweddate` datetime default NULL, -- date the item was last renewed
1670
  `lastreneweddate` datetime default NULL, -- date the item was last renewed
1670
  `renewals` tinyint(4) NOT NULL default 0, -- lists the number of times the item was renewed
1671
  `renewals` tinyint(4) NOT NULL default 0, -- lists the number of times the item was renewed
1672
  `unseen_renewals` tinyint(4) NOT NULL default 0, -- lists the number of consecutive times the item was renewed without being seen
1671
  `auto_renew` BOOLEAN default FALSE, -- automatic renewal
1673
  `auto_renew` BOOLEAN default FALSE, -- automatic renewal
1672
  `auto_renew_error` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, -- automatic renewal error
1674
  `auto_renew_error` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, -- automatic renewal error
1673
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched
1675
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched
Lines 1700-1705 CREATE TABLE `old_issues` ( -- lists items that were checked out and have been r Link Here
1700
  `returndate` datetime default NULL, -- date the item was returned
1702
  `returndate` datetime default NULL, -- date the item was returned
1701
  `lastreneweddate` datetime default NULL, -- date the item was last renewed
1703
  `lastreneweddate` datetime default NULL, -- date the item was last renewed
1702
  `renewals` tinyint(4) NOT NULL default 0, -- lists the number of times the item was renewed
1704
  `renewals` tinyint(4) NOT NULL default 0, -- lists the number of times the item was renewed
1705
  `unseen_renewals` tinyint(4) NOT NULL default 0, -- lists the number of consecutive times the item was renewed without being seen
1703
  `auto_renew` BOOLEAN default FALSE, -- automatic renewal
1706
  `auto_renew` BOOLEAN default FALSE, -- automatic renewal
1704
  `auto_renew_error` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, -- automatic renewal error
1707
  `auto_renew_error` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, -- automatic renewal error
1705
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched
1708
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 642-647 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
642
('UNIMARCField100Language','fre',NULL,'UNIMARC field 100 default language','short'),
642
('UNIMARCField100Language','fre',NULL,'UNIMARC field 100 default language','short'),
643
('UpdateItemWhenLostFromHoldList','',NULL,'This is a list of values to update an item when it is marked as lost from the holds to pull screen','Free'),
643
('UpdateItemWhenLostFromHoldList','',NULL,'This is a list of values to update an item when it is marked as lost from the holds to pull screen','Free'),
644
('UniqueItemFields','barcode','','Pipe-separated list of fields that should be unique (used in acquisition module for item creation). Fields must be valid SQL column names of items table','Free'),
644
('UniqueItemFields','barcode','','Pipe-separated list of fields that should be unique (used in acquisition module for item creation). Fields must be valid SQL column names of items table','Free'),
645
('UnseenRenewals','0','','Allow renewals to be recorded as "unseen" by the library, and count against the borrowers unseen renewals limit','YesNo'),
645
('UnsubscribeReflectionDelay','',NULL,'Delay for locking unsubscribers', 'Integer'),
646
('UnsubscribeReflectionDelay','',NULL,'Delay for locking unsubscribers', 'Integer'),
646
('UpdateItemLocationOnCheckin', '', 'NULL', 'This is a list of value pairs.\n Examples:\n\nPROC: FIC - causes an item in the Processing Center location to be updated into the Fiction location on check in.\nFIC: GEN - causes an item in the Fiction location to be updated into the General stacks location on check in.\n_BLANK_:FIC - causes an item that has no location to be updated into the Fiction location on check in.\nFIC: _BLANK_ - causes an item in location FIC to be updated to a blank location on check in.\n_ALL_:FIC - causes all items to be updated into the Fiction location on check in.\nPROC: _PERM_ - causes an item that is in the Processing Center to be updated to it''s permanent location.\n\nGeneral rule: if the location value on the left matches the item''s current location, it will be updated to match the location value on the right.\nNote: PROC and CART are special values, for these locations only can location and permanent_location differ, in all other cases an update will affect both. Items in the CART location will be returned to their permanent location on checkout.\n\nThe special term _BLANK_ may be used on either side of a value pair to update or remove the location from items with no location assigned.\nThe special term _ALL_ is used on the left side of the colon (:) to affect all items.\nThe special term _PERM_ is used on the right side of the colon (:) to return items to their permanent location.', 'Free'),
647
('UpdateItemLocationOnCheckin', '', 'NULL', 'This is a list of value pairs.\n Examples:\n\nPROC: FIC - causes an item in the Processing Center location to be updated into the Fiction location on check in.\nFIC: GEN - causes an item in the Fiction location to be updated into the General stacks location on check in.\n_BLANK_:FIC - causes an item that has no location to be updated into the Fiction location on check in.\nFIC: _BLANK_ - causes an item in location FIC to be updated to a blank location on check in.\n_ALL_:FIC - causes all items to be updated into the Fiction location on check in.\nPROC: _PERM_ - causes an item that is in the Processing Center to be updated to it''s permanent location.\n\nGeneral rule: if the location value on the left matches the item''s current location, it will be updated to match the location value on the right.\nNote: PROC and CART are special values, for these locations only can location and permanent_location differ, in all other cases an update will affect both. Items in the CART location will be returned to their permanent location on checkout.\n\nThe special term _BLANK_ may be used on either side of a value pair to update or remove the location from items with no location assigned.\nThe special term _ALL_ is used on the left side of the colon (:) to affect all items.\nThe special term _PERM_ is used on the right side of the colon (:) to return items to their permanent location.', 'Free'),
647
('UpdateNotForLoanStatusOnCheckin', '', 'NULL', 'This is a list of value pairs. When an item is checked in, if the not for loan value on the left matches the items not for loan value it will be updated to the right-hand value. E.g. ''-1: 0'' will cause an item that was set to ''Ordered'' to now be available for loan. Each pair of values should be on a separate line.', 'Free'),
648
('UpdateNotForLoanStatusOnCheckin', '', 'NULL', 'This is a list of value pairs. When an item is checked in, if the not for loan value on the left matches the items not for loan value it will be updated to the right-hand value. E.g. ''-1: 0'' will cause an item that was set to ''Ordered'' to now be available for loan. Each pair of values should be on a separate line.', 'Free'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-1 / +6 lines)
Lines 307-312 Circulation: Link Here
307
                  no: "Don't send"
307
                  no: "Don't send"
308
            - a renewal notice according to patron checkout alert preferences.
308
            - a renewal notice according to patron checkout alert preferences.
309
        -
309
        -
310
            - pref: UnseenRenewals
311
              choices:
312
                  yes: Allow
313
                  no: "Don't allow"
314
            - renewals to be recorded as "unseen" by the library, and count against the borrowers unseen renewals limit
315
        -
310
            - Prevent patrons from making holds on the OPAC if they owe more than
316
            - Prevent patrons from making holds on the OPAC if they owe more than
311
            - pref: maxoutstanding
317
            - pref: maxoutstanding
312
              class: currency
318
              class: currency
313
- 

Return to bug 24083