[%# HTML Snippet, for import only %]
[% SWITCH entity_class %][% CASE 1 %][% entity_classname = "Vendor" %][% CASE 2 %][% entity_classname = "Customer" %][% END %]
[% text("$operation $entity_classname") %]
[% PROCESS input element_data = { # Only for generate_control_code id = 'person-target-div' type = "hidden" name = "target_div" value = 'person_div' } %] [% PROCESS input element_data = { id = 'person-entity-id' type = "hidden" name = "entity_id" value = entity_id } %] [% PROCESS input element_data = { id = 'person-id' type = "hidden" name = "id" value = person.id } %] [% PROCESS input element_data = { id = 'person-form-id' type = "hidden" name = "form_id" value = form_id } %] [% PROCESS input element_data = { id = 'person-account-class' type = "hidden" name = "account_class" value = account_class } %]
[% PROCESS input element_data = { id = 'person-control-code' title = text('Control Code') #' label = "_none_" type= "text" name = "control_code" value = person.control_code size = "20" } %] [% IF !created_as_class; created_as_class = entity_class; END; # IF !created_as_class %]
[% PROCESS select element_data = { id = 'person-entity-class' name = "entity_class" options = entity_classes default_values = [entity_class] text_attr = 'class' value_attr = 'id' title = text('Class') label = "_none_" } %]
[% PROCESS select element_data = { title = text('Salutation') label = "_none_" name = 'salutation_id' default_values = [person.salutation_id] default_blank = 1 options = salutations class = 'salutations' text_attr = 'salutation' value_attr = 'id' required = 'true' } %]
[% PROCESS input element_data = { title = text('Given Name') #' label = "_none_" type= "text" name = "first_name" value = person.first_name size = "20" required = 'true' } %]
[% PROCESS input element_data = { title = text('Middle Name') #' label = "_none_" type= "text" name = "middle_name" value = person.middle_name size = "20" } %]
[% PROCESS input element_data = { title = text('Surname') label = "_none_" type= "text" name = "last_name" value = person.last_name size = "20" required = 'true' } %]
[% person_country_id = person.country_id; IF !person_country_id; person_country_id = default_country; END; INCLUDE select_country element_data = { id = 'person-country-id' text_attr = "name" value_attr = "id" default_values = [person_country_id] options = country_list name = "country_id" title = text('Country') label = "_none_" required = 'true' } %]
[% INCLUDE input element_data = { name = 'personal_id', type = 'text', size = '20', value = person.personal_id, title = text('Personal ID') #' label = "_none_" class = 'id', required = 'true' } %]
[% INCLUDE input element_data = { name = 'birthdate', type = 'text', value = person.birthdate, title = text('Birthdate'), label = "_none_" size = '11', class = 'date', required = 'true' } %]

[% PROCESS button element_data = { id = 'person-generate-control-code' text = text('Generate Control Code') #' type = "submit" name = "action" value = "generate_control_code" class = "submit" } %] [% PROCESS button element_data = { id = 'person-retrieve' text = text('Retrieve') type = 'submit' name = 'action' value = 'get_by_cc' class = 'submit' } %] [% INCLUDE button element_data = { text = text('Save'), class="submit" type="submit" name="action" value="save_person" accesskey="S" title="Save [Alt-S]" } %]
[% FOREACH n = notes %]
[% n.note %]
[% END %]