1
0
mirror of synced 2024-11-29 08:46: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 $ID - Order id
* @param mixed $arFields - Order arFields * @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']) if(isset($GLOBALS['INTARO_CRM_ORDER_ADD']) && $GLOBALS['INTARO_CRM_ORDER_ADD'])
return; return;
@ -123,13 +123,13 @@ class ICrmOrderEvent {
if (is_array($arFields) && !empty($arFields)) { if (is_array($arFields) && !empty($arFields)) {
$arFieldsNew = array( $arFieldsNew = array(
'USER_ID' => $arOrder['USER_ID'], 'USER_ID' => $arOrder['USER_ID'],
'ID' => $ID, 'ID' => $ID,
'PERSON_TYPE_ID' => $arOrder['PERSON_TYPE_ID'], 'PERSON_TYPE_ID' => $arOrder['PERSON_TYPE_ID'],
'CANCELED' => $arOrder['CANCELED'], 'CANCELED' => $arOrder['CANCELED'],
'STATUS_ID' => $arOrder['STATUS_ID'], 'STATUS_ID' => $arOrder['STATUS_ID'],
'DATE_INSERT' => $arOrder['DATE_INSERT'], 'DATE_INSERT' => $arOrder['DATE_INSERT'],
'LID' => $arOrder['LID'] 'LID' => $arOrder['LID']
); );
$arFieldsNew = array_merge($arFieldsNew, $arFields); $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", "OnSalePayOrder", $this->MODULE_ID, "ICrmOrderEvent", "onSalePayOrder");
UnRegisterModuleDependences("sale", "OnSaleCancelOrder", $this->MODULE_ID, "ICrmOrderEvent", "onSaleCancelOrder"); UnRegisterModuleDependences("sale", "OnSaleCancelOrder", $this->MODULE_ID, "ICrmOrderEvent", "onSaleCancelOrder");
UnRegisterModuleDependences("sale", "OnOrderNewSendEmail", $this->MODULE_ID, "ICrmOrderEvent", "onSendOrderMail"); 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"); UnRegisterModuleDependences("sale", "OnBeforeOrderAdd", $this->MODULE_ID, "ICrmOrderEvent", "onBeforeOrderAdd");
if (CModule::IncludeModule("catalog")) { if (CModule::IncludeModule("catalog")) {
if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/bitrix/php_interface/include/catalog_export/' . $this->INTARO_CRM_EXPORT . '_run.php')) { 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)) { if (($orderDischarge != $previousDischarge) && ($orderDischarge == 0)) {
// remove depenedencies // remove depenedencies
UnRegisterModuleDependences("sale", "OnOrderNewSendEmail", $mid, "ICrmOrderEvent", "onSendOrderMail"); UnRegisterModuleDependences("sale", "OnOrderNewSendEmail", $mid, "ICrmOrderEvent", "onSendOrderMail");
UnRegisterModuleDependences("sale", "OnBeforeOrderUpdate", $mid, "ICrmOrderEvent", "onBeforeUpdateOrder"); UnRegisterModuleDependences("sale", "OnOrderUpdate", $mid, "ICrmOrderEvent", "onUpdateOrder");
UnRegisterModuleDependences("sale", "OnBeforeOrderAdd", $mid, "ICrmOrderEvent", "onBeforeOrderAdd"); UnRegisterModuleDependences("sale", "OnBeforeOrderAdd", $mid, "ICrmOrderEvent", "onBeforeOrderAdd");
} else if (($orderDischarge != $previousDischarge) && ($orderDischarge == 1)) { } else if (($orderDischarge != $previousDischarge) && ($orderDischarge == 1)) {
// event dependencies // event dependencies
RegisterModuleDependences("sale", "OnOrderNewSendEmail", $mid, "ICrmOrderEvent", "onSendOrderMail"); RegisterModuleDependences("sale", "OnOrderNewSendEmail", $mid, "ICrmOrderEvent", "onSendOrderMail");
RegisterModuleDependences("sale", "OnBeforeOrderUpdate", $mid, "ICrmOrderEvent", "onBeforeUpdateOrder"); RegisterModuleDependences("sale", "OnOrderUpdate", $mid, "ICrmOrderEvent", "onUpdateOrder");
RegisterModuleDependences("sale", "OnBeforeOrderAdd", $mid, "ICrmOrderEvent", "onBeforeOrderAdd"); RegisterModuleDependences("sale", "OnBeforeOrderAdd", $mid, "ICrmOrderEvent", "onBeforeOrderAdd");
} }