From 8c90db7d2c6659df135bf361290956d5548d7b06 Mon Sep 17 00:00:00 2001 From: Dmitry Mamontov Date: Mon, 16 Feb 2015 11:44:14 +0300 Subject: [PATCH] clear trash && fix find user --- .../classes/general/ICrmOrderActions.php | 42 +++---------------- 1 file changed, 6 insertions(+), 36 deletions(-) diff --git a/intaro.intarocrm/classes/general/ICrmOrderActions.php b/intaro.intarocrm/classes/general/ICrmOrderActions.php index 7cf5a177..b80c6df4 100755 --- a/intaro.intarocrm/classes/general/ICrmOrderActions.php +++ b/intaro.intarocrm/classes/general/ICrmOrderActions.php @@ -1047,37 +1047,13 @@ class ICrmOrderActions public static function uploadOrdersAgent() { self::uploadOrders(); $failedIds = unserialize(COption::GetOptionString(self::$MODULE_ID, self::$CRM_ORDER_FAILED_IDS, 0)); - if(is_array($failedIds) && !empty($failedIds)) - self::uploadOrders(50, true); // upload failed orders + if (is_array($failedIds) && !empty($failedIds)) { + self::uploadOrders(50, true); + } return 'ICrmOrderActions::uploadOrdersAgent();'; } - /** - * - * Agent function - * - * @return self name - */ - - public static function orderHistoryAgent() { - self::orderHistory(); - return 'ICrmOrderActions::orderHistoryAgent();'; - } - - /** - * - * Agent function - * - * @return self name - */ - - public static function notForkedOrderAgent() { - self::uploadOrdersAgent(); - self::orderHistory(); - return 'ICrmOrderActions::notForkedOrderAgent();'; - } - /** * * Agent function @@ -1086,18 +1062,12 @@ class ICrmOrderActions */ public static function orderAgent() { - $rsSites = CSite::GetList($by, $sort, array('DEF' => 'Y')); - $defaultSite = array(); - while ($ar = $rsSites->Fetch()) { - $defaultSite = $ar; - break; - } - if(COption::GetOptionString('main', 'agents_use_crontab', 'N') != 'N') { define('NO_AGENT_CHECK', true); } - self::notForkedOrderAgent(); + self::uploadOrdersAgent(); + self::orderHistory(); return 'ICrmOrderActions::orderAgent();'; } @@ -1520,7 +1490,7 @@ class RetailUser extends CUser public function GetID() { - $rsUser = CUser::GetList(($by='ID'), ($order='DESC'), array('LOGIN' => '%retailcrm%')); + $rsUser = CUser::GetList(($by='ID'), ($order='DESC'), array('LOGIN' => 'retailcrm%')); if ($arUser = $rsUser->Fetch()) { return $arUser['ID']; } else {