/
mikopbx
/
ModuleBeelinePbx
Обзор
Документация
Войти
/
mikopbx
/
ModuleBeelinePbx
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
master
App/Forms/ModuleBeelinePbxForm.php
63 строки
3 KB
boffart
Инициализация модуля ModuleBeelinePbx
08 июл 2026, 17:11
08 июл 2026, 17:11
1cc4e1a
Код
Авторство
О чём код?
<?php /* * MikoPBX - free phone system for small business * Copyright © 2017-2024 Alexey Portnov and Nikolay Beketov * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with this program. * If not, see <https://www.gnu.org/licenses/>. */ namespace Modules\ModuleBeelinePbx\App\Forms; use MikoPBX\Core\System\Util; use Modules\ModuleBeelinePbx\Lib\BeelineCdrHelper; use Phalcon\Forms\Form; use Phalcon\Forms\Element\Text; use Phalcon\Forms\Element\TextArea; use Phalcon\Forms\Element\Select; use Phalcon\Forms\Element\Hidden; class ModuleBeelinePbxForm extends Form { public function initialize($entity = null, $options = null): void { $this->add(new Hidden('id', ['value' => $entity->id])); $rows = max((int)round(strlen((string)$entity->authApiKey) / 95), 2); $this->add(new TextArea('authApiKey', ['rows' => $rows])); $this->add(new Text('pbxPublicUrl')); $this->add(new Text('gap')); // Выбор отображаемого номера сотрудника: внутренний (добавочный) или мобильный. $employeeOptions = [ BeelineCdrHelper::EMPLOYEE_FIELD_EXTENSION => Util::translate('module_beeline_pbx_employeeInternal'), BeelineCdrHelper::EMPLOYEE_FIELD_MOBILE => Util::translate('module_beeline_pbx_employeeMobile'), ]; $this->add(new Select('employeeNumberField', $employeeOptions, [ 'using' => ['id', 'name'], 'useEmpty' => false, 'value' => (string)$entity->employeeNumberField, 'class' => 'ui selection dropdown', ])); $this->add(new TextArea('excludedNumbers', [ 'rows' => 5, 'value' => (string)$entity->excludedNumbers, 'placeholder' => "2500\n+7 495 123-45-67", ])); // Чекбокс downloadRecordings рендерится в Volt вручную (с корректным состоянием // из сущности) — Phalcon\Forms\Element\Check не выставляет checked из entity надёжно. } }