<?php
namespace Modules\Orders\MiceProjects; class View_Utils_FormAdmin extends \App\Mvc\View_Utils_FormAbstract { public function getForm() { $cfg=\Entity\MiceProject::loadCFG(); $form =\Engine\Form\General::create(); $fieldset = \Engine\Form\Container\Fieldset::create($this->lang['insert']['general']); $form->addContainer($fieldset); $name = new \Engine\Form\Input\Text($this->lang['insert']['name'], 'name', $this->values['name']); $name->importFromConfig($cfg['name']); $form->addElement($name); $code = new \Engine\Form\Input\Text($this->lang['insert']['code'], 'code', $this->values['code']); $code->importFromConfig($cfg['code']); $form->addElement($code); $corporate = new \App\Form\Input\Autocomplete_Corporate($this->lang['insert']['corporate'], 'corporate', $this->values['corporate']['id']); $corporate->importFromConfig($cfg['idCorporate']); $corporate->addEvent('onChange', "FormField.setValue(null, 'Engine/Form/Input/Autocomplete', null, 'contactPerson', {
			displayValue: '',
			value: ''});"); $form->addElement($corporate); $contactPerson = new \App\Form\Input\Autocomplete_ContactPersonCorporate($this->lang['insert']['contact_person'], 'contactPerson', $this->values['contactPerson']); $contactPerson->importFromConfig($cfg['idContactPerson']); $contactPerson->setFilters('idCompany', $corporate); $form->addElement($contactPerson); $type = new \App\Form\Input\Autocomplete_MiceProjectType($this->lang['insert']['type'], 'idType', $this->values['idType']); $type->importFromConfig($cfg['idType']); $form->addElement($type); $interval = new \Engine\Form\Input\DateInterval($this->lang['insert']['interval'], 'interval', $this->values['interval']); $interval->setMandatory($cfg['startDate']['mandatory']); $form->addElement($interval); $location = new \App\Form\Input\Autocomplete_CountryCity($this->lang['insert']['location'], 'location', $this->values['location']); $location->setMandatory($cfg['countryCode']['mandatory']); $form->addElement($location); $email = new \Engine\Form\Input\Text($this->lang['insert']['email'], 'email', $this->values['email']); $email->importFromConfig($cfg['email']); $email->setTooltip($this->lang['insert']['emailTooltip']); $form->addElement($email); $responsibleUser = new \App\Form\Input\Autocomplete_User($this->lang['insert']['responsibleUser'], 'idResponsibleUser', $this->values['idResponsibleUser']); $responsibleUser->importFromConfig($cfg['idResponsibleUser']); $form->addElement($responsibleUser); $comments = new \Engine\Form\Input\Textarea($this->lang['insert']['comments'], 'comments', $this->values['comments']); $comments->importFromConfig($cfg['comments']); $form->addElement($comments); $remarks = new \App\Form\Input\Remarks($this->lang['insert']['remarks'], 'remarks', $this->values['remarks']); $remarks->importFromConfig($cfg['remarks']); $remarks->setRemarksType('miceProject'); $form->addElement($remarks); $form->addElement(new \Engine\Form\Input\Hidden('', $this->submitButtonName, 1)); return $form; } }