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

(-)a/installer/data/mysql/atomicupdate/bug_14962-temporary_shelves.pl (+113 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "",
5
    description => "Add display tables for display module",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        # Create displays table
11
        unless ( TableExists('displays') ) {
12
            $dbh->do(
13
                q{
14
                CREATE TABLE IF NOT EXISTS `displays` (
15
                    `display_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'unique id for the display',
16
                    `display_name` varchar(255) DEFAULT NULL COMMENT 'the name of the display',
17
                    `start_date` date DEFAULT NULL COMMENT 'the start date of the display (optional)',
18
                    `end_date` date DEFAULT NULL COMMENT 'the end date of the display (optional)',
19
                    `enabled` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'determines whether the display is active',
20
                    `display_location` varchar(80) DEFAULT NULL COMMENT 'the shelving location for the display (optional)',
21
                    `display_code` varchar(80) DEFAULT NULL COMMENT 'the collection code for the display (optional)',
22
                    `display_branch` varchar(10) DEFAULT NULL COMMENT 'a new home branch for the item to have while on display (optional)',
23
                    `display_holding_branch` varchar(10) DEFAULT NULL COMMENT 'a new holding branch for the item to have while on display (optional)',
24
                    `display_itype` varchar(10) DEFAULT NULL COMMENT 'a new itype for the item to have while on display (optional)',
25
                    `staff_note` mediumtext DEFAULT NULL COMMENT 'staff note for the display',
26
                    `public_note` mediumtext DEFAULT NULL COMMENT 'public note for the display',
27
                    `display_days` int(11) DEFAULT NULL COMMENT 'default number of days items will remain on display',
28
                    `display_return_over` enum('yes - any library','yes - except at home library','no') NOT NULL DEFAULT 'no' COMMENT 'should the item be removed from the display when it is returned',
29
                    PRIMARY KEY (`display_id`),
30
                    KEY `display_branch` (`display_branch`),
31
                    KEY `display_holding_branch` (`display_holding_branch`),
32
                    KEY `display_itype` (`display_itype`),
33
                    CONSTRAINT `displays_ibfk_1` FOREIGN KEY (`display_branch`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
34
                    CONSTRAINT `displays_ibfk_2` FOREIGN KEY (`display_holding_branch`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
35
                    CONSTRAINT `displays_ibfk_3` FOREIGN KEY (`display_itype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE
36
                ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
37
            }
38
            );
39
40
            say $out "Added new table 'displays'";
41
        }
42
43
        # Create display_items table
44
        unless ( TableExists('display_items') ) {
45
            $dbh->do(
46
                q{
47
                CREATE TABLE IF NOT EXISTS `display_items` (
48
                    `display_item_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key',
49
                    `display_id` int(11) NOT NULL COMMENT 'foreign key to link to displays.display_id',
50
                    `itemnumber` int(11) DEFAULT NULL COMMENT 'items.itemnumber for the item on display',
51
                    `biblionumber` int(11) DEFAULT NULL COMMENT 'biblio.biblionumber for the bibliographic record on display',
52
                    `date_added` date DEFAULT NULL COMMENT 'the date the item was added to the display',
53
                    `date_remove` date DEFAULT NULL COMMENT 'the date the item should be removed from the display',
54
                    PRIMARY KEY (`display_item_id`),
55
                    UNIQUE KEY `display_items_uniq` (`display_id`,`itemnumber`),
56
                    KEY `display_id` (`display_id`),
57
                    KEY `itemnumber` (`itemnumber`),
58
                    KEY `biblionumber` (`biblionumber`),
59
                    CONSTRAINT `display_items_ibfk_1` FOREIGN KEY (`display_id`) REFERENCES `displays` (`display_id`) ON DELETE CASCADE ON UPDATE CASCADE,
60
                    CONSTRAINT `display_items_ibfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
61
                    CONSTRAINT `display_items_ibfk_3` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
62
                ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
63
            }
64
            );
65
66
            say $out "Added new table 'display_items'";
67
        }
68
69
        # Add UseDisplayModule system preference
70
        $dbh->do(
71
            q{
72
            INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type)
73
            VALUES ('UseDisplayModule', '0', NULL, 'Enable the display module for managing item displays.', 'YesNo')
74
        }
75
        );
76
        say $out "Added UseDisplayModule system preference";
77
78
        # Add displays user flag
79
        $dbh->do(
80
            q{
81
            INSERT IGNORE INTO userflags (bit, flag, flagdesc, defaulton)
82
            VALUES (33, 'displays', 'Display module', 0)
83
        }
84
        );
85
        say $out "Added displays user flag";
86
87
        # Add display permissions
88
        $dbh->do(
89
            q{
90
            INSERT IGNORE INTO permissions (module_bit, code, description) VALUES
91
            (33, 'view_display', 'View displays'),
92
            (33, 'add_display', 'Add displays'),
93
            (33, 'edit_display', 'Edit displays'),
94
            (33, 'delete_display', 'Delete displays'),
95
            (33, 'add_items_to_display', 'Add items to displays'),
96
            (33, 'add_items_to_display_from_any_libraries', 'Add items to displays from any libraries'),
97
            (33, 'remove_items_from_display', 'Remove items from displays')
98
        }
99
        );
100
        say $out "Added display permissions";
101
102
        # Add ft_display_group column to library_groups table
103
        unless ( column_exists( 'library_groups', 'ft_display_group' ) ) {
104
            $dbh->do(
105
                q{
106
                ALTER TABLE library_groups
107
                ADD COLUMN `ft_display_group` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Use this group to identify libraries that can share display items' AFTER `ft_local_float_group`
108
            }
109
            );
110
            say $out "Added ft_display_group column to library_groups table";
111
        }
112
    },
113
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+2 lines)
Lines 227-232 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
227
('DisplayClearScreenButton','no','no|issueslip|issueqslip','If set to ON, a clear screen button will appear on the circulation page.','Choice'),
227
('DisplayClearScreenButton','no','no|issueslip|issueqslip','If set to ON, a clear screen button will appear on the circulation page.','Choice'),
228
('displayFacetCount','0',NULL,'If enabled, display the number of facet counts','YesNo'),
228
('displayFacetCount','0',NULL,'If enabled, display the number of facet counts','YesNo'),
229
('DisplayIconsXSLT','1',NULL,'If ON, displays the format, audience, and material type icons in XSLT MARC21 results and detail pages.','YesNo'),
229
('DisplayIconsXSLT','1',NULL,'If ON, displays the format, audience, and material type icons in XSLT MARC21 results and detail pages.','YesNo'),
230
('DisplayItemsLog','1',NULL,'If ON, log create/edit/delete actions on display items.','YesNo'),
230
('DisplayLibraryFacets', 'holding', 'home|holding|both', 'Defines which library facets to display.', 'Choice'),
231
('DisplayLibraryFacets', 'holding', 'home|holding|both', 'Defines which library facets to display.', 'Choice'),
231
('DisplayMultiItemHolds','0',NULL,'Display the ability to place holds on different items at the same time in staff interface and OPAC','YesNo'),
232
('DisplayMultiItemHolds','0',NULL,'Display the ability to place holds on different items at the same time in staff interface and OPAC','YesNo'),
232
('DisplayMultiPlaceHold','1',NULL,'Display the ability to place multiple holds or not','YesNo'),
233
('DisplayMultiPlaceHold','1',NULL,'Display the ability to place multiple holds or not','YesNo'),
Lines 877-882 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
877
('useDaysMode','Calendar','Calendar|Days|Datedue|Dayweek','Choose the method for calculating due date: select Calendar, Datedue or Dayweek to use the holidays module, and Days to ignore the holidays module','Choice'),
878
('useDaysMode','Calendar','Calendar|Days|Datedue|Dayweek','Choose the method for calculating due date: select Calendar, Datedue or Dayweek to use the holidays module, and Days to ignore the holidays module','Choice'),
878
('useDefaultReplacementCost', '0', NULL, 'default replacement cost defined in item type', 'YesNo'),
879
('useDefaultReplacementCost', '0', NULL, 'default replacement cost defined in item type', 'YesNo'),
879
('useDischarge','0',NULL,'Allows librarians to discharge borrowers and borrowers to request a discharge','YesNo'),
880
('useDischarge','0',NULL,'Allows librarians to discharge borrowers and borrowers to request a discharge','YesNo'),
881
('UseDisplayModule','0',NULL,'Enable the display module for managing item displays.','YesNo'),
880
('UseICUStyleQuotes','0',NULL,'Tell Koha whether to use ICU style quotes ({) or default (") when tracing subjects .','YesNo'),
882
('UseICUStyleQuotes','0',NULL,'Tell Koha whether to use ICU style quotes ({) or default (") when tracing subjects .','YesNo'),
881
('UseLibraryFloatLimits', '0', '', 'Enables library float limits', 'YesNo'),
883
('UseLibraryFloatLimits', '0', '', 'Enables library float limits', 'YesNo'),
882
('UseLocationAsAQInSIP', '0', NULL, 'Use permanent_location instead of homebranch for AQ in SIP response', 'YesNo'),
884
('UseLocationAsAQInSIP', '0', NULL, 'Use permanent_location instead of homebranch for AQ in SIP response', 'YesNo'),
(-)a/installer/data/mysql/mandatory/userflags.sql (-1 / +2 lines)
Lines 29-33 INSERT INTO userflags (bit, flag, flagdesc, defaulton) VALUES Link Here
29
(29, 'loggedinlibrary', 'Change logged in library', 0),
29
(29, 'loggedinlibrary', 'Change logged in library', 0),
30
(30, 'preservation', 'Preservation module', 0),
30
(30, 'preservation', 'Preservation module', 0),
31
(31, 'sip2', 'SIP2 module', 0),
31
(31, 'sip2', 'SIP2 module', 0),
32
(32, 'debug', 'Show debug interface', 0)
32
(32, 'debug', 'Show debug interface', 0),
33
(33, 'displays', 'Display module', 0)
33
;
34
;
(-)a/installer/data/mysql/mandatory/userpermissions.sql (-2 / +8 lines)
Lines 171-175 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
171
   (25, 'cashup', 'Perform cash register cashup action'),
171
   (25, 'cashup', 'Perform cash register cashup action'),
172
   (25, 'takepayment', 'Access the point of sale page and take payments'),
172
   (25, 'takepayment', 'Access the point of sale page and take payments'),
173
   (26, 'manage_problem_reports', 'Manage OPAC problem reports'),
173
   (26, 'manage_problem_reports', 'Manage OPAC problem reports'),
174
   (27, 'manage_recalls', 'Manage recalls for patrons')
174
   (27, 'manage_recalls', 'Manage recalls for patrons'),
175
   (33, 'view_display', 'View displays'),
176
   (33, 'add_display', 'Add displays'),
177
   (33, 'edit_display', 'Edit displays'),
178
   (33, 'delete_display', 'Delete displays'),
179
   (33, 'add_items_to_display', 'Add items to displays'),
180
   (33, 'add_items_to_display_from_any_libraries', 'Add items to displays from any libraries'),
181
   (33, 'remove_items_from_display', 'Remove items from displays')
175
;
182
;
176
- 

Return to bug 14962