<?php
 namespace Modules\Admin\Config\InvoiceCashings\DocsList; class View_Utils_FormAdmin extends \App\Mvc\View_Utils_FormAbstract { public function getForm() { $form = \Engine\Form\General::create(); $fieldset1=\Engine\Form\Container\Fieldset::create($this->lang['form']['fieldsets']['details']); $form->addContainer($fieldset1); $fld = new \Engine\Form\Input\Text($this->lang['form']['fields']['name'], 'name', $this->values['name']); $fld->setTooltip($this->lang['form']['fields']['nameTooltip']); $fld->setMandatory(); $fld->setValidator(['maxLength'=>50]); $fieldset1->addElement($fld); $fld = new \Engine\Form\Input\Text($this->lang['form']['fields']['id'], 'id', $this->values['id']); $fld->setTooltip($this->lang['form']['fields']['idTooltip']); $fld->setMandatory(); $fld->setValidator(['maxLength'=>25]); if ($this->controller->getAction()=='update') { $fld->setDisabled(); } $fieldset1->addElement($fld); if ($this->controller->getAction()=='update') { $fld = new \Engine\Form\Input\Hidden('', 'id', $this->values['id']); $fieldset1->addElement($fld); } $fld = new \Engine\Form\Input\Checkbox($this->lang['form']['fields']['active'], 'active', $this->values['active']); $fieldset1->addElement($fld); $fld = new \Engine\Form\Input\Select($this->lang['form']['fields']['number'], 'number', $this->values['number']); $fld->setPossibleValues( [ 'hidden' => $this->lang['form']['fields']['general_h'], 'optional' => $this->lang['form']['fields']['general_o'], 'mandatory' => $this->lang['form']['fields']['general_m'], 'series' => $this->lang['form']['fields']['general_s'], ]); $fld->showDefaultOption(); $fld->setMandatory(); $form->addElement($fld); $fld_pivot = new \Engine\Form\Input\Select($this->lang['form']['fields']['sign'], 'sign', $this->values['sign']); $fld_pivot->setPossibleValues( [ '1' => $this->lang['form']['fields']['sign_p'], '-1' => $this->lang['form']['fields']['sign_n'], '2' => $this->lang['form']['fields']['sign_b'], ]); $fld_pivot->showDefaultOption(); $fld_pivot->setMandatory(); $form->addElement($fld_pivot); $fld = new \Engine\Form\Input\Select($this->lang['form']['fields']['bankAccount'], 'bankAccount', $this->values['bankAccount']); $fld->setPossibleValues( [ 'hidden' => $this->lang['form']['fields']['general_h'], 'optional' => $this->lang['form']['fields']['general_o'], 'mandatory' => $this->lang['form']['fields']['general_m'], ]); $fld->showDefaultOption(); $fld->setMandatory(); $form->addElement($fld); $fld = new \Engine\Form\Input\Select($this->lang['form']['fields']['explanations'], 'explanations', $this->values['explanations']); $fld->setPossibleValues( [ 'hidden' => $this->lang['form']['fields']['general_h'], 'optional' => $this->lang['form']['fields']['general_o'], 'mandatory' => $this->lang['form']['fields']['general_m'], ]); $fld->showDefaultOption(); $fld->setMandatory(); $form->addElement($fld); $fld = new \Engine\Form\Input\Select($this->lang['form']['fields']['comments'], 'comments', $this->values['comments']); $fld->setPossibleValues( [ 'hidden' => $this->lang['form']['fields']['general_h'], 'optional' => $this->lang['form']['fields']['general_o'], 'mandatory' => $this->lang['form']['fields']['general_m'], ]); $fld->showDefaultOption(); $fld->setMandatory(); $form->addElement($fld); $form->addElement(new \Engine\Form\Input\Hidden('', $this->submitButtonName, 1)); return $form; } }