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
       (23, 'stockrotation', 'Manage stockrotation operations', 0);
59
60
INSERT IGNORE INTO permissions (module_bit, code, description) VALUES
61
       (23, 'can_edit_rotas', 'Create, edit and delete rotas'),
62
       (23, 'can_add_items_rotas', 'Add and remove items from rotas');
(-)a/installer/data/mysql/kohastructure.sql (+54 lines)
Lines 4122-4127 CREATE TABLE illrequests ( Link Here
4122
      ON UPDATE CASCADE ON DELETE CASCADE
4122
      ON UPDATE CASCADE ON DELETE CASCADE
4123
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4123
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4124
4124
4125
--
4126
-- Table structure for table `stockrotationrotas`
4127
--
4128
4129
CREATE TABLE IF NOT EXISTS stockrotationrotas (
4130
    rota_id int(11) auto_increment,          -- Stockrotation rota ID
4131
    title varchar(100) NOT NULL,            -- Title for this rota
4132
    description text NOT NULL default '',   -- Description for this rota
4133
    cyclical tinyint(1) NOT NULL default 0, -- Should items on this rota keep cycling?
4134
    active tinyint(1) NOT NULL default 0,   -- Is this rota currently active?
4135
    PRIMARY KEY (`rota_id`)
4136
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
4137
4138
--
4139
-- Table structure for table `stockrotationstages`
4140
--
4141
4142
CREATE TABLE IF NOT EXISTS stockrotationstages (
4143
    stage_id int(11) auto_increment,     -- Unique stage ID
4144
    position int(11) NOT NULL,           -- The position of this stage within its rota
4145
    rota_id int(11) NOT NULL,            -- The rota this stage belongs to
4146
    branchcode_id varchar(10) NOT NULL,  -- Branch this stage relates to
4147
    duration int(11) NOT NULL default 4, -- The number of days items shoud occupy this stage
4148
    PRIMARY KEY (`stage_id`),
4149
    CONSTRAINT `stockrotationstages_rifk`
4150
      FOREIGN KEY (`rota_id`)
4151
      REFERENCES `stockrotationrotas` (`rota_id`)
4152
      ON UPDATE CASCADE ON DELETE CASCADE,
4153
    CONSTRAINT `stockrotationstages_bifk`
4154
      FOREIGN KEY (`branchcode_id`)
4155
      REFERENCES `branches` (`branchcode`)
4156
      ON UPDATE CASCADE ON DELETE CASCADE
4157
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
4158
4125
--
4159
--
4126
-- Table structure for table `illrequestattributes`
4160
-- Table structure for table `illrequestattributes`
4127
--
4161
--
Lines 4160-4165 CREATE TABLE library_groups ( Link Here
4160
    UNIQUE KEY title ( title )
4194
    UNIQUE KEY title ( title )
4161
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4195
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4162
4196
4197
--
4198
-- Table structure for table `stockrotationitems`
4199
--
4200
4201
CREATE TABLE IF NOT EXISTS stockrotationitems (
4202
    itemnumber_id int(11) NOT NULL,         -- Itemnumber to link to a stage & rota
4203
    stage_id int(11) NOT NULL,              -- stage ID to link the item to
4204
    indemand tinyint(1) NOT NULL default 0, -- Should this item be skipped for rotation?
4205
    fresh tinyint(1) NOT NULL default 0,    -- Flag showing item is only just added to rota
4206
    PRIMARY KEY (itemnumber_id),
4207
    CONSTRAINT `stockrotationitems_iifk`
4208
      FOREIGN KEY (`itemnumber_id`)
4209
      REFERENCES `items` (`itemnumber`)
4210
      ON UPDATE CASCADE ON DELETE CASCADE,
4211
    CONSTRAINT `stockrotationitems_sifk`
4212
      FOREIGN KEY (`stage_id`)
4213
      REFERENCES `stockrotationstages` (`stage_id`)
4214
      ON UPDATE CASCADE ON DELETE CASCADE
4215
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
4216
4163
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
4217
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
4164
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
4218
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
4165
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
4219
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
(-)a/installer/data/mysql/sysprefs.sql (-1 / +3 lines)
Lines 612-616 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
612
('XSLTListsDisplay','default','','Enable XSLT stylesheet control over lists pages display on intranet','Free'),
612
('XSLTListsDisplay','default','','Enable XSLT stylesheet control over lists pages display on intranet','Free'),
613
('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'),
613
('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'),
614
('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
614
('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
615
('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo')
615
('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo'),
616
('StockRotation','0',NULL,'If ON, enables the stock rotation module','YesNo'),
617
('RotationPreventTransfers','0',NULL,'If ON, prevent any transfers for items on stock rotation rotas, except for stock rotation transfers','YesNo')
616
;
618
;
(-)a/installer/data/mysql/userflags.sql (+1 lines)
Lines 21-24 INSERT INTO userflags (bit, flag, flagdesc, defaulton) VALUES Link Here
21
(21, 'clubs', 'Patron clubs', '0'),
21
(21, 'clubs', 'Patron clubs', '0'),
22
(22,'ill','The Interlibrary Loans Module',0),
22
(22,'ill','The Interlibrary Loans Module',0),
23
(23,'self_check','Self check modules',0)
23
(23,'self_check','Self check modules',0)
24
(24, 'stockrotation', 'Manage stockrotation operations', 0)
24
;
25
;
(-)a/installer/data/mysql/userpermissions.sql (+2 lines)
Lines 85-88 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
85
   (21, 'enroll', 'Enroll patrons in clubs'),
85
   (21, 'enroll', 'Enroll patrons in clubs'),
86
   (23, 'self_checkin_module', 'Log into the self check-in module'),
86
   (23, 'self_checkin_module', 'Log into the self check-in module'),
87
   (23, 'self_checkout_module', 'Perform self checkout at the OPAC. It should be used for the patron matching the AutoSelfCheckID')
87
   (23, 'self_checkout_module', 'Perform self checkout at the OPAC. It should be used for the patron matching the AutoSelfCheckID')
88
   (24, 'can_edit_rotas', 'Create, edit and delete rotas'),
89
   (24, 'can_add_items_rotas', 'Add and remove items from rotas')
88
;
90
;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc (+4 lines)
Lines 22-27 Link Here
22
    [%- CASE 'clubs' -%]<span>Patron clubs</span>
22
    [%- CASE 'clubs' -%]<span>Patron clubs</span>
23
    [%- CASE 'ill' -%]<span>Create and modify Interlibrary loan requests</span>
23
    [%- CASE 'ill' -%]<span>Create and modify Interlibrary loan requests</span>
24
    [%- CASE 'self_check' -%]<span>Self check modules</span>
24
    [%- CASE 'self_check' -%]<span>Self check modules</span>
25
    [%- CASE 'stockrotation' -%]<span>Manage stockrotation operations</span>
25
    [%- END -%]
26
    [%- END -%]
26
[%- END -%]
27
[%- END -%]
27
28
Lines 115-118 Link Here
115
    [%- 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>
116
    [%- 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>
116
    [%- CASE 'self_checkout_module' -%]<span>Perform self checkout at the OPAC. It should be used for the patron matching the AutoSelfCheckID</span>
117
    [%- CASE 'self_checkout_module' -%]<span>Perform self checkout at the OPAC. It should be used for the patron matching the AutoSelfCheckID</span>
117
  [%- END -%]
118
  [%- END -%]
119
    [%- CASE 'can_add_items_rotas' -%]<span>Add and remove items from rotas</span>
120
    [%- CASE 'can_edit_rotas' -%]<span>Create, edit and delete rotas</span>
121
    [%- END -%]
118
[%- END -%]
122
[%- END -%]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-1 / +13 lines)
Lines 901-906 Circulation: Link Here
901
                  yes: Enable
901
                  yes: Enable
902
                  no: Disable
902
                  no: Disable
903
            - "housebound module"
903
            - "housebound module"
904
    Stockrotation module:
905
        -
906
            - pref: StockRotation
907
              choices:
908
                  yes: Enable
909
                  no: Disable
910
            - "the stock rotation module"
911
        -
912
            - pref: RotationPreventTransfers
913
              choices:
914
                  yes: Disallow
915
                  no: Allow
916
            - "library transfers on items in stockrotation rotas"
904
    Article Requests:
917
    Article Requests:
905
        -
918
        -
906
            - pref: ArticleRequests
919
            - pref: ArticleRequests
907
- 

Return to bug 11897