403Webshell
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/TabOptions/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/lpost.delivery/lib/TabOptions/TabTech.php
<?php

namespace Lpost\Delivery\TabOptions;

use Bitrix\Main\Config\Option;
use Bitrix\Main\Localization\Loc;
use Lpost\Delivery\Order\OrderManager;
use Lpost\Delivery\Repository\RepositoryOrderStatus;
use Lpost\Delivery\Settings;

/**
 * Вывод табов для технических настроек
 */
class TabTech implements ITabOption
{
    public static function getListOptions(): array
    {
        $yandex_map_api_key = Option::getRealValue(Settings::getInstance()->getModuleId(), 'yandex_map_api_key');
        $yandex_map_api_key_fileman = Option::get('fileman', 'yandex_map_api_key');
        $currentYandexKey = (empty($yandex_map_api_key) && !empty($yandex_map_api_key_fileman)) ? $yandex_map_api_key_fileman : $yandex_map_api_key;
        
        $currentYandexGeoSuggestKey = Option::getRealValue(Settings::getInstance()->getModuleId(), 'yandex_geo_suggest_api_key');

        return [
            [
                'test_mode',
                Loc::getMessage("lpost.option_SETTING_TEST_MODE"),
                '',
                ['checkbox']
            ],
            [
                'secret_key',
                Loc::getMessage("lpost.option_SETTING_SECRET_KEY"),
                '',
                ['text', 20]
            ],
            [
                'check_connection',
                Loc::getMessage("lpost.option_SETTING_CHECK_CONNECTION"),
                '<input type="button" class="adm-btn-save check_connection" value="' . Loc::getMessage("lpost.option_SETTING_CHECK") . '"><div class="info"></div>',
                ['statichtml']
            ],
            [
                'yandex_map_active',
                Loc::getMessage("lpost.option_YANDEX_MAP_ACTIVE"),
                '',
                ['checkbox']
            ],
            [
                'yandex_map_api_key',
                Loc::getMessage("lpost.option_YANDEX_MAP_API_KEY"),
                $currentYandexKey,
                ['text', 20]
            ],
            [
                'yandex_geo_suggest_api_key',
                Loc::getMessage("lpost.option_YANDEX_GEO_SUGGEST_API_KEY"),
                $currentYandexGeoSuggestKey,
                ['text', 20]
            ],
            [
                'yandex_key_check',
                Loc::getMessage("lpost.option_SETTING_CHECK_YANDEX_KEY"),
                '<input type="button" class="adm-btn-save check_yandex_key" value="' . Loc::getMessage("lpost.option_SETTING_CHECK_YANDEX_KEY") . '"><div class="info"></div>',
                ['statichtml']
            ],
            [
                'show_additional_fields',
                Loc::getMessage("lpost.option_SETTING_SHOW_ADDITIONAL_FIELDS"),
                '',
                ['checkbox']
            ],
            [
                'date_selection_for_courier',
                Loc::getMessage("lpost.option_SETTING_DATE_SELECTION_FOR_COURIER"),
                '',
                ['checkbox']
            ],
            [
                'store_full_address_in_address_property',
                Loc::getMessage("lpost.option_STORE_FULL_ADDRESS_IN_ADDRESS_PROPERTY"),
                '',
                ['checkbox']
            ],
            [
                'show_pickup_points_only_for_selected_location',
                Loc::getMessage("lpost.option_SHOW_PICKUP_POINTS_ONLY_LOC"),
                '',
                ['checkbox']
            ],
            [
                'is_send_to_api',
                Loc::getMessage("lpost.option_SETTING_IS_SEND_TO_API"),
                'Y',
                ['checkbox']
            ],
            [
                'is_not_resend_order_for_del_sipment',
                Loc::getMessage("lpost.option_SETTING_IS_NOT_RESEND_ORDER"),
                '',
                ['checkbox']
            ],
            [
                'is_auto_allow_delivery',
                Loc::getMessage("lpost.option_SETTING_IS_AUTO_ALLOW_DELIVERY"),
                'Y',
                ['checkbox']
            ],
            [
                'send_status',
                Loc::getMessage("lpost.option_SETTING_STATUSORDER"),
                '',
                [
                    'selectbox',
                    (new RepositoryOrderStatus())->getAll(),
                ]
            ],
            [
                'send_status_setting',
                Loc::getMessage("lpost.option_SETTING_SEND_STATUSORDER"),
                '',
                [
                    'selectbox',
                    [
                        'from' => Loc::getMessage("lpost.option_SETTING_SEND_STATUSORDER_FROM"),
                        'strictly' => Loc::getMessage("lpost.option_SETTING_SEND_STATUSORDER_STRICTLY"),
                    ]
                ]
            ],
            [
                'pvz_agent', Loc::getMessage("lpost.option_PVZ_AGENT"),
                '',
                [
                    'selectbox',
                    [
                        86400 => Loc::getMessage("lpost.option_PVZ_AGENT_day"),
                        43200 => Loc::getMessage("lpost.option_PVZ_AGENT_half_day"),
                        21600 => Loc::getMessage("lpost.option_PVZ_AGENT_6hour"),
                    ]
                ]
            ],
            [
                'agent_time_check_delivery', Loc::getMessage("lpost.option_AGENT_UPDATE_DELIVERY_STATUS"),
                '',
                [
                    'selectbox',
                    [
                        3600  => Loc::getMessage("lpost.option_AGENT_UPDATE_DELIVERY_STATUS_1H"),
                        21600 => Loc::getMessage("lpost.option_AGENT_UPDATE_DELIVERY_STATUS_6H"),
                        43200 => Loc::getMessage("lpost.option_AGENT_UPDATE_DELIVERY_STATUS_12H"),
                        86400 => Loc::getMessage("lpost.option_AGENT_UPDATE_DELIVERY_STATUS_24H"),
                    ]
                ]
            ],
            [
                'logger_active',
                Loc::getMessage("lpost.option_LOGGER_ACTIVE"),
                '',
                ['checkbox']
            ],
            [
                'note' => Loc::getMessage("lpost.option_SHOW_LOGS"),
            ]
        ];
    }

    public static function isPostValidFields()
    {
        $request = \Bitrix\Main\Context::getCurrent()->getRequest();

        if (!Settings::getInstance()->checkYandexKey($request->get("yandex_map_api_key"))) {
            throw new \ErrorException(Loc::getMessage("LPOST_DELIVERY_SETTING_ERROR_YANDEX_KEY"));
        }
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit