Bugzilla – Attachment 184831 Details for
Bug 37054
Allow for custom library colors in the staff interface
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37054: Rename column as ui_staff_customization
Bug-37054-Rename-column-as-uistaffcustomization.patch (text/plain), 9.62 KB, created by
Lucas Gass (lukeg)
on 2025-07-29 17:15:38 UTC
(
hide
)
Description:
Bug 37054: Rename column as ui_staff_customization
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2025-07-29 17:15:38 UTC
Size:
9.62 KB
patch
obsolete
>From 1a201d698f6b0ca12090f029f9210a23cd9f9034 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Tue, 29 Jul 2025 17:13:09 +0000 >Subject: [PATCH] Bug 37054: Rename column as ui_staff_customization > >--- > Koha/Library.pm | 46 +++++++++---------- > Koha/Schema/Result/Branch.pm | 6 +-- > admin/branches.pl | 2 +- > api/v1/swagger/definitions/library.yaml | 2 +- > .../atomicupdate/bug_37054_add_branchcolor.pl | 8 ++-- > installer/data/mysql/kohastructure.sql | 2 +- > .../prog/en/includes/doc-head-open.inc | 7 +-- > .../prog/en/modules/admin/branches.tt | 12 ++--- > 8 files changed, 43 insertions(+), 42 deletions(-) > >diff --git a/Koha/Library.pm b/Koha/Library.pm >index 6b3189fc5e7..f5e68cdca7f 100644 >--- a/Koha/Library.pm >+++ b/Koha/Library.pm >@@ -348,29 +348,29 @@ on the API. > > sub to_api_mapping { > return { >- branchcode => 'library_id', >- branchname => 'name', >- branchaddress1 => 'address1', >- branchaddress2 => 'address2', >- branchaddress3 => 'address3', >- branchzip => 'postal_code', >- branchcity => 'city', >- branchstate => 'state', >- branchcountry => 'country', >- branchphone => 'phone', >- branchfax => 'fax', >- branchemail => 'email', >- branchillemail => 'ill_email', >- branchreplyto => 'reply_to_email', >- branchreturnpath => 'return_path_email', >- branchurl => 'url', >- issuing => undef, >- branchip => 'ip', >- branchnotes => 'notes', >- marcorgcode => 'marc_org_code', >- opacusercss => undef, >- opacuserjs => undef, >- library_color => undef >+ branchcode => 'library_id', >+ branchname => 'name', >+ branchaddress1 => 'address1', >+ branchaddress2 => 'address2', >+ branchaddress3 => 'address3', >+ branchzip => 'postal_code', >+ branchcity => 'city', >+ branchstate => 'state', >+ branchcountry => 'country', >+ branchphone => 'phone', >+ branchfax => 'fax', >+ branchemail => 'email', >+ branchillemail => 'ill_email', >+ branchreplyto => 'reply_to_email', >+ branchreturnpath => 'return_path_email', >+ branchurl => 'url', >+ issuing => undef, >+ branchip => 'ip', >+ branchnotes => 'notes', >+ marcorgcode => 'marc_org_code', >+ opacusercss => undef, >+ opacuserjs => undef, >+ ui_staff_customization => undef > }; > } > >diff --git a/Koha/Schema/Result/Branch.pm b/Koha/Schema/Result/Branch.pm >index 4afc605c7cd..f5b0063f874 100644 >--- a/Koha/Schema/Result/Branch.pm >+++ b/Koha/Schema/Result/Branch.pm >@@ -206,9 +206,9 @@ branch specific javascript for the OPAC > > branch specific css for the OPAC > >-=head2 library_color >+=head2 ui_staff_customization > >- data_type: 'varchar' >+ data_type: 'longtext' > is_nullable: 1 > size: 16 > >@@ -267,7 +267,7 @@ __PACKAGE__->add_columns( > { data_type => "longtext", is_nullable => 1 }, > "opacusercss", > { data_type => "longtext", is_nullable => 1 }, >- "library_color", >+ "ui_staff_customization", > { data_type => "varchar", is_nullable => 1, size => 16 }, > ); > >diff --git a/admin/branches.pl b/admin/branches.pl >index 0d084f26aec..611a0b3b6a4 100755 >--- a/admin/branches.pl >+++ b/admin/branches.pl >@@ -98,7 +98,7 @@ if ( $op eq 'add_form' ) { > public > opacuserjs > opacusercss >- library_color >+ ui_staff_customization > ); > my $is_a_modif = $input->param('is_a_modif'); > >diff --git a/api/v1/swagger/definitions/library.yaml b/api/v1/swagger/definitions/library.yaml >index e535073f4f5..d9889c0f615 100644 >--- a/api/v1/swagger/definitions/library.yaml >+++ b/api/v1/swagger/definitions/library.yaml >@@ -97,7 +97,7 @@ properties: > - "null" > description: geolocation of your library > maxLength: 255 >- library_color: >+ ui_staff_customization: > type: > - string > - "null" >diff --git a/installer/data/mysql/atomicupdate/bug_37054_add_branchcolor.pl b/installer/data/mysql/atomicupdate/bug_37054_add_branchcolor.pl >index 669ea04751f..d5f02fe9923 100755 >--- a/installer/data/mysql/atomicupdate/bug_37054_add_branchcolor.pl >+++ b/installer/data/mysql/atomicupdate/bug_37054_add_branchcolor.pl >@@ -3,20 +3,20 @@ use Koha::Installer::Output qw(say_warning say_failure say_success say_info); > > return { > bug_number => "37054", >- description => "Add branches.library_color", >+ description => "Add branches.ui_staff_customization", > up => sub { > my ($args) = @_; > my ( $dbh, $out ) = @$args{qw(dbh out)}; > >- if ( !column_exists( 'branches', 'library_color' ) ) { >+ if ( !column_exists( 'branches', 'ui_staff_customization' ) ) { > $dbh->do( > q{ > ALTER TABLE branches >- ADD COLUMN `library_color` varchar(16) DEFAULT 0 COMMENT 'defines the branch color' >+ ADD COLUMN `ui_staff_customization` LONGTEXT DEFAULT 0 COMMENT 'defines the branch color' > AFTER `opacusercss` > } > ); > } >- say $out "Added column 'branch.library_color'"; >+ say $out "Added column 'branch.ui_staff_customization'"; > }, > }; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index a86792fe239..e964e5be3e3 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1678,7 +1678,7 @@ CREATE TABLE `branches` ( > `public` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'whether this library should show in the opac', > `opacuserjs` longtext DEFAULT NULL COMMENT 'branch specific javascript for the OPAC', > `opacusercss` longtext DEFAULT NULL COMMENT 'branch specific css for the OPAC', >- `library_color` varchar(16) DEFAULT NULL COMMENT 'library specific color', >+ `ui_staff_customization` longtext DEFAULT NULL COMMENT 'branch specific UI customizations', > PRIMARY KEY (`branchcode`) > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > /*!40101 SET character_set_client = @saved_cs_client */; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-open.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-open.inc >index 564ab68e111..18eb86ca410 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-open.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-open.inc >@@ -3,6 +3,7 @@ > > [% USE Koha %] > [% USE raw %] >+[% USE Branches %] > [% USE Dumper( Indent=1, SortKeys=1 ) %] > > [% IF Koha.Preference('DumpSearchQueryTemplate') %] >@@ -33,11 +34,11 @@ > > [% IF ( bidi ) %]<html lang="[% lang | html %]" dir="[% bidi | html %]">[% ELSE %]<html lang="[% lang | html %]">[% END %] > <head> >-[% SET library_color = Branches.GetLoggedInBranch.library_color %] >-[% IF library_color %] >+[% SET ui_staff_customization = Branches.GetLoggedInBranch.ui_staff_customization %] >+[% IF ui_staff_customization %] > <style> > :root { >- --library-color: [% library_color %] >+ --library-color: [% ui_staff_customization | html %] > } > </style> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt >index 8a167affa91..295f4ed77e7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt >@@ -512,8 +512,8 @@ > <label for="colorpicker">Primary branch color: </label> > </div> > <div class="fg-input"> >- <input type="color" name="colorpicker" id="colorpicker" value="[% library.library_color | html %]" /> >- <input type="text" name="library_color" id="library_color" readonly="readonly" size="10" maxlength="16" value="[% library.library_color | html %]" /> >+ <input type="color" name="colorpicker" id="colorpicker" value="[% library.ui_staff_customization | html %]" /> >+ <input type="text" name="ui_staff_customization" id="ui_staff_customization" readonly="readonly" size="10" maxlength="16" value="[% library.ui_staff_customization | html %]" /> > <a href="#" class="clear_color"><i class="fa fa-fw fa-trash-can"></i> Clear</a> > </div> > </div> >@@ -759,7 +759,7 @@ > </li> > <li> > <span class="label">Library color</span> >- [% library.library_color | html %] >+ [% library.ui_staff_customization | html %] > </li> > </ol> > </div> >@@ -1033,13 +1033,13 @@ > $( "#" + target ).hide(); > }); > $("#colorpicker").on("change", function(){ >- let library_color = this.value; >- $("#library_color").val( library_color ); >+ let ui_staff_customization = this.value; >+ $("#ui_staff_customization").val( ui_staff_customization ); > }); > > $(".clear_color").on("click", function(e){ > e.preventDefault(); >- $("#library_color, #colorpicker").val( "" ); >+ $("#ui_staff_customization, #colorpicker").val( "" ); > }); > </script> > [% END %] >-- >2.39.5
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 37054
:
167577
|
167578
|
167579
|
167590
|
167595
|
167596
|
167597
|
167598
|
167609
|
167612
|
167613
|
167614
|
167615
|
167616
|
167618
|
167625
|
171221
|
171222
|
171223
|
171224
|
171225
|
171226
|
175991
|
175992
|
175993
|
175994
|
175995
|
175996
|
176014
|
176015
|
176016
|
176615
|
176616
|
180329
|
180330
|
180331
|
180332
|
180333
|
180334
|
184825
|
184826
|
184827
|
184828
|
184829
|
184830
| 184831 |
184838
|
184903