From 3a90a7c28edec7669189e4b1a72a84b627d86887 Mon Sep 17 00:00:00 2001 From: Dmitry Mamontov Date: Fri, 13 Feb 2015 16:15:58 +0300 Subject: [PATCH] Add users to log changes of the order --- .../classes/general/ICrmOrderActions.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/intaro.intarocrm/classes/general/ICrmOrderActions.php b/intaro.intarocrm/classes/general/ICrmOrderActions.php index 340b78a3..514d954c 100755 --- a/intaro.intarocrm/classes/general/ICrmOrderActions.php +++ b/intaro.intarocrm/classes/general/ICrmOrderActions.php @@ -358,7 +358,7 @@ class ICrmOrderActions public static function orderHistory() { global $USER; if (is_object($USER) == false) { - $USER = new CUser; + $USER = new RetailUser; } if (!CModule::IncludeModule("iblock")) { @@ -1015,7 +1015,7 @@ class ICrmOrderActions if (count($orderHistory)) { COption::SetOptionString(self::$MODULE_ID, self::$CRM_ORDER_HISTORY_DATE, $dateFinish->format('Y-m-d H:i:s')); } - + $USER = new CUser; $GLOBALS['INTARO_CRM_FROM_HISTORY'] = false; return true; @@ -1525,3 +1525,16 @@ class ICrmOrderActions return $location['ID']; } } + +class RetailUser extends CUser +{ + public function GetID() + { + $rsUser = CUser::GetList(($by='ID'), ($order='DESC'), array('LOGIN' => '%retailcrm%')); + if ($arUser = $rsUser->Fetch()) { + return $arUser['ID']; + } else { + return null; + } + } +}