Bugzilla – Attachment 150725 Details for
Bug 32721
Allow specifying UserCSS and UserJS at library level for the OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32721: Database update to add userjs and usercss to branches table
Bug-32721-Database-update-to-add-userjs-and-usercs.patch (text/plain), 3.42 KB, created by
Nick Clemens (kidclamp)
on 2023-05-05 11:23:11 UTC
(
hide
)
Description:
Bug 32721: Database update to add userjs and usercss to branches table
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2023-05-05 11:23:11 UTC
Size:
3.42 KB
patch
obsolete
>From 7950a365963558bbdd453f7f3671a1966dec8544 Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Fri, 27 Jan 2023 12:55:17 +0000 >Subject: [PATCH] Bug 32721: Database update to add userjs and usercss to > branches table > >This patch adds the columns for userjs and usercss to the branches table > >Test plan as per previous commit > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > api/v1/swagger/definitions/library.yaml | 10 ++++++++ > .../bug_32721-add_branch_level_js.pl | 25 +++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 2 ++ > 3 files changed, 37 insertions(+) > create mode 100644 installer/data/mysql/atomicupdate/bug_32721-add_branch_level_js.pl > >diff --git a/api/v1/swagger/definitions/library.yaml b/api/v1/swagger/definitions/library.yaml >index de010c50d3..24d88b588f 100644 >--- a/api/v1/swagger/definitions/library.yaml >+++ b/api/v1/swagger/definitions/library.yaml >@@ -107,6 +107,16 @@ properties: > public: > type: boolean > description: If the library is visible to the public >+ userjs: >+ type: >+ - string >+ - "null" >+ description: Any branch-specific UserJS for the OPAC >+ usercss: >+ type: >+ - string >+ - "null" >+ description: Any branch-specific UserCSS for the OPAC > smtp_server: > type: > - object >diff --git a/installer/data/mysql/atomicupdate/bug_32721-add_branch_level_js.pl b/installer/data/mysql/atomicupdate/bug_32721-add_branch_level_js.pl >new file mode 100644 >index 0000000000..4471d96eef >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_32721-add_branch_level_js.pl >@@ -0,0 +1,25 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "32721", >+ description => "Allow branch specific javascript and css to be injected into the OPAC depending on a branchcode", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ >+ if( !column_exists( 'branches', 'userjs' ) ) { >+ $dbh->do(q{ >+ ALTER TABLE branches ADD COLUMN `userjs` longtext DEFAULT NULL AFTER `public` >+ }); >+ >+ say $out "Added column 'branches.userjs'"; >+ } >+ if( !column_exists( 'branches', 'usercss' ) ) { >+ $dbh->do(q{ >+ ALTER TABLE branches ADD COLUMN `usercss` longtext DEFAULT NULL AFTER `userjs` >+ }); >+ >+ say $out "Added column 'branches.usercss'"; >+ } >+ }, >+}; >\ No newline at end of file >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 50796112dc..63c54256e8 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1558,6 +1558,8 @@ CREATE TABLE `branches` ( > `marcorgcode` varchar(16) DEFAULT NULL COMMENT 'MARC Organization Code, see http://www.loc.gov/marc/organizations/orgshome.html, when empty defaults to syspref MARCOrgCode', > `pickup_location` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'the ability to act as a pickup location', > `public` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'whether this library should show in the opac', >+ `userjs` longtext DEFAULT NULL COMMENT 'branch specific javascript for the OPAC', >+ `usercss` longtext DEFAULT NULL COMMENT 'branch specific css for the OPAC', > PRIMARY KEY (`branchcode`) > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > /*!40101 SET character_set_client = @saved_cs_client */; >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 32721
:
145731
|
145732
|
145733
|
145734
|
145735
|
145754
|
145759
|
146159
|
146160
|
146161
|
146162
|
146163
|
146164
|
147373
|
149860
|
149861
|
149862
|
149863
|
149864
|
149865
|
149866
|
150713
|
150724
|
150725
|
150726
|
150727
|
150728
|
150729
|
150730
|
150731
|
150732
|
150754
|
150755
|
150756
|
150757
|
150758
|
156157
|
156158
|
156159
|
156160
|
156161
|
156162
|
156163
|
156164
|
157335