From 9b433a7794814018d5f07fcb947c0936f9adfb62 Mon Sep 17 00:00:00 2001 From: Akshay Kumar Date: Tue, 13 Jun 2023 18:44:34 +0530 Subject: [PATCH] Render version no. dynamically --- DependencyInjection/CoreFramework.php | 11 +++++++++++ Resources/views/dashboard.html.twig | 4 ++-- Services/TicketService.php | 1 - Templates/twig.yaml | 3 ++- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/DependencyInjection/CoreFramework.php b/DependencyInjection/CoreFramework.php index 966fa4b25..fb1801496 100644 --- a/DependencyInjection/CoreFramework.php +++ b/DependencyInjection/CoreFramework.php @@ -21,6 +21,8 @@ class CoreFramework extends Extension { + const VERSION = 'v1.1.4'; + public function getAlias() { return 'uvdesk'; @@ -43,8 +45,11 @@ public function load(array $configs, ContainerBuilder $container) $services->load('automations.yaml'); } + $container->setParameter("uvdesk.core.version", self::VERSION); + // Load bundle configurations $configuration = $this->getConfiguration($configs, $container); + foreach ($this->processConfiguration($configuration, $configs) as $param => $value) { switch ($param) { case 'support_email': @@ -52,6 +57,7 @@ public function load(array $configs, ContainerBuilder $container) foreach ($value as $field => $fieldValue) { $container->setParameter("uvdesk.$param.$field", $fieldValue); } + break; case 'default': foreach ($value as $defaultItem => $defaultItemValue) { @@ -60,20 +66,25 @@ public function load(array $configs, ContainerBuilder $container) foreach ($defaultItemValue as $template => $templateValue) { $container->setParameter("uvdesk.default.templates.$template", $templateValue); } + break; case 'ticket': foreach ($defaultItemValue as $option => $optionValue) { $container->setParameter("uvdesk.default.ticket.$option", $optionValue); } + break; default: $container->setParameter("uvdesk.default.$defaultItem", $defaultItemValue); + break; } } + break; default: $container->setParameter("uvdesk.$param", $value); + break; } } diff --git a/Resources/views/dashboard.html.twig b/Resources/views/dashboard.html.twig index e72aeb3cb..41c60bb31 100644 --- a/Resources/views/dashboard.html.twig +++ b/Resources/views/dashboard.html.twig @@ -216,9 +216,9 @@
{{ uvdesk_extensibles.getRegisteredComponent('Webkul\\UVDesk\\CoreFrameworkBundle\\Dashboard\\Dashboard').getHomepageTemplate().render()|raw }} - {# @TODO: Version number should be loaded dynamically #}
diff --git a/Services/TicketService.php b/Services/TicketService.php index bc31e388f..3c257522e 100644 --- a/Services/TicketService.php +++ b/Services/TicketService.php @@ -235,7 +235,6 @@ public function createTicket(array $params = []) } $params['role'] = 4; - $params['mailboxEmail'] = current($params['replyTo']); $params['customer'] = $params['user'] = $user; return $this->createTicketBase($params); diff --git a/Templates/twig.yaml b/Templates/twig.yaml index 17390c2a0..804d5914d 100644 --- a/Templates/twig.yaml +++ b/Templates/twig.yaml @@ -13,4 +13,5 @@ twig: csrf_token_generator: "@security.csrf.token_manager" email_service: "@email.service" uvdesk_extensibles: '@uvdesk.extensibles' - uvdesk_core_file_system: '@uvdesk.core.file_system.service' \ No newline at end of file + uvdesk_core_file_system: '@uvdesk.core.file_system.service' + uvdesk_core_version: '%uvdesk.core.version%' \ No newline at end of file