5 description => "Add saved search filters feature",
8 my ($dbh, $out) = @$args{qw(dbh out)};
10 INSERT IGNORE INTO permissions (module_bit, code, description) VALUES
11 (3, 'manage_search_filters', 'Manage custom search filters');
14 say $out "Added new permission 'manage_search_filters'";
16 unless( TableExists( 'search_filters' ) ){
18 CREATE TABLE `search_filters` (
19 `search_filter_id` int(11) NOT NULL AUTO_INCREMENT,
20 `name` varchar(255) NOT NULL COMMENT 'filter name',
21 `query` mediumtext NULL DEFAULT NULL COMMENT 'filter query part',
22 `limits` mediumtext NULL DEFAULT NULL COMMENT 'filter limits part',
23 `opac` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'whether this filter is shown on OPAC',
24 `staff_client` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'whether this filter is shown in staff client',
25 PRIMARY KEY (`search_filter_id`)
26 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
28 say $out "Added new table 'search_filters'";
31 INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
32 ('SavedSearchFilters', '0', NULL, 'Allow staff with permission to create/edit custom search filters', 'YesNo')
35 say $out "Added new system preference 'SavedSearchFilters'";