From 7cef79f1c1de91737e964d5cbed719a1f8dfd80c Mon Sep 17 00:00:00 2001 From: Alexandr Kolomiec Date: Thu, 25 Aug 2016 18:08:55 +0300 Subject: [PATCH] add version notification support --- Controller/ConfigurationController.php | 37 +++++++++++++++++++ DependencyInjection/Configuration.php | 3 +- .../DiamanteEmailProcessingExtension.php | 1 + Form/Type/HelpChannelsConfigurationType.php | 29 +++++++++++++++ Resources/config/assets.yml | 3 ++ Resources/config/form.xml | 16 ++++++++ Resources/config/oro/routing.yml | 3 ++ Resources/config/oro/twig.yml | 2 + Resources/public/css/diam.css | 10 +++++ .../Configuration/block/system.html.twig | 7 ++++ Resources/views/Form/fields.html.twig | 8 ++++ 11 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 Controller/ConfigurationController.php create mode 100644 Form/Type/HelpChannelsConfigurationType.php create mode 100644 Resources/config/assets.yml create mode 100644 Resources/config/form.xml create mode 100644 Resources/config/oro/routing.yml create mode 100644 Resources/config/oro/twig.yml create mode 100755 Resources/public/css/diam.css create mode 100644 Resources/views/Configuration/block/system.html.twig create mode 100644 Resources/views/Form/fields.html.twig diff --git a/Controller/ConfigurationController.php b/Controller/ConfigurationController.php new file mode 100644 index 0000000..d53711d --- /dev/null +++ b/Controller/ConfigurationController.php @@ -0,0 +1,37 @@ +get('diamante.version.service'); + $versions = sprintf('%s|%s', $versionService->getDiamanteVersion(), $versionService->getOroVersion()); + + return ['versions' => base64_encode($versions)]; + } +} diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index f131c29..3f6f184 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -56,7 +56,8 @@ public function getConfigTreeBuilder() 'mailbox_delete_processed_messages' => [ 'value' => false, 'type' => 'bool' - ] + ], + 'mailbox_help' => ['type' => 'array'] ) ); diff --git a/DependencyInjection/DiamanteEmailProcessingExtension.php b/DependencyInjection/DiamanteEmailProcessingExtension.php index 510bd09..113d948 100644 --- a/DependencyInjection/DiamanteEmailProcessingExtension.php +++ b/DependencyInjection/DiamanteEmailProcessingExtension.php @@ -38,5 +38,6 @@ public function load(array $configs, ContainerBuilder $container) $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); $loader->load('services.xml'); + $loader->load('form.xml'); } } diff --git a/Form/Type/HelpChannelsConfigurationType.php b/Form/Type/HelpChannelsConfigurationType.php new file mode 100644 index 0000000..25ac168 --- /dev/null +++ b/Form/Type/HelpChannelsConfigurationType.php @@ -0,0 +1,29 @@ + + + + + + Diamante\EmailProcessingBundle\Form\Type\HelpChannelsConfigurationType + + + + + + + + diff --git a/Resources/config/oro/routing.yml b/Resources/config/oro/routing.yml new file mode 100644 index 0000000..b5633d4 --- /dev/null +++ b/Resources/config/oro/routing.yml @@ -0,0 +1,3 @@ +diamante_email_processing_bundle: + resource: "@DiamanteEmailProcessingBundle/Controller" + type: annotation \ No newline at end of file diff --git a/Resources/config/oro/twig.yml b/Resources/config/oro/twig.yml new file mode 100644 index 0000000..707be34 --- /dev/null +++ b/Resources/config/oro/twig.yml @@ -0,0 +1,2 @@ +bundles: + - DiamanteEmailProcessingBundle:Form:fields.html.twig diff --git a/Resources/public/css/diam.css b/Resources/public/css/diam.css new file mode 100755 index 0000000..d98cfc6 --- /dev/null +++ b/Resources/public/css/diam.css @@ -0,0 +1,10 @@ +.diam-channels-info { + margin-top: 20px; +} + +.diam-channels-image { + width: 13px; + height: 13px; + position: relative; + bottom: 1px; +} \ No newline at end of file diff --git a/Resources/views/Configuration/block/system.html.twig b/Resources/views/Configuration/block/system.html.twig new file mode 100644 index 0000000..f0f006e --- /dev/null +++ b/Resources/views/Configuration/block/system.html.twig @@ -0,0 +1,7 @@ +
+ More info could be found in the + documentation. +
\ No newline at end of file diff --git a/Resources/views/Form/fields.html.twig b/Resources/views/Form/fields.html.twig new file mode 100644 index 0000000..9c28d73 --- /dev/null +++ b/Resources/views/Form/fields.html.twig @@ -0,0 +1,8 @@ +{% block diamante_config_channels_help_widget %} + {{ form_widget(form) }} + {{ oro_widget_render({ + 'widgetType': 'block', + 'url': path('diamante_config_channels_help'), + 'alias': 'diamante_config_channels_help' + }) }} +{% endblock %}