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

+orderHistory agent

This commit is contained in:
Grisha Pomadchin 2013-09-04 20:49:07 +04:00
parent 1d611ef2f7
commit 0ce0403311
2 changed files with 24 additions and 4 deletions

View File

@ -452,6 +452,18 @@ class ICrmOrderActions
return 'ICrmOrderActions::uploadOrdersAgent();';
}
/**
*
* Agent function
*
* @return self name
*/
public static function orderHistoryAgent() {
self::orderHistory();
return 'ICrmOrderActions::orderHistoryAgent();';
}
/**
*
* creates order or returns array of order and customer for mass upload

View File

@ -906,10 +906,7 @@ class intaro_intarocrm extends CModule
}
}
//
//agent
//agents
$dateAgent = new DateTime();
$intAgent = new DateInterval('PT60S'); // PT60S - 60 sec;
$dateAgent->add($intAgent);
@ -925,6 +922,17 @@ class intaro_intarocrm extends CModule
30
);
CAgent::AddAgent(
"ICrmOrderActions::orderHistoryAgent();",
$this->MODULE_ID,
"N",
600, // interval - 10 mins
$dateAgent->format('d.m.Y H:i:s'), // date of first check
"Y", // агент активен
$dateAgent->format('d.m.Y H:i:s'), // date of first start
30
);
$api_host = COption::GetOptionString($this->MODULE_ID, $this->CRM_API_HOST_OPTION, 0);
$api_key = COption::GetOptionString($this->MODULE_ID, $this->CRM_API_KEY_OPTION, 0);
$this->INTARO_CRM_API = new \IntaroCrm\RestApi($api_host, $api_key);