Files
wyczarujprezent.pl/modules/autoupgrade/views/templates/block/checklist.twig
2024-10-28 22:14:22 +01:00

225 lines
11 KiB
Twig

{% import "@ModuleAutoUpgrade/macros/icons.twig" as icons %}
<div class="bootstrap" id="currentConfigurationBlock">
<div class="panel">
<div class="panel-heading">
{{ 'The pre-Upgrade checklist'|trans({}, 'Modules.Autoupgrade.Admin') }}
</div>
{% if not moduleIsUpToDate %}
<p class="alert alert-warning">
{{ 'Your current version of the module is out of date. Update now'|trans({}, 'Modules.Autoupgrade.Admin') }}
<a href=" {{ moduleUpdateLink }} ">{{ 'Modules > Module Manager > Updates'|trans({}, 'Modules.Autoupgrade.Admin') }}</a>
</p>
{% endif %}
{% if showErrorMessage %}
<p class="alert alert-warning">{{ 'The checklist is not OK. You can only upgrade your shop once all indicators are green.'|trans({}, 'Modules.Autoupgrade.Admin') }}</p>
{% endif %}
<div id="currentConfiguration">
<p class="alert alert-info">{{ 'Before starting the upgrade process, please make sure this checklist is all green.'|trans({}, 'Modules.Autoupgrade.Admin') }}</p>
<table class="table" cellpadding="0" cellspacing="0">
<tr>
<td>
{% if not phpUpgradeRequired %}
{{ 'Your server is running on a supported PHP version.'|trans({}, 'Modules.Autoupgrade.Admin') }}
{% else %}
{{ 'The PHP version your server is running on is obsolete and needs to be upgraded. [1]Learn more[/1].'|trans({
'[1]': '<a href="https://devdocs.prestashop.com/1.7/basics/installation/system-requirements/" target="_blank">',
'[/1]': '</a>',
}, 'Modules.Autoupgrade.Admin')|raw }}
{% endif %}
</td>
<td>
{% if not phpUpgradeRequired %}
{{ icons.ok }}
{% else %}
{{ icons.warning }}
{% endif %}
</td>
</tr>
<tr>
<td>{{ 'Your store\'s root directory (%s) is writable (with appropriate CHMOD permissions).'|trans([rootDirectory], 'Modules.Autoupgrade.Admin') }}</td>
<td>
{% if rootDirectoryIsWritable %}
{{ icons.ok }}
{% else %}
{{ icons.nok }}
{% endif %}
</td>
</tr>
{% if adminDirectoryWritableReport %}
<tr>
<td>{{ 'The "/admin/autoupgrade" directory is writable (appropriate CHMOD permissions)'|trans({}, 'Modules.Autoupgrade.Admin') }}</td>
<td>
{% if adminDirectoryIsWritable %}
{{ icons.ok }}
{% else %}
{{ icons.nok }} {{ adminDirectoryWritableReport }}
{% endif %}
</td>
</tr>
{% endif %}
<tr>
<td>{{ 'PHP\'s "Safe mode" option is turned off'|trans({}, 'Modules.Autoupgrade.Admin')|raw }}</td>
<td>
{% if safeModeIsDisabled %}
{{ icons.ok }}
{% else %}
{{ icons.warning }}
{% endif %}
</td>
</tr>
<tr>
<td>{{ 'PHP\'s "allow_url_fopen" option is turned on, or cURL is installed'|trans({}, 'Modules.Autoupgrade.Admin')|raw }}</td>
<td>
{% if allowUrlFopenOrCurlIsEnabled %}
{{ icons.ok }}
{% else %}
{{ icons.nok }}
{% endif %}
</td>
</tr>
<tr>
<td>{{ 'PHP\'s "zip" extension is enabled'|trans({}, 'Modules.Autoupgrade.Admin')|raw }}</td>
<td>
{% if zipIsEnabled %}
{{ icons.ok }}
{% else %}
{{ icons.nok }}
{% endif %}
</td>
</tr>
<tr>
<td>
{% if storeIsInMaintenance %}
{{ 'Your store is in maintenance mode'|trans({}, 'Modules.Autoupgrade.Admin') }}
{% else %}
{{ 'Enable maintenance mode and add your maintenance IP in [1]Shop parameters > General > Maintenance[/1]'|trans({
'[1]' : '<a href="' ~ maintenanceLink ~'" target="_blank">',
'[/1]' : '</a>',
}, 'Modules.Autoupgrade.Admin')|raw }}
{% endif %}
</td>
<td>
{% if storeIsInMaintenance %}
{{ icons.ok }}
{% else %}
{{ icons.nok }}
{% endif %}
</td>
</tr>
<tr>
<td>{{ 'PrestaShop\'s caching features are disabled'|trans({}, 'Modules.Autoupgrade.Admin') }}</td>
<td>
{% if cachingIsDisabled %}
{{ icons.ok }}
{% else %}
{{ icons.nok }}
{% endif %}
</td>
</tr>
<tr>
<td>
{% if maxExecutionTime == 0 %}
{{ 'PHP\'s max_execution_time setting has a high value or is disabled entirely (current value: unlimited)'|trans({}, 'Modules.Autoupgrade.Admin') }}
{% else %}
{{ 'PHP\'s max_execution_time setting has a high value or is disabled entirely (current value: %s seconds)'|trans([maxExecutionTime], 'Modules.Autoupgrade.Admin') }}
{% endif %}
</td>
<td>
{% if maxExecutionTime == 0 %}
{{ icons.ok }}
{% else %}
{{ icons.warning }}
{% endif %}
</td>
</tr>
{% if not checkPhpVersionCompatibility %}
<tr>
<td>{{ 'Your current PHP version isn\'t compatible with your PrestaShop version.'|trans({}, 'Modules.Autoupgrade.Admin') }}</td>
<td>{{ icons.nok }}</td>
</tr>
{% endif %}
{% if not checkApacheModRewrite %}
<tr>
<td>{{ 'Apache mod_rewrite is disabled.'|trans({}, 'Modules.Autoupgrade.Admin') }}</td>
<td>{{ icons.nok }}</td>
</tr>
{% endif %}
{% if notLoadedPhpExtensions|length > 0 %}
<tr>
<td>
{% if notLoadedPhpExtensions|length > 1 %}
{{ 'The following PHP extensions are not installed: %s.'|trans([notLoadedPhpExtensions|join(', ')], 'Modules.Autoupgrade.Admin') }}
{% else %}
{{ 'The following PHP extension is not installed: %s.'|trans([notLoadedPhpExtensions|first], 'Modules.Autoupgrade.Admin') }}
{% endif %}
</td>
<td>{{ icons.nok }}</td>
</tr>
{% endif %}
{% if not checkMemoryLimit %}
<tr>
<td>{{ 'PHP memory_limit is inferior to 256 MB.'|trans({}, 'Modules.Autoupgrade.Admin') }}</td>
<td>{{ icons.nok }}</td>
</tr>
{% endif %}
{% if not checkFileUploads %}
<tr>
<td>{{ 'PHP file_uploads configuration is disabled.'|trans({}, 'Modules.Autoupgrade.Admin') }}</td>
<td>{{ icons.nok }}</td>
</tr>
{% endif %}
{% if notExistsPhpFunctions|length > 0 %}
<tr>
<td>
{% if notExistsPhpFunctions|length > 1 %}
{{ 'The following PHP functions are not installed: %s.'|trans([notExistsPhpFunctions|join(', ')], 'Modules.Autoupgrade.Admin') }}
{% else %}
{{ 'The following PHP function is not installed: %s.'|trans([notExistsPhpFunctions|first], 'Modules.Autoupgrade.Admin') }}
{% endif %}
</td>
<td>{{ icons.nok }}</td>
</tr>
{% endif %}
{% if not checkPhpSessions %}
<tr>
<td>{{ 'It\'s not possible to create a PHP session.'|trans({}, 'Modules.Autoupgrade.Admin') }}</td>
<td>{{ icons.nok }}</td>
</tr>
{% endif %}
{% if missingFiles|length > 0 %}
<tr>
<td>
{{ 'The following files are missing:'|trans({}, 'Modules.Autoupgrade.Admin') }}
<ul>
{% for file in missingFiles %}
<li>{{ file }}</li>
{% endfor %}
</ul>
</td>
<td>{{ icons.nok }}</td>
</tr>
{% endif %}
{% if notWritingDirectories|length > 0 %}
<tr>
<td>
{{ 'It\'s not possible to write in the following folders:'|trans({}, 'Modules.Autoupgrade.Admin') }}
<ul>
{% for missingFile in notWritingDirectories %}
<li>{{ missingFile }}</li>
{% endfor %}
</ul>
</td>
<td>{{ icons.nok }}</td>
</tr>
{% endif %}
</table>
<br>
<p class="alert alert-info">{{ 'Please also make sure you make a full manual backup of your files and database.'|trans({}, 'Modules.Autoupgrade.Admin') }}</p>
{% if showErrorMessage %}
<p class="alert alert-danger">{{ 'PrestaShop requirements are not satisfied.'|trans({}, 'Modules.Autoupgrade.Admin') }}</p>
{% endif %}
</div>
</div>
</div>