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

(-)a/installer/data/mysql/atomicupdate/stockrot_tables.sql (+61 lines)
Line 0 Link Here
1
-- Stock Rotation Rotas
2
3
CREATE TABLE IF NOT EXISTS stockrotationrotas (
4
    rota_id int(11) auto_increment,          -- Stockrotation rota ID
5
    title varchar(100) NOT NULL,            -- Title for this rota
6
    description text NOT NULL default '',   -- Description for this rota
7
    cyclical tinyint(1) NOT NULL default 0, -- Should items on this rota keep cycling?
8
    active tinyint(1) NOT NULL default 0,   -- Is this rota currently active?
9
    PRIMARY KEY (`rota_id`)
10
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
11
12
-- Stock Rotation Stages
13
14
CREATE TABLE IF NOT EXISTS stockrotationstages (
15
    stage_id int(11) auto_increment,     -- Unique stage ID
16
    position int(11) NOT NULL,           -- The position of this stage within its rota
17
    rota_id int(11) NOT NULL,            -- The rota this stage belongs to
18
    branchcode_id varchar(10) NOT NULL,  -- Branch this stage relates to
19
    duration int(11) NOT NULL default 4, -- The number of days items shoud occupy this stage
20
    PRIMARY KEY (`stage_id`),
21
    CONSTRAINT `stockrotationstages_rifk`
22
      FOREIGN KEY (`rota_id`)
23
      REFERENCES `stockrotationrotas` (`rota_id`)
24
      ON UPDATE CASCADE ON DELETE CASCADE,
25
    CONSTRAINT `stockrotationstages_bifk`
26
      FOREIGN KEY (`branchcode_id`)
27
      REFERENCES `branches` (`branchcode`)
28
      ON UPDATE CASCADE ON DELETE CASCADE
29
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
30
31
-- Stock Rotation Items
32
33
CREATE TABLE IF NOT EXISTS stockrotationitems (
34
    itemnumber_id int(11) NOT NULL,         -- Itemnumber to link to a stage & rota
35
    stage_id int(11) NOT NULL,              -- stage ID to link the item to
36
    indemand tinyint(1) NOT NULL default 0, -- Should this item be skipped for rotation?
37
    PRIMARY KEY (itemnumber_id),
38
    CONSTRAINT `stockrotationitems_iifk`
39
      FOREIGN KEY (`itemnumber_id`)
40
      REFERENCES `items` (`itemnumber`)
41
      ON UPDATE CASCADE ON DELETE CASCADE,
42
    CONSTRAINT `stockrotationitems_sifk`
43
      FOREIGN KEY (`stage_id`)
44
      REFERENCES `stockrotationstages` (`stage_id`)
45
      ON UPDATE CASCADE ON DELETE CASCADE
46
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
47
48
-- System preferences
49
50
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES
51
       ('StockRotation','0','If ON, enables the stock rotation module','','YesNo'),
52
       ('RotationPreventTransfers','0','If ON, prevent any transfers for items on stock rotation rotas, except for stock rotation transfers','','YesNo');
53
54
-- Permissions
55
56
INSERT IGNORE INTO userflags (bit, flag, flagdesc, defaulton) VALUES
57
       (21, 'stockrotation', 'Manage stockrotation operations', 0);
58
59
INSERT IGNORE INTO permissions (module_bit, code, description) VALUES
60
       (21, 'can_edit_rotas', 'Create, edit and delete rotas'),
61
       (21, 'can_add_items_rotas', 'Add and remove items from rotas');
(-)a/installer/data/mysql/kohastructure.sql (+47 lines)
Lines 3921-3926 CREATE TABLE `article_requests` ( Link Here
3921
  CONSTRAINT `article_requests_ibfk_4` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE SET NULL ON UPDATE CASCADE
3921
  CONSTRAINT `article_requests_ibfk_4` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE SET NULL ON UPDATE CASCADE
3922
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3922
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3923
3923
3924
-- Stock Rotation Rotas
3925
3926
CREATE TABLE IF NOT EXISTS stockrotationrotas (
3927
    rota_id int(11) auto_increment,          -- Stockrotation rota ID
3928
    title varchar(100) NOT NULL,            -- Title for this rota
3929
    description text NOT NULL default '',   -- Description for this rota
3930
    cyclical tinyint(1) NOT NULL default 0, -- Should items on this rota keep cycling?
3931
    active tinyint(1) NOT NULL default 0,   -- Is this rota currently active?
3932
    PRIMARY KEY (`rota_id`)
3933
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3934
3935
-- Stock Rotation Stages
3936
3937
CREATE TABLE IF NOT EXISTS stockrotationstages (
3938
    stage_id int(11) auto_increment,     -- Unique stage ID
3939
    position int(11) NOT NULL,           -- The position of this stage within its rota
3940
    rota_id int(11) NOT NULL,            -- The rota this stage belongs to
3941
    branchcode_id varchar(10) NOT NULL,  -- Branch this stage relates to
3942
    duration int(11) NOT NULL default 4, -- The number of days items shoud occupy this stage
3943
    PRIMARY KEY (`stage_id`),
3944
    CONSTRAINT `stockrotationstages_rifk`
3945
      FOREIGN KEY (`rota_id`)
3946
      REFERENCES `stockrotationrotas` (`rota_id`)
3947
      ON UPDATE CASCADE ON DELETE CASCADE,
3948
    CONSTRAINT `stockrotationstages_bifk`
3949
      FOREIGN KEY (`branchcode_id`)
3950
      REFERENCES `branches` (`branchcode`)
3951
      ON UPDATE CASCADE ON DELETE CASCADE
3952
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3953
3954
-- Stock Rotation Items
3955
3956
CREATE TABLE IF NOT EXISTS stockrotationitems (
3957
    itemnumber_id int(11) NOT NULL,         -- Itemnumber to link to a stage & rota
3958
    stage_id int(11) NOT NULL,              -- stage ID to link the item to
3959
    indemand tinyint(1) NOT NULL default 0, -- Should this item be skipped for rotation?
3960
    PRIMARY KEY (itemnumber_id),
3961
    CONSTRAINT `stockrotationitems_iifk`
3962
      FOREIGN KEY (`itemnumber_id`)
3963
      REFERENCES `items` (`itemnumber`)
3964
      ON UPDATE CASCADE ON DELETE CASCADE,
3965
    CONSTRAINT `stockrotationitems_sifk`
3966
      FOREIGN KEY (`stage_id`)
3967
      REFERENCES `stockrotationstages` (`stage_id`)
3968
      ON UPDATE CASCADE ON DELETE CASCADE
3969
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3970
3924
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
3971
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
3925
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
3972
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
3926
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
3973
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
(-)a/installer/data/mysql/sysprefs.sql (+2 lines)
Lines 564-567 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
564
('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'),
564
('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'),
565
('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
565
('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
566
('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo')
566
('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo')
567
('StockRotation','0','If ON, enables the stock rotation module','','YesNo')
568
('RotationPreventTransfers','0','If ON, prevent any transfers for items on stock rotation rotas, except for stock rotation transfers','','YesNo')
567
;
569
;
(-)a/installer/data/mysql/userflags.sql (+1 lines)
Lines 18-21 INSERT INTO userflags (bit, flag, flagdesc, defaulton) VALUES Link Here
18
(18,'coursereserves','Course reserves',0),
18
(18,'coursereserves','Course reserves',0),
19
(19, 'plugins', 'Koha plugins', '0'),
19
(19, 'plugins', 'Koha plugins', '0'),
20
(20, 'lists', 'Lists', 0)
20
(20, 'lists', 'Lists', 0)
21
(21, 'stockrotation', 'Manage stockrotation operations', 0)
21
;
22
;
(-)a/installer/data/mysql/userpermissions.sql (+2 lines)
Lines 79-82 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
79
   (19, 'report', 'Use report plugins'),
79
   (19, 'report', 'Use report plugins'),
80
   (19, 'configure', 'Configure plugins'),
80
   (19, 'configure', 'Configure plugins'),
81
   (20, 'delete_public_lists', 'Delete public lists')
81
   (20, 'delete_public_lists', 'Delete public lists')
82
   (21, 'can_edit_rotas', 'Create, edit and delete rotas')
83
   (21, 'can_add_items_rotas', 'Add and remove items from rotas')
82
;
84
;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-1 / +13 lines)
Lines 782-787 Circulation: Link Here
782
                  yes: Enable
782
                  yes: Enable
783
                  no: Disable
783
                  no: Disable
784
            - "housebound module"
784
            - "housebound module"
785
    Stockrotation module:
786
        -
787
            - pref: StockRotation
788
              choices:
789
                  yes: Enable
790
                  no: Disable
791
            - "Enable the stock rotation module"
792
        -
793
            - pref: RotationPreventTransfers
794
              choices:
795
                  yes: Enable
796
                  no: Disable
797
            - "Prevent branchtransfers on items in stockrotation rotas"
785
    Article Requests:
798
    Article Requests:
786
        -
799
        -
787
            - pref: ArticleRequests
800
            - pref: ArticleRequests
788
- 

Return to bug 11897