1
0
Fork 0
mirror of synced 2025-04-20 01:21:01 +00:00

fix codestyle after review

This commit is contained in:
Sergey Chazov 2020-08-21 13:28:19 +03:00 committed by Павел
parent 09bf0ba5fe
commit 0a0535dd80
11 changed files with 29 additions and 19 deletions

View file

@ -1,3 +1,8 @@
<?php
$filePath = $_SERVER['DOCUMENT_ROOT'] . BX_ROOT . '/modules/intaro.retailcrm/lib/component/payment/retailcrmbonus/.description.php';
if (file_exists($filePath)) {
require_once($filePath);
}
require_once($_SERVER['DOCUMENT_ROOT'] . BX_ROOT . '/modules/intaro.retailcrm/lib/component/payment/retailcrmbonus/.description.php');

View file

@ -1,3 +1,6 @@
<?php
$filePath = $_SERVER['DOCUMENT_ROOT'] . BX_ROOT . '/modules/intaro.retailcrm/lib/component/payment/retailcrmbonus/handler.php';
require_once($_SERVER['DOCUMENT_ROOT'] . BX_ROOT . '/modules/intaro.retailcrm/lib/component/payment/retailcrmbonus/handler.php');
if (file_exists($filePath)) {
require_once($filePath);
}

View file

@ -42,6 +42,7 @@ class intaro_retailcrm extends CModule
public const BONUS_PAY_SYSTEM_NAME = 'Оплата бонусами';
public const BONUS_PAY_SYSTEM_CODE = 'retailcrmbonus';
public const BONUS_PAY_SYSTEM_DESCRIPTION = 'Оплата бонусами программы лояльности retailCRM';
/**
* @var string[][]
*/
@ -1499,6 +1500,7 @@ class intaro_retailcrm extends CModule
public function addLPOrderProps(): void
{
$persons = PersonTypeRepository::getCollectionByWhere(['ID']);
foreach ($persons as $person) {
$personId = $person->getID();
$groupID = $this->getGroupID($personId);
@ -1524,6 +1526,7 @@ class intaro_retailcrm extends CModule
];
$obUserField = new CUserTypeEntity;
$dbRes = CUserTypeEntity::GetList([], ["FIELD_NAME" => $filedName])->fetch();
if (!$dbRes['ID']) {
$obUserField->Add($arProps);
}
@ -1559,6 +1562,7 @@ class intaro_retailcrm extends CModule
'NAME' => self::LP_ORDER_GROUP_NAME,
];
$result = OrderPropsGroupTable::add($groupFields);
return $result->getId();
}
}
@ -1613,7 +1617,6 @@ class intaro_retailcrm extends CModule
])
->fetchCollection();
if (count($arrPaySystemAction) === 0) {
$data = [
'NAME' => self::BONUS_PAY_SYSTEM_NAME,
@ -1661,6 +1664,7 @@ class intaro_retailcrm extends CModule
['to_method', '=', $event['EVENT_NAME'] . 'Handler'],
['to_class', '=', EventsHandlers::class],
];
try {
$events = ToModuleRepository::getCollectionByWhere($select, $where);
if ($events !== null && count($events) === 0) {
@ -1673,7 +1677,7 @@ class intaro_retailcrm extends CModule
);
}
} catch (ObjectPropertyException | ArgumentException | SystemException $exception) {
AddMessage2Log($exception->getMessage(), $this->MODULE_ID);
AddMessage2Log($exception->getMessage(), $this->MODULE_ID);
}
}
}
@ -1684,6 +1688,7 @@ class intaro_retailcrm extends CModule
private function deleteLPEvents(): void
{
$eventManager = EventManager::getInstance();
foreach (self::SUBSCRIBE_LP_EVENTS as $event){
$eventManager->unRegisterEventHandler(
$event['FROM_MODULE'],

View file

@ -15,9 +15,8 @@ namespace Intaro\RetailCrm\Component\Loyalty;
use Bitrix\Main\Event;
/**
* Class ServiceLocator
*
* @package Intaro\RetailCrm\Component\EventsHandlers
* Class EventsHandlers
* @package Intaro\RetailCrm\Component\Loyalty
*/
class EventsHandlers
{

View file

@ -33,4 +33,4 @@ class RetailCrmBonusHandler extends PaySystem\BaseServiceHandler
return [];
}
}
}

View file

@ -1,3 +1,2 @@
<?
<?php
$MESS["SALE_HPS_BONUS"] = "retailCRM bonus account";
?>

View file

@ -1,2 +1,2 @@
<?
$MESS["SALE_HPS_BONUS"] = "бонусный счет retailCRM";
<?php
$MESS["SALE_HPS_BONUS"] = "бонусный счет retailCRM";

View file

@ -18,7 +18,7 @@ use Bitrix\Sale\Internals\OrderPropsTable;
use Intaro\RetailCrm\Model\Bitrix\ORM\ToModuleTable;
/**
* Class ToModule
* Class OrderProps
*
* @package Intaro\RetailCrm\Model\Bitrix
*

View file

@ -3,7 +3,7 @@
* PHP version 7.1
*
* @category Integration
* @package Intaro\RetailCrm\Model\Api
* @package Intaro\RetailCrm\Repository
* @author retailCRM <integration@retailcrm.ru>
* @license MIT
* @link http://retailcrm.ru
@ -17,8 +17,7 @@ use Intaro\RetailCrm\Model\Bitrix\OrderProps;
/**
* Class RepositoryRepository
*
* Class OrderPropsRepository
* @package Intaro\RetailCrm\Repository
*/
class OrderPropsRepository extends AbstractRepository

View file

@ -3,7 +3,7 @@
* PHP version 7.1
*
* @category Integration
* @package Intaro\RetailCrm\Model\Api
* @package Intaro\RetailCrm\Repository
* @author retailCRM <integration@retailcrm.ru>
* @license MIT
* @link http://retailcrm.ru
@ -15,7 +15,7 @@ use Bitrix\Main\Type\Collection;
use Bitrix\Sale\Internals\PersonTypeTable;
/**
* Class ToModuleRepository
* Class PersonTypeRepository
*
* @package Intaro\RetailCrm\Repository
*/

View file

@ -3,7 +3,7 @@
* PHP version 7.1
*
* @category Integration
* @package Intaro\RetailCrm\Model\Api
* @package Intaro\RetailCrm\Repository
* @author retailCRM <integration@retailcrm.ru>
* @license MIT
* @link http://retailcrm.ru