From 9102f9cd2a78e7506fd8df918d62b6d5c811ae85 Mon Sep 17 00:00:00 2001 From: Martin Stenberg Date: Fri, 18 Sep 2015 14:30:39 +0200 Subject: [PATCH] Bug 8628: Digital signs - db changes - Adding edit_digital_signs permission for managing digital signs - Adding OPACDigitalSigns, OPACDigitalSignsCSS and OPACDigitalSignsSwatches system preferences - Adding signs, sign_streams and signs_to_streams tables - Updating sysprefs.sql and kohastructure.sql Signed-off-by: Lisette Scheer --- .../bug_8628-digital-signs-permissions.perl | 7 ++++ .../bug_8628-digital-signs-sysprefs.perl | 11 +++++ .../mysql/atomicupdate/bug_8628-digital-signs.perl | 37 +++++++++++++++++ installer/data/mysql/kohastructure.sql | 45 +++++++++++++++++++++ installer/data/mysql/sysprefs.sql | 5 ++- tools/.nfs00000000028807d100000006 | Bin 0 -> 12288 bytes 6 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug_8628-digital-signs-permissions.perl create mode 100644 installer/data/mysql/atomicupdate/bug_8628-digital-signs-sysprefs.perl create mode 100644 installer/data/mysql/atomicupdate/bug_8628-digital-signs.perl create mode 100644 tools/.nfs00000000028807d100000006 diff --git a/installer/data/mysql/atomicupdate/bug_8628-digital-signs-permissions.perl b/installer/data/mysql/atomicupdate/bug_8628-digital-signs-permissions.perl new file mode 100644 index 0000000..1d17026 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_8628-digital-signs-permissions.perl @@ -0,0 +1,7 @@ +$DBversion = 'XXX'; +if( CheckVersion( $DBversion ) ) { + $dbh->do(q{INSERT IGNORE INTO permissions (module_bit, code, description) VALUES (13, 'edit_digital_signs', 'Create and edit digital signs for the OPAC') }); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 8628 - adding permission for managing digital signs)\n"; +} diff --git a/installer/data/mysql/atomicupdate/bug_8628-digital-signs-sysprefs.perl b/installer/data/mysql/atomicupdate/bug_8628-digital-signs-sysprefs.perl new file mode 100644 index 0000000..38c1c5d --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_8628-digital-signs-sysprefs.perl @@ -0,0 +1,11 @@ +$DBversion = 'XXX'; +if( CheckVersion( $DBversion ) ) { + $dbh->do(q{INSERT IGNORE INTO systempreferences (`variable`,`value`,`options`,`explanation`,`type`) VALUES + ('OPACDigitalSigns',0,NULL,'Turn digital signs in the OPAC on or off.','YesNo'), + ('OPACDigitalSignsCSS','',NULL,'Extra CSS to be included in all signs','Textarea'), + ('OPACDigitalSignsSwatches','abcde',NULL,'List the swatches that can be chosen when creating a new sign','free') + }); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 8628 - Adding OPACDigitalSigns, OPACDigitalSignsCSS and OPACDigitalSignsSwatches system preferences)\n"; +} diff --git a/installer/data/mysql/atomicupdate/bug_8628-digital-signs.perl b/installer/data/mysql/atomicupdate/bug_8628-digital-signs.perl new file mode 100644 index 0000000..54e24c1 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_8628-digital-signs.perl @@ -0,0 +1,37 @@ +$DBversion = 'XXX'; +if( CheckVersion( $DBversion ) ) { + $dbh->do(q{DROP TABLE IF EXISTS sign_streams }); + $dbh->do(q{DROP TABLE IF EXISTS signs }); + $dbh->do(q{CREATE TABLE sign_streams ( + sign_stream_id int(11) NOT NULL auto_increment, -- primary key, used to identify streams + saved_sql_id int(11) NOT NULL, -- foreign key from the saved_sql table + name varchar(64), -- name/title of the sign + PRIMARY KEY (sign_stream_id), + CONSTRAINT sign_streams_ibfk_1 FOREIGN KEY (saved_sql_id) REFERENCES saved_sql (id) ON DELETE CASCADE + ) ENGINE=InnoDB DEFAULT CHARSET=utf8 }); + $dbh->do(q{CREATE TABLE signs ( + sign_id int(11) NOT NULL auto_increment, -- primary key, used to identify signs + name varchar(64), -- name/title of the deck + webapp int(1) NOT NULL DEFAULT 0, -- display as web app or normal page + transition char(16) NOT NULL DEFAULT 'none', -- transition to use between pages, must be one of the transitions defined by jQuery Mobile (see their docs) + swatch char(1) NOT NULL DEFAULT '', -- swatches determine the colors of page elements + idleafter int(11) NOT NULL default 0, -- seconds to wait before automatic page turning cicks in + pagedelay int(11) NOT NULL default 0, -- seconds to wait before turning to a new page/record + reloadafter int(11) NOT NULL default 0, -- seconds to wait before reloading all the pages + PRIMARY KEY (sign_id) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8 }); + + $dbh->do(q{DROP TABLE IF EXISTS signs_to_streams }); + $dbh->do(q{CREATE TABLE signs_to_streams ( + sign_to_stream_id int(11) NOT NULL auto_increment, -- primary key, used to identify connections between signs and streams (the same stream can be attached to a sign more than once, with different parameters) + sign_stream_id int(11) NOT NULL, -- foreign key from the decks sign_streams table + sign_id int(11) NOT NULL, -- foreign key from the signs table + params varchar(255) NOT NULL DEFAULT '', -- list of parameters for the SQL associated with the sign_stream + PRIMARY KEY (sign_to_stream_id), + CONSTRAINT signs_to_streams_ibfk_1 FOREIGN KEY (sign_stream_id) REFERENCES sign_streams (sign_stream_id) ON DELETE CASCADE, + CONSTRAINT signs_to_streams_ibfk_2 FOREIGN KEY (sign_id) REFERENCES signs (sign_id) ON DELETE CASCADE + ) ENGINE=InnoDB DEFAULT CHARSET=utf8 }); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 8628 - add signs, sign_streams and signs_to_streams tables)\n"; +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 8ec1791..0b609c2 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -4415,6 +4415,51 @@ CREATE TABLE return_claims ( CONSTRAINT `rc_resolved_by_ibfk` FOREIGN KEY (`resolved_by`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +-- +-- Table structure for table 'sign_streams' +-- + +DROP TABLE IF EXISTS sign_streams; +CREATE TABLE sign_streams ( + `sign_stream_id` int(11) NOT NULL auto_increment, -- primary key, used to identify streams + `saved_sql_id` int(11) NOT NULL, -- foreign key from the saved_sql table + `name` varchar(64), -- name/title of the sign + PRIMARY KEY (`sign_stream_id`), + CONSTRAINT `sign_streams_ibfk_1` FOREIGN KEY (`saved_sql_id`) REFERENCES `saved_sql` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Table structure for table 'signs' +-- + +DROP TABLE IF EXISTS signs; +CREATE TABLE signs ( + `sign_id` int(11) NOT NULL auto_increment, -- primary key, used to identify signs + `name` varchar(64), -- name/title of the deck + `webapp` int(1) NOT NULL DEFAULT 0, -- display as web app or normal page + `transition` char(16) NOT NULL DEFAULT 'none', -- transition to use between pages, must be one of the transitions defined by jQuery Mobile (see their docs) + `swatch` char(1) NOT NULL DEFAULT '', -- swatches determine the colors of page elements + `idleafter` int(11) NOT NULL default 0, -- seconds to wait before automatic page turning clicks in + `pagedelay` int(11) NOT NULL default 0, -- seconds to wait before turning to a new page/record + `reloadafter` int(11) NOT NULL default 0, -- seconds to wait before reloading all the pages + PRIMARY KEY (`sign_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Table structure for table 'signs_to_streams' +-- + +DROP TABLE IF EXISTS signs_to_streams; +CREATE TABLE signs_to_streams ( + `sign_to_stream_id` int(11) NOT NULL auto_increment, -- primary key, used to identify connections between signs and streams (the same stream can be attached to a sign more than once, with different parameters) + `sign_stream_id` int(11) NOT NULL, -- foreign key from the decks sign_streams table + `sign_id` int(11) NOT NULL, -- foreign key from the signs table + `params` varchar(255) NOT NULL DEFAULT '', -- list of parameters for the SQL associated with the sign_stream + PRIMARY KEY (`sign_to_stream_id`), + CONSTRAINT `signs_to_streams_ibfk_1` FOREIGN KEY (`sign_stream_id`) REFERENCES `sign_streams` (`sign_stream_id`) ON DELETE CASCADE, + CONSTRAINT `signs_to_streams_ibfk_2` FOREIGN KEY (`sign_id`) REFERENCES `signs` (`sign_id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index b565b7f..0884219 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -93,7 +93,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('BatchCheckoutsValidCategories','',NULL,'Patron categories allowed to checkout in a batch','Free'), ('BiblioAddsAuthorities','0',NULL,'If ON, adding a new biblio will check for an existing authority record and create one on the fly if one doesn\'t exist','YesNo'), ('BiblioDefaultView','normal','normal|marc|isbd','Choose the default detail view in the catalog; choose between normal, marc or isbd','Choice'), -('BibtexExportAdditionalFields', '', NULL , 'Define additional BibTex tags to export from MARC records in YAML format as an associative array with either a marc tag/subfield combination as the value, or a list of tag/subfield combinations.', 'textarea'), +('BibtexExportAdditionalFields', '', NULL, 'Define additional BibTex tags to export from MARC records in YAML format as an associative array with either a marc tag/subfield combination as the value, or a list of tag/subfield combinations.', 'textarea'), ('BlockExpiredPatronOpacActions','1',NULL,'Set whether an expired patron can perform opac actions such as placing holds or renew books, can be overridden on a per patron-type basis','YesNo'), ('BlockReturnOfLostItems','0','0','If enabled, items that are marked as lost cannot be returned.','YesNo'), ('BlockReturnOfWithdrawnItems','1','0','If enabled, items that are marked as withdrawn cannot be returned.','YesNo'), @@ -375,6 +375,9 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('OPACdefaultSortField','relevance','relevance|popularity|call_number|pubdate|acqdate|title|author','Specify the default field used for sorting','Choice'), ('OPACdefaultSortOrder','dsc','asc|dsc|za|az','Specify the default sort order','Choice'), ('OPACdidyoumean','',NULL,'Did you mean? configuration for the OPAC. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'), +('OPACDigitalSigns',0,NULL, 'Turn digital signs in the OPAC on or off.','YesNo'), +('OPACDigitalSignsCSS','',NULL,'Extra CSS to be included in all signs','Textarea'), +('OPACDigitalSignsSwatches','abcde',NULL,'List the swatches that can be chosen when creating a new sign','free'), ('OPACDisplay856uAsImage','OFF','OFF|Details|Results|Both','Display the URI in the 856u field as an image, the corresponding OPACXSLT option must be on','Choice'), ('OpacExportOptions','bibtex,dc,marcxml,marc8,utf8,marcstd,mods,ris,isbd','','Define export options available on OPAC detail page.','multiple'), ('OPACFallback', 'prog', 'bootstrap|prog', 'Define the fallback theme for the OPAC interface.', 'Themes'), diff --git a/tools/.nfs00000000028807d100000006 b/tools/.nfs00000000028807d100000006 new file mode 100644 index 0000000000000000000000000000000000000000..a73a1f3c28fa6f94e65ac85bda5e34ff28f148c6 GIT binary patch literal 12288 zcmeI2&u<$=6vwAMAn~IVm4D#nhg1hS-jo(WZ4${uNovRs%W>YJ?XEQr% zV}-z#Q%@X`sKf$_o z-IX^RJM?np2E+9nW50hC-g$|AaPj*m85{C}=CQFO=U#VJzKH|Pu#9k@x7yflGn(pQZI0BAAL>Di&|jAr z`vdwMI)W1DZRifP1>J;}pueAC>=)=~=sV~`=pOVIbQ8J){rNOwUqhckpFsDakD(?s z56wZBp`Q@*SJ0Qx7m&^27;={*;0QPZj({WJ2si?c!2gqg%1n}(PGF+2Gm<92CzEsn zfy1OarNyI6=y91AdrIAv0w0Wsl8_s*ymmUXhOd-0Mz|6Y`!XIFK1gkoR@Z28rjOaa zqTN$bBw~}!+D!V&Y~~pW*E}jQ7L6b9MXNLrrqfedY&zX>2hZ%JhMO!ctst5i>xoy) zcmoGstJRhmN-;{8*HXcCFX)6al1BKYW8z7o)lm30s1-U{T3*ZjPZK=JQ?P0HqMHru zhvLGFYh^ZR^+O=g;wY0E-f|GflpnISuCKmul}@I{JTpP8%$d1;_;l2a6ESgX?--qz zvB8O8Vdkf1d6j1DU{+L)O?oGF>%=^=F0H5k9Q-vCr^l9IX>tQLVP^$~hW&4=JrTwcN`W?X+D7 z#GhJy7+$ z(P&f|#92k@ffvf2h*OcSRWSQdWt0Xg3w;XsP>>cqA??!P)KkfrRG&;BXlwU?wnQv6 z52=}T;exhL-LM6CdH68(m8M8(ft6;s3{(5iosHJ|t@>`e{#s+Z(LN-YY&P1v8~gjT zx!0mPHS4W*WBp*e-lFC~tGTzoQK5aLgHSO2cB6f3@1RZf-9x%vZ?)j*u$B|RMkX;7 zaUQe8_Lj(G#I-$lZgat8yLU*YoHRgE-SJGeeH%+!#8R^fP>;u`_7sCn8cW{G>*dS- l7#(@W?Etv?G87gYUSq~aVlh^*{N}tY)m~S|UV;V5{s9J?0Ve