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

(-)a/installer/data/mysql/atomicupdate/bug_14697.perl (+46 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
                borrowernumber int(11) NOT NULL,
10
                notes MEDIUMTEXT DEFAULT NULL,
11
                created_on TIMESTAMP NULL,
12
                created_by int(11) NULL DEFAULT NULL,
13
                updated_on TIMESTAMP NULL ON UPDATE CURRENT_TIMESTAMP,
14
                updated_by int(11) NULL DEFAULT NULL,
15
                resolution  varchar(80) NULL DEFAULT NULL,
16
                resolved_on TIMESTAMP NULL DEFAULT NULL,
17
                resolved_by int(11) NULL DEFAULT NULL,
18
                PRIMARY KEY (`id`),
19
                KEY `itemnumber` (`itemnumber`),
20
                UNIQUE( issue_id ),
21
                CONSTRAINT `rc_items_ibfk` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
22
                CONSTRAINT `rc_borrowers_ibfk` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
23
                CONSTRAINT `rc_created_by_ibfk` FOREIGN KEY (`created_by`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
24
                CONSTRAINT `rc_updated_by_ibfk` FOREIGN KEY (`updated_by`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
25
                CONSTRAINT `rc_resolved_by_ibfk` FOREIGN KEY (`resolved_by`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE
26
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
27
        });
28
    }
29
30
    $dbh->do(q{
31
        INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
32
        ('ClaimReturnedChargeFee', 'ask', 'ask|charge|no_charge', 'Controls whether or not a lost item fee is charged for return claims', 'Choice'),
33
        ('ClaimReturnedLostValue', '', '', 'Sets the LOST AV value that represents "Claims returned" as a lost value', 'Free'),
34
        ('ClaimReturnedWarningThreshold', '', '', 'Sets the number of return claims past which the librarian will be warned the patron has many return claims', 'Integer');
35
    });
36
37
    $dbh->do(q{
38
        INSERT IGNORE INTO `authorised_values` ( category, authorised_value, lib )
39
        VALUES
40
          ('RETURN_CLAIM_RESOLUTION', 'RET_BY_PATRON', 'Returned by patron'),
41
          ('RETURN_CLAIM_RESOLUTION', 'FOUND_IN_LIB', 'Found in library');
42
    });
43
44
    SetVersion( $DBversion );
45
    print "Upgrade to $DBversion done (Bug 14697 - Extend and enhance 'Claims returned' lost status)\n";
46
}
(-)a/installer/data/mysql/kohastructure.sql (+28 lines)
Lines 4419-4424 CREATE TABLE itemtypes_branches( -- association table between authorised_values Link Here
4419
    FOREIGN KEY (branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE
4419
    FOREIGN KEY (branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE
4420
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4420
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4421
4421
4422
--
4423
-- Table structure for table `return_claims`
4424
--
4425
4426
DROP TABLE IF EXISTS `return_claims`;
4427
CREATE TABLE return_claims (
4428
    id int(11) auto_increment,
4429
    itemnumber int(11) NOT NULL,
4430
    issue_id int(11) NULL DEFAULT NULL,
4431
    borrowernumber int(11) NOT NULL,
4432
    notes MEDIUMTEXT DEFAULT NULL,
4433
    created_on TIMESTAMP NULL,
4434
    created_by int(11) NULL DEFAULT NULL,
4435
    updated_on TIMESTAMP NULL ON UPDATE CURRENT_TIMESTAMP,
4436
    updated_by int(11) NULL DEFAULT NULL,
4437
    resolution  varchar(80) NULL DEFAULT NULL,
4438
    resolved_on TIMESTAMP NULL DEFAULT NULL,
4439
    resolved_by int(11) NULL DEFAULT NULL,
4440
    PRIMARY KEY (`id`),
4441
    KEY `itemnumber` (`itemnumber`),
4442
    UNIQUE( issue_id ),
4443
    CONSTRAINT `rc_items_ibfk` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
4444
    CONSTRAINT `rc_borrowers_ibfk` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
4445
    CONSTRAINT `rc_created_by_ibfk` FOREIGN KEY (`created_by`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
4446
    CONSTRAINT `rc_updated_by_ibfk` FOREIGN KEY (`updated_by`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
4447
    CONSTRAINT `rc_resolved_by_ibfk` FOREIGN KEY (`resolved_by`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE
4448
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4449
4422
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
4450
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
4423
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
4451
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
4424
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
4452
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
(-)a/installer/data/mysql/sysprefs.sql (-1 / +3 lines)
Lines 120-125 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
120
('CircControl','ItemHomeLibrary','PickupLibrary|PatronLibrary|ItemHomeLibrary','Specify the agency that controls the circulation and fines policy','Choice'),
120
('CircControl','ItemHomeLibrary','PickupLibrary|PatronLibrary|ItemHomeLibrary','Specify the agency that controls the circulation and fines policy','Choice'),
121
('CircSidebar','0',NULL,'Activate or deactivate the navigation sidebar on all Circulation pages','YesNo'),
121
('CircSidebar','0',NULL,'Activate or deactivate the navigation sidebar on all Circulation pages','YesNo'),
122
('ClaimsBccCopy','0','','Bcc the ClaimAcquisition and ClaimIssues alerts','YesNo'),
122
('ClaimsBccCopy','0','','Bcc the ClaimAcquisition and ClaimIssues alerts','YesNo'),
123
('ClaimReturnedChargeFee', 'ask', 'ask|charge|no_charge', 'Controls whether or not a lost item fee is charged for return claims', 'Choice'),
124
('ClaimReturnedLostValue', '', '', 'Sets the LOST AV value that represents "Claims returned" as a lost value', 'Free'),
125
('ClaimReturnedWarningThreshold', '', '', 'Sets the number of return claims past which the librarian will be warned the patron has many return claims', 'Integer'),
123
('CoceHost', '', NULL, 'Coce server URL', 'Free'),
126
('CoceHost', '', NULL, 'Coce server URL', 'Free'),
124
('CoceProviders', '', 'aws,gb,ol', 'Coce providers', 'multiple'),
127
('CoceProviders', '', 'aws,gb,ol', 'Coce providers', 'multiple'),
125
('COinSinOPACResults','1','','If ON, use COinS in OPAC search results page.  NOTE: this can slow down search response time significantly','YesNo'),
128
('COinSinOPACResults','1','','If ON, use COinS in OPAC search results page.  NOTE: this can slow down search response time significantly','YesNo'),
126
- 

Return to bug 14697