public function getForm(array $companyTypes, array $statusList) { if (!$this->form) { $companyId = new Element\Hidden(); $companyId->setName('companyId'); $name = new Element\Text(); $name->setLabel('Name')->setName("name")->setAttribute('class', 'form-control'); $phone = new Element\Text(); $phone->setLabel('Phone')->setName("phone")->setAttribute('class', 'form-control'); $address = new Element\Textarea(); $address->setLabel('Address')->setName("address")->setAttribute('class', 'form-control'); $website = new Element\Url(); $website->setLabel('Website')->setName("website")->setAttribute('class', 'form-control'); $type = new Element\Select(); $type->setName("type")->setLabel('Type')->setAttribute('class', 'form-control')->setValueOptions($companyTypes); $status = new Element\Select(); $status->setName("status")->setLabel('Status')->setAttribute('class', 'form-control')->setValueOptions($statusList); $form = new Form(); $form->setAttribute('class', 'form-horizontal'); $form->add($companyId); $form->add($name); $form->add($phone); $form->add($address); $form->add($website); $form->add($type); $form->add($status); $this->form = $form; } return $this->form; }
public function getForm() { if (!$this->form) { $hidId = new Element\Hidden(); $hidId->setName('routeId'); $txtName = new Element\Text(); $txtName->setLabel('Route Name')->setName("name")->setAttribute('class', 'form-control'); $txtRoute = new Element\Text(); $txtRoute->setLabel('Route')->setName("route")->setAttribute('class', 'form-control'); $txtModule = new Element\Text(); $txtModule->setLabel("Module")->setName('module')->setAttribute('class', 'form-control'); $txtController = new Element\Text(); $txtController->setLabel("Controller")->setName('controller')->setAttribute('class', 'form-control'); $txtConstraints = new Element\Textarea(); $txtConstraints->setLabel("Constraints")->setName('constraints')->setAttribute('class', 'form-control'); $form = new Form(); $form->setAttribute('class', 'form-horizontal'); $form->add($hidId); $form->add($txtName); $form->add($txtRoute); $form->add($txtModule); $form->add($txtController); $form->add($txtConstraints); $this->form = $form; } return $this->form; }
public function __construct($name = null) { parent::__construct('reginfo'); $id_hidden = new Element\Hidden('id'); $id_hidden->setName('id'); $email_text = new Element\Text('login'); $email_text->setLabel('E-mail'); $email_text->setLabelAttributes(array('class' => 'type_text')); $email_text->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type something...', 'disabled' => 'disable')); $type_text = new Element\Text('type'); $type_text->setLabel('Type'); $type_text->setLabelAttributes(array('class' => 'type_text')); $type_text->setAttributes(array('class' => 'type_text_input', 'disabled' => 'disable')); $password_text = new Element\Password('password'); $password_text->setLabel('New password'); $password_text->setLabelAttributes(array('class' => 'type_text')); $password_text->setAttributes(array('id' => 'password', 'class' => 'type_text_input')); $cpassword_text = new Element\Password('cpassword'); $cpassword_text->setLabel('Confirm password'); $cpassword_text->setLabelAttributes(array('class' => 'type_text')); $cpassword_text->setAttributes(array('id' => 'cpassword', 'class' => 'type_text_input')); $this->add($id_hidden); $this->add($email_text); $this->add($type_text); $this->add($password_text); $this->add($cpassword_text); }
public function getForm(array $default_status) { if (!$this->form) { $hidId = new Element\Hidden(); $hidId->setName('userId'); $txtName = new Element\Text(); $txtName->setLabel('User Name')->setName("userName")->setAttribute('class', 'form-control'); $password = new Element\Password(); $password->setLabel('Password')->setName('password')->setAttribute('class', 'form-control'); $confirmPassword = new Element\Password(); $confirmPassword->setName('confirmPassword')->setLabel('Retype Password')->setAttribute('class', 'form-control'); $selectRole = new Element\Hidden('userRole'); $description = new Element\Textarea(); $description->setName('description')->setLabel('Description')->setAttribute('class', 'form-control'); $status = new Element\Select(); $status->setName('status')->setLabel('Status')->setAttribute('class', 'form-control')->setValueOptions($default_status); $image = new Element\File(); $image->setName('image')->setLabel('Profile image'); $form = new Form(); $form->setAttribute('class', 'form-horizontal'); $form->setAttribute('enctype', 'multipart/form-data'); $form->add($hidId); $form->add($txtName); $form->add($password); $form->add($confirmPassword); $form->add($selectRole); $form->add($description); $form->add($status); $form->add($image); $this->form = $form; } return $this->form; }
public function getForm(array $defaultStatus, array $currencyList) { if (!$this->form) { $positionId = new Element\Hidden(); $positionId->setName('positionId'); $name = new Element\Text(); $name->setLabel('Name')->setName("name")->setAttribute('class', 'form-control'); $minSalary = new Element\Text(); $minSalary->setLabel('MinSalary')->setName("min_Salary")->setAttribute('class', 'form-control'); $maxSalary = new Element\Text(); $maxSalary->setLabel('MaxSalary')->setName("max_Salary")->setAttribute('class', 'form-control'); $currency = new Element\Select(); $currency->setName('currencyId')->setLabel('Currency Type')->setAttribute('class', 'form-control')->setEmptyOption('-- Choose Currency --')->setValueOptions($currencyList); $status = new Element\Select(); $status->setName('status')->setLabel('Status')->setAttribute('class', 'form-control')->setValueOptions($defaultStatus); $form = new Form(); $form->setAttribute('class', 'form-horizontal'); $form->add($positionId); $form->add($name); $form->add($currency); $form->add($minSalary); $form->add($maxSalary); $form->add($status); $this->form = $form; } return $this->form; }
public function getForm(array $defaultStatus) { if (!$this->form) { $currencyId = new Element\Hidden(); $currencyId->setName('currencyId'); $name = new Element\Text(); $name->setLabel('Name')->setName("name")->setAttribute('class', 'form-control'); $code = new Element\Text(); $code->setLabel('Code')->setName("code")->setAttribute('class', 'form-control'); $rate = new Element\Text(); $rate->setLabel('Rate')->setName("rate")->setAttributes(array('class' => 'form-control')); $status = new Element\Select(); $status->setName('status')->setLabel('Status')->setAttribute('class', 'form-control')->setValueOptions($defaultStatus); $changedRate = new Element\Checkbox(); $changedRate->setName('changedRate')->setLabel('Auto renew?')->setAttribute('class', 'form-control'); $form = new Form(); $form->setAttribute('class', 'form-horizontal'); $form->add($currencyId); $form->add($code); $form->add($name); $form->add($rate); $form->add($status); $form->add($changedRate); $this->form = $form; } return $this->form; }
public function getForm(array $staff) { if (!$this->form) { $attendanceId = new Element\Hidden(); $attendanceId->setName('attendanceId'); $staffId = new Element\Select(); $staffId->setName('staffId')->setLabel('Staff')->setAttribute('class', 'form-control')->setEmptyOption('-- Choose --')->setValueOptions($staff); $type = new Element\Select(); $type->setName('type')->setLabel('Type')->setAttribute('class', 'form-control')->setValueOptions(array('I' => 'In', 'O' => 'Out')); $date = new Element\Date(); $date->setName('attendanceDate')->setLabel('Date')->setAttributes(array('class' => 'form-control', 'allowPastDates' => true, 'momentConfig' => array('format' => 'YYYY-MM-DD'))); $workingHours = array(); for ($i = 8; $i < 20; $i++) { $workingHours[$i] = sprintf('%02d', $i); } $hour = new Element\Select(); $hour->setName('hour')->setAttribute('class', 'form-control')->setValueOptions($workingHours); $workingMinutes = array(); for ($i = 0; $i < 12; $i++) { $workingMinutes[$i] = sprintf('%02d', $i * 5); } $minute = new Element\Select(); $minute->setName('minute')->setAttribute('class', 'form-control')->setValueOptions($workingMinutes); $form = new Form(); $form->setAttributes(array('role' => 'form', 'class' => 'form-horizontal')); $form->add($attendanceId); $form->add($staffId); $form->add($type); $form->add($date); $form->add($hour); $form->add($minute); $this->form = $form; } return $this->form; }
public function __construct(EntityManager $em) { parent::__construct(); $this->em = $em; $hiddenElement = new Element\Hidden('id'); $hiddenElement->setName('id')->setAttributes(array('type' => 'hidden')); $this->add($hiddenElement, array()); $this->add(array('name' => 'name', 'options' => array('label' => 'Category Name'), 'attributes' => array('type' => 'text', 'placeholder' => 'Category Name', 'class' => 'form-control', 'id' => 'name', 'required' => 'required', 'autofocus' => 'autofocus')))->add(array('type' => 'Zend\\Form\\Element\\Csrf', 'name' => 'csrf')); $submitElement = new Element\Button('submit'); $submitElement->setName('submit')->setLabel('Save Category')->setAttributes(array('type' => 'submit', 'class' => 'btn btn-primary btn-sm', 'id' => 'addCategory')); $this->add($submitElement, array('priority' => -100)); }
public function __construct($name = null) { parent::__construct('page'); $id_hidden = new Element\Hidden('id'); $id_hidden->setName('id'); $title_text = new Element\Text('title'); $title_text->setLabel('Title'); $title_text->setLabelAttributes(array('class' => 'type_text type_text_short')); $title_text->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type something...', 'required' => 'require')); $url_text = new Element\Text('url'); $url_text->setLabel('Url'); $url_text->setLabelAttributes(array('class' => 'type_text type_text_short')); $url_text->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type something...', 'required' => 'require')); $text_textarea = new Element\Textarea('text'); $text_textarea->setLabel('Text'); $text_textarea->setLabelAttributes(array('class' => 'type_text')); $text_textarea->setAttributes(array('placeholder' => 'Type something...')); $auto_check = new Element\Checkbox('auto'); $auto_check->setLabel('Automatically'); $auto_check->setLabelAttributes(array('class' => 'type_text type_check')); $auto_check->setUseHiddenElement(true); $auto_check->setCheckedValue("1"); $auto_check->setUncheckedValue("0"); $auto_check->setValue('1'); $meta_text = new Element\Text('meta'); $meta_text->setLabel('Meta'); $meta_text->setLabelAttributes(array('class' => 'type_text type_text_mod_darker')); $meta_text->setAttributes(array('class' => 'type_text_input')); $keywords_text = new Element\Text('keywords'); $keywords_text->setLabel('Keywords'); $keywords_text->setLabelAttributes(array('class' => 'type_text type_text_mod_darker')); $keywords_text->setAttributes(array('class' => 'type_text_input')); $desc_text = new Element\Text('description'); $desc_text->setLabel('Description'); $desc_text->setLabelAttributes(array('class' => 'type_text type_text_mod_darker')); $desc_text->setAttributes(array('class' => 'type_text_input')); $submit_button = new Element\Submit('submit'); $submit_button->setValue('Submit'); $submit_button->setAttributes(array('class' => 'btn btn_white')); $cancel_button = new Element\Submit('cancel'); $cancel_button->setValue('Cancel'); $cancel_button->setAttributes(array('class' => 'btn btn_rozy')); $this->add($id_hidden); $this->add($title_text); $this->add($url_text); $this->add($text_textarea); $this->add($auto_check); $this->add($meta_text); $this->add($keywords_text); $this->add($desc_text); $this->add($submit_button); $this->add($cancel_button); }
public function __construct($name = null, $options = array()) { parent::__construct(isset($name) ? $name : 'personal'); $id_hidden = new Element\Hidden('id'); $id_hidden->setName('id'); $firstname_text = new Element\Text('firstname'); $firstname_text->setLabel('First name'); $firstname_text->setLabelAttributes(array('class' => 'type_text')); $firstname_text->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type something...')); $lastname_text = new Element\Text('lastname'); $lastname_text->setLabel('Last name'); $lastname_text->setLabelAttributes(array('class' => 'type_text')); $lastname_text->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type something...', 'required' => true)); $country_select = new Element\Select('country_id'); $country_select->setLabel('Country'); $country_select->setLabelAttributes(array('class' => 'select f_3_w50')); $country_select->setAttributes(array('class' => 'sel_chosen')); $country_select->setOptions(array('disable_inarray_validator' => true, 'empty_option' => 'Please choose your country')); $state_select = new Element\Select('state_id'); $state_select->setLabel('Province/State'); $state_select->setLabelAttributes(array('class' => 'select f_3_w50')); $state_select->setAttributes(array('class' => 'sel_chosen', 'required' => true)); $state_select->setOptions(array('disable_inarray_validator' => true, 'empty_option' => 'Please choose your state')); $city_select = new Element\Select('city_id'); $city_select->setLabel('City'); $city_select->setLabelAttributes(array('class' => 'select f_3_w50')); $city_select->setAttributes(array('class' => 'sel_chosen', 'required' => true)); $city_select->setOptions(array('disable_inarray_validator' => true, 'empty_option' => 'Please choose your city')); $adress_text = new Element\Text('adress'); $adress_text->setLabel('Adress'); $adress_text->setLabelAttributes(array('class' => 'type_text')); $adress_text->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type adress in format (наш формат)')); $languages_select = new Element\Select('languages'); $languages_select->setLabel('Languages'); $languages_select->setLabelAttributes(array('class' => 'select', 'style' => 'float:left;')); $languages_select->setAttributes(array('class' => 'sel_chosen', 'multiple' => 'multiple', 'required' => true)); $languages_select->setOptions(array('disable_inarray_validator' => true)); $logo = new Element\Image('logo'); $logo->setAttributes(array('src', '/images/11.jpg', 'style' => 'float:left;')); $file = new Element\File('file'); $file->setLabelAttributes(array('style' => 'float:left;clear:both')); $this->add($id_hidden); $this->add($firstname_text); $this->add($lastname_text); $this->add($country_select); $this->add($state_select); $this->add($city_select); $this->add($adress_text); $this->add($languages_select); $this->add($logo); $this->add($file); }
public function getForm(array $currencies, array $companies, array $contacts, array $statusList) { if (!$this->form) { $hidId = new Element\Hidden(); $hidId->setName('proposalId'); $txtCompanyId = new Element\Select(); $txtCompanyId->setLabel('Company Name')->setName("companyId")->setAttribute('class', 'form-control')->setEmptyOption("--Choose Company--")->setValueOptions($companies); $txtContactId = new Element\Select(); $txtContactId->setLabel('Contact Name')->setName('contactId')->setAttribute('class', 'form-control')->setEmptyOption("--Choose Contact--")->setValueOptions($contacts); $txtCode = new Element\Text(); $txtCode->setLabel('Code')->setName('code')->setAttribute('class', 'form-control'); $txtName = new Element\Text(); $txtName->setLabel('Name')->setName('name')->setAttribute('class', 'form-control'); $txtAmount = new Element\Number(); $txtAmount->setName("amount")->setLabel('Amount')->setAttribute('class', 'form-control')->setAttributes(array('min' => '100', 'max' => '99999999999', 'step' => '100')); $selectCurrency = new Element\Select(); $selectCurrency->setName('currencyId')->setLabel('Currency')->setAttribute('class', 'form-control')->setValueOptions($currencies); $txtProposalDate = new Element\Date('proposalDate'); $txtProposalDate->setLabel('Date')->setAttributes(array('class' => 'form-control', 'allowPastDates' => true, 'momentConfig' => array('format' => 'YYYY-MM-DD'))); $txtProposalFile = new Element\File(); $txtProposalFile->setName('proposalFile')->setLabel('Upload file'); $txtNodes = new Element\Textarea(); $txtNodes->setLabel('Notes')->setName('notes')->setAttribute('class', 'form-control'); $txtProposalBy = new Element\Text(); $txtProposalBy->setName('proposalBy')->setLabel('Proposal By')->setAttribute('class', 'form-control'); $txtGroupCode = new Element\Text(); $txtGroupCode->setLabel('Group Code')->setName('group_code')->setAttribute('class', 'form-control'); $txtStatus = new Element\Select(); $txtStatus->setName('status')->setLabel('Status')->setAttribute('class', 'form-control')->setValueOptions($statusList); $form = new Form(); $form->setAttribute('class', 'form-horizontal'); $form->setAttribute('enctype', 'multipart/form-data'); $form->add($hidId); $form->add($txtCompanyId); $form->add($txtContactId); $form->add($txtCode); $form->add($txtName); $form->add($txtAmount); $form->add($selectCurrency); $form->add($txtProposalDate); $form->add($txtProposalFile); $form->add($txtNodes); $form->add($txtProposalBy); $form->add($txtGroupCode); $form->add($txtStatus); $this->form = $form; } return $this->form; }
public function __construct(EntityManager $em) { parent::__construct(); $this->em = $em; $hiddenElement = new Element\Hidden('id'); $hiddenElement->setName('id')->setAttributes(array('type' => 'hidden')); $this->add($hiddenElement, array()); $this->add(array('name' => 'name', 'options' => array('label' => 'Product Name'), 'attributes' => array('type' => 'text', 'placeholder' => 'Product Name', 'class' => 'form-control', 'id' => 'name', 'required' => 'required', 'autofocus' => 'autofocus')))->add(array('name' => 'sku', 'options' => array('label' => 'SKU'), 'attributes' => array('type' => 'text', 'placeholder' => 'SKU', 'class' => 'form-control', 'id' => 'sku', 'required' => 'required')))->add(array('name' => 'price', 'options' => array('label' => 'Product Price', 'help' => 'Price must be of type float i.e 50.00'), 'attributes' => array('type' => 'text', 'placeholder' => 'Product Price', 'class' => 'form-control', 'id' => 'price', 'required' => 'required')))->add(array('type' => 'Zend\\Form\\Element\\Number', 'name' => 'qty', 'options' => array('label' => 'Qty in Stock'), 'attributes' => array('min' => '0', 'step' => '1', 'placeholder' => 'Qty in Stock', 'class' => 'form-control', 'id' => 'qty', 'required' => 'required')))->add(array('type' => 'Zend\\Form\\Element\\Csrf', 'name' => 'csrf')); $textAreaElement = new Element\Textarea('description'); $textAreaElement->setName('description')->setLabel('Product Description')->setAttributes(array('type' => 'textarea', 'placeholder' => 'Product Description', 'class' => 'form-control', 'rows' => '3', 'id' => 'description', 'required' => 'required')); $this->add($textAreaElement, array()); $submitElement = new Element\Button('submit'); $submitElement->setName('submit')->setLabel('Save Product')->setAttributes(array('type' => 'submit', 'class' => 'btn btn-primary btn-sm', 'id' => 'addProduct')); $this->add($submitElement, array('priority' => -100)); }
public function getForm(array $usersData, array $positionsData, array $currencyData, array $defaultStatus) { if (!$this->form) { $hidId = new Element\Hidden(); $hidId->setName('staffId'); $selectUsers = new Element\Select(); $selectUsers->setName('userId')->setLabel('User')->setAttribute('class', 'form-control')->setEmptyOption("--Choose User --")->setValueOptions($usersData); $staffCode = new Element\Text(); $staffCode->setLabel('Code')->setName("staffCode")->setAttribute('class', 'form-control'); $staffName = new Element\Text(); $staffName->setLabel('Name')->setName("staffName")->setAttribute('class', 'form-control'); $selectPosition = new Element\Select(); $selectPosition->setName('positionId')->setLabel('Position')->setAttribute('class', 'form-control')->setEmptyOption("-- Choose Position --")->setValueOptions($positionsData); $selectDepartment = new Element\Hidden('departmentId'); $salary = new Element\Number(); $salary->setLabel('Salary')->setName("salary")->setAttributes(array('min' => '0', 'max' => '999999999999', 'step' => '1')); $leave = new Element\Number(); $leave->setLabel('Leave')->setName("annual_leave")->setAttributes(array('min' => '0.5', 'max' => '100', 'step' => '0.5')); $PermanentDate = new Element\Date('permanentDate'); $PermanentDate->setLabel('P-Date')->setAttributes(array('allowPastDates' => true, 'momentConfig' => array('format' => 'YYYY-MM-DD'))); $birthDay = new Element\Date('birthday'); $birthDay->setLabel('Birthday')->setAttributes(array('allowPastDates' => true, 'momentConfig' => array('format' => 'YYYY-MM-DD'))); $selectCurrency = new Element\Select(); $selectCurrency->setName('currencyId')->setAttribute('class', 'form-control')->setValueOptions($currencyData); $status = new Element\Select(); $status->setName('status')->setLabel('Status')->setAttribute('class', 'form-control')->setValueOptions($defaultStatus); $bankCode = new Element\Text('bankCode'); $bankCode->setLabel('Bank Account')->setAttributes(array('class' => 'form-control', 'placeholder' => 'Aya Bank Account No')); $form = new Form(); $form->setAttribute('class', 'form-horizontal'); $form->add($hidId); $form->add($selectUsers); $form->add($staffCode); $form->add($staffName); $form->add($selectPosition); $form->add($selectDepartment); $form->add($salary); $form->add($leave); $form->add($PermanentDate); $form->add($status); $form->add($birthDay); $form->add($selectCurrency); $form->add($bankCode); $this->form = $form; } return $this->form; }
public function getForm() { if (!$this->form) { $hidId = new Element\Hidden(); $hidId->setName('constantId'); $txtName = new Element\Text(); $txtName->setLabel('Constant Name')->setName("name")->setAttribute('class', 'form-control'); $txtValue = new Element\Textarea(); $txtValue->setLabel('Value')->setName("value")->setAttribute('class', 'form-control'); $txtGroupCode = new Element\Text(); $txtGroupCode->setLabel('Group Code')->setName("group_code")->setAttribute('class', 'form-control'); $form = new Form(); $form->setAttribute('class', 'form-horizontal'); $form->add($hidId); $form->add($txtName); $form->add($txtValue); $form->add($txtGroupCode); $this->form = $form; } return $this->form; }
public function getForm() { if (!$this->form) { $contactId = new Element\Hidden(); $contactId->setName('contactId'); $name = new Element\Text(); $name->setLabel('Name')->setName("name")->setAttribute('class', 'form-control'); $phone = new Element\Text(); $phone->setLabel('Phone')->setName("phone")->setAttribute('class', 'form-control'); $email = new Element\Email(); $email->setLabel('Email')->setName("email")->setAttribute('class', 'form-control'); $address = new Element\Textarea(); $address->setLabel('Address')->setName("address")->setAttribute('class', 'form-control'); $website = new Element\Url(); $website->setLabel('Website')->setName("website")->setAttribute('class', 'form-control'); $selectCompany = new Element\Select(); $selectCompany->setName('companyId')->setLabel('Company')->setAttribute('class', 'form-control')->setEmptyOption("---Choose Company---")->setValueOptions($this->companies); $notes = new Element\Textarea(); $notes->setLabel('Notes')->setName("notes")->setAttribute('class', 'form-control'); $tag = new Element\Text(); $tag->setLabel('Tag')->setName("tag")->setAttribute('class', 'form-control'); $status = new Element\Select(); $status->setName('status')->setLabel('Status')->setAttribute('class', 'form-control')->setValueOptions(array('A' => 'Active', 'D' => 'Inactive')); $form = new Form(); $form->setAttribute('class', 'form-horizontal'); $form->setAttribute('enctype', 'multipart/form-data'); $form->add($contactId); $form->add($name); $form->add($phone); $form->add($email); $form->add($address); $form->add($website); $form->add($selectCompany); $form->add($notes); $form->add($tag); $form->add($status); $this->form = $form; } return $this->form; }
public function getForm($managers) { if (!$this->form) { $projectId = new Element\Hidden(); $projectId->setName('projectId'); $code = new Element\Text(); $code->setLabel('Code')->setName('code')->setAttributes(array('class' => 'form-control'), 'placeholder', 'Enter Code'); $name = new Element\Text(); $name->setLabel('Name')->setName('name')->setAttributes(array('class' => 'form-control'), 'placeholder', 'Enter Name'); $description = new Element\Textarea(); $description->setLabel('Description')->setName('description')->setAttributes(array('class' => 'form-control'), 'placeholder', 'Enter Description'); $manager = new Element\Select(); $manager->setLabel('Manager')->setAttribute('class', 'form-control')->setName('managerId')->setEmptyOption('---Choose Manager---')->setValueOptions($managers); $startDate = new Element\Date('startDate'); $startDate->setLabel('Start Date')->setName('startDate')->setAttributes(array('class' => 'form-control', 'allowPastDates' => true, 'momentConfig' => array('format' => 'YYYY-MM-DD'))); $endDate = new Element\Date('endDate'); $endDate->setLabel('End Date')->setName('endDate')->setAttributes(array('class' => 'form-control', 'allowPastDates' => true, 'momentConfig' => array('format' => 'YYYY-MM-DD'))); $group_code = new Element\Text(); $group_code->setLabel('group_code')->setName('group_code')->setAttributes(array('class' => 'form-control', 'placeholder' => 'Enter Group Code')); $status = new Element\Select(); $status->setLabel('Status')->setName('status')->setAttribute('class', 'form-control')->setValueOptions(array('A' => 'Active', 'D' => 'Inactive')); $remark = new Element\Textarea(); $remark->setLabel('Remark')->setName('remark')->setAttributes(array('class' => 'form-control', 'placeholder' => 'Enter Remark')); $form = new Form(); $form->setAttributes(array('class' => 'form-horizontal', 'enctype' => 'multipart/form-data')); $form->add($projectId); $form->add($code); $form->add($name); $form->add($description); $form->add($manager); $form->add($startDate); $form->add($endDate); $form->add($group_code); $form->add($status); $form->add($remark); $this->form = $form; } return $this->form; }
public function getForm(array $holidayType) { if (!$this->form) { $hidId = new Hidden(); $hidId->setName('calendarId'); $cboType = new Select(); $cboType->setName('type')->setLabel('Type')->setAttribute('class', 'form-control')->setEmptyOption('-- Choose Types --')->setValueOptions($holidayType); $maxYear = date('Y', time()) + 10; $datePicker = new DateSelect('date'); $datePicker->setValue(new \DateTime('now'))->setShouldRenderDelimiters(false)->setMinYear(2011)->setMaxYear($maxYear)->setLabel('Date')->setDayAttributes(array('class' => 'date-control', 'id' => 'dayCombo'))->setMonthAttributes(array('class' => 'date-control', 'id' => 'monthCombo'))->setYearAttributes(array('class' => 'date-control', 'id' => 'yearCombo')); $txtTitle = new Text(); $txtTitle->setName('title')->setLabel('Title')->setAttribute('class', 'form-control')->setAttribute('placeholder', 'Title'); $form = new Form(); $form->setAttributes(array('class' => 'form-horizontal', 'role' => 'form')); $form->add($hidId); $form->add($cboType); $form->add($datePicker); $form->add($txtTitle); $this->form = $form; } return $this->form; }
public function __construct($name = null) { parent::__construct('terms'); $id_hidden = new Element\Hidden('id'); $id_hidden->setName('id'); $orders_radio = new Element\Radio('custom_orders'); $orders_radio->setLabel('Custom orders'); $orders_radio->setValueOptions(array('0' => 'No', '1' => 'Yes')); $shipping_select = new Element\Select('shipping'); $shipping_select->setLabel('Shipping'); $shipping_select->setLabelAttributes(array('class' => 'select f_3_w50')); $shipping_select->setAttributes(array('class' => 'sel_chosen')); $shipping_select->setOptions(array('disable_inarray_validator' => true, 'empty_option' => 'Please choose your shipping')); $policies_text = new Element\Textarea('wholesale_policies'); $policies_text->setLabel('Wholesale policies'); $policies_text->setLabelAttributes(array('class' => 'type_text')); $policies_text->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type something...')); $this->add($id_hidden); $this->add($orders_radio); $this->add($shipping_select); $this->add($policies_text); }
public function getForm(array $currencies) { if (!$this->form) { $hidId = new Element\Hidden(); $hidId->setName('receiveVoucherId'); $txtVoucherNo = new Element\Text(); $txtVoucherNo->setLabel('Number')->setName("voucherNo")->setAttribute('class', 'form-control text-center')->setAttribute('readonly', 'readonly'); $txtVoucherDate = new Element\Date('voucherDate'); $txtVoucherDate->setLabel('Date')->setAttributes(array('class' => 'form-control', 'allowPastDates' => true, 'momentConfig' => array('format' => 'YYYY-MM-DD'))); $txtAccountType = new Element\Hidden('accountType'); $txtDescription = new Element\Textarea(); $txtDescription->setName("description")->setLabel('Description')->setAttribute('class', 'form-control'); $txtAmount = new Element\Number(); $txtAmount->setName("amount")->setLabel('Amount')->setAttribute('class', 'form-control')->setattributes(array('min' => '10', 'max' => '99999999999', 'step' => '1')); $cboCurrency = new Element\Select(); $cboCurrency->setName('currencyId')->setLabel('Currency Type')->setAttribute('class', 'form-control')->setEmptyOption('-- Choose --')->setValueOptions($currencies); $txtDepositBy = new Element\Hidden(); $txtDepositBy->setName("depositBy"); $txtReason = new Element\Textarea(); $txtReason->setName('reason'); $txtGroupCode = new Element\Text(); $txtGroupCode->setName('group_code')->setLabel('Group Code (optional)')->setAttribute('class', 'form-control'); $form = new Form(); $form->setAttribute('role', 'form'); $form->add($hidId); $form->add($txtVoucherNo); $form->add($txtVoucherDate); $form->add($txtAccountType); $form->add($txtDescription); $form->add($txtAmount); $form->add($cboCurrency); $form->add($txtDepositBy); $form->add($txtReason); $form->add($txtGroupCode); $this->form = $form; } return $this->form; }
public function __construct($name = null, $options = array()) { parent::__construct(isset($name) ? $name : 'about'); $id_hidden = new Element\Hidden('id'); $id_hidden->setName('id'); $specialty_text = new Element\Text('specialty'); $specialty_text->setLabel('Specialty'); $specialty_text->setLabelAttributes(array('class' => 'type_text')); $specialty_text->setAttributes(array('class' => 'type_text_input')); $proficiency_select = new Element\Select('proficiency_level'); $proficiency_select->setLabel('Proficiency level'); $proficiency_select->setLabelAttributes(array('class' => 'select f_3_w50')); $proficiency_select->setAttributes(array('class' => 'sel_chosen')); $proficiency_select->setOptions(array('disable_inarray_validator' => true, 'empty_option' => 'Please choose your proficiency')); $about_textarea = new Element\Textarea('about'); $about_textarea->setLabel('About'); $about_textarea->setLabelAttributes(array('class' => 'type_text')); $about_textarea->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type something...', 'required' => 'require')); $this->add($id_hidden); $this->add($specialty_text); $this->add($proficiency_select); $this->add($about_textarea); }
/** * Load mixed editor * * @return string */ public function load() { $config = $this->getConfig(); $values = unserialize($this->getValue()); $datatypes = empty($config['datatypes']) ? array() : $config['datatypes']; $datatypesElements = array(); $lineId = 0; if (!empty($values)) { foreach ($values as $lineId => $datatypeValue) { foreach ($datatypeValue as $datatypeId => $value) { if (empty($datatypes[$datatypeId])) { continue; } $datatypeConfig = $datatypes[$datatypeId]; //Get datatypes $object = $this->loadDatatype($datatypeConfig['name']); $editor = $object->getEditor($this->getProperty()); if (empty($values[$lineId][$datatypeId])) { $values[$lineId][$datatypeId] = array('value' => ''); } $editor->setValue($values[$lineId][$datatypeId]['value']); if (!empty($datatypeConfig['config'])) { $editor->setConfig(serialize($datatypeConfig['config'])); } //Initialize prefix $prefix = $this->getName() . '[' . $lineId . '][' . $datatypeId . ']'; //Create form $fieldset = new Fieldset($datatypeConfig['name'] . $datatypeId); AbstractForm::addContent($fieldset, $editor->load(), $prefix); $datatypesElements[$lineId][$datatypeId]['label'] = empty($datatypeConfig['label']) ? '' : $datatypeConfig['label']; $datatypesElements[$lineId][$datatypeId]['fieldset'] = $fieldset; } } } //Defauts elements $template = array(); foreach ($datatypes as $datatypeId => $datatypeConfig) { $datatypeConfig = $datatypes[$datatypeId]; //Get datatypes $object = $this->loadDatatype($datatypeConfig['name']); $editor = $object->getEditor($this->getProperty()); if (empty($values['#{line}'][$datatypeId])) { $values['#{line}'][$datatypeId] = array('value' => ''); } $editor->setValue($values['#{line}'][$datatypeId]['value']); if (!empty($datatypeConfig['config'])) { $editor->setConfig(serialize($datatypeConfig['config'])); } //Initialize prefix $prefix = $this->getName() . '[#{line}][' . $datatypeId . ']'; //Create form $fieldset = new Fieldset($datatypeConfig['name'] . $datatypeId); $hidden = new Element\Hidden(); $hidden->setName($prefix . '[name]'); $hidden->setValue($datatypeConfig['name']); $fieldset->add($hidden); AbstractForm::addContent($fieldset, $editor->load(), $prefix, '#{line}'); $template[$datatypeId]['label'] = empty($datatypeConfig['label']) ? '' : $datatypeConfig['label']; $template[$datatypeId]['fieldset'] = $fieldset; } $this->getHelper('HeadLink')->appendStylesheet('/backend/assets/datatypes/mixed/mixed.css'); return $this->addPath(__DIR__)->render('mixed-editor.phtml', array('property' => $this->getProperty(), 'datatypes' => $datatypesElements, 'propertyName' => $this->getName(), 'templateElements' => $template)); }
public function __construct($name = null) { parent::__construct('services'); $id_hidden = new Element\Hidden('id'); $id_hidden->setName('id'); $tutorial_select = new Element\Select('tutorial_status'); $tutorial_select->setLabel('Tutorial status'); $tutorial_select->setLabelAttributes(array('class' => 'select f_3_w50')); $tutorial_select->setAttributes(array('class' => 'sel_chosen')); $tutorial_select->setOptions(array('disable_inarray_validator' => true, 'empty_option' => 'Please choose your status')); $members_select = new Element\Textarea('members_special'); $members_select->setLabel('Members Special'); $members_select->setLabelAttributes(array('class' => 'type_text')); $members_select->setAttributes(array('class' => 'type_text_input')); $this->add($id_hidden); $this->add($tutorial_select); $this->add($members_select); $this->add(array('type' => 'Profile\\Form\\AdressesFieldset')); }
/** * Load mixed prevalue editor * * @return string */ public function load() { $config = $this->getConfig(); $listDir = $this->getDatatype()->getDatatypesList(); $options = array(); foreach ($listDir as $dir) { $options[$dir] = $dir; } $datatypes = empty($config['datatypes']) ? array() : $config['datatypes']; foreach ($datatypes as $datatypeId => $datatypeConfig) { //Get datatypes $object = $this->loadDatatype($datatypeConfig['name']); //Force configuration $object->getPrevalueEditor()->setConfig(empty($datatypeConfig['config']) ? null : serialize($datatypeConfig['config'])); //Initiliaze prefix $prefix = 'datatypes[' . $datatypeId . ']'; //Create form $fieldset = new Fieldset(); $hidden = new Element\Hidden(); $hidden->setName($prefix . '[name]'); $hidden->setValue($datatypeConfig['name']); $fieldset->add($hidden); $label = new Element\Text(); $label->setName($prefix . '[label]'); $label->setAttribute('class', 'form-control'); $label->setLabel('Label'); $label->setAttribute('id', 'label' . $datatypeId); $label->setValue(empty($datatypeConfig['label']) ? '' : $datatypeConfig['label']); $fieldset->add($label); AbstractForm::addContent($fieldset, $object->getPrevalueEditor()->load(), $prefix); $datatypes[$datatypeId]['fieldset'] = $fieldset; } $data = array(); $data['datatypes'] = $datatypes; $data['modelOptions'] = $options; return $this->addPath(__DIR__)->render('mixed-prevalue.phtml', $data); }
public function __construct($name = null) { parent::__construct('contacts'); $id_hidden = new Element\Hidden('id'); $id_hidden->setName('id'); $contacts_select = new Element\Select('contacts'); $contacts_select->setLabel('Contacts'); $contacts_select->setLabelAttributes(array('class' => 'select f_3_w50')); $contacts_select->setAttributes(array('class' => 'sel_chosen')); $contacts_select->setOptions(array('disable_inarray_validator' => true, 'empty_option' => 'Please choose your link', 'required' => false)); $this->add($id_hidden); $this->add($contacts_select); $this->add(array('type' => 'Profile\\Form\\LinksFieldset')); }