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

(-)a/installer/data/mysql/atomicupdate/bug_14697.perl (+48 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    if( !TableExists( 'return_claims' ) ) {
4
        $dbh->do(q{
5
            CREATE TABLE return_claims (
6
                id int(11) auto_increment,
7
                itemnumber int(11) NOT NULL,
8
                issue_id int(11) NULL DEFAULT NULL,
9
                old_issue_id int(11) NULL DEFAULT NULL,
10
                borrowernumber int(11) NOT NULL,
11
                notes MEDIUMTEXT DEFAULT NULL,
12
                created_on TIMESTAMP NULL,
13
                created_by int(11) NULL DEFAULT NULL,
14
                updated_on TIMESTAMP NULL ON UPDATE CURRENT_TIMESTAMP,
15
                updated_by int(11) NULL DEFAULT NULL,
16
                resolution  varchar(80) NULL DEFAULT NULL,
17
                resolved_on TIMESTAMP NULL DEFAULT NULL,
18
                resolved_by int(11) NULL DEFAULT NULL,
19
                PRIMARY KEY (`id`),
20
                KEY `itemnumber` (`itemnumber`),
21
                CONSTRAINT `rc_issues_ibfk` FOREIGN KEY (`issue_id`) REFERENCES `issues` (`issue_id`) ON DELETE SET NULL ON UPDATE CASCADE,
22
                CONSTRAINT `rc_old_issues_ibfk` FOREIGN KEY (`old_issue_id`) REFERENCES `issues` (`issue_id`) ON DELETE SET NULL ON UPDATE CASCADE,
23
                CONSTRAINT `rc_items_ibfk` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
24
                CONSTRAINT `rc_borrowers_ibfk` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
25
                CONSTRAINT `rc_created_by_ibfk` FOREIGN KEY (`created_by`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
26
                CONSTRAINT `rc_updated_by_ibfk` FOREIGN KEY (`updated_by`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
27
                CONSTRAINT `rc_resolved_by_ibfk` FOREIGN KEY (`resolved_by`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE
28
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
29
        });
30
    }
31
32
    $dbh->do(q{
33
        INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
34
        ('ClaimReturnedChargeFee', 'ask', 'ask|charge|no_charge', 'Controls whether or not a lost item fee is charged for return claims', 'Choice'),
35
        ('ClaimReturnedLostValue', '', '', 'Sets the LOST AV value that represents "Claims returned" as a lost value', 'Free'),
36
        ('ClaimReturnedWarningThreshold', '', '', 'Sets the number of return claims past which the librarian will be warned the patron has many return claims', 'Integer');
37
    });
38
39
    $dbh->do(q{
40
        INSERT IGNORE INTO `authorised_values` ( category, authorised_value, lib )
41
        VALUES
42
          ('RETURN_CLAIM_RESOLUTION', 'RET_BY_PATRON', 'Returned by patron'),
43
          ('RETURN_CLAIM_RESOLUTION', 'FOUND_IN_LIB', 'Found in library');
44
    });
45
46
    SetVersion( $DBversion );
47
    print "Upgrade to $DBversion done (Bug 14697 - Extend and enhance 'Claims returned' lost status)\n";
48
}
(-)a/installer/data/mysql/kohastructure.sql (+30 lines)
Lines 4299-4304 CREATE TABLE itemtypes_branches( -- association table between authorised_values Link Here
4299
    FOREIGN KEY (branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE
4299
    FOREIGN KEY (branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE
4300
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4300
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4301
4301
4302
--
4303
-- Table structure for table `return_claims`
4304
--
4305
4306
DROP TABLE IF EXISTS `return_claims`;
4307
CREATE TABLE return_claims (
4308
    id int(11) auto_increment,
4309
    itemnumber int(11) NOT NULL,
4310
    issue_id int(11) NULL DEFAULT NULL,
4311
    old_issue_id int(11) NULL DEFAULT NULL,
4312
    borrowernumber int(11) NOT NULL,
4313
    notes MEDIUMTEXT DEFAULT NULL,
4314
    created_on TIMESTAMP NULL,
4315
    created_by int(11) NULL DEFAULT NULL,
4316
    updated_on TIMESTAMP NULL ON UPDATE CURRENT_TIMESTAMP,
4317
    updated_by int(11) NULL DEFAULT NULL,
4318
    resolution  varchar(80) NULL DEFAULT NULL,
4319
    resolved_on TIMESTAMP NULL DEFAULT NULL,
4320
    resolved_by int(11) NULL DEFAULT NULL,
4321
    PRIMARY KEY (`id`),
4322
    KEY `itemnumber` (`itemnumber`),
4323
    CONSTRAINT `rc_issues_ibfk` FOREIGN KEY (`issue_id`) REFERENCES `issues` (`issue_id`) ON DELETE SET NULL ON UPDATE CASCADE,
4324
    CONSTRAINT `rc_old_issues_ibfk` FOREIGN KEY (`old_issue_id`) REFERENCES `issues` (`issue_id`) ON DELETE SET NULL ON UPDATE CASCADE,
4325
    CONSTRAINT `rc_items_ibfk` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
4326
    CONSTRAINT `rc_borrowers_ibfk` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
4327
    CONSTRAINT `rc_created_by_ibfk` FOREIGN KEY (`created_by`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
4328
    CONSTRAINT `rc_updated_by_ibfk` FOREIGN KEY (`updated_by`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
4329
    CONSTRAINT `rc_resolved_by_ibfk` FOREIGN KEY (`resolved_by`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE
4330
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4331
4302
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
4332
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
4303
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
4333
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
4304
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
4334
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
(-)a/installer/data/mysql/sysprefs.sql (-1 / +3 lines)
Lines 121-126 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
121
('CircControl','ItemHomeLibrary','PickupLibrary|PatronLibrary|ItemHomeLibrary','Specify the agency that controls the circulation and fines policy','Choice'),
121
('CircControl','ItemHomeLibrary','PickupLibrary|PatronLibrary|ItemHomeLibrary','Specify the agency that controls the circulation and fines policy','Choice'),
122
('CircSidebar','0',NULL,'Activate or deactivate the navigation sidebar on all Circulation pages','YesNo'),
122
('CircSidebar','0',NULL,'Activate or deactivate the navigation sidebar on all Circulation pages','YesNo'),
123
('ClaimsBccCopy','0','','Bcc the ClaimAcquisition and ClaimIssues alerts','YesNo'),
123
('ClaimsBccCopy','0','','Bcc the ClaimAcquisition and ClaimIssues alerts','YesNo'),
124
('ClaimReturnedChargeFee', 'ask', 'ask|charge|no_charge', 'Controls whether or not a lost item fee is charged for return claims', 'Choice'),
125
('ClaimReturnedLostValue', '', '', 'Sets the LOST AV value that represents "Claims returned" as a lost value', 'Free'),
126
('ClaimReturnedWarningThreshold', '', '', 'Sets the number of return claims past which the librarian will be warned the patron has many return claims', 'Integer'),
124
('Coce','0', NULL, 'If on, enables cover retrieval from the configured Coce server', 'YesNo'),
127
('Coce','0', NULL, 'If on, enables cover retrieval from the configured Coce server', 'YesNo'),
125
('CoceHost', '', NULL, 'Coce server URL', 'Free'),
128
('CoceHost', '', NULL, 'Coce server URL', 'Free'),
126
('CoceProviders', '', 'aws,gb,ol', 'Coce providers', 'multiple'),
129
('CoceProviders', '', 'aws,gb,ol', 'Coce providers', 'multiple'),
127
- 

Return to bug 14697