Bump version, fixed formatting

This commit is contained in:
Eugene Polozov 2021-05-29 18:37:46 +03:00
parent d4982bb7cb
commit 4fb5030c23
5 changed files with 44 additions and 28 deletions

View File

@ -1,3 +1,14 @@
## v3.3.0
* Добавлена возможность ручной выгрузки архива клиентов и заказов в RetailCRM
* Добавлены фильтры для упрощенной модификации данных
* Изменен путь хранения логов, добавлена автоматическая очистка старых логов
* Изменен путь для файлов кастомизации модуля, файлы необходимо размещать в папке /custom/classes внутри модуля
* Включение debug-режима в модуле перенесено в настройки в базе данных
* Улучшена работа JobManager, добавлена страница с отладочной информацией о работе
* Добавлена команда для сброса метки истории из RetailCRM
* Добавлена команда для очистки старых файлов логов
* Исправлена ошибка с форматом тегов при обновлении клиентов
## v3.2.6 ## v3.2.6
* Исправлена ошибка при сохранении настроек модуля на старых версиях PrestaShop * Исправлена ошибка при сохранении настроек модуля на старых версиях PrestaShop

View File

@ -1 +1 @@
3.2.6 3.3.0

View File

@ -130,7 +130,7 @@ class RetailCRM extends Module
{ {
$this->name = 'retailcrm'; $this->name = 'retailcrm';
$this->tab = 'export'; $this->tab = 'export';
$this->version = '3.2.6'; $this->version = '3.3.0';
$this->author = 'DIGITAL RETAIL TECHNOLOGIES SL'; $this->author = 'DIGITAL RETAIL TECHNOLOGIES SL';
$this->displayName = $this->l('retailCRM'); $this->displayName = $this->l('retailCRM');
$this->description = $this->l('Integration module for retailCRM'); $this->description = $this->l('Integration module for retailCRM');
@ -282,7 +282,7 @@ class RetailCRM extends Module
} elseif (!empty($exportCustomers)) { } elseif (!empty($exportCustomers)) {
return $this->export($exportCustomers, 'customer'); return $this->export($exportCustomers, 'customer');
} elseif ($updateSinceId) { } elseif ($updateSinceId) {
return $this->updateSinceId(); return $this->updateSinceId();
} elseif ($downloadLogs) { } elseif ($downloadLogs) {
return $this->downloadLogs($logNames); return $this->downloadLogs($logNames);
} else { } else {
@ -385,12 +385,14 @@ class RetailCRM extends Module
*/ */
public function export($step, $entity = 'order') public function export($step, $entity = 'order')
{ {
if (!Tools::getValue('ajax')) if (!Tools::getValue('ajax')) {
return RetailcrmJsonResponse::invalidResponse('This method allow only in ajax mode'); return RetailcrmJsonResponse::invalidResponse('This method allow only in ajax mode');
}
$step--; $step--;
if ($step < 0) if ($step < 0) {
return RetailcrmJsonResponse::invalidResponse('Invalid request data'); return RetailcrmJsonResponse::invalidResponse('Invalid request data');
}
$api = RetailcrmTools::getApiClient(); $api = RetailcrmTools::getApiClient();
@ -421,8 +423,9 @@ class RetailCRM extends Module
public function updateSinceId() public function updateSinceId()
{ {
if (!Tools::getValue('ajax')) if (!Tools::getValue('ajax')) {
return RetailcrmJsonResponse::invalidResponse('This method allow only in ajax mode'); return RetailcrmJsonResponse::invalidResponse('This method allow only in ajax mode');
}
$api = RetailcrmTools::getApiClient(); $api = RetailcrmTools::getApiClient();
@ -440,8 +443,9 @@ class RetailCRM extends Module
public function downloadLogs($name = '') public function downloadLogs($name = '')
{ {
if (!Tools::getValue('ajax')) if (!Tools::getValue('ajax')) {
return false; return false;
}
if (!empty($name)) { if (!empty($name)) {
if (false === ($filePath = RetailcrmLogger::checkFileName($name))) { if (false === ($filePath = RetailcrmLogger::checkFileName($name))) {

View File

@ -41,13 +41,13 @@ if (!defined('_PS_VERSION_')) {
} }
/** /**
* Upgrade module to version 3.2.7 * Upgrade module to version 3.3.0
* *
* @param \RetailCRM $module * @param \RetailCRM $module
* *
* @return bool * @return bool
*/ */
function upgrade_module_3_2_7($module) function upgrade_module_3_3_0($module)
{ {
if ('retailcrm' != $module->name) { if ('retailcrm' != $module->name) {
return false; return false;
@ -71,13 +71,14 @@ function retailcrm_upgrade_recursive_copy($src, $dst, $childFolder = '')
{ {
$dir = opendir($src); $dir = opendir($src);
if(!file_exists($dst)) { if (!file_exists($dst)) {
mkdir($dst); mkdir($dst);
} }
if ($childFolder != '') { if ($childFolder != '') {
if(!file_exists($dst . '/' . $childFolder)) if (!file_exists($dst . '/' . $childFolder)) {
mkdir($dst . '/' . $childFolder); mkdir($dst . '/' . $childFolder);
}
while (false !== ($file = readdir($dir))) { while (false !== ($file = readdir($dir))) {
if (($file != '.') && ($file != '..')) { if (($file != '.') && ($file != '..')) {
@ -101,4 +102,4 @@ function retailcrm_upgrade_recursive_copy($src, $dst, $childFolder = '')
} }
closedir($dir); closedir($dir);
} }

View File

@ -197,21 +197,21 @@
<div class="retail-circle"> <div class="retail-circle">
<div class="retail-circle__title">{l s='Orders' mod='retailcrm'}</div> <div class="retail-circle__title">{l s='Orders' mod='retailcrm'}</div>
<input type="text" name="RETAILCRM_EXPORT_ORDERS_COUNT" readonly="readonly" <input type="text" name="RETAILCRM_EXPORT_ORDERS_COUNT" readonly="readonly"
class="retail-circle__content" value="{$ordersCount}"/> class="retail-circle__content" value="{$ordersCount|escape:'htmlall':'UTF-8'}"/>
<input type="hidden" name="RETAILCRM_EXPORT_ORDERS_STEP_SIZE" <input type="hidden" name="RETAILCRM_EXPORT_ORDERS_STEP_SIZE"
value="{$exportOrdersStepSize}"/> value="{$exportOrdersStepSize|escape:'htmlall':'UTF-8'}"/>
</div> </div>
<div class="retail-circle"> <div class="retail-circle">
<div class="retail-circle__title"> <div class="retail-circle__title">
{l s='Customers' mod='retailcrm'} {l s='Customers' mod='retailcrm'}
</div> </div>
<input type="text" readonly="readonly" <input type="text" readonly="readonly"
title="{l s='Customers without orders' mod='retailcrm'}: {$exportCustomersCount}" title="{l s='Customers without orders' mod='retailcrm'}: {$exportCustomersCount|escape:'htmlall':'UTF-8'}"
class="retail-circle__content" value="{$customersCount}"/> class="retail-circle__content" value="{$customersCount|escape:'htmlall':'UTF-8'}"/>
<input type="hidden" name="RETAILCRM_EXPORT_CUSTOMERS_COUNT" <input type="hidden" name="RETAILCRM_EXPORT_CUSTOMERS_COUNT"
value="{$exportCustomersCount}"/> value="{$exportCustomersCount|escape:'htmlall':'UTF-8'}"/>
<input type="hidden" name="RETAILCRM_EXPORT_CUSTOMERS_STEP_SIZE" <input type="hidden" name="RETAILCRM_EXPORT_CUSTOMERS_STEP_SIZE"
value="{$exportCustomersStepSize}"/> value="{$exportCustomersStepSize|escape:'htmlall':'UTF-8'}"/>
</div> </div>
</div> </div>
<div class="retail-form__row retail-form__row_submit" <div class="retail-form__row retail-form__row_submit"
@ -296,12 +296,12 @@
<tr class="retail-table__row-top"> <tr class="retail-table__row-top">
<td> <td>
{if isset($jobsNames[$key]) } {if isset($jobsNames[$key]) }
<span title="{$key}">{l s=$jobsNames[$key] mod='retailcrm'}</span> <span title="{$key|escape:'htmlall':'UTF-8'}">{l s=$jobsNames[$key] mod='retailcrm'}</span>
{else} {else}
{$key} {$key|escape:'htmlall':'UTF-8'}
{/if} {/if}
</td> </td>
<td class="retail-table-center retail-table-no-wrap">{if isset($item['lastRun'])}{$item['lastRun']|date_format:'Y-m-d H:i:s'}{/if}</td> <td class="retail-table-center retail-table-no-wrap">{if isset($item['lastRun'])}{$item['lastRun']|date_format:'Y-m-d H:i:s'|escape:'htmlall':'UTF-8'}{/if}</td>
<td class="retail-table-center"> <td class="retail-table-center">
{if $key === $currentJob || $key === $currentJobCli} {if $key === $currentJob || $key === $currentJobCli}
<span>&#8987;</span> <span>&#8987;</span>
@ -317,13 +317,13 @@
</td> </td>
<td class="retail-collapsible"> <td class="retail-collapsible">
{if isset($item['error']['message'])} {if isset($item['error']['message'])}
<input type="checkbox" class="retail-collapsible__input" id="error_{$key}"> <input type="checkbox" class="retail-collapsible__input" id="error_{$key|escape:'htmlall':'UTF-8'}">
<label for="error_{$key}" <label for="error_{$key|escape:'htmlall':'UTF-8'}"
class="retail-collapsible__title retail-error-msg"> class="retail-collapsible__title retail-error-msg">
<span class="retail-error-msg">{$item['error']['message']}</span> <span class="retail-error-msg">{$item['error']['message']|escape:'htmlall':'UTF-8'}</span>
<p class="retail-collapsible__content"> <p class="retail-collapsible__content">
<b>{l s='StackTrace' mod='retailcrm'} <b>{l s='StackTrace' mod='retailcrm'}
:</b><br>{$item['error']['trace']} :</b><br>{$item['error']['trace']|escape:'htmlall':'UTF-8'}
</p> </p>
</label> </label>
{/if} {/if}
@ -360,9 +360,9 @@
<tbody> <tbody>
{foreach from=$retailcrmLogsInfo key=key item=logItem} {foreach from=$retailcrmLogsInfo key=key item=logItem}
<tr class="retail-table__row-top"> <tr class="retail-table__row-top">
<td>{$logItem.name}</td> <td>{$logItem.name|escape:'htmlall':'UTF-8'}</td>
<td class="retail-table-center">{$logItem.modified}</td> <td class="retail-table-center">{$logItem.modified|escape:'htmlall':'UTF-8'}</td>
<td class="retail-table-center">{$logItem.size}</td> <td class="retail-table-center">{$logItem.size|escape:'htmlall':'UTF-8'}</td>
<td class="retail-table-center"> <td class="retail-table-center">
<form class="rcrm-form-submit-trigger" <form class="rcrm-form-submit-trigger"
action="{$url_post|escape:'htmlall':'UTF-8'}&amp;configure=retailcrm&amp;ajax=1" action="{$url_post|escape:'htmlall':'UTF-8'}&amp;configure=retailcrm&amp;ajax=1"