%PDF- %PDF-
Server IP : 37.220.80.31 / Your IP : 18.218.135.227 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/blocks/bitrix/66.100.form_cb/ |
Upload File : |
<?php if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true) { die(); } use Bitrix\Landing\Block; use Bitrix\Landing\LandingBlock; use Bitrix\Landing\Manager; use Bitrix\Landing\Subtype; use Bitrix\Main\Loader; use Bitrix\Main\Localization\Loc; use Bitrix\Socialservices\ApClient; class CallbackFormBlock extends LandingBlock { protected const CALLBACK_MARKER_PREFIX = '#crmFormCallback'; /** * Before every view checked: * If form ID already replaced - do nothing. * If first time - replace by first CB form * If not form - show alert * * @param Block $block Block instance. * @return void */ public function beforeView(Block $block) { $content = $block->getContent(); if(strpos($content, self::CALLBACK_MARKER_PREFIX) !== false) { if(($forms = Subtype\Form::getCallbackForms())) { $block->saveContent(str_replace( self::CALLBACK_MARKER_PREFIX, Subtype\Form::POPUP_MARKER_PREFIX . array_shift($forms)['ID'], $content )); $block->save(); } else { if(Loader::includeModule('crm')) { $desc = Loc::getMessage('LNDNGBLCK_CALLBACK_ERR_DESC', [ '#LINK1#' => '/telephony/', '#LINK2#' => '/crm/webform/', ]); } elseif (Manager::isB24Connector()) { //todo check $portalUrl = ApClient::init() ? ApClient::init()->getConnection()['ENDPOINT'] : ''; $desc = Loc::getMessage('LNDNGBLCK_CALLBACK_ERR_DESC_CONNECTOR', [ '#LINK1#' => $portalUrl . '/telephony/', '#LINK2#' => $portalUrl . '/crm/webform/', ]); } else { $desc = Loc::getMessage('LNDNGBLCK_CALLBACK_ERR_DESC_NO_CONNECTOR', [ '#LINK1#' => '/bitrix/admin/module_admin.php', ]); } $block->setRuntimeRequiredUserAction([ 'header' => Loc::getMessage('LNDNGBLCK_CALLBACK_ERR_TITLE'), 'description' => $desc, 'text' => Loc::getMessage('LNDNGBLCK_CALLBACK_SETTINGS'), ]); } } } }