"all" => 0,
"old_id" => \@old_project_ids
},
- "employees" => "ALL_EMPLOYEES",
- "salesmen" => "ALL_SALESMEN",
$vc => "ALL_VC",
"price_factors" => "ALL_PRICE_FACTORS",
"departments" => "ALL_DEPARTMENTS",
"business_types" => "ALL_BUSINESS_TYPES",
);
+
+ $::form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all(query => [ or => [ id => $::form->{employee_id}, deleted => 0 ] ]);
+ $::form->{ALL_SALESMEN} = SL::DB::Manager::Employee->get_all(query => [ or => [ id => $::form->{salesman_id}, deleted => 0 ] ]);
$::form->{ALL_CONTACTS} = SL::DB::Manager::Contact->get_all(query => [
or => [
cp_cv_id => $::form->{"$::form->{vc}_id"} * 1,
[% IF row.id == employee_id %][%- IF row.name %][%- HTML.escape(row.name) %][%- ELSE %][% HTML.escape(row.login) %][%- END %][% END %]
[%- END %]
[%- ELSE %]
- <select name="employee_id">
- [%- FOREACH row = ALL_EMPLOYEES %]
- <option value="[% HTML.escape(row.id) %]"[% IF row.id == employee_id %] selected[% END %]>
- [%- IF row.name %][%- HTML.escape(row.name) %][%- ELSE %][% HTML.escape(row.login) %][%- END %]
- </option>
- [%- END %]
- </select>
+ [% L.select_tag('employee_id', L.options_for_select(ALL_EMPLOYEES, default=employee_id, title='safe_name')) %]
[%- END %]
</td>
</tr>
[% IF row.id == the_salesman_id %][%- IF row.name %][%- HTML.escape(row.name) %][%- ELSE %][% HTML.escape(row.login) %][%- END %][% END %]
[%- END %]
[%- ELSE %]
- <select name="salesman_id">
- [%- FOREACH row = ALL_SALESMEN %]
- <option value="[% HTML.escape(row.id) %]"[% IF row.id == the_salesman_id %] selected[% END %]>
- [%- IF row.name %][%- HTML.escape(row.name) %][%- ELSE %][% HTML.escape(row.login) %][%- END %]
- </option>
- [%- END %]
- </select>
+ [% L.select_tag('salesman_id', L.options_for_select(ALL_SALESMEN, default=(salesman_id ? salesman_id : employee_id), title='safe_name')) %]
[%- END %]
</td>
</tr>