From 60f655c342485f0c84646169758f906b25947811 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Mon, 1 May 2023 22:10:44 +0000 Subject: [PATCH] Bug 6796: (follow-up) Fix branch_hours.day to enum and add filters --- ..._-_add_ConsiderLibraryHoursWhenIssuing_syspref.pl | 0 .../bug_6796_-_add_branch_hours_table.pl | 2 +- installer/data/mysql/kohastructure.sql | 2 +- .../intranet-tmpl/prog/en/modules/admin/branches.tt | 12 ++++++------ 4 files changed, 8 insertions(+), 8 deletions(-) mode change 100644 => 100755 installer/data/mysql/atomicupdate/bug_6796_-_add_ConsiderLibraryHoursWhenIssuing_syspref.pl diff --git a/installer/data/mysql/atomicupdate/bug_6796_-_add_ConsiderLibraryHoursWhenIssuing_syspref.pl b/installer/data/mysql/atomicupdate/bug_6796_-_add_ConsiderLibraryHoursWhenIssuing_syspref.pl old mode 100644 new mode 100755 diff --git a/installer/data/mysql/atomicupdate/bug_6796_-_add_branch_hours_table.pl b/installer/data/mysql/atomicupdate/bug_6796_-_add_branch_hours_table.pl index e33503257c6..f7a6a300b84 100644 --- a/installer/data/mysql/atomicupdate/bug_6796_-_add_branch_hours_table.pl +++ b/installer/data/mysql/atomicupdate/bug_6796_-_add_branch_hours_table.pl @@ -11,7 +11,7 @@ return { $dbh->do(q{ CREATE TABLE branch_hours ( branchcode varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL, - day int(1) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 0, + day enum('0','1','2','3','4','5','6') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0', open_time time COLLATE utf8mb4_unicode_ci DEFAULT NULL, close_time time COLLATE utf8mb4_unicode_ci DEFAULT NULL, PRIMARY KEY (branchcode, day), diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index aea2a8b95f9..05df4274af8 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1570,7 +1570,7 @@ DROP TABLE IF EXISTS branch_hours; /*!40101 SET character_set_client = utf8 */; CREATE TABLE branch_hours ( branchcode varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL, - day int(1) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 0, + day enum('0','1','2','3','4','5','6') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0', open_time time COLLATE utf8mb4_unicode_ci DEFAULT NULL, close_time time COLLATE utf8mb4_unicode_ci DEFAULT NULL, PRIMARY KEY (branchcode, day), 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 92da642d8d9..44f1befae5d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt @@ -289,21 +289,21 @@ Libraries › Administration › Koha [% IF opening_hours # Existing library %] [% daycount = 0 %] [% FOREACH hr IN opening_hours %] - + [% PROCESS dayname day=daycount %] - + [% IF hr.day == daycount && hr.open_time %] - + [% ELSE %] [% END %] [% IF hr.day == daycount && hr.close_time %] - + [% ELSE %] [% END %] @@ -313,10 +313,10 @@ Libraries › Administration › Koha [% END %] [% ELSE # New library %] [% FOREACH daycount IN [0..6] %] - + [% PROCESS dayname day=daycount %] - + -- 2.30.2