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

(-)a/installer/data/mysql/atomicupdate/temporary_shelves.pl (+112 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 (31, '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
            (31, 'add_display', 'Add displays'),
92
            (31, 'edit_display', 'Edit displays'),
93
            (31, 'delete_display', 'Delete displays'),
94
            (31, 'add_items_to_display', 'Add items to displays'),
95
            (31, 'add_items_to_display_from_any_libraries', 'Add items to displays from any libraries'),
96
            (31, 'remove_items_from_display', 'Remove items from displays')
97
        }
98
        );
99
        say $out "Added display permissions";
100
101
        # Add ft_display_group column to library_groups table
102
        unless ( column_exists( 'library_groups', 'ft_display_group' ) ) {
103
            $dbh->do(
104
                q{
105
                ALTER TABLE library_groups
106
                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`
107
            }
108
            );
109
            say $out "Added ft_display_group column to library_groups table";
110
        }
111
    },
112
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+2 lines)
Lines 225-230 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
225
('DisplayClearScreenButton','no','no|issueslip|issueqslip','If set to ON, a clear screen button will appear on the circulation page.','Choice'),
225
('DisplayClearScreenButton','no','no|issueslip|issueqslip','If set to ON, a clear screen button will appear on the circulation page.','Choice'),
226
('displayFacetCount','0',NULL,NULL,'YesNo'),
226
('displayFacetCount','0',NULL,NULL,'YesNo'),
227
('DisplayIconsXSLT','1','','If ON, displays the format, audience, and material type icons in XSLT MARC21 results and detail pages.','YesNo'),
227
('DisplayIconsXSLT','1','','If ON, displays the format, audience, and material type icons in XSLT MARC21 results and detail pages.','YesNo'),
228
('DisplayItemsLog','1',NULL,'If ON, log create/edit/delete actions on display items.','YesNo'),
228
('DisplayLibraryFacets',  'holding',  'home|holding|both',  'Defines which library facets to display.',  'Choice'),
229
('DisplayLibraryFacets',  'holding',  'home|holding|both',  'Defines which library facets to display.',  'Choice'),
229
('DisplayMultiItemHolds','0','','Display the ability to place holds on different items at the same time in staff interface and OPAC','YesNo'),
230
('DisplayMultiItemHolds','0','','Display the ability to place holds on different items at the same time in staff interface and OPAC','YesNo'),
230
('DisplayMultiPlaceHold','1','','Display the ability to place multiple holds or not','YesNo'),
231
('DisplayMultiPlaceHold','1','','Display the ability to place multiple holds or not','YesNo'),
Lines 868-873 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
868
('UseCirculationDesks','0','','Use circulation desks with circulation.','YesNo'),
869
('UseCirculationDesks','0','','Use circulation desks with circulation.','YesNo'),
869
('UseControlNumber','0','','If ON, record control number (w subfields) and control number (001) are used for linking of bibliographic records.','YesNo'),
870
('UseControlNumber','0','','If ON, record control number (w subfields) and control number (001) are used for linking of bibliographic records.','YesNo'),
870
('UseCourseReserves','0',NULL,'Enable the course reserves feature.','YesNo'),
871
('UseCourseReserves','0',NULL,'Enable the course reserves feature.','YesNo'),
872
('UseDisplayModule','0',NULL,'Enable the display module for managing item displays.','YesNo'),
871
('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'),
873
('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'),
872
('useDefaultReplacementCost', '0', NULL, 'default replacement cost defined in item type', 'YesNo'),
874
('useDefaultReplacementCost', '0', NULL, 'default replacement cost defined in item type', 'YesNo'),
873
('useDischarge','0','','Allows librarians to discharge borrowers and borrowers to request a discharge','YesNo'),
875
('useDischarge','0','','Allows librarians to discharge borrowers and borrowers to request a discharge','YesNo'),
(-)a/installer/data/mysql/mandatory/userflags.sql (-1 / +2 lines)
Lines 28-32 INSERT INTO userflags (bit, flag, flagdesc, defaulton) VALUES Link Here
28
(28, 'erm', 'Manage electronic resources', 0),
28
(28, 'erm', 'Manage electronic resources', 0),
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, 'displays', 'Display module', 0)
32
;
33
;
(-)a/installer/data/mysql/mandatory/userpermissions.sql (-2 / +7 lines)
Lines 169-173 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
169
   (25, 'cashup', 'Perform cash register cashup action'),
169
   (25, 'cashup', 'Perform cash register cashup action'),
170
   (25, 'takepayment', 'Access the point of sale page and take payments'),
170
   (25, 'takepayment', 'Access the point of sale page and take payments'),
171
   (26, 'manage_problem_reports', 'Manage OPAC problem reports'),
171
   (26, 'manage_problem_reports', 'Manage OPAC problem reports'),
172
   (27, 'manage_recalls', 'Manage recalls for patrons')
172
   (27, 'manage_recalls', 'Manage recalls for patrons'),
173
   (31, 'add_display', 'Add displays'),
174
   (31, 'edit_display', 'Edit displays'),
175
   (31, 'delete_display', 'Delete displays'),
176
   (31, 'add_items_to_display', 'Add items to displays'),
177
   (31, 'add_items_to_display_from_any_libraries', 'Add items to displays from any libraries'),
178
   (31, 'remove_items_from_display', 'Remove items from displays')
173
;
179
;
174
- 

Return to bug 14962