diff --git a/intaro.intarocrm/classes/general/ICrmOrderActions.php b/intaro.intarocrm/classes/general/ICrmOrderActions.php index 9c243a45..063ec739 100755 --- a/intaro.intarocrm/classes/general/ICrmOrderActions.php +++ b/intaro.intarocrm/classes/general/ICrmOrderActions.php @@ -282,8 +282,6 @@ class ICrmOrderActions public static function orderHistory() { global $USER; - $GLOBALS['INTARO_CRM_FROM_HISTORY'] = true; - if(isset($_SESSION["SESS_AUTH"]["USER_ID"]) && $_SESSION["SESS_AUTH"]["USER_ID"]) { $realUser = $USER->GetID(); $USER->Logout(); @@ -374,6 +372,8 @@ class ICrmOrderActions $orderHistory = $api->orderHistory($dateStart); + $GLOBALS['INTARO_CRM_FROM_HISTORY'] = false; + // pushing existing orders foreach ($orderHistory as $order) { @@ -875,6 +875,8 @@ class ICrmOrderActions $USER->Logout(); if($realUser) $USER->Authorize($realUser); + $GLOBALS['INTARO_CRM_FROM_HISTORY'] = false; + return true; }