]> wagnertech.de Git - mfinanz.git/blobdiff - bin/mozilla/ct.pl
Unterstützung für zellenübergreifende Überschriften im PDF-Export des ReportGenerator...
[mfinanz.git] / bin / mozilla / ct.pl
index d4c5230d3e7f3c03cf910689abfabf5f0c6ba70e..bc4f42829d9a83a1845c74986aa6257964f6595d 100644 (file)
@@ -37,7 +37,6 @@
 # $locale->text('Add Customer')
 # $locale->text('Add Vendor')
 
-use CGI;
 use CGI::Ajax;
 use POSIX qw(strftime);
 
@@ -111,23 +110,14 @@ sub list_names {
   my @options;
   if ($form->{status} eq 'all') {
     push @options, $locale->text('All');
-
   } elsif ($form->{status} eq 'orphaned') {
     push @options, $locale->text('Orphaned');
   }
 
-  if ($form->{name}) {
-    push @options, $locale->text('Name') . " : $form->{name}";
-  }
-  if ($form->{contact}) {
-    push @options, $locale->text('Contact') . " : $form->{contact}";
-  }
-  if ($form->{"$form->{db}number"}) {
-    push @options, $locale->text('Number') . qq| : $form->{"$form->{db}number"}|;
-  }
-  if ($form->{email}) {
-    push @options, $locale->text('E-mail') . " : $form->{email}";
-  }
+  push @options, $locale->text('Name') . " : $form->{name}"                    if $form->{name};
+  push @options, $locale->text('Contact') . " : $form->{contact}"              if $form->{contact};
+  push @options, $locale->text('Number') . qq| : $form->{"$form->{db}number"}| if $form->{"$form->{db}number"};
+  push @options, $locale->text('E-mail') . " : $form->{email}"                 if $form->{email};
 
   my @columns = (
     'id',        'name',  "$form->{db}number", 'address',  'contact',  'phone',
@@ -267,10 +257,11 @@ sub form_header {
 
   $auth->assert('customer_vendor_edit');
 
-  $form->get_lists("employees" => "ALL_SALESMEN",
+  $form->get_lists("employees" => "ALL_EMPLOYEES",
                    "taxzones"  => "ALL_TAXZONES");
   $form->get_pricegroup(\%myconfig, { all => 1 });
 
+  $form->{ALL_SALESMEN}   = $form->{ALL_EMPLOYEES};
   $form->{taxincluded}    = ($form->{taxincluded}) ? "checked" : "";
   $form->{is_admin}       = $myconfig{role} eq 'admin';
   $form->{is_customer}    = $form->{db}     eq 'customer';
@@ -295,12 +286,12 @@ sub form_header {
   map { $form->{"MB_$_"} = [ map +{ id => $_, description => $_ }, @{ $form->{$_} } ] } qw(TITLES GREETINGS COMPANY_GREETINGS DEPARTMENT);
 ## /LINET
 
+  $form->{NOTES} ||= [ ];
+
   $form->{CUSTOM_VARIABLES} = CVar->get_custom_variables('module' => 'CT', 'trans_id' => $form->{id});
 
   CVar->render_inputs('variables' => $form->{CUSTOM_VARIABLES}) if (scalar @{ $form->{CUSTOM_VARIABLES} });
 
-  $main::lxdebug->dump(0, "cvar", $form->{CUSTOM_VARIABLES});
-
   $form->header;
   print $form->parse_html_template('ct/form_header');
 
@@ -584,11 +575,9 @@ sub get_contact {
 
   CT->get_contact(\%myconfig, \%$form);
 
-  my $q = new CGI;
   $result = "$form->{cp_name}";
   map { $result .= "__pjx__" . $form->{$_} } qw(cp_greeting cp_title cp_givenname cp_phone1 cp_phone2 cp_email cp_abteilung cp_fax cp_mobile1 cp_mobile2 cp_satphone cp_satfax cp_project cp_privatphone cp_privatemail cp_birthday);
-  print $q->header();
-  print $result;
+  print $cgi->header(), $result;
   $lxdebug->leave_sub();
 
 }
@@ -600,11 +589,9 @@ sub get_shipto {
 
   CT->get_shipto(\%myconfig, \%$form);
 
-  my $q = new CGI;
   $result = "$form->{shiptoname}";
   map { $result .= "__pjx__" . $form->{$_} } qw(shiptodepartment_1 shiptodepartment_2 shiptostreet shiptozipcode shiptocity shiptocountry shiptocontact shiptophone shiptofax shiptoemail);
-  print $q->header();
-  print $result;
+  print $cgi->header(), $result;
   $lxdebug->leave_sub();
 
 }
@@ -616,8 +603,8 @@ sub get_delivery {
 
   CT->get_delivery(\%myconfig, \%$form );
 
-  print CGI->new->header();
-  print $form->parse_html_template('ct/get_delivery');
+  print $cgi->header(), $form->parse_html_template('ct/get_delivery');
+
   $lxdebug->leave_sub();
 }