Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/lpost.delivery/lib/components/ |
Upload File : |
<? namespace Lpost\Delivery\Components; use Bitrix\Main\Localization\Loc; use Lpost\Delivery\Handlers\Pvz; use Lpost\Delivery\Handlers\Zone; use Lpost\Delivery\Order\OrderManager; use Lpost\Delivery\Order\Property\Entity\PropertyTimeDelivery; use Lpost\Delivery\Settings; Loc::loadMessages(__FILE__); \Bitrix\Main\Loader::IncludeModule("sale"); class Soa { public static function calculateDelivery($order, &$arUserResult, $request, &$arParams, &$arResult) { $GLOBALS['APPLICATION']->IncludeComponent("lpost:delivery.soa", ".default", [ "ORDER" => $order ],false); $yandexKey = Settings::getInstance()->getOption("yandex_map_api_key"); $yandexMapActive = Settings::getInstance()->getOption("yandex_map_active"); $yandexKeySuggest = Settings::getInstance()->getOption("yandex_geo_suggest_api_key"); if($yandexMapActive == 'Y' && !empty($yandexKey)) { global $APPLICATION; $APPLICATION->AddHeadString( '<script type="text/javascript" src="https://api-maps.yandex.ru/2.1/?lang=ru_RU&coordorder=latlong&apikey='.$yandexKey.'&suggest_apikey='.$yandexKeySuggest.'"></script>', true, false, \Bitrix\Main\Page\AssetLocation::AFTER_JS_KERNEL ); } } /** * @deprecated */ public static function getLpostProfilesDeliveryList() { $arProfiles = []; foreach (self::getLpostDeliveryList() as $delivery) { if($delivery['PARENT_ID'] > 0) { $arProfiles[] = $delivery; } } return $arProfiles; } /** * @deprecated */ public static function getLpostDeliveryList() { $arLpostDelivery = []; $arDelivery = \Bitrix\Sale\Delivery\Services\Manager::getActiveList(); foreach ($arDelivery as $delivery) { if(strpos($delivery['CLASS_NAME'], "Lpost")) { $arLpostDelivery[] = $delivery; } } return $arLpostDelivery; } /** * @deprecated */ public static function getListProfile($order) { $deliveryListLpost = []; $deliveryList = []; foreach ($order->getShipmentCollection() as $shipment) { if (!$shipment->isSystem()) { $deliveryList = \Bitrix\Sale\Delivery\Services\Manager::getRestrictedList( $shipment, \Bitrix\Sale\Services\Base\RestrictionManager::MODE_MANAGER ); } } foreach ($deliveryList as $delivery) { if(strpos($delivery['CLASS_NAME'], "Lpost")) { if($delivery['PARENT_ID'] != 0) { $deliveryListLpost[] = $delivery; } } } return $deliveryListLpost; } /** * @deprecated */ public static function isProfileLpost(\Bitrix\Sale\Order $order, $profileId) { $LProfiles = self::getListProfile($order); foreach ($LProfiles as $LProfile) { if($LProfile["ID"] == $profileId) { return true; } } return false; } /** * @deprecated * @param $deliveryId * @return false|string * @throws \Bitrix\Main\ArgumentNullException * @throws \Bitrix\Main\SystemException */ public static function getProfileType($deliveryId) { $deliveryObject = \Bitrix\Sale\Delivery\Services\Manager::getObjectById($deliveryId); if($deliveryObject instanceof Pvz) { return Pvz::TYPE; } if($deliveryObject instanceof Zone) { return Zone::TYPE; } return false; } } ?>