Rebase master (#132)
* Payment status fix * fix error during installation when orders count equals zero (#130) * Fixed module installation error when there are no orders * New module structure (refactoring) * simple serializer and deserializer with models, new architecture * move logic to strategies * datetime strategy, some changes in order to make subtype parsing possible * fallback to array casting for internal objects * serializer now supports typed arrays and formatted DateTime * models, prevent hangup from circular serialization of empty entities, improve compatibility with JMS Serializer (to simplify usage), (de)serialization callbacks * fuser repository & correct annotations * correct naming for proxy * move several helper methods to the new structure * customizable customer building * more models, api corporate customer builder & bitrix customer builder * AbstractApiModel shoudn't implement Traversable * check if user exists in the order before building corporate customer * don't check _rc cookie; it's untestable for now * better structure + service locator, cookie extraction should be testable now * enable forgotten domaincollector cookie extraction * partial api client facade implementation (full implementation is not necessary for now) * remove unimportant assert in tests, move utils to service * move identifierspair to correct directory * move CookieExtractor assert to a single test * more models & ClientAdapter * fix DateTimeConverter test compatibility with lower php versions * update test date format * finish customer-related methods in the client facade, fixes in models * minor tweaks for (de)serializer, compatibility layer for models which implement types without full functionality * make model's getters nullable * better logic for AbstractSerializableModel * different logic for AbstractSerializableModel * ability to create filled AbstractSerializableModel by passing primary key value * reuse logic from repositories for passing primary as constructor parameter for AbstractSerializableModel * Loyalty feature installer (#118) * fixes for crash during the installation * add LP activate option * add custom fields * add events hadler and bonus pay system * add check for the existence of an event and add orm tomodule * add any repository and new-style models * included class files in install.php * delete annotation generator * fix unserialize problem on step 4
This commit is contained in:
parent
f0944b954c
commit
22172bec36
7 changed files with 43 additions and 12 deletions
|
@ -1,3 +1,9 @@
|
|||
## 2020-09-02 v.5.4.6
|
||||
* Исправлена ошибка установки модуля при отсутствии заказов в Битрикс
|
||||
|
||||
## 2020-09-02 v.5.4.5
|
||||
* Исправлена ошибка установки статуса оплаты в заказе
|
||||
|
||||
## 2020-08-26 v.5.4.4
|
||||
* Исправлена ошибка при установке модуля
|
||||
|
||||
|
|
|
@ -260,7 +260,7 @@ class RCrmActions
|
|||
public static function fromJSON($str)
|
||||
{
|
||||
/** @var \Intaro\RetailCrm\Service\Utils $utils */
|
||||
$utils = ServiceLocator::get(\Intaro\RetailCrm\Service\Utils::class);
|
||||
$utils = ServiceLocator::getOrCreate(\Intaro\RetailCrm\Service\Utils::class);
|
||||
return $utils->fromUTF8($str);
|
||||
}
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
- Исправлена ошибка при установке модуля
|
||||
- Исправлена ошибка установки модуля при отсутствии заказов в Битрикс
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
*/
|
||||
global $MESS;
|
||||
|
||||
|
||||
use Bitrix\Main\ArgumentException;
|
||||
use Bitrix\Main\EventManager;
|
||||
use Bitrix\Main\Loader;
|
||||
|
@ -31,7 +30,6 @@ use Intaro\RetailCrm\Repository\OrderPropsRepository;
|
|||
use Intaro\RetailCrm\Repository\PersonTypeRepository;
|
||||
use Intaro\RetailCrm\Repository\ToModuleRepository;
|
||||
|
||||
|
||||
IncludeModuleLangFile(__FILE__);
|
||||
if (class_exists('intaro_retailcrm')) {
|
||||
return false;
|
||||
|
@ -39,7 +37,6 @@ if (class_exists('intaro_retailcrm')) {
|
|||
|
||||
class intaro_retailcrm extends CModule
|
||||
{
|
||||
|
||||
public const LP_ORDER_GROUP_NAME = 'Программа лояльности';
|
||||
public const BONUS_COUNT = 'Количество бонусов';
|
||||
public const BONUS_PAY_SYSTEM_NAME = 'Оплата бонусами';
|
||||
|
@ -60,6 +57,7 @@ class intaro_retailcrm extends CModule
|
|||
['EVENT_NAME' => 'OnSaleOrderDeleted', 'FROM_MODULE' => 'sale'],
|
||||
['EVENT_NAME' => 'OnSaleComponentOrderOneStepProcess', 'FROM_MODULE' => 'sale'],
|
||||
];
|
||||
|
||||
public const V5 = 'v5';
|
||||
public $MODULE_ID = 'intaro.retailcrm';
|
||||
public $OLD_MODULE_ID = 'intaro.intarocrm';
|
||||
|
@ -230,6 +228,26 @@ class intaro_retailcrm extends CModule
|
|||
}
|
||||
|
||||
|
||||
include($this->INSTALL_PATH . '/../lib/model/bitrix/abstractmodelproxy.php');
|
||||
include($this->INSTALL_PATH . '/../lib/model/bitrix/orderprops.php');
|
||||
include($this->INSTALL_PATH . '/../lib/model/bitrix/tomodule.php');
|
||||
include($this->INSTALL_PATH . '/../lib/repository/abstractrepository.php');
|
||||
include($this->INSTALL_PATH . '/../lib/repository/orderpropsrepository.php');
|
||||
include($this->INSTALL_PATH . '/../lib/repository/persontyperepository.php');
|
||||
include($this->INSTALL_PATH . '/../lib/repository/tomodulerepository.php');
|
||||
include($this->INSTALL_PATH . '/../lib/model/bitrix/orm/tomodule.php');
|
||||
|
||||
$this->CopyFiles();
|
||||
$this->addBonusPaySystem();
|
||||
$this->addLPUserFields();
|
||||
$this->addLPEvents();
|
||||
|
||||
try {
|
||||
$this->addLPOrderProps();
|
||||
} catch (ObjectPropertyException | ArgumentException | SystemException $e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
include($this->INSTALL_PATH . '/../lib/model/bitrix/abstractmodelproxy.php');
|
||||
include($this->INSTALL_PATH . '/../lib/model/bitrix/orderprops.php');
|
||||
include($this->INSTALL_PATH . '/../lib/model/bitrix/tomodule.php');
|
||||
|
@ -657,11 +675,17 @@ class intaro_retailcrm extends CModule
|
|||
} else {
|
||||
$finish = (int)$_POST['finish'];
|
||||
}
|
||||
$percent = round(100 - ($countLeft * 100 / $countAll), 1);
|
||||
|
||||
|
||||
if (!$countAll) {
|
||||
$percent = 100;
|
||||
} else {
|
||||
$percent = round(100 - ($countLeft * 100 / $countAll), 1);
|
||||
}
|
||||
|
||||
if (!$countLeft) {
|
||||
$finish = 1;
|
||||
}
|
||||
|
||||
$APPLICATION->RestartBuffer();
|
||||
header('Content-Type: application/x-javascript; charset=' . LANG_CHARSET);
|
||||
die(json_encode(["finish" => $finish, "percent" => $percent]));
|
||||
|
@ -1020,6 +1044,7 @@ class intaro_retailcrm extends CModule
|
|||
);
|
||||
|
||||
$this->CopyFiles();
|
||||
|
||||
if (isset($_POST['LOAD_NOW'])) {
|
||||
$loader = new RetailCrmICML();
|
||||
$loader->iblocks = $iblocks;
|
||||
|
@ -1293,7 +1318,7 @@ class intaro_retailcrm extends CModule
|
|||
|
||||
public function CopyFiles(): void
|
||||
{
|
||||
$pathFrom = $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/' . $this->MODULE_ID . '/install';
|
||||
$pathFrom = $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/' . $this->MODULE_ID . '/install';
|
||||
|
||||
CopyDirFiles(
|
||||
$pathFrom . '/export',
|
||||
|
@ -1713,4 +1738,5 @@ class intaro_retailcrm extends CModule
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?
|
||||
$arModuleVersion = array(
|
||||
"VERSION" => "5.4.4",
|
||||
"VERSION_DATE" => "2020-08-26 10:50:00"
|
||||
"VERSION" => "5.4.6",
|
||||
"VERSION_DATE" => "2020-09-02 14:40:00"
|
||||
);
|
||||
|
|
|
@ -103,7 +103,7 @@ class ConfigProvider
|
|||
|
||||
/** @var bool|null|string $loyaltyProgramStatus */
|
||||
protected static $loyaltyProgramStatus;
|
||||
|
||||
|
||||
/**
|
||||
* @return bool|string|null
|
||||
*/
|
||||
|
|
|
@ -105,7 +105,6 @@ class ServiceLocator
|
|||
return $service;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets service into ServiceContainer.
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue