1
0
mirror of synced 2024-11-25 14:56:09 +03:00

upd +0.4.3

This commit is contained in:
Grisha Pomadchin 2013-10-30 17:01:34 +04:00
parent 43cb653ee2
commit 45c180c40e
5 changed files with 2103 additions and 2085 deletions

View File

@ -31,7 +31,7 @@ class ICMLLoader {
$this->PrepareSettings();
$this->fp = $this->PrepareFile($this->filename);
$this->fp = $this->PrepareFile($this->filename. '.tmp');
if ($this->isLogged) {
$this->fpLog = $this->PrepareFile($this->logFile);
@ -57,6 +57,8 @@ class ICMLLoader {
$this->CloseFile($this->fp);
$this->CloseFile($this->fpLog);
unlink($_SERVER["DOCUMENT_ROOT"] . $this->filename);
rename($_SERVER["DOCUMENT_ROOT"] . $this->filename. '.tmp', $_SERVER["DOCUMENT_ROOT"] . $this->filename);
return true;

View File

@ -333,10 +333,13 @@ class ICrmOrderActions
);
if(isset($order['number']) && $order['number'])
$newOrderFields['ACCOUNT_NUMBER'] = $order['number'];
$GLOBALS['ICRM_ACCOUNT_NUMBER'] = $order['number'];
$order['externalId'] = CSaleOrder::Add($newOrderFields);
if(isset($GLOBALS['ICRM_ACCOUNT_NUMBER']))
unset($GLOBALS['ICRM_ACCOUNT_NUMBER']);
$api->orderFixExternalIds(array(array('id' => $order['id'], 'externalId' => $order['externalId'])));
if ($api->getStatusCode() != 200) {

View File

@ -249,4 +249,15 @@ class ICrmOrderEvent {
return true;
}
/**
*
* @param type $ID -- orderId
* @param type $value -- ACCOUNT_NUMBER
* @return boolean
*/
function onBeforeOrderAccountNumberSet($ID, $value) {
if(isset($GLOBALS['ICRM_ACCOUNT_NUMBER']) && $GLOBALS['ICRM_ACCOUNT_NUMBER'])
return $GLOBALS['ICRM_ACCOUNT_NUMBER'];
}
}

View File

@ -890,6 +890,7 @@ class intaro_intarocrm extends CModule {
RegisterModule($this->MODULE_ID);
RegisterModuleDependences("sale", "OnSalePayOrder", $this->MODULE_ID, "ICrmOrderEvent", "onSalePayOrder");
RegisterModuleDependences("sale", "OnSaleCancelOrder", $this->MODULE_ID, "ICrmOrderEvent", "onSaleCancelOrder");
RegisterModuleDependences("sale", "OnBeforeOrderAccountNumberSet", $this->MODULE_ID, "ICrmOrderEvent", "onBeforeOrderAccountNumberSet");
$this->CopyFiles();
if (isset($_POST['LOAD_NOW'])) {
@ -1061,6 +1062,7 @@ class intaro_intarocrm extends CModule {
UnRegisterModuleDependences("sale", "OnOrderNewSendEmail", $this->MODULE_ID, "ICrmOrderEvent", "onSendOrderMail");
UnRegisterModuleDependences("sale", "OnOrderUpdate", $this->MODULE_ID, "ICrmOrderEvent", "onUpdateOrder");
UnRegisterModuleDependences("sale", "OnBeforeOrderAdd", $this->MODULE_ID, "ICrmOrderEvent", "onBeforeOrderAdd");
UnRegisterModuleDependences("sale", "OnBeforeOrderAccountNumberSet", $this->MODULE_ID, "ICrmOrderEvent", "onBeforeOrderAccountNumberSet");
if (CModule::IncludeModule("catalog")) {
if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/bitrix/php_interface/include/catalog_export/' . $this->INTARO_CRM_EXPORT . '_run.php')) {
$dbProfile = CCatalogExport::GetList(array(), array("FILE_NAME" => $this->INTARO_CRM_EXPORT));

View File

@ -1,5 +1,5 @@
<?
$arModuleVersion = array(
"VERSION" => "0.4.3",
"VERSION_DATE" => "2013-10-29 15:28:00",
"VERSION_DATE" => "2013-10-30 16:04:00",
);