diff --git a/AdminUi/Component/EzInfoTwigComponent.php b/AdminUi/Component/EzInfoTwigComponent.php
new file mode 100644
index 00000000..9b465f92
--- /dev/null
+++ b/AdminUi/Component/EzInfoTwigComponent.php
@@ -0,0 +1,84 @@
+twig = $twig;
+ $this->template = $template;
+ $this->parameters = $parameters;
+ $this->ezSystemInfo = $ezSystemInfo;
+ $this->urlList = $urlList;
+ }
+
+ /**
+ * @param array $parameters
+ *
+ * @return string
+ */
+ public function render(array $parameters = []): string
+ {
+ $urls = $this->replaceUrlPlaceholders();
+
+ return $this->twig->render(
+ $this->template,
+ $parameters + ['urls' => $urls, 'ez' => $this->ezSystemInfo] + $this->parameters
+ );
+ }
+
+ /**
+ * @return array
+ */
+ private function replaceUrlPlaceholders(): array
+ {
+ $urls = $this->urlList;
+ foreach ($this->urlList as $urlName => $url) {
+ foreach ($this->ezSystemInfo as $attribute => $value) {
+ if (is_string($value) && strpos($url,'{ez.' . $attribute . '}') !== false) {
+ $urls[$urlName] = str_replace('{ez.' . $attribute . '}', $value, $url);
+ }
+ }
+ }
+
+ return $urls;
+ }
+}
diff --git a/Resources/config/services.yml b/Resources/config/services.yml
index 0d276c2c..951ddbf2 100644
--- a/Resources/config/services.yml
+++ b/Resources/config/services.yml
@@ -8,10 +8,25 @@ parameters:
support_tools.system_info.ezc.wrapper.class: EzSystems\EzSupportToolsBundle\SystemInfo\EzcSystemInfoWrapper
support_tools.system_info.collector.composer.lock_file.class: EzSystems\EzSupportToolsBundle\SystemInfo\Collector\JsonComposerLockSystemInfoCollector
support_tools.system_info.collector.database.doctrine.class: EzSystems\EzSupportToolsBundle\SystemInfo\Collector\DoctrineDatabaseSystemInfoCollector
+ support_tools.system_info.collector.system.ez.class: EzSystems\EzSupportToolsBundle\SystemInfo\Collector\EzSystemInfoCollector
support_tools.system_info.collector.hardware.ezc.class: EzSystems\EzSupportToolsBundle\SystemInfo\Collector\EzcHardwareSystemInfoCollector
support_tools.system_info.collector.php.ezc.class: EzSystems\EzSupportToolsBundle\SystemInfo\Collector\EzcPhpSystemInfoCollector
support_tools.system_info.collector.symfony.kernel.config.class: EzSystems\EzSupportToolsBundle\SystemInfo\Collector\ConfigurationSymfonyKernelSystemInfoCollector
support_tools.system_info.output_format.json.class: EzSystems\EzSupportToolsBundle\SystemInfo\OutputFormat\JsonOutputFormat
+ support_tools.ez_url_list:
+ contact: "https://ez.no/About-eZ/Contact-Us"
+ license: "https://ez.no/About-our-Software/Licenses-and-agreements"
+ ttl: "https://ez.no/About-our-Software/Licenses-and-agreements/eZ-Trial-and-Test-License-Agreement-eZ-TTL-v2.1"
+ service_life: "https://support.ez.no/Public/Service-Life"
+ support_service: "https://ez.no/Services/Support-Maintenance"
+ training_service: "https://ez.no/Services/Training"
+ consulting_service: "https://ez.no/Services/Consulting"
+ ee_product: "https://ez.no/Products/eZ-Platform-Enterprise-Edition"
+ install_ee: "https://doc.ezplatform.com/en/#{ez.release}/getting_started/install_ez_enterprise/"
+ doc: "https://doc.ezplatform.com"
+ update: "https://doc.ezplatform.com/en/latest/releases/updating_ez_platform/"
+ gpl_faq: "https://www.gnu.org/licenses/old-licenses/gpl-2.0-faq.en.html#GPLModuleLicense"
+ support: "https://support.ez.no"
services:
support_tools.command.dump_info:
@@ -34,6 +49,15 @@ services:
# SystemInfoCollectors
+ support_tools.system_info.collector.system.ez:
+ class: "%support_tools.system_info.collector.system.ez.class%"
+ arguments:
+ - "@support_tools.system_info.collector.composer.lock_file"
+ - "%kernel.debug%"
+ # Can't tag this before v0.3 (2.5?) as it will blow up in admin UI for missing templates there
+ # And it does not look like there is anway to add it from this package, so maybe it needs to be made extensible(?)
+ #tags: [{ name: "support_tools.system_info.collector", identifier: "ez" }]
+
support_tools.system_info.collector.composer.lock_file:
class: "%support_tools.system_info.collector.composer.lock_file.class%"
arguments:
@@ -77,3 +101,13 @@ services:
class: "%support_tools.system_info.output_format.json.class%"
tags:
- { name: "support_tools.system_info.output_format", format: "json" }
+
+ # Dashboard
+ EzSystems\EzSupportToolsBundle\AdminUi\Component\EzInfoTwigComponent:
+ autowire: true
+ arguments:
+ $template: '@@ezdesign/dashboard/block/ez.html.twig'
+ $ezSystemInfo: "@=service('support_tools.system_info.collector.system.ez').collect()"
+ $urlList: '%support_tools.ez_url_list%'
+ tags:
+ - { name: ezplatform.admin_ui.component, group: 'dashboard-blocks', priority: 200 }
diff --git a/Resources/translations/dashboard.en.xlf b/Resources/translations/dashboard.en.xlf
new file mode 100644
index 00000000..b0c8d8ae
--- /dev/null
+++ b/Resources/translations/dashboard.en.xlf
@@ -0,0 +1,105 @@
+
+
+
+
+
+ The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message.
+
+
+
+
+ please upgrade.]]>
+ key: dashboard.ez_version.community_end_of_maintenance
+
+
+
+ A business friendly license,
+ several productivity features,
+ professional Support and
+ longer maintenance periode of your release.]]>
+ key: dashboard.ez_version.community_end_of_maintenance_upgrade
+
+
+
+ GPL license,
+ sharing your code is what it's all about.]]>
+ key: dashboard.ez_version.community_severity_non
+
+
+
+ GPL license,
+ sharing your code is what it's all about.]]>
+ key: dashboard.ez_version.end_of_life
+
+
+
+ end of life,
+ please plan to upgrade. If you need assistance, don't hesitate to contact eZ.]]>
+ key: dashboard.ez_version.end_of_life_upgrade
+
+
+
+ Your trial period is coming to an end.
+ key: dashboard.ez_version.end_of_maintenance
+
+
+
+ Contact eZ or its partner(s) to purchase a subscription
+ and follow the online documentation to configure your project.]]>
+ key: dashboard.ez_version.end_of_maintenance_contanct
+
+
+
+ Your setup is running with unstable packages, this is not recommended besides when testing updates.
+ key: dashboard.ez_version.non_stable
+
+
+
+ get in touch with eZ support.]]>
+ key: dashboard.ez_version.non_stable_ee
+
+
+
+ composer.lock file. It's needed to determine information about
+ your eZ install, and recommended to be kept on project development to make sure same package versions are used across all environments.]]>
+ key: dashboard.ez_version.release_not_determined
+
+
+
+ online documentation, consulting
+ or training services in order to get the most out of your trial.]]>
+ key: dashboard.ez_version.severity_non
+
+
+
+ Contact eZ or its partner(s) to purchase a subscription
+ and follow the online documentation to configure your project.]]>
+ key: dashboard.ez_version.severity_non_contant
+
+
+
+ TTL license is no longer valid.]]>
+ key: dashboard.ez_version.trial_expired
+
+
+
+ Contact eZ or its partner(s) to purchase a subscription
+ and follow the online documentation to configure your project.]]>
+ key: dashboard.ez_version.trial_expired_contant
+
+
+
+
diff --git a/Resources/views/themes/admin/dashboard/block/ez.html.twig b/Resources/views/themes/admin/dashboard/block/ez.html.twig
new file mode 100644
index 00000000..2386505b
--- /dev/null
+++ b/Resources/views/themes/admin/dashboard/block/ez.html.twig
@@ -0,0 +1,134 @@
+{% trans_default_domain 'dashboard' %}
+
+{#
+ Want to edit these messages?
+ If you are on GPL, as always make sure to share your modifications, as well as your bundles. But to
+ make sure everyone benefits, please consider contributing modifications to ezsystems/ez-support-tools.
+#}
+
+{% set badge = "" %}
+{% set severity = 0 %}
+{% set levels = {0: "info", 1: "warning", 2: "danger"} %}
+{% set icons = {0: "", 1: "⚠", 2: "⚠"} %}
+{% set status %}
+ {% spaceless %}
+ {% if not ez.release %}
+ {% set severity = 1 %}
+
+ {{ 'dashboard.ez_version.release_not_determined'|trans|desc("The system could not find your composer.lock file. It's needed to determine information about
+ your eZ install, and recommended to be kept on project development to make sure same package versions are used across all environments.")}}
+
+ {% elseif ez.isTrial %}
+ {% set badge = 'Trial' %}
+ {% if ez.isEndOfLife %}
+ {% set severity = 2 %}
+
+ {{ 'dashboard.ez_version.trial_expired'|trans({'%ttl_url%': urls['ttl']})|desc("Unfortunately your trial period has expired and your TTL license is no longer valid.")|raw }}
+ {{ 'dashboard.ez_version.trial_expired_contant'|trans({'%contact_url%': urls['contact'], '%install_ee%': urls['install_ee']})|desc("Contact eZ or its partner(s) to purchase a subscription
+ and follow the online documentation to configure your project.")|raw }}
+
+ {{ 'dashboard.ez_version.end_of_maintenance'|trans|desc("Your trial period is coming to an end.")}}
+ {{ 'dashboard.ez_version.end_of_maintenance_contanct'|trans({'%contact_url%': urls['contact'], '%install_ee%': urls['install_ee']})
+ |desc("Contact eZ or its partner(s) to purchase a subscription
+ and follow the online documentation to configure your project.")
+ |raw }}
+
+ {% else %}
+ {% set severity = 0 %}
+
+ {{ 'dashboard.ez_version.severity_non'|trans({'%name%': ez.name, '%doc_url%': urls['doc'], '%consulting_url%': urls['consulting_service'], '%training_url%': urls['training_service']})
+ |desc('Welcome to %name%, check our online documentation, consulting
+ or training services in order to get the most out of your trial.')
+ |raw }}
+ {{ 'dashboard.ez_version.severity_non_contant'|trans({'%contact_url%': urls['contact'], '%install_ee%': urls['install_ee']})
+ |desc("Contact eZ or its partner(s) to purchase a subscription
+ and follow the online documentation to configure your project.")
+ |raw }}
+
+ {% endif %}
+ {% elseif not ez.isEnterpise %}
+ {% set badge = 'GPL' %}
+ {% if ez.isEndOfMaintenance %}
+ {# In the future with retrival of info from updates.ez.no we can detect missing (public) security fixes and then let this become an error #}
+ {% set severity = 1 %}
+
+ {{ 'dashboard.ez_version.community_end_of_maintenance'|trans({'%release%': ez.release, '%update_url%': urls['update_url']})
+ |desc("Unfortunately %release% open source version has reached end of life, please upgrade.")}}
+
+ {{ 'dashboard.ez_version.community_end_of_maintenance_upgrade'|trans({
+ '%license_url%': urls['license'],
+ '%ee_product_url%': urls['ee_product'],
+ '%support_service_url%': urls['support_service'],
+ '%service_life_url%': urls['service_life']
+ })
+ |desc("Tip: If you upgrade to eZ Platform Enterprise you'll get access to:
+ A business friendly license,
+ several productivity features,
+ professional Support and
+ longer maintenance periode of your release.")
+ |raw }}
+
+
+ {% else %}
+ {% set severity = 0 %}
+
+ {{ 'dashboard.ez_version.community_severity_non'|trans({
+ '%release%': ez.release,
+ '%license_url%': urls['license'],
+ '%gpl_faq_url%': urls['gpl_faq'],
+ })
+ |desc("Welcome to the open source %release% release. Using the community friendly GPL license,
+ sharing your code is what it's all about.")
+ |raw }}
+
+ {% endif %}
+ {% elseif ez.isEndOfLife %}
+ {# As we don't yet here know if subscription has expired (todo with info from updates.ez.no), this is a warning and not a error #}
+ {% set severity = 1 %}
+ {% set badge = 'End of Life' %}
+
+ {{ 'dashboard.ez_version.end_of_life'|trans({
+ '%release%': urls['license'],
+ '%license_url%': urls['ee_product'],
+ '%gpl_faq_url%': urls['gpl_faq'],
+ })
+ |desc("Welcome to the open source %release% release. Using the community friendly GPL license,
+ sharing your code is what it's all about.")
+ |raw }}
+ {{ 'dashboard.ez_version.end_of_life_upgrade'|trans({
+ '%release%': urls['license'],
+ '%service_life_url%': urls['service_life'],
+ '%contact_url%': urls['contact'],
+ })
+ |desc("Unfortunately %release% has reached end of life,
+ please plan to upgrade. If you need assistance, don't hesitate to contact eZ.")
+ |raw }}
+
+ {% elseif not ez.debug and ez.stability != 'stable' %}
+ {% set severity = 1 %}
+ {% set badge = 'Development' %}
+
+ {{ 'dashboard.ez_version.non_stable'|trans|desc("Your setup is running with unstable packages, this is not recommended besides when testing updates.") }}
+ {% if ez.isEnterpise %}
+ {{ 'dashboard.ez_version.non_stable_ee'|trans({'%support_url%': urls['support']})|desc("If you need assistance, don't hesitate to get in touch with eZ support.")|raw }}
+ {% endif %}
+