1
0
mirror of synced 2025-02-07 18:49:23 +03:00

Add users to log changes of the order

This commit is contained in:
Dmitry Mamontov 2015-02-13 16:15:58 +03:00
parent a570eede61
commit 3a90a7c28e

View File

@ -358,7 +358,7 @@ class ICrmOrderActions
public static function orderHistory() { public static function orderHistory() {
global $USER; global $USER;
if (is_object($USER) == false) { if (is_object($USER) == false) {
$USER = new CUser; $USER = new RetailUser;
} }
if (!CModule::IncludeModule("iblock")) { if (!CModule::IncludeModule("iblock")) {
@ -1015,7 +1015,7 @@ class ICrmOrderActions
if (count($orderHistory)) { if (count($orderHistory)) {
COption::SetOptionString(self::$MODULE_ID, self::$CRM_ORDER_HISTORY_DATE, $dateFinish->format('Y-m-d H:i:s')); 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; $GLOBALS['INTARO_CRM_FROM_HISTORY'] = false;
return true; return true;
@ -1525,3 +1525,16 @@ class ICrmOrderActions
return $location['ID']; 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;
}
}
}