<?php
namespace Modules\Admin\Config\CorporateCreditLimitEmails; class View_Utils_FormAdmin extends \App\Mvc\View_Utils_FormAbstract { public function getForm() { $form = \Engine\Form\General::create(); $form->setStyle('width', '600'); $fieldset = \Engine\Form\Container\Fieldset::create(); $form->addContainer($fieldset); $nameFld = new \Engine\Form\Input\Text($this->lang['formFields']['name'], 'name', $this->values['name']); $nameFld->setMandatory(); $fieldset->addElement($nameFld); $subjectFld = new \Engine\Form\Input\Text($this->lang['formFields']['emailSubject'], 'emailSubject', $this->values['emailSubject']); $subjectFld->setMandatory(); $fieldset->addElement($subjectFld); $description = $this->lang['descriptions']['emailStart']; $vars = [ 'DATE_TODAY', 'INVOICES_DESCRIPTION', 'COMPANY_NAME', 'ALERT_CREDIT_LIMIT', 'BLOCK_CREDIT_LIMIT', 'DEBIT_BALANCE_VALUE', 'DEBIT_BALANCE_PERCENT', 'CREDIT_BALANCE_VALUE', 'CREDIT_BALANCE_PERCENT', 'OUTSTANDING_BALANCE_VALUE', 'OUTSTANDING_BALANCE_PERCENT', 'TOTAL_BALANCE_VALUE', 'TOTAL_BALANCE_PERCENT', 'AVAILABLE_CREDIT_VALUE', 'AVAILABLE_CREDIT_PERCENT', ]; foreach($vars as $var) { $description .= '<div><b>'.$var.'</b> - '.$this->lang['descriptions']['emailElements'][$var].';</div>'; } $description .= $this->lang['descriptions']['emailEnd']; $bodyFld = new \App\Form\Input\HtmlArea($this->lang['formFields']['emailContent'], 'emailContent', $this->values['emailContent']); $bodyFld->setHeight('200'); $bodyFld->setDetails($description); $bodyFld->setMandatory(); $fieldset->addElement($bodyFld); $sendingUser = new \App\Form\Input\Autocomplete_User($this->lang['formFields']['idSendingUser'], 'idSendingUser', $this->values['idSendingUser']); $sendingUser->setMandatory(); $fieldset->addElement($sendingUser); $bccUsersFld = new \App\Form\Input\Cloned_AutocompleteUser($this->lang['formFields']['idUsersBcc'], 'idUsersBcc', $this->values['idUsersBcc']); $fieldset->addElement($bccUsersFld); if ($this->controller->getAction()=='update') { $form->addElement(new \Engine\Form\Input\Hidden('', 'id', $this->values['id'])); } $form->addElement(new \Engine\Form\Input\Hidden(null, $this->submitButtonName, 1)); return $form; } } 