Skip to content

Commit

Permalink
Render version no. dynamically
Browse files Browse the repository at this point in the history
  • Loading branch information
Akshay Kumar committed Jun 13, 2023
1 parent deb189e commit 9b433a7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
11 changes: 11 additions & 0 deletions DependencyInjection/CoreFramework.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

class CoreFramework extends Extension
{
const VERSION = 'v1.1.4';

public function getAlias()
{
return 'uvdesk';
Expand All @@ -43,15 +45,19 @@ 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':
case 'upload_manager':
foreach ($value as $field => $fieldValue) {
$container->setParameter("uvdesk.$param.$field", $fieldValue);
}

break;
case 'default':
foreach ($value as $defaultItem => $defaultItemValue) {
Expand All @@ -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;
}
}
Expand Down
4 changes: 2 additions & 2 deletions Resources/views/dashboard.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@
<div class="uv-area">
{{ uvdesk_extensibles.getRegisteredComponent('Webkul\\UVDesk\\CoreFrameworkBundle\\Dashboard\\Dashboard').getHomepageTemplate().render()|raw }}

{# @TODO: Version number should be loaded dynamically #}
<div class="uv-copyright">
<span class="uv-credit-text">{{ 'Powered by'|trans }} <a href="https://www.uvdesk.com" target="_blank">UVdesk</a></span> | <span class="uv-credit-text">V -1.1.0</span>
<p style="margin: unset; font-size: 14px; line-height: 1.4em;">{{ 'Powered by'|trans }} <a href="https://www.uvdesk.com" target="_blank">Uvdesk</a></p>
<p style="color: #5a5a5a; margin: unset; font-size: 12px; line-height: 1.4em;">Version {{ uvdesk_version }}; Core Version {{ uvdesk_core_version }}</p>
</div>

<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
Expand Down
1 change: 0 additions & 1 deletion Services/TicketService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion Templates/twig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
uvdesk_core_file_system: '@uvdesk.core.file_system.service'
uvdesk_core_version: '%uvdesk.core.version%'

0 comments on commit 9b433a7

Please sign in to comment.