gelöschte Benutzer in ct/form_header ausblenden
authorSven Schöling <s.schoeling@linet-services.de>
Mon, 13 Feb 2012 13:56:58 +0000 (14:56 +0100)
committerSven Schöling <s.schoeling@linet-services.de>
Mon, 13 Feb 2012 13:56:58 +0000 (14:56 +0100)
bin/mozilla/ct.pl
templates/webpages/ct/form_header.html

index b525535..2eb6c24 100644 (file)
@@ -314,17 +314,17 @@ sub form_header {
   my %myconfig = %main::myconfig;
   my $locale   = $main::locale;
 
-  $form->get_lists(employees  => "ALL_EMPLOYEES",
-                   taxzones   => "ALL_TAXZONES",
+  $form->get_lists(taxzones   => "ALL_TAXZONES",
                    currencies => "ALL_CURRENCIES");
   $form->get_pricegroup(\%myconfig, { all => 1 });
 
   $form->get_lists(customers => { key => "ALL_SALESMAN_CUSTOMERS", business_is_salesman => 1 }) if $::lx_office_conf{features}->{vertreter};
+  $form->{ALL_EMPLOYEES}          = SL::DB::Manager::Employee->get_all(query => [ or => [ id => $::form->{FU_created_for_user},  deleted => 0 ] ]);
+  $form->{ALL_SALESMEN}           = SL::DB::Manager::Employee->get_all(query => [ or => [ id => $::form->{salesman_id},  deleted => 0 ] ]);
+  $form->{USER}                   = SL::DB::Manager::Employee->current;
 
-  $form->{ALL_SALESMEN}   = $form->{ALL_EMPLOYEES};
   $form->{taxincluded}    = ($form->{taxincluded}) ? "checked" : "";
   $form->{is_customer}    = $form->{db}     eq 'customer';
-  $form->{salesman_label} = sub { $_[0]->{name} ne "" ? $_[0]->{name} : $_[0]->{login} };
   $form->{shipto_label}   = \&_shipto_label;
   $form->{contacts_label} = \&_contacts_label;
   $form->{taxzone_id}     = 0                                                               if !$form->{id};
index 4d6ee5a..501ebaa 100644 (file)
       </td>
       [%- IF is_customer && !conf_vertreter %]
       <th align="right">[% 'Salesman' | $T8 %]</th>
-      <td>
-       [%- INCLUDE generic/multibox.html
-             name       = 'salesman_id',
-             DATA       = ALL_SALESMEN,
-             show_empty = 1,
-             id_key     = 'id',
-             label_sub  = 'salesman_label',
-       -%]
-      </td>
+      <td>[% L.select_tag('salesman_id', L.options_for_select(ALL_SALESMEN, default=salesman_id, show_empty=1, title='safe_name')) %]</td>
       [%- END %]
      </tr>
     </table>
         <input name="FU_date" id="FU_date" value="[% HTML.escape(FU_date) %]" size="12">
         <input type="button" name="FU_date_button" id="FU_date_trigger" value="?">
         [% 'for' | $T8 %]
-        <select name="FU_created_for_user">
-         [%- FOREACH row = ALL_EMPLOYEES %]
-         <option value="[% HTML.escape(row.id) %]"[% IF (NOTE_id && (row.id == FU_created_for_user)) || (row.login == login) %] selected[% END %]>
-          [%- IF row.name %][%- HTML.escape(row.name) %] ([% HTML.escape(row.login) %])[% ELSE %][% HTML.escape(row.login) %][% END %]
-         </option>
-         [%- END %]
-        </select>
+        [% L.select_tag('FU_created_for_user', L.options_for_select(ALL_EMPLOYEES, default=(FU_created_for_user ? FU_created_for_user : USER.id), title='safe_name')) %]
        </td>
       </tr>