Initial commit

This commit is contained in:
2019-11-20 07:44:43 +01:00
commit 5bf49c4a81
41188 changed files with 5459177 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
<div class="bootstrap" id="activityLogBlock" style="display:none">
<div class="panel">
<div class="panel-heading">
{{ 'Activity Log'|trans }}
</div>
<p id="upgradeResultCheck" style="display: none;" class="alert alert-success"></p>
<div><div id="upgradeResultToDoList" style="display: none;" class="alert alert-info col-xs-12"></div></div><br>
<div class="row">
<div id="currentlyProcessing" class="col-xs-12" style="display:none;">
<h4 id="pleaseWait">{{ 'Currently processing'|trans }} <img class="pleaseWait" src="{{ psBaseUri }}img/loader.gif"/></h4>
<div id="infoStep" class="processing">{{ 'Analyzing the situation...'|trans }}</div>
</div>
</div><br>
<div id="quickInfo" class="clear processing col-xs-12"></div>
{# this block will show errors and important warnings that happens during upgrade #}
<div class="row">
<div id="errorDuringUpgrade" class="col-xs-12" style="display:none;">
<h4>{{ 'Errors'|trans }}</h4>
<div id="infoError" class="processing"></div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,47 @@
<div id="channel-infos" ><br>
{% if upgradeInfo.branch is not empty %}
<div style="clear:both">
<label class="label-small">{{ 'Branch:'|trans }}</label>
<span class="available">
<img src="../img/admin/{% if upgradeInfo.available is not empty %}enabled{% else %}disabled{% endif %}.gif">
{% if upgradeInfo.available is not empty %}
{{ 'Available'|trans({}, 'Admin.Global') }}
{% else %}
{{ 'Unavailable'|trans({}, 'Admin.Global') }}
{% endif %}
</span>
</div>
{% endif %}
<div class="all-infos">
{% if upgradeInfo.version_name is not empty %}
<div style="clear:both;">
<label class="label-small">{{ 'Name:'|trans({}, 'Admin.Global') }}</label>
<span class="name">{{ upgradeInfo.version_name }}</span>
</div>
{% endif %}
{% if upgradeInfo.version_num is not empty %}
<div style="clear:both;">
<label class="label-small">{{ 'Version number:'|trans }}</label>
<span class="version">{{ upgradeInfo.version_num }}</span>
</div>
{% endif %}
{% if upgradeInfo.link is not empty %}
<div style="clear:both;">
<label class="label-small">{{ 'URL:'|trans }}</label>
<a class="url" href="{{ upgradeInfo.link }}">{{ upgradeInfo.link }}</a>
</div>
{% endif %}
{% if upgradeInfo.md5 is not empty %}
<div style="clear:both;">
<label class="label-small">{{ 'MD5 hash:'|trans }}</label>
<span class="md5">{{ upgradeInfo.md5 }}</span>
</div>
{% endif %}
{% if upgradeInfo.changelog is not empty %}
<div style="clear:both;">
<label class="label-small">{{ 'Changelog:'|trans }}</label>
<a class="changelog" href="{{ upgradeInfo.changelog }}">{{ 'see changelog'|trans }}</a>
</div>
{% endif %}
</div>
</div>

View File

@@ -0,0 +1,153 @@
{% import "@ModuleAutoUpgrade/macros/icons.twig" as icons %}
<div class="bootstrap" id="currentConfigurationBlock">
<div class="panel">
<div class="panel-heading">
{{ 'The pre-Upgrade checklist'|trans }}
</div>
{% if showErrorMessage %}
<p class="alert alert-warning">{{ 'The checklist is not OK. You can only upgrade your shop once all indicators are green.'|trans }}</p>
{% endif %}
<div id="currentConfiguration">
<p class="alert alert-info">{{ 'Before starting the upgrade process, please make sure this checklist is all green.'|trans }}</p>
<table class="table" cellpadding="0" cellspacing="0">
<tr>
<td>{{ 'The 1-click upgrade module is up-to-date (your current version is v%s)'|trans([moduleVersion]) }}
{% if not moduleIsUpToDate %}
{% if versionGreaterThan1_5_3 %}
<strong><a href="index.php?controller=AdminModules&amp;token={{ adminToken|url_encode }}&update=autoupgrade">{{ 'Update'|trans({}, 'Admin.Actions') }}</a></strong>
{% endif %}
<strong><a class="_blank" href="http://addons.prestashop.com/en/administration-tools-prestashop-modules/5496-1-click-upgrade-autoupgrade.html">{{ 'Download'|trans }}</a></strong>
{% endif %}
</td>
<td>
{% if moduleIsUpToDate %}
{{ icons.ok }}
{% else %}
{{ icons.nok }}
{% endif %}
</td>
</tr>
<tr>
<td>{{ 'Your store\'s root directory is writable (with appropriate CHMOD permissions)'|trans }}</td>
<td>
{% if rootDirectoryIsWritable %}
{{ icons.ok }}
{% else %}
{{ icons.nok }} {{ rootDirectoryWritableReport }}
{% endif %}
</td>
</tr>
{% if adminDirectoryWritableReport %}
<tr>
<td>{{ 'The "/admin/autoupgrade" directory is writable (appropriate CHMOD permissions)'|trans|raw }}</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|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|raw }}</td>
<td>
{% if allowUrlFopenOrCurlIsEnabled %}
{{ icons.ok }}
{% else %}
{{ icons.nok }}
{% endif %}
</td>
</tr>
<tr>
<td>{{ 'PHP\'s "zip" extension is enabled'|trans|raw }}</td>
<td>
{% if zipIsEnabled %}
{{ icons.ok }}
{% else %}
{{ icons.nok }}
{% endif %}
</td>
</tr>
<tr>
<td>
{{ 'Your store is in maintenance mode'|trans }}
{% if not storeIsInMaintenance %}
<br><form method="post" action="{{ currentIndex }}&token={{ token }}">
<input type="submit" class="button" name="putUnderMaintenance" value="{{ 'Click here to put your shop under maintenance'|trans }}">
</form>
{% endif %}
</td>
<td>
{% if storeIsInMaintenance %}
{{ icons.ok }}
{% else %}
{{ icons.nok }}
{% endif %}
</td>
</tr>
<tr>
<td>{{ 'PrestaShop\'s caching features are disabled'|trans }}</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 }}
{% else %}
{{ 'PHP\'s max_execution_time setting has a high value or is disabled entirely (current value: %s seconds)'|trans([maxExecutionTime]) }}
{% endif %}
</td>
<td>
{% if maxExecutionTime == 0 %}
{{ icons.ok }}
{% else %}
{{ icons.warning }}
{% endif %}
</td>
</tr>
<tr>
<td>
{% if isPrestaShopReady %}
{{ 'PrestaShop requirements are satisfied.'|trans }}
{% else %}
{{ 'PrestaShop requirements are not satisfied. [1]See details[/1] or [2]ignore[/2].'|trans({
'[1]': '<a href="' ~ informationsLink ~'">',
'[/1]': '</a>',
'[2]': '<a href="' ~ currentIndex ~ '&token=' ~ token ~ '&ignorePsRequirements=1">',
'[/2]': '</a>',
})|raw }}
{% endif %}
</td>
<td>
{% if isPrestaShopReady %}
{{ icons.ok }}
{% else %}
{{ icons.warning }}
{% endif %}
</td>
</tr>
</table>
<br>
<p class="alert alert-info">{{ 'Please also make sure you make a full manual backup of your files and database.'|trans }}</p>
</div>
</div>
</div>

