diff --git a/intaro.intarocrm/classes/general/ICrmOrderActions.php b/intaro.intarocrm/classes/general/ICrmOrderActions.php index d2128d2c..d21719f8 100755 --- a/intaro.intarocrm/classes/general/ICrmOrderActions.php +++ b/intaro.intarocrm/classes/general/ICrmOrderActions.php @@ -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 diff --git a/intaro.intarocrm/install/index.php b/intaro.intarocrm/install/index.php index 57f8633f..f5381545 100755 --- a/intaro.intarocrm/install/index.php +++ b/intaro.intarocrm/install/index.php @@ -906,10 +906,7 @@ class intaro_intarocrm extends CModule } } - // - - //agent - + //agents $dateAgent = new DateTime(); $intAgent = new DateInterval('PT60S'); // PT60S - 60 sec; $dateAgent->add($intAgent); @@ -924,6 +921,17 @@ class intaro_intarocrm extends CModule $dateAgent->format('d.m.Y H:i:s'), // date of first start 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);