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

(-)a/installer/data/mysql/atomicupdate/stockrot_tables.sql (+69 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
    CONSTRAINT `stockrotationrotas_title`
11
      UNIQUE (`title`)
12
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
13
14
-- Stock Rotation Stages
15
16
CREATE TABLE IF NOT EXISTS stockrotationstages (
17
    stage_id int(11) auto_increment,     -- Unique stage ID
18
    position int(11) NOT NULL,           -- The position of this stage within its rota
19
    rota_id int(11) NOT NULL,            -- The rota this stage belongs to
20
    branchcode_id varchar(10) NOT NULL,  -- Branch this stage relates to
21
    duration int(11) NOT NULL default 4, -- The number of days items shoud occupy this stage
22
    PRIMARY KEY (`stage_id`),
23
    CONSTRAINT `stockrotationstages_rifk`
24
      FOREIGN KEY (`rota_id`)
25
      REFERENCES `stockrotationrotas` (`rota_id`)
26
      ON UPDATE CASCADE ON DELETE CASCADE,
27
    CONSTRAINT `stockrotationstages_bifk`
28
      FOREIGN KEY (`branchcode_id`)
29
      REFERENCES `branches` (`branchcode`)
30
      ON UPDATE CASCADE ON DELETE CASCADE
31
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
32
33
-- Stock Rotation Items
34
35
CREATE TABLE IF NOT EXISTS stockrotationitems (
36
    itemnumber_id int(11) NOT NULL,         -- Itemnumber to link to a stage & rota
37
    stage_id int(11) NOT NULL,              -- stage ID to link the item to
38
    indemand tinyint(1) NOT NULL default 0, -- Should this item be skipped for rotation?
39
    fresh tinyint(1) NOT NULL default 0,    -- Flag showing item is only just added to rota
40
    PRIMARY KEY (itemnumber_id),
41
    CONSTRAINT `stockrotationitems_iifk`
42
      FOREIGN KEY (`itemnumber_id`)
43
      REFERENCES `items` (`itemnumber`)
44
      ON UPDATE CASCADE ON DELETE CASCADE,
45
    CONSTRAINT `stockrotationitems_sifk`
46
      FOREIGN KEY (`stage_id`)
47
      REFERENCES `stockrotationstages` (`stage_id`)
48
      ON UPDATE CASCADE ON DELETE CASCADE
49
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
50
51
-- System preferences
52
53
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES
54
       ('StockRotation','0','If ON, enables the stock rotation module','','YesNo'),
55
       ('RotationPreventTransfers','0','If ON, prevent any transfers for items on stock rotation rotas, except for stock rotation transfers','','YesNo');
56
57
-- Permissions
58
59
INSERT IGNORE INTO userflags (bit, flag, flagdesc, defaulton) VALUES
60
       (24, 'stockrotation', 'Manage stockrotation operations', 0);
61
62
INSERT IGNORE INTO permissions (module_bit, code, description) VALUES
63
       (24, 'manage_rotas', 'Create, edit and delete rotas'),
64
       (24, 'manage_rota_items', 'Add and remove items from rotas');
65
66
-- Notices
67
68
INSERT IGNORE INTO letter (module, code, branchcode, name, is_html, title, content, message_transport_type) VALUES
69
       ('circulation', 'SR_SLIP', '', 'Stock Rotation Slip', 0, 'Stockrotation Report', 'Stockrotation report for [% branch.name %]:\r\n\r\n[% IF branch.items.size %][% branch.items.size %] items to be processed for this branch.\r\n[% ELSE %]No items to be processed for this branch\r\n[% END %][% FOREACH item IN branch.items %][% IF item.reason ne \'in-demand\' %]Title: [% item.title %]\r\nAuthor: [% item.author %]\r\nCallnumber: [% item.callnumber %]\r\nLocation: [% item.location %]\r\nBarcode: [% item.barcode %]\r\nOn loan?: [% item.onloan %]\r\nStatus: [% item.reason %]\r\nCurrent Library: [% item.branch.branchname %] [% item.branch.branchcode %]\r\n\r\n[% END %][% END %]', 'email');
(-)a/installer/data/mysql/kohastructure.sql (+54 lines)
Lines 4152-4157 CREATE TABLE illrequests ( Link Here
4152
      ON UPDATE CASCADE ON DELETE CASCADE
4152
      ON UPDATE CASCADE ON DELETE CASCADE
4153
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4153
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4154
4154
4155
--
4156
-- Table structure for table `stockrotationrotas`
4157
--
4158
4159
CREATE TABLE IF NOT EXISTS stockrotationrotas (
4160
    rota_id int(11) auto_increment,          -- Stockrotation rota ID
4161
    title varchar(100) NOT NULL,            -- Title for this rota
4162
    description text NOT NULL default '',   -- Description for this rota
4163
    cyclical tinyint(1) NOT NULL default 0, -- Should items on this rota keep cycling?
4164
    active tinyint(1) NOT NULL default 0,   -- Is this rota currently active?
4165
    PRIMARY KEY (`rota_id`)
4166
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
4167
4168
--
4169
-- Table structure for table `stockrotationstages`
4170
--
4171
4172
CREATE TABLE IF NOT EXISTS stockrotationstages (
4173
    stage_id int(11) auto_increment,     -- Unique stage ID
4174
    position int(11) NOT NULL,           -- The position of this stage within its rota
4175
    rota_id int(11) NOT NULL,            -- The rota this stage belongs to
4176
    branchcode_id varchar(10) NOT NULL,  -- Branch this stage relates to
4177
    duration int(11) NOT NULL default 4, -- The number of days items shoud occupy this stage
4178
    PRIMARY KEY (`stage_id`),
4179
    CONSTRAINT `stockrotationstages_rifk`
4180
      FOREIGN KEY (`rota_id`)
4181
      REFERENCES `stockrotationrotas` (`rota_id`)
4182
      ON UPDATE CASCADE ON DELETE CASCADE,
4183
    CONSTRAINT `stockrotationstages_bifk`
4184
      FOREIGN KEY (`branchcode_id`)
4185
      REFERENCES `branches` (`branchcode`)
4186
      ON UPDATE CASCADE ON DELETE CASCADE
4187
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
4188
4155
--
4189
--
4156
-- Table structure for table `illrequestattributes`
4190
-- Table structure for table `illrequestattributes`
4157
--
4191
--
Lines 4202-4207 CREATE TABLE `oauth_access_tokens` ( Link Here
4202
    PRIMARY KEY (`access_token`)
4236
    PRIMARY KEY (`access_token`)
4203
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4237
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4204
4238
4239
--
4240
-- Table structure for table `stockrotationitems`
4241
--
4242
4243
CREATE TABLE IF NOT EXISTS stockrotationitems (
4244
    itemnumber_id int(11) NOT NULL,         -- Itemnumber to link to a stage & rota
4245
    stage_id int(11) NOT NULL,              -- stage ID to link the item to
4246
    indemand tinyint(1) NOT NULL default 0, -- Should this item be skipped for rotation?
4247
    fresh tinyint(1) NOT NULL default 0,    -- Flag showing item is only just added to rota
4248
    PRIMARY KEY (itemnumber_id),
4249
    CONSTRAINT `stockrotationitems_iifk`
4250
      FOREIGN KEY (`itemnumber_id`)
4251
      REFERENCES `items` (`itemnumber`)
4252
      ON UPDATE CASCADE ON DELETE CASCADE,
4253
    CONSTRAINT `stockrotationitems_sifk`
4254
      FOREIGN KEY (`stage_id`)
4255
      REFERENCES `stockrotationstages` (`stage_id`)
4256
      ON UPDATE CASCADE ON DELETE CASCADE
4257
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
4258
4205
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
4259
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
4206
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
4260
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
4207
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
4261
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
(-)a/installer/data/mysql/sysprefs.sql (-1 / +3 lines)
Lines 611-615 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
611
('XSLTListsDisplay','default','','Enable XSLT stylesheet control over lists pages display on intranet','Free'),
611
('XSLTListsDisplay','default','','Enable XSLT stylesheet control over lists pages display on intranet','Free'),
612
('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'),
612
('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'),
613
('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
613
('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
614
('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo')
614
('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo'),
615
('StockRotation','0',NULL,'If ON, enables the stock rotation module','YesNo'),
616
('RotationPreventTransfers','0',NULL,'If ON, prevent any transfers for items on stock rotation rotas, except for stock rotation transfers','YesNo')
615
;
617
;
(-)a/installer/data/mysql/userflags.sql (+1 lines)
Lines 20-23 INSERT INTO userflags (bit, flag, flagdesc, defaulton) VALUES Link Here
20
(21, 'clubs', 'Patron clubs', '0'),
20
(21, 'clubs', 'Patron clubs', '0'),
21
(22,'ill','The Interlibrary Loans Module',0),
21
(22,'ill','The Interlibrary Loans Module',0),
22
(23,'self_check','Self check modules',0)
22
(23,'self_check','Self check modules',0)
23
(24, 'stockrotation', 'Manage stockrotation operations', 0)
23
;
24
;
(-)a/installer/data/mysql/userpermissions.sql (+2 lines)
Lines 89-92 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
89
   (21, 'enroll', 'Enroll patrons in clubs'),
89
   (21, 'enroll', 'Enroll patrons in clubs'),
90
   (23, 'self_checkin_module', 'Log into the self check-in module'),
90
   (23, 'self_checkin_module', 'Log into the self check-in module'),
91
   (23, 'self_checkout_module', 'Perform self checkout at the OPAC. It should be used for the patron matching the AutoSelfCheckID')
91
   (23, 'self_checkout_module', 'Perform self checkout at the OPAC. It should be used for the patron matching the AutoSelfCheckID')
92
   (24, 'manage_rotas', 'Create, edit and delete rotas'),
93
   (24, 'manage_rota_items', 'Add and remove items from rotas')
92
;
94
;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc (+4 lines)
Lines 21-26 Link Here
21
    [%- CASE 'clubs' -%]<span>Patron clubs</span>
21
    [%- CASE 'clubs' -%]<span>Patron clubs</span>
22
    [%- CASE 'ill' -%]<span>Create and modify Interlibrary loan requests</span>
22
    [%- CASE 'ill' -%]<span>Create and modify Interlibrary loan requests</span>
23
    [%- CASE 'self_check' -%]<span>Self check modules</span>
23
    [%- CASE 'self_check' -%]<span>Self check modules</span>
24
    [%- CASE 'stockrotation' -%]<span>Manage stockrotation operations</span>
24
    [%- END -%]
25
    [%- END -%]
25
[%- END -%]
26
[%- END -%]
26
27
Lines 118-121 Link Here
118
    [%- CASE 'self_checkin_module' -%]<span>Log into the self check-in module. Note: this permission prevents the patron from using any other OPAC functionality</span>
119
    [%- CASE 'self_checkin_module' -%]<span>Log into the self check-in module. Note: this permission prevents the patron from using any other OPAC functionality</span>
119
    [%- CASE 'self_checkout_module' -%]<span>Perform self checkout at the OPAC. It should be used for the patron matching the AutoSelfCheckID</span>
120
    [%- CASE 'self_checkout_module' -%]<span>Perform self checkout at the OPAC. It should be used for the patron matching the AutoSelfCheckID</span>
120
  [%- END -%]
121
  [%- END -%]
122
    [%- CASE 'can_add_items_rotas' -%]<span>Add and remove items from rotas</span>
123
    [%- CASE 'can_edit_rotas' -%]<span>Create, edit and delete rotas</span>
124
    [%- END -%]
121
[%- END -%]
125
[%- END -%]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-1 / +13 lines)
Lines 936-941 Circulation: Link Here
936
                  yes: Enable
936
                  yes: Enable
937
                  no: Disable
937
                  no: Disable
938
            - "housebound module"
938
            - "housebound module"
939
    Stockrotation module:
940
        -
941
            - pref: StockRotation
942
              choices:
943
                  yes: Enable
944
                  no: Disable
945
            - "the stock rotation module"
946
        -
947
            - pref: RotationPreventTransfers
948
              choices:
949
                  yes: Disallow
950
                  no: Allow
951
            - "library transfers on items in stockrotation rotas"
939
    Article Requests:
952
    Article Requests:
940
        -
953
        -
941
            - pref: ArticleRequests
954
            - pref: ArticleRequests
942
- 

Return to bug 11897