1
0
mirror of synced 2024-11-22 05:16:09 +03:00

event fixes

This commit is contained in:
Grisha Pomadchin 2013-09-22 21:28:28 +04:00
parent 6c2552881b
commit 66c0d8998b
3 changed files with 10 additions and 10 deletions

View File

@ -32,7 +32,7 @@ class ICrmOrderEvent {
* @param mixed $ID - Order id
* @param mixed $arFields - Order arFields
*/
function onBeforeUpdateOrder($ID, $arFields) {
function onUpdateOrder($ID, $arFields) {
if(isset($GLOBALS['INTARO_CRM_ORDER_ADD']) && $GLOBALS['INTARO_CRM_ORDER_ADD'])
return;
@ -123,13 +123,13 @@ class ICrmOrderEvent {
if (is_array($arFields) && !empty($arFields)) {
$arFieldsNew = array(
'USER_ID' => $arOrder['USER_ID'],
'ID' => $ID,
'USER_ID' => $arOrder['USER_ID'],
'ID' => $ID,
'PERSON_TYPE_ID' => $arOrder['PERSON_TYPE_ID'],
'CANCELED' => $arOrder['CANCELED'],
'STATUS_ID' => $arOrder['STATUS_ID'],
'DATE_INSERT' => $arOrder['DATE_INSERT'],
'LID' => $arOrder['LID']
'CANCELED' => $arOrder['CANCELED'],
'STATUS_ID' => $arOrder['STATUS_ID'],
'DATE_INSERT' => $arOrder['DATE_INSERT'],
'LID' => $arOrder['LID']
);
$arFieldsNew = array_merge($arFieldsNew, $arFields);

View File

@ -1039,7 +1039,7 @@ class intaro_intarocrm extends CModule {
UnRegisterModuleDependences("sale", "OnSalePayOrder", $this->MODULE_ID, "ICrmOrderEvent", "onSalePayOrder");
UnRegisterModuleDependences("sale", "OnSaleCancelOrder", $this->MODULE_ID, "ICrmOrderEvent", "onSaleCancelOrder");
UnRegisterModuleDependences("sale", "OnOrderNewSendEmail", $this->MODULE_ID, "ICrmOrderEvent", "onSendOrderMail");
UnRegisterModuleDependences("sale", "OnBeforeOrderUpdate", $this->MODULE_ID, "ICrmOrderEvent", "onBeforeUpdateOrder");
UnRegisterModuleDependences("sale", "OnOrderUpdate", $this->MODULE_ID, "ICrmOrderEvent", "onUpdateOrder");
UnRegisterModuleDependences("sale", "OnBeforeOrderAdd", $this->MODULE_ID, "ICrmOrderEvent", "onBeforeOrderAdd");
if (CModule::IncludeModule("catalog")) {
if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/bitrix/php_interface/include/catalog_export/' . $this->INTARO_CRM_EXPORT . '_run.php')) {

View File

@ -218,13 +218,13 @@ if (isset($_POST['Update']) && ($_POST['Update'] == 'Y')) {
if (($orderDischarge != $previousDischarge) && ($orderDischarge == 0)) {
// remove depenedencies
UnRegisterModuleDependences("sale", "OnOrderNewSendEmail", $mid, "ICrmOrderEvent", "onSendOrderMail");
UnRegisterModuleDependences("sale", "OnBeforeOrderUpdate", $mid, "ICrmOrderEvent", "onBeforeUpdateOrder");
UnRegisterModuleDependences("sale", "OnOrderUpdate", $mid, "ICrmOrderEvent", "onUpdateOrder");
UnRegisterModuleDependences("sale", "OnBeforeOrderAdd", $mid, "ICrmOrderEvent", "onBeforeOrderAdd");
} else if (($orderDischarge != $previousDischarge) && ($orderDischarge == 1)) {
// event dependencies
RegisterModuleDependences("sale", "OnOrderNewSendEmail", $mid, "ICrmOrderEvent", "onSendOrderMail");
RegisterModuleDependences("sale", "OnBeforeOrderUpdate", $mid, "ICrmOrderEvent", "onBeforeUpdateOrder");
RegisterModuleDependences("sale", "OnOrderUpdate", $mid, "ICrmOrderEvent", "onUpdateOrder");
RegisterModuleDependences("sale", "OnBeforeOrderAdd", $mid, "ICrmOrderEvent", "onBeforeOrderAdd");
}