%PDF- %PDF-
Server IP : 37.220.80.31 / Your IP : 3.144.37.240 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.personal.order/ |
Upload File : |
<?php if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die(); use Bitrix\Main\Loader; use \Bitrix\Sale; class PersonalOrder extends CBitrixComponent { public function executeComponent() { $this->setFrameMode(false); $defaultUrlTemplates404 = array( "list" => "index.php", "detail" => "detail/#ID#", "cancel" => "cancel/#ID#", ); $componentVariables = array("CANCEL", "COPY_ORDER", "ID"); $variables = array(); $request = Bitrix\Main\Application::getInstance()->getContext()->getRequest(); if ($this->arParams["SEF_MODE"] == "Y") { $templatesUrls = CComponentEngine::makeComponentUrlTemplates($defaultUrlTemplates404, $this->arParams["SEF_URL_TEMPLATES"]); foreach ($templatesUrls as $url => $value) { $this->arResult["PATH_TO_".ToUpper($url)] = $this->arParams["SEF_FOLDER"].$value; } $variableAliases = CComponentEngine::makeComponentVariableAliases(array(), $this->arParams["VARIABLE_ALIASES"]); $componentPage = CComponentEngine::parseComponentPath( $this->arParams["SEF_FOLDER"], $templatesUrls, $variables ); CComponentEngine::initComponentVariables($componentPage, $componentVariables, $variableAliases, $variables); if ($request["CANCEL"]=="Y") { $componentPage = "cancel"; } if (empty($componentPage)) { $componentPage = 'list'; } $this->arResult = array_merge( Array( "SEF_FOLDER" => $this->arParams["SEF_FOLDER"], "URL_TEMPLATES" => $templatesUrls, "VARIABLES" => $variables, "ALIASES" => $variableAliases, ), $this->arResult ); } else { $variableAliases = CComponentEngine::makeComponentVariableAliases(array(), $this->arParams["VARIABLE_ALIASES"]); CComponentEngine::initComponentVariables(false, $componentVariables, $variableAliases, $variables); if ($request["CANCEL"]=="Y") { $componentPage = "cancel"; } elseif (!empty($variables["ID"]) && $request["COPY_ORDER"]!="Y") { $componentPage = "detail"; } else { $componentPage = "list"; } $this->arResult = array( "VARIABLES" => $variables, "ALIASES" => $variableAliases ); } if ($componentPage == "index" && $this->getTemplateName() !== "") $componentPage = "template"; if ($componentPage == "detail") { $id = urldecode(urldecode($variables["ID"])); Loader::includeModule('sale'); $registry = Sale\Registry::getInstance(Sale\Registry::REGISTRY_TYPE_ORDER); $orderClassName = $registry->getOrderClassName(); $order = $orderClassName::loadByAccountNumber($id); if (!$order) { $order = $orderClassName::load((int)$id); } /** @var Sale\Order $order */ if ($order) { if ( (is_array($this->arParams["HISTORIC_STATUSES"]) && in_array($order->getField('STATUS_ID'), $this->arParams["HISTORIC_STATUSES"])) || $order->isCanceled() ) { $delimeter = (mb_strpos($this->arResult["PATH_TO_LIST"], '?') !== false) ? '&' : '?'; $this->arResult["PATH_TO_LIST"] .= $delimeter . "filter_history=Y"; if ($order->isCanceled()) { $this->arResult["PATH_TO_LIST"] .= "&show_canceled=Y"; } } } } $this->includeComponentTemplate($componentPage); } }