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

(-)a/installer/data/mysql/kohastructure.sql (+5 lines)
Lines 634-639 CREATE TABLE `branch_borrower_circ_rules` ( -- includes default circulation rule Link Here
634
  `branchcode` VARCHAR(10) NOT NULL, -- the branch this rule applies to (branches.branchcode)
634
  `branchcode` VARCHAR(10) NOT NULL, -- the branch this rule applies to (branches.branchcode)
635
  `categorycode` VARCHAR(10) NOT NULL, -- the patron category this rule applies to (categories.categorycode)
635
  `categorycode` VARCHAR(10) NOT NULL, -- the patron category this rule applies to (categories.categorycode)
636
  `maxissueqty` int(4) default NULL, -- the maximum number of checkouts this patron category can have at this branch
636
  `maxissueqty` int(4) default NULL, -- the maximum number of checkouts this patron category can have at this branch
637
  `maxonsiteissueqty` int(4) default NULL, -- the maximum number of on-site checkouts this patron category can have at this branch
637
  PRIMARY KEY (`categorycode`, `branchcode`),
638
  PRIMARY KEY (`categorycode`, `branchcode`),
638
  CONSTRAINT `branch_borrower_circ_rules_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`)
639
  CONSTRAINT `branch_borrower_circ_rules_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`)
639
    ON DELETE CASCADE ON UPDATE CASCADE,
640
    ON DELETE CASCADE ON UPDATE CASCADE,
Lines 649-654 DROP TABLE IF EXISTS `default_borrower_circ_rules`; Link Here
649
CREATE TABLE `default_borrower_circ_rules` ( -- default checkout rules found under "Default checkout, hold and return policy"
650
CREATE TABLE `default_borrower_circ_rules` ( -- default checkout rules found under "Default checkout, hold and return policy"
650
  `categorycode` VARCHAR(10) NOT NULL, -- patron category this rul
651
  `categorycode` VARCHAR(10) NOT NULL, -- patron category this rul
651
  `maxissueqty` int(4) default NULL,
652
  `maxissueqty` int(4) default NULL,
653
  `maxonsiteissueqty` int(4) default NULL,
652
  PRIMARY KEY (`categorycode`),
654
  PRIMARY KEY (`categorycode`),
653
  CONSTRAINT `borrower_borrower_circ_rules_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`)
655
  CONSTRAINT `borrower_borrower_circ_rules_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`)
654
    ON DELETE CASCADE ON UPDATE CASCADE
656
    ON DELETE CASCADE ON UPDATE CASCADE
