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

(-)a/installer/data/mysql/atomicupdate/stockrot_tables.sql (+62 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
    fresh tinyint(1) NOT NULL default 0,    -- Flag showing item is only just added to rota
38
    PRIMARY KEY (itemnumber_id),
39
    CONSTRAINT `stockrotationitems_iifk`
40
      FOREIGN KEY (`itemnumber_id`)
41
      REFERENCES `items` (`itemnumber`)
42
      ON UPDATE CASCADE ON DELETE CASCADE,
43
    CONSTRAINT `stockrotationitems_sifk`
44
      FOREIGN KEY (`stage_id`)
45
      REFERENCES `stockrotationstages` (`stage_id`)
46
      ON UPDATE CASCADE ON DELETE CASCADE
47
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
48
49
-- System preferences
50
51
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES
52
       ('StockRotation','0','If ON, enables the stock rotation module','','YesNo'),
53
       ('RotationPreventTransfers','0','If ON, prevent any transfers for items on stock rotation rotas, except for stock rotation transfers','','YesNo');
54
55
-- Permissions
56
57
INSERT IGNORE INTO userflags (bit, flag, flagdesc, defaulton) VALUES
58
       (21, 'stockrotation', 'Manage stockrotation operations', 0);
59
60
INSERT IGNORE INTO permissions (module_bit, code, description) VALUES
61
       (21, 'can_edit_rotas', 'Create, edit and delete rotas'),
62
       (21, 'can_add_items_rotas', 'Add and remove items from rotas');
(-)a/installer/data/mysql/kohastructure.sql (+54 lines)
Lines 3955-3960 CREATE TABLE deletedbiblio_metadata ( Link Here
3955
    CONSTRAINT `deletedrecord_metadata_fk_1` FOREIGN KEY (biblionumber) REFERENCES deletedbiblio (biblionumber) ON DELETE CASCADE ON UPDATE CASCADE
3955
    CONSTRAINT `deletedrecord_metadata_fk_1` FOREIGN KEY (biblionumber) REFERENCES deletedbiblio (biblionumber) ON DELETE CASCADE ON UPDATE CASCADE
3956
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3956
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3957
3957
3958
--
3959
-- Table structure for table `stockrotationrotas`
3960
--
3961
3962
CREATE TABLE IF NOT EXISTS stockrotationrotas (
3963
    rota_id int(11) auto_increment,          -- Stockrotation rota ID
3964
    title varchar(100) NOT NULL,            -- Title for this rota
3965
    description text NOT NULL default '',   -- Description for this rota
3966
    cyclical tinyint(1) NOT NULL default 0, -- Should items on this rota keep cycling?
3967
    active tinyint(1) NOT NULL default 0,   -- Is this rota currently active?
3968
    PRIMARY KEY (`rota_id`)
3969
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3970
3971
--
3972
-- Table structure for table `stockrotationstages`
3973
--
3974
3975
CREATE TABLE IF NOT EXISTS stockrotationstages (
3976
    stage_id int(11) auto_increment,     -- Unique stage ID
3977
    position int(11) NOT NULL,           -- The position of this stage within its rota
3978
    rota_id int(11) NOT NULL,            -- The rota this stage belongs to
3979
    branchcode_id varchar(10) NOT NULL,  -- Branch this stage relates to
3980
    duration int(11) NOT NULL default 4, -- The number of days items shoud occupy this stage
3981
    PRIMARY KEY (`stage_id`),
3982
    CONSTRAINT `stockrotationstages_rifk`
3983
      FOREIGN KEY (`rota_id`)
3984
      REFERENCES `stockrotationrotas` (`rota_id`)
3985
      ON UPDATE CASCADE ON DELETE CASCADE,
3986
    CONSTRAINT `stockrotationstages_bifk`
3987
      FOREIGN KEY (`branchcode_id`)
3988
      REFERENCES `branches` (`branchcode`)
3989
      ON UPDATE CASCADE ON DELETE CASCADE
3990
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
3991
3992
--
3993
-- Table structure for table `stockrotationitems`
3994
--
3995
3996
CREATE TABLE IF NOT EXISTS stockrotationitems (
3997
    itemnumber_id int(11) NOT NULL,         -- Itemnumber to link to a stage & rota
3998
    stage_id int(11) NOT NULL,              -- stage ID to link the item to
3999
    indemand tinyint(1) NOT NULL default 0, -- Should this item be skipped for rotation?
4000
    fresh tinyint(1) NOT NULL default 0,    -- Flag showing item is only just added to rota
4001
    PRIMARY KEY (itemnumber_id),
4002
    CONSTRAINT `stockrotationitems_iifk`
4003
      FOREIGN KEY (`itemnumber_id`)
4004
      REFERENCES `items` (`itemnumber`)
4005
      ON UPDATE CASCADE ON DELETE CASCADE,
4006
    CONSTRAINT `stockrotationitems_sifk`
4007
      FOREIGN KEY (`stage_id`)
4008
      REFERENCES `stockrotationstages` (`stage_id`)
4009
      ON UPDATE CASCADE ON DELETE CASCADE
4010
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
4011
3958
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
4012
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
3959
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
4013
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
3960
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
4014
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
(-)a/installer/data/mysql/sysprefs.sql (-1 / +3 lines)
Lines 577-581 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
577
('XSLTListsDisplay','default','','Enable XSLT stylesheet control over lists pages display on intranet','Free'),
577
('XSLTListsDisplay','default','','Enable XSLT stylesheet control over lists pages display on intranet','Free'),
578
('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'),
578
('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'),
579
('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
579
('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
580
('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo')
580
('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo'),
581
('StockRotation','0',NULL,'If ON, enables the stock rotation module','YesNo'),
582
('RotationPreventTransfers','0',NULL,'If ON, prevent any transfers for items on stock rotation rotas, except for stock rotation transfers','YesNo')
581
;
583
;
(-)a/installer/data/mysql/userflags.sql (-1 / +2 lines)
Lines 17-21 INSERT INTO userflags (bit, flag, flagdesc, defaulton) VALUES Link Here
17
(17,'staffaccess','Allow staff members to modify permissions for other staff members',0),
17
(17,'staffaccess','Allow staff members to modify permissions for other staff members',0),
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 (-1 / +3 lines)
Lines 78-82 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
78
   (19, 'tool', 'Use tool plugins'),
78
   (19, 'tool', 'Use tool plugins'),
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/includes/permissions.inc (+1 lines)
Lines 19-24 Link Here
19
    [%- CASE 'coursereserves' -%]<span>Course reserves</span>
19
    [%- CASE 'coursereserves' -%]<span>Course reserves</span>
20
    [%- CASE 'plugins' -%]<span>Koha plugins</span>
20
    [%- CASE 'plugins' -%]<span>Koha plugins</span>
21
    [%- CASE 'lists' -%]<span>Lists</span>
21
    [%- CASE 'lists' -%]<span>Lists</span>
22
    [%- CASE 'stockrotation' -%]<span>Manage stockrotation operations</span>
22
    [%- END -%]
23
    [%- END -%]
23
[%- END -%]
24
[%- END -%]
24
25
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-1 / +13 lines)
Lines 807-812 Circulation: Link Here
807
                  yes: Enable
807
                  yes: Enable
808
                  no: Disable
808
                  no: Disable
809
            - "housebound module"
809
            - "housebound module"
810
    Stockrotation module:
811
        -
812
            - pref: StockRotation
813
              choices:
814
                  yes: Enable
815
                  no: Disable
816
            - "Enable the stock rotation module"
817
        -
818
            - pref: RotationPreventTransfers
819
              choices:
820
                  yes: Enable
821
                  no: Disable
822
            - "Prevent branchtransfers on items in stockrotation rotas"
810
    Article Requests:
823
    Article Requests:
811
        -
824
        -
812
            - pref: ArticleRequests
825
            - pref: ArticleRequests
813
- 

Return to bug 11897