Skip to content

Commit

Permalink
Bump version, fixed formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
opheugene committed May 29, 2021
1 parent d4982bb commit 4fb5030
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 28 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## v3.3.0
* Добавлена возможность ручной выгрузки архива клиентов и заказов в RetailCRM
* Добавлены фильтры для упрощенной модификации данных
* Изменен путь хранения логов, добавлена автоматическая очистка старых логов
* Изменен путь для файлов кастомизации модуля, файлы необходимо размещать в папке /custom/classes внутри модуля
* Включение debug-режима в модуле перенесено в настройки в базе данных
* Улучшена работа JobManager, добавлена страница с отладочной информацией о работе
* Добавлена команда для сброса метки истории из RetailCRM
* Добавлена команда для очистки старых файлов логов
* Исправлена ошибка с форматом тегов при обновлении клиентов

## v3.2.6
* Исправлена ошибка при сохранении настроек модуля на старых версиях PrestaShop

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.6
3.3.0
16 changes: 10 additions & 6 deletions retailcrm/retailcrm.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public function __construct()
{
$this->name = 'retailcrm';
$this->tab = 'export';
$this->version = '3.2.6';
$this->version = '3.3.0';
$this->author = 'DIGITAL RETAIL TECHNOLOGIES SL';
$this->displayName = $this->l('retailCRM');
$this->description = $this->l('Integration module for retailCRM');
Expand Down Expand Up @@ -282,7 +282,7 @@ public function getContent()
} elseif (!empty($exportCustomers)) {
return $this->export($exportCustomers, 'customer');
} elseif ($updateSinceId) {
return $this->updateSinceId();
return $this->updateSinceId();
} elseif ($downloadLogs) {
return $this->downloadLogs($logNames);
} else {
Expand Down Expand Up @@ -385,12 +385,14 @@ public function uploadOrders($orderIds)
*/
public function export($step, $entity = 'order')
{
if (!Tools::getValue('ajax'))
if (!Tools::getValue('ajax')) {
return RetailcrmJsonResponse::invalidResponse('This method allow only in ajax mode');
}

$step--;
if ($step < 0)
if ($step < 0) {
return RetailcrmJsonResponse::invalidResponse('Invalid request data');
}

$api = RetailcrmTools::getApiClient();

Expand Down Expand Up @@ -421,8 +423,9 @@ public function export($step, $entity = 'order')

public function updateSinceId()
{
if (!Tools::getValue('ajax'))
if (!Tools::getValue('ajax')) {
return RetailcrmJsonResponse::invalidResponse('This method allow only in ajax mode');
}

$api = RetailcrmTools::getApiClient();

Expand All @@ -440,8 +443,9 @@ public function updateSinceId()

public function downloadLogs($name = '')
{
if (!Tools::getValue('ajax'))
if (!Tools::getValue('ajax')) {
return false;
}

if (!empty($name)) {
if (false === ($filePath = RetailcrmLogger::checkFileName($name))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@
}

/**
* Upgrade module to version 3.2.7
* Upgrade module to version 3.3.0
*
* @param \RetailCRM $module
*
* @return bool
*/
function upgrade_module_3_2_7($module)
function upgrade_module_3_3_0($module)
{
if ('retailcrm' != $module->name) {
return false;
Expand All @@ -71,13 +71,14 @@ function retailcrm_upgrade_recursive_copy($src, $dst, $childFolder = '')
{
$dir = opendir($src);

if(!file_exists($dst)) {
if (!file_exists($dst)) {
mkdir($dst);
}

if ($childFolder != '') {
if(!file_exists($dst . '/' . $childFolder))
if (!file_exists($dst . '/' . $childFolder)) {
mkdir($dst . '/' . $childFolder);
}

while (false !== ($file = readdir($dir))) {
if (($file != '.') && ($file != '..')) {
Expand All @@ -101,4 +102,4 @@ function retailcrm_upgrade_recursive_copy($src, $dst, $childFolder = '')
}

closedir($dir);
}
}
32 changes: 16 additions & 16 deletions retailcrm/views/templates/admin/settings.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -197,21 +197,21 @@
<div class="retail-circle">
<div class="retail-circle__title">{l s='Orders' mod='retailcrm'}</div>
<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"
value="{$exportOrdersStepSize}"/>
value="{$exportOrdersStepSize|escape:'htmlall':'UTF-8'}"/>
</div>
<div class="retail-circle">
<div class="retail-circle__title">
{l s='Customers' mod='retailcrm'}
</div>
<input type="text" readonly="readonly"
title="{l s='Customers without orders' mod='retailcrm'}: {$exportCustomersCount}"
class="retail-circle__content" value="{$customersCount}"/>
title="{l s='Customers without orders' mod='retailcrm'}: {$exportCustomersCount|escape:'htmlall':'UTF-8'}"
class="retail-circle__content" value="{$customersCount|escape:'htmlall':'UTF-8'}"/>
<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"
value="{$exportCustomersStepSize}"/>
value="{$exportCustomersStepSize|escape:'htmlall':'UTF-8'}"/>
</div>
</div>
<div class="retail-form__row retail-form__row_submit"
Expand Down Expand Up @@ -296,12 +296,12 @@
<tr class="retail-table__row-top">
<td>
{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}
{$key}
{$key|escape:'htmlall':'UTF-8'}
{/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'}{/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">
{if $key === $currentJob || $key === $currentJobCli}
<span>&#8987;</span>
Expand All @@ -317,13 +317,13 @@
</td>
<td class="retail-collapsible">
{if isset($item['error']['message'])}
<input type="checkbox" class="retail-collapsible__input" id="error_{$key}">
<label for="error_{$key}"
<input type="checkbox" class="retail-collapsible__input" id="error_{$key|escape:'htmlall':'UTF-8'}">
<label for="error_{$key|escape:'htmlall':'UTF-8'}"
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">
<b>{l s='StackTrace' mod='retailcrm'}
:</b><br>{$item['error']['trace']}
:</b><br>{$item['error']['trace']|escape:'htmlall':'UTF-8'}
</p>
</label>
{/if}
Expand Down Expand Up @@ -360,9 +360,9 @@
<tbody>
{foreach from=$retailcrmLogsInfo key=key item=logItem}
<tr class="retail-table__row-top">
<td>{$logItem.name}</td>
<td class="retail-table-center">{$logItem.modified}</td>
<td class="retail-table-center">{$logItem.size}</td>
<td>{$logItem.name|escape:'htmlall':'UTF-8'}</td>
<td class="retail-table-center">{$logItem.modified|escape:'htmlall':'UTF-8'}</td>
<td class="retail-table-center">{$logItem.size|escape:'htmlall':'UTF-8'}</td>
<td class="retail-table-center">
<form class="rcrm-form-submit-trigger"
action="{$url_post|escape:'htmlall':'UTF-8'}&amp;configure=retailcrm&amp;ajax=1"
Expand Down

0 comments on commit 4fb5030

Please sign in to comment.