$form->addElement("select", $field['name'], $field['description'], unserialize($field['options']), 'class = " inputSelect"'); break; case 'checkbox': $form->addElement("advcheckbox", $field['name'], $field['description'], null, 'class = "inputCheckbox"', array(0, 1)); break; case 'text': $form->addElement("text", $field['name'], $field['description'], 'class = "inputText"'); break; case 'textarea': $element = $form->addElement("textarea", $field['name'], $field['description'], 'class = "inputText"'); $element->setCols(40); $element->setRows(2); break; case 'date': $options = unserialize($field['options']); $form->addElement(EfrontEntity::createDateElement($form, $field['name'], $field['description'], array('minYear' => $options['year_range_from'], 'maxYear' => $options['year_range_to'], 'include_time' => $options['include_time']))); break; default: break; } if ($field['mandatory']) { $form->addRule($field['name'], _THEFIELD . ' "' . $field['description'] . '" ' . _ISMANDATORY, 'required', null, 'client'); } if ($field['rule']) { $form->addRule($field['name'], _INVALIDFIELDDATA, 'checkRule', $field['rule']); } if ($field['type'] == 'date' && $field['default_value'] == 0) { $form->setDefaults(array($field['name'] => time())); } else { $form->setDefaults(array($field['name'] => $field['default_value'])); }
$form->addElement('text', 'mother_tongue', _MOTHERTONGUE, 'class = "inputText" '); $form->addElement('text', 'nationality', _NATIONALITY, 'class = "inputText" '); $form->addElement('text', 'address', _ADDRESS, 'class = "inputText" '); $form->addElement('text', 'city', _CITY, 'class = "inputText" '); $form->addElement('text', 'country', _COUNTRY, 'class = "inputText" '); $form->addElement('text', 'homephone', _HOMEPHONE, 'class = "inputText" '); $form->addElement('text', 'mobilephone', _MOBILEPHONE, 'class = "inputText" '); $form->addElement('text', 'office', _OFFICE, 'class = "inputText" '); $form->addElement('text', 'company_internal_phone', _COMPANYINTERNALPHONE, 'class = "inputText" '); $form->addElement('text', 'afm', _VATREGNUMBER, 'class = "inputText" '); $form->addElement('text', 'doy', _TAXOFFICE, 'class = "inputText" '); $form->addElement('text', 'police_id_number', _POLICEIDNUMBER, 'class = "inputText" '); $form->addElement('text', 'work_permission_data', _WORKPERMISSIONDATA, 'class = "inputText"'); $form->addElement('text', 'employement_type', _EMPLOYMENTTYPE, 'class = "inputText"'); $form->addElement(EfrontEntity::createDateElement($form, 'hired_on', _HIREDON, array('minYear' => 1960, 'maxYear' => date("Y") + 1, 'addEmptyOption' => true, 'format' => getDateFormat()))); $form->addElement(EfrontEntity::createDateElement($form, 'left_on', _LEFTON, array('minYear' => 1960, 'maxYear' => date("Y") + 1, 'addEmptyOption' => true, 'format' => getDateFormat()))); $form->addElement('text', 'wage', _WAGE, 'class = "inputText"'); $form->addElement('select', 'marital_status', _MARITALSTATUS, array("0" => _SINGLE, "1" => _MARRIED), 'class = "inputText" '); $form->addElement('text', 'bank', _BANK, 'class = "inputText" '); $form->addElement('text', 'bank_account', _BANKACCOUNT, 'class = "inputText" '); $form->addElement('select', 'way_of_working', _WAYOFWORKING, array("" => "", "0" => _FULLTIME, "1" => _PARTTIME, "2" => _CASUAL), 'class = "inputText" id="way_of_working"'); $form->addElement('advcheckbox', 'driving_licence', _DRIVINGLICENSE, null, 'class = "inputCheckbox"'); $form->addElement('advcheckbox', 'national_service_completed', _NATIONALSERVICECOMPLETED, null, 'class = "inputCheckbox"'); $form->addElement('advcheckbox', 'transport', _TRANSPORTMEANS, null, 'class = "inputCheckbox"'); $form->setDefaults($editedEmployee->employee); if ($constrainAccess != 'all') { $form->addElement('submit', 'submit_personal_details', _SUBMIT, 'class = "flatButton"'); $form->freeze($constrainAccess); } else { $form->freeze(); }