From 1a201d698f6b0ca12090f029f9210a23cd9f9034 Mon Sep 17 00:00:00 2001 From: Lucas Gass 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 ) %][% ELSE %][% END %] -[% SET library_color = Branches.GetLoggedInBranch.library_color %] -[% IF library_color %] +[% SET ui_staff_customization = Branches.GetLoggedInBranch.ui_staff_customization %] +[% IF ui_staff_customization %] [% 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 @@
- - + + Clear
@@ -759,7 +759,7 @@
  • Library color - [% library.library_color | html %] + [% library.ui_staff_customization | html %]
  • @@ -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( "" ); }); [% END %] -- 2.39.5