Lines 662-667 DROP TABLE IF EXISTS `default_branch_circ_rules`; Link Here
662
CREATE TABLE `default_branch_circ_rules` (
664
CREATE TABLE `default_branch_circ_rules` (
663
  `branchcode` VARCHAR(10) NOT NULL,
665
  `branchcode` VARCHAR(10) NOT NULL,
664
  `maxissueqty` int(4) default NULL,
666
  `maxissueqty` int(4) default NULL,
667
  `maxonsiteissueqty` int(4) default NULL,
665
  `holdallowed` tinyint(1) default NULL,
668
  `holdallowed` tinyint(1) default NULL,
666
  `returnbranch` varchar(15) default NULL,
669
  `returnbranch` varchar(15) default NULL,
667
  PRIMARY KEY (`branchcode`),
670
  PRIMARY KEY (`branchcode`),
Lines 690-695 DROP TABLE IF EXISTS `default_circ_rules`; Link Here
690
CREATE TABLE `default_circ_rules` (
693
CREATE TABLE `default_circ_rules` (
691
    `singleton` enum('singleton') NOT NULL default 'singleton',
694
    `singleton` enum('singleton') NOT NULL default 'singleton',
692
    `maxissueqty` int(4) default NULL,
695
    `maxissueqty` int(4) default NULL,
696
    `maxonsiteissueqty` int(4) default NULL,
693
    `holdallowed` int(1) default NULL,
697
    `holdallowed` int(1) default NULL,
694
    `returnbranch` varchar(15) default NULL,
698
    `returnbranch` varchar(15) default NULL,
695
    PRIMARY KEY (`singleton`)
699
    PRIMARY KEY (`singleton`)
Lines 1171-1176 CREATE TABLE `issuingrules` ( -- circulation and fine rules Link Here
1171
  `accountsent` int(11) default NULL, -- not used? always NULL
1175
  `accountsent` int(11) default NULL, -- not used? always NULL
1172
  `chargename` varchar(100) default NULL, -- not used? always NULL
1176
  `chargename` varchar(100) default NULL, -- not used? always NULL
1173
  `maxissueqty` int(4) default NULL, -- total number of checkouts allowed
1177
  `maxissueqty` int(4) default NULL, -- total number of checkouts allowed
1178
  `maxonsiteissueqty` int(4) default NULL, -- total number of on-site checkouts allowed
1174
  `issuelength` int(4) default NULL, -- length of checkout in the unit set in issuingrules.lengthunit
1179
  `issuelength` int(4) default NULL, -- length of checkout in the unit set in issuingrules.lengthunit
1175
  `lengthunit` varchar(10) default 'days', -- unit of checkout length (days, hours)
1180
  `lengthunit` varchar(10) default 'days', -- unit of checkout length (days, hours)
1176
  `hardduedate` date default NULL, -- hard due date
1181
  `hardduedate` date default NULL, -- hard due date
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 93-98 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
93
('CoceProviders', NULL, 'aws,gb,ol', 'Coce providers', 'multiple'),
93
('CoceProviders', NULL, 'aws,gb,ol', 'Coce providers', 'multiple'),
94
('COinSinOPACResults','1','','If ON, use COinS in OPAC search results page.  NOTE: this can slow down search response time significantly','YesNo'),
94
('COinSinOPACResults','1','','If ON, use COinS in OPAC search results page.  NOTE: this can slow down search response time significantly','YesNo'),
95
('ConfirmFutureHolds','0','','Number of days for confirming future holds','Integer'),
95
('ConfirmFutureHolds','0','','Number of days for confirming future holds','Integer'),
96
('ConsiderOnSiteCheckoutsAsNormalCheckouts','1',NULL,'Consider on-site checkouts as normal checkouts','YesNo'),
96
('CronjobLog','0',NULL,'If ON, log information from cron jobs.','YesNo'),
97
('CronjobLog','0',NULL,'If ON, log information from cron jobs.','YesNo'),
97
('CurrencyFormat','US','US|FR','Determines the display format of currencies. eg: \'36000\' is displayed as \'360 000,00\'  in \'FR\' or \'360,000.00\'  in \'US\'.','Choice'),
98
('CurrencyFormat','US','US|FR','Determines the display format of currencies. eg: \'36000\' is displayed as \'360 000,00\'  in \'FR\' or \'360,000.00\'  in \'US\'.','Choice'),
98
('dateformat','us','metric|us|iso','Define global date format (us mm/dd/yyyy, metric dd/mm/yyy, ISO yyyy-mm-dd)','Choice'),
99
('dateformat','us','metric|us|iso','Define global date format (us mm/dd/yyyy, metric dd/mm/yyy, ISO yyyy-mm-dd)','Choice'),
(-)a/installer/data/mysql/updatedatabase.pl (+41 lines)
Lines 11054-11059 if ( CheckVersion($DBversion) ) { Link Here
11054
    SetVersion($DBversion);
11054
    SetVersion($DBversion);
11055
}
11055
}
11056
11056
11057
$DBversion = "XXX";
11058
if ( CheckVersion($DBversion) ) {
11059
    $dbh->do(q|
11060
        ALTER TABLE branch_borrower_circ_rules ADD COLUMN maxonsiteissueqty int(4) DEFAULT NULL AFTER maxissueqty;
11061
    |);
11062
    $dbh->do(q|
11063
        UPDATE branch_borrower_circ_rules SET maxonsiteissueqty = maxissueqty;
11064
    |);
11065
    $dbh->do(q|
11066
        ALTER TABLE default_borrower_circ_rules ADD COLUMN maxonsiteissueqty int(4) DEFAULT NULL AFTER maxissueqty;
11067
    |);
11068
    $dbh->do(q|
11069
        UPDATE default_borrower_circ_rules SET maxonsiteissueqty = maxissueqty;
11070
    |);
11071
    $dbh->do(q|
11072
        ALTER TABLE default_branch_circ_rules ADD COLUMN maxonsiteissueqty int(4) DEFAULT NULL AFTER maxissueqty;
11073
    |);
11074
    $dbh->do(q|
11075
        UPDATE default_branch_circ_rules SET maxonsiteissueqty = maxissueqty;
11076
    |);
11077
    $dbh->do(q|
11078
        ALTER TABLE default_circ_rules ADD COLUMN maxonsiteissueqty int(4) DEFAULT NULL AFTER maxissueqty;
11079
    |);
11080
    $dbh->do(q|
11081
        UPDATE default_circ_rules SET maxonsiteissueqty = maxissueqty;
11082
    |);
11083
    $dbh->do(q|
11084
        ALTER TABLE issuingrules ADD COLUMN maxonsiteissueqty int(4) DEFAULT NULL AFTER maxissueqty;
11085
    |);
11086
    $dbh->do(q|
11087
        UPDATE issuingrules SET maxonsiteissueqty = maxissueqty;
11088
    |);
11089
    $dbh->do(q|
11090
        INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type)
11091
        VALUES ('ConsiderOnSiteCheckoutsAsNormalCheckouts','1',NULL,'Consider on-site checkouts as normal checkouts','YesNo');
11092
    |);
11093
11094
    print "Upgrade to $DBversion done (Bug 14045: Add DB fields maxonsiteissueqty and pref ConsiderOnSiteCheckoutsAsNormalCheckouts)\n";
11095
    SetVersion ($DBversion);
11096
}
11097
11057
# DEVELOPER PROCESS, search for anything to execute in the db_update directory
11098
# DEVELOPER PROCESS, search for anything to execute in the db_update directory
11058
# SEE bug 13068
11099
# SEE bug 13068
11059
# if there is anything in the atomicupdate, read and execute it.
11100
# if there is anything in the atomicupdate, read and execute it.
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-1 / +9 lines)
Lines 391-396 Circulation: Link Here
391
                  yes: Enable
391
                  yes: Enable
392
                  no: Disable
392
                  no: Disable
393
            - the on-site for all cases (Even if a user is debarred, etc.).
393
            - the on-site for all cases (Even if a user is debarred, etc.).
394
        -
395
            - pref: ConsiderOnSiteCheckoutsAsNormalCheckouts
396
              choices:
397
                  yes: Consider
398
                  no: "Don't consider"
399
            - on-site checkouts as normal checkouts.
400
            - If enabled, the number of checkouts allowed will be normal checkouts + on-site checkouts.
401
            - If disabled, both values will be checked separately.
402
394
    Checkin Policy:
403
    Checkin Policy:
395
        -
404
        -
396
            - pref: BlockReturnOfWithdrawnItems
405
            - pref: BlockReturnOfWithdrawnItems
397
- 

Return to bug 14045