%PDF- %PDF- 403WebShell
403Webshell
Server IP : 37.220.80.31  /  Your IP : 3.144.117.167
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux 3051455-guretool.twc1.net 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64
User : www-root ( 1010)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/www-root/data/www/dev.artlot24.ru/bitrix/modules/sale/install/components/bitrix/sale.delivery.request.processed/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/www-root/data/www/dev.artlot24.ru/bitrix/modules/sale/install/components/bitrix/sale.delivery.request.processed/class.php
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();

use Bitrix\Sale\Delivery\Services,
	Bitrix\Sale\Delivery\Requests,
	Bitrix\Main\Localization\Loc;


require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/sale/lib/internals/input.php");

class CSaleDeliveryRequestProcessComponent extends CBitrixComponent
{
	public function checkParams($params)
	{
		if(!isset($params["SHIPMENTS_ERRORS"]))
			throw new \Bitrix\Main\ArgumentNullException('params["SHIPMENTS_ERRORS"]');

		if(!isset($params["DELIVERY_ID"]))
			throw new \Bitrix\Main\ArgumentNullException('params["DELIVERY_ID"]');

		if(!isset($params["DELIVERY_REQUESTS"]))
			throw new \Bitrix\Main\ArgumentNullException('params["DELIVERY_REQUESTS"]');

		if(!isset($params["SHIPMENTS_COUNT"]))
			throw new \Bitrix\Main\ArgumentNullException('params["SHIPMENTS_COUNT"]');

		if(!isset($params["WEIGHT"]))
			throw new \Bitrix\Main\ArgumentNullException('params["WEIGHT"]');

		if(!isset($params["ACTION"]))
			throw new \Bitrix\Main\ArgumentNullException('params["ACTION"]');

		return true;
	}

	/**
	 * @param array $params
	 * @return array
	 */
	public function onPrepareComponentParams($params)
	{
		$params = parent::onPrepareComponentParams($params);

		$params["WEIGHT"] = round(floatval($params["WEIGHT"]), 2);
		$params["SHIPMENTS_COUNT"] = intval($params["SHIPMENTS_COUNT"]);
		$params["DELIVERY_ID"] = intval($params["DELIVERY_ID"]);
		$params["SHIPMENTS_ERRORS"] = intval($params["SHIPMENTS_ERRORS"]);

		return $params;
	}

	public function executeComponent()
	{
		global $APPLICATION;

		if ($APPLICATION->GetGroupRight("sale") < "U")
		{
			ShowError(Loc::getMessage('SALE_CSDRP_ACCESS_DENIED'));
			return;
		}

		if (!\Bitrix\Main\Loader::includeModule('sale'))
		{
			ShowError(Loc::getMessage('SALE_CSDRP_SALE_NOT_INCLUDED'));
			return;
		}

		try
		{
			$this->checkParams($this->arParams);
		}
		catch(\Exception $e)
		{
			ShowError($e->getMessage());
			return;
		}

		$res = Services\Table::getList(array(
			'filter' => array(
				'=ID' => $this->arParams['DELIVERY_ID']
			),
			'select' => array('*', 'PARENT_CLASS_NAME' => 'PARENT.CLASS_NAME')
		));

		if($fields = $res->fetch())
		{
			if(!Services\Manager::isDeliveryServiceClassValid($fields['CLASS_NAME']))
			{
				ShowError('Delivery class "'.$fields['CLASS_NAME'].'" is not valid');
				return;
			}

			$deliveryId = $fields['ID'];

			if(!($deliveryRequestHandler = Requests\Manager::getDeliveryRequestHandlerByDeliveryId($deliveryId)))
			{
				ShowError(Loc::getMessage('SALE_CSDRP_DELIVERY_NOT_SUPPORTED', array('#DELIVERY_ID#' => $fields['ID'])));
				return;
			}

			$deliveryId = $deliveryRequestHandler->getHandlingDeliveryServiceId();

			if(!($delivery = Services\Manager::getObjectById($deliveryId)))
			{
				ShowError(Loc::getMessage('SALE_CSDRP_OBJECT_DELIVERY_ERROR', array('#DELIVERY_ID#' => $fields['ID'])));
				return;
			}

			$logo = intval($fields['LOGOTIP']) > 0 ? CFile::GetFileArray($fields['LOGOTIP']) : array();

			$this->arResult['DELIVERY'] = array(
				'NAME' => htmlspecialcharsbx($delivery->getNameWithParent()),
				'LOGO_SRC' => isset($logo['SRC']) ? $logo['SRC'] : "/bitrix/images/sale/logo-default-d.gif",
				'EDIT_LINK' => '/bitrix/admin/sale_delivery_service_edit.php?ID='.$deliveryId.'&lang='.LANGUAGE_ID,
				'ID' => $deliveryId
			);
		}

		$this->arResult['DELIVERY_REQUESTS'] = array();

		foreach($this->arParams['DELIVERY_REQUESTS'] as $requestId => $params)
		{
			if($params['SHIPMENTS_COUNT'] > 0)
			{
				$this->arResult['DELIVERY_REQUESTS'][$requestId] = array(
					'VIEW_LINK' => Requests\Helper::getRequestViewLink($requestId),
					'SHIPMENTS_COUNT' => $params['SHIPMENTS_COUNT']
				);
			}
		}

		$this->includeComponentTemplate();
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit