From ec989bb3f7bff4fe44fcada8497af0abca2d6688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20V=C3=A4nttinen?= Date: Wed, 13 Sep 2023 12:33:42 +0300 Subject: [PATCH 1/4] TMS-973: Update changelog --- CHANGELOG.MD | 2 ++ style.css | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 82e61764..151d4611 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [1.48.0] - 2023-09-13 + - TMS-973: Fix manual event sorting ## [1.47.0] - 2023-09-04 diff --git a/style.css b/style.css index e592197b..2ffc4d9c 100644 --- a/style.css +++ b/style.css @@ -2,7 +2,7 @@ * Theme Name: TMS Theme Base * Description: Tampere Multisite Base Theme * Domain Path: /lang - * Version: 1.45.0 + * Version: 1.48.0 * Author: Geniem * Author URI: https://geniem.fi * Text Domain: tms-theme-base From 64084924c15bef95e9644d40de582c7a5f4ad275 Mon Sep 17 00:00:00 2001 From: aerkkilae Date: Fri, 15 Sep 2023 11:16:10 +0300 Subject: [PATCH 2/4] TMS-962: Add Lunch Menus plugin caps to roles. (#474) * TMS-962: Add Lunch Menus plugin caps to roles. * Add LunchMenublock. --- CHANGELOG.MD | 3 +++ lib/BlocksController.php | 6 ++++++ lib/Roles.php | 25 ++++++++++++++++++++++++- 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 151d4611..50f95ab7 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -7,10 +7,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +- TMS-962: Add Lunch Menus plugin caps to roles. + ## [1.48.0] - 2023-09-13 - TMS-973: Fix manual event sorting + ## [1.47.0] - 2023-09-04 - TMS-964-2: Update translation and format pricing. diff --git a/lib/BlocksController.php b/lib/BlocksController.php index 29717aab..ffa1d871 100644 --- a/lib/BlocksController.php +++ b/lib/BlocksController.php @@ -297,6 +297,12 @@ private function allowed_block_types( $allowed_blocks, $context ) { PostType\Contact::SLUG, ], ], + 'acf/lunch-menu' => [ + 'post_types' => [ + PostType\Page::SLUG, + PostType\Post::SLUG, + ], + ], ]; $blocks = apply_filters( diff --git a/lib/Roles.php b/lib/Roles.php index af298bc3..d94dd46f 100644 --- a/lib/Roles.php +++ b/lib/Roles.php @@ -172,6 +172,27 @@ class Roles implements Controller { 'edit_manual_events', ]; + /** + * Lunch Menu / lunch-menu-cpt. + * + * @var array + */ + private $lunch_menus_all_capabilities = [ + 'edit_lunch_menu', + 'read_lunch_menu', + 'delete_lunch_menu', + 'edit_others_lunch_menus', + 'delete_lunch_menus', + 'publish_lunch_menus', + 'read_private_lunch_menus', + 'delete_private_lunch_menus', + 'delete_published_lunch_menus', + 'delete_others_lunch_menus', + 'edit_private_lunch_menus', + 'edit_published_lunch_menus', + 'edit_lunch_menus', + ]; + /** * Base taxonomy capabilities, only for admins. * @@ -207,7 +228,7 @@ class Roles implements Controller { 'delete_material_types', 'assign_material_types', ]; - + /** * Manual Event Category taxonomy * @@ -494,6 +515,7 @@ private function modify_editor_caps() : void { $role->add_caps( $this->contact_all_capabilities ); $role->add_caps( $this->dynamic_event_all_capabilities ); $role->add_caps( $this->manual_event_all_capabilities ); + $role->add_caps( $this->lunch_menus_all_capabilities ); // Taxonomies $role->add_caps( $this->taxonomy_category_all_capabilities ); @@ -548,6 +570,7 @@ private function modify_author_caps() : void { $role->add_caps( $this->contact_all_capabilities ); $role->add_caps( $this->dynamic_event_all_capabilities ); $role->add_caps( $this->manual_event_all_capabilities ); + $role->add_caps( $this->lunch_menus_all_capabilities ); // Taxonomies $role->add_caps( [ From ccf1dd862ce1d4aabf53544216d66ec4194e9101 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arttu=20Erkkil=C3=A4?= Date: Fri, 15 Sep 2023 11:17:16 +0300 Subject: [PATCH 3/4] 1.49.0 --- CHANGELOG.MD | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 50f95ab7..17621bab 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [1.49.0] - 2023-09-15 + - TMS-962: Add Lunch Menus plugin caps to roles. ## [1.48.0] - 2023-09-13 From 07642c69ba3050781400dbcc9c33530d34fa5691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arttu=20Erkkil=C3=A4?= Date: Wed, 27 Sep 2023 14:14:49 +0300 Subject: [PATCH 4/4] TMS-950: Empty check for phone repeater. --- CHANGELOG.MD | 2 ++ lib/Formatters/ContactFormatter.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 17621bab..6f030af8 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +- TMS-950: Empty check for phone repeater. + ## [1.49.0] - 2023-09-15 - TMS-962: Add Lunch Menus plugin caps to roles. diff --git a/lib/Formatters/ContactFormatter.php b/lib/Formatters/ContactFormatter.php index cce03568..715d2209 100644 --- a/lib/Formatters/ContactFormatter.php +++ b/lib/Formatters/ContactFormatter.php @@ -150,7 +150,7 @@ public function map_keys( array $posts, array $field_keys, $default_image = null $fields = $this->append_image( $fields, $field_key, $default_image ); } - if ( isset( $fields['phone_repeater'] ) ) { + if ( ! empty( $fields['phone_repeater'] ) ) { $fields['phone_repeater'] = array_filter( $fields['phone_repeater'], function ( $item ) { return ! empty( $item['phone_text'] ) || ! empty( $item['phone_number'] ); } );