View File

@@ -0,0 +1,31 @@
<div class="bootstrap" id="rollbackForm">
<div class="panel">
<div class="panel-heading">
{{ 'Rollback'|trans }}
</div>
<p class="alert alert-info">
{{ 'After upgrading your shop, you can rollback to the previous database and files. Use this function if your theme or an essential module is not working correctly.'|trans }}
</p>
<div class="row" id="restoreBackupContainer">
<label class="col-lg-3 control-label text-right">{{ 'Choose your backup:'|trans }}</label>
<div class="col-lg-9">
<select name="restoreName">
<option value="0">{{ '-- Choose a backup to restore --'|trans }}</option>';
{% if availableBackups is not empty %}
{% for backupName in availableBackups %}
<option value="{{ backupName }}">{{ backupName }}</option>
{% endfor %}
{% endif %}
</select>
<span id="buttonDeleteBackup"></span>
</div>
</div>
<br>
<div class="row">
<p id="rollbackContainer" class="col-lg-offset-3 col-lg-9">
<a disabled="disabled" class="upgradestep button btn btn-primary" href="" id="rollback">{{ 'Rollback'|trans }}</a>
</p>
</div>
</div>
</div>

View File

@@ -0,0 +1,169 @@
<div class="bootstrap" id="upgradeButtonBlock">
<div class="panel">
<div class="panel-heading">
{{ 'Start your Upgrade'|trans }}
</div>
<div class="blocOneClickUpgrade">
{% if versionCompare > 0 %}
<p class="alert alert-warning">{{ 'You come from the future! You are using a more recent version than the latest available!'|trans }}</p>
{% elseif versionCompare == 0 %}
<p class="alert alert-success">{{ 'Congratulations, you are already using the latest version available!'|trans }}</p>
{% endif %}
<p>
{{ 'Your current PrestaShop version'|trans }}: <strong>{{ currentPsVersion }}</strong>
</p>
<p>
{{ 'Latest official version for %s channel.'|trans([channel]) }}: <strong>{{ latestChannelVersion }}</strong>
</p>
</div>
<br>
{% if showUpgradeButton %}
<div>
<a href="#" id="upgradeNow" class="button-autoupgrade upgradestep btn btn-primary">{{ 'Upgrade PrestaShop now!'|trans }}</a>
{% if showUpgradeLink %}
<small><a href="{{ upgradeLink }}">{{ 'PrestaShop will be downloaded from %s'|trans([upgradeLink]) }}</a></small>
{% if changelogLink is not empty %}
<p>
<a href="{{ changelogLink }}" target="_blank" >{{ 'Open changelog in a new window'|trans }}</a>
</p>
{% endif %}
{% else %}
{{ 'No file will be downloaded (channel %s is used)'|trans([channel]) }}
{% endif %}
</div>
{% if skipActions is not empty %}
<div id="skipAction-list" class="alert alert-warning">
<p>{{ 'The following action are automatically replaced'|trans }}</p>
<ul>
{% for old, new in skipActions %}
<li>
{{ '%old% will be replaced by %new%'|trans({'%old%': old, '%new%': new}) }}
</li>
{% endfor %}
</ul>
<p>{{ 'To change this behavior, you need to manually edit your php files'|trans }}</p>
</div>
{% endif %}
{% endif %}
<br>
<p>
{% if showUpgradeButton %}
<a class="button button-autoupgrade btn btn-default" href="index.php?tab=AdminSelfUpgrade&amp;token={{ token }}&amp;refreshCurrentVersion=1">{{ 'Refresh the page'|trans }}</a> -
{% else %}
<a class="button button-autoupgrade btn btn-primary" href="index.php?tab=AdminSelfUpgrade&amp;token={{ token }}&amp;refreshCurrentVersion=1">{{ 'Check if a new version is available'|trans }}</a> -
{% endif %}
<span style="font-style: italic; font-size: 11px;">{% if lastVersionCheck %}
{{ 'Last check: %s'|trans([lastVersionCheck|date('Y-m-d H:i:s')]) }}
{% else %}
{{ 'Last check: never'|trans }}
{% endif %}
</span>
</p>
<!-- advanced configuration -->
<div class="row">
<div class="pull-right">
<p><input type="button" class="button btn btn-warning" name="btn_adv" value="{{ 'More options (Expert mode)'|trans }}"/></p>
</div>
<div class="col-xs-12">
<p class="alert alert-info" style="display:none;" id="configResult">&nbsp;</p>
<div id="advanced" style="margin-top: 30px;">
<h3>{{ 'Expert mode'|trans }}</h3>
<h4 style="margin-top: 0">{{ 'Please select your channel:'|trans }}</h4>
<p>
{{ 'Channels are offering you different ways to perform an upgrade. You can either upload the new version manually or let the 1-Click Upgrade module download it for you.'|trans }}<br>
{{ 'The Alpha, Beta and Private channels give you the ability to upgrade to a non-official or unstable release (for testing purposes only).'|trans }}<br>
{{ 'By default, you should use the "Minor release" channel which is offering the latest stable version available.'|trans|raw }}
</p>
<br>
<label for="channel">{{ 'Channel:'|trans }}</label>
<select name="channel" id="channel">
{% for channelOpt in channelOptions %}
{% set selected = (channel == channelOpt[1]) %}
<option id="{{ channelOpt[0] }}" value="{{ channelOpt[1] }}" {% if selected %}class="current" selected{% endif %}>
{% if selected %}* {% endif %}{{ channelOpt[2] }}
</option>
{% endfor %}
</select>
{{ channelInfoBlock|raw }}
<div id="for-useMinor">
<div class="margin-form margin-form-small">
{{ 'This option regroup all stable versions.'|trans }}
</div>
</div>
<div id="for-usePrivate">
<p><label for="private_release_link">{{ 'Link:'|trans }} *</label>
<input type="text" size="50" id="private_release_link" name="private_release_link" value="{{ privateChannel.releaseLink }}">
</p>
<p><label for="private_release_md5">{{ 'Hash key:'|trans }} *</label>
<input type="text" size="32" id="private_release_md5" name="private_release_md5" value="{{ privateChannel.releaseMd5 }}">
</p>
<p><label for="private_allow_major">{{ 'Allow major upgrade:'|trans }}</label>
<input type="checkbox" id="private_allow_major" name="private_allow_major" value="1"{% if privateChannel.allowMajor %} checked{% endif %}>
</p>
</div>
<div id="for-useArchive">
{% if archiveFiles is not empty %}
<label for="archive_prestashop">{{ 'Archive to use:'|trans }}</label>
<div>
<select id="archive_prestashop" name="archive_prestashop">
<option value="">{{ 'Choose an archive'|trans }}</option>
{% for file in archiveFiles %}
{% set fileName = file|replace({(downloadPath): ''}) %}
<option {% if archiveFileName == fileName %} selected{% endif %} value="{{ fileName }}">{{ fileName }}</option>
{% endfor %}
</select>
<br>
<label for="archive_num">{{ 'Number of the version you want to upgrade to:'|trans }} * </label>
<input type="text" size="10" id="archive_num" name="archive_num" value="{{ archiveVersionNumber }}" placeholder="1.7.0.1" />
</div>
{% else %}
<div class="alert alert-warning">{{ 'No archive found in your admin/autoupgrade/download directory'|trans }}</div>
{% endif %}
<div class="margin-form">
{{ 'Save in the following directory the archive file of the version you want to upgrade to: %s'|trans(['<b>/admin/autoupgrade/download/</b>'])|raw }}<br>
{{ 'Click "Save" once the archive is there.'|trans }}<br>
{{ 'This option will skip the download step.'|trans }}
</div>
</div>
<div id="for-useDirectory">
<div>
{{ 'Save in the following directory the uncompressed PrestaShop files of the version you want to upgrade to: %s'|trans(['<b>/admin/autoupgrade/latest/</b>'])|raw }}
<br><br>
<label for="directory_num">{{ 'Please tell us which version you are upgrading to [1](1.7.0.1 for instance)[/1]'|trans({'[1]': '<small>', '[/1]': '</small>'})|raw }}</label>
<input type="text" size="10" id="directory_num" name="directory_num" value="{{ directoryVersionNumber }}" placeholder="1.7.0.1">
<div class="margin-form">
{{ 'Click "Save" once the archive is there.'|trans }}<br>
* {{ 'This option will skip both download and unzip steps and will use %1$s as the source directory'|trans(['<b>/admin/autoupgrade/latest/</b>'])|raw }}
</div>
</div>
</div>
<br>
<p>
<input type="button" class="button btn btn-primary" value="{{ 'Save'|trans({}, 'Admin.Actions') }}" name="submitConf-channel">
</p>
</div>
</div>
</div>
{% if manualMode %}
<br class="clear"/>
<fieldset class="autoupgradeSteps"><legend>{{ 'Step'|trans }}</legend>
<h4>{{ 'Upgrade steps'|trans }} : </h4>
<div>
<a id="download" class="upgradestep">download</a>
<a id="unzip" class="upgradestep">unzip</a>{# unzip in autoupgrade/latest #}
<a id="removeSamples" class="upgradestep">removeSamples</a> {# remove samples (iWheel images) #}
<a id="backupFiles" class="upgradestep">backupFiles</a>
<a id="backupDb" class="upgradestep">backupDb</a>
<a id="upgradeFiles" class="upgradestep">upgradeFiles</a>
<a id="upgradeDb" class="upgradestep">upgradeDb</a>
<a id="upgradeModules" class="upgradestep">upgradeModules</a>
<a id="cleanDatabase" class="upgradestep">cleanDb</a>
<a id="upgradeComplete" class="upgradestep">upgradeComplete</a>
</div>
</fieldset>
{% endif %}
</div>
</div>

View File

@@ -0,0 +1,19 @@
<div class="bootstrap" id="comparisonBlock">
<div class="panel">
<div class="panel-heading">
{{ 'Version comparison'|trans }}
</div>
<p>
<b>{{ 'PrestaShop Original version'|trans }}:</b><br>
<span id="checkPrestaShopFilesVersion">
<img id="pleaseWait" src="{{ psBaseUri }}img/loader.gif"/>
</span>
</p>
<p>
<b>{{ 'Differences between versions'|trans }}:</b><br>
<span id="checkPrestaShopModifiedFiles">
<img id="pleaseWait" src="{{ psBaseUri }}img/loader.gif"/>
</span>
</p>
</div>
</div>

View File

@@ -0,0 +1,4 @@
<div class="error">
{% if showWarningIcon %}<img src="../img/admin/warning.gif" />{% endif %}
{{ message }}
</div>

View File

@@ -0,0 +1,16 @@
<div class="bootstrap" id="{{ name }}Block">
<div class="panel">
<div class="panel-heading">
{{ tabName }}
</div>
<div class="form-wrapper">
{% for field in fields %}
{{ field|raw }}
{% endfor %}
</div>
<div class="panel-footer">
<button type="submit" class="btn btn-default pull-right" value="{{ 'Save'|trans({}, 'Admin.Actions') }}" name="customSubmitAutoUpgrade"><i class="process-icon-save"></i>
{{ 'Save'|trans({}, 'Admin.Actions') }}</button>
</div>
</div>
</div>

View File

@@ -0,0 +1,9 @@
{% macro ok() %}
<img src="../img/admin/enabled.gif" alt="ok">
{% endmacro %}
{% macro nok() %}
<img src="../img/admin/disabled.gif" alt="nok">
{% endmacro %}
{% macro warning() %}
<img src="../img/admin/warning.gif" alt="warn">
{% endmacro %}

View File

@@ -0,0 +1,45 @@
<script>
var jQueryVersionPS = parseInt($().jquery.replace(/\./g, ""));
</script>
<script src="{{ psBaseUri }}modules/autoupgrade/js/jquery-1.6.2.min.js"></script>
<script>
if (jQueryVersionPS >= 162) {
jq162 = jQuery.noConflict(true);
}
</script>
<link type="text/css" rel="stylesheet" href="{{ psBaseUri }}modules/autoupgrade/css/styles.css" />
<div class="bootstrap" id="informationBlock">
<div class="panel">
<div class="panel-heading">
{{ 'Welcome!'|trans }}
</div>
<p>
{{ 'With the PrestaShop 1-Click Upgrade module, upgrading your store to the latest version available has never been easier!'|trans }}<br><br>
<span style="color:#CC0000;font-weight:bold">{{ 'Please always perform a full manual backup of your files and database before starting any upgrade.'|trans }}</span><br>
{{ 'Double-check the integrity of your backup and that you can easily manually roll-back if necessary.'|trans }}<br>
{{ 'If you do not know how to proceed, ask your hosting provider.'|trans }}
</p>
</div>
</div>
{# content #}
{{ currentConfig|raw }}
{{ upgradeButtonBlock|raw }}
{% include '@ModuleAutoUpgrade/block/versionComparison.twig' %}
{% include '@ModuleAutoUpgrade/block/activityLog.twig' %}
{{ rollbackForm|raw }}
<br>
<form action="{{ currentIndex }}&amp;customSubmitAutoUpgrade=1&amp;token={{ token }}" method="post" class="form-horizontal" enctype="multipart/form-data">
{{ backupOptions|raw }}
{{ upgradeOptions|raw }}
</form>
<script src="{{ psBaseUri }}modules/autoupgrade/js/jquery.xml2json.js"></script>
<script>
var input = {{ jsParams|json_encode|raw }};
</script>
<script src="{{ psBaseUri }}modules/autoupgrade/js/upgrade.js"></script>