X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fct.pl;h=bc4f42829d9a83a1845c74986aa6257964f6595d;hb=1296b8698b6f6ac80bcb63b0f94dd56e07046e9c;hp=6c119be5d3916836e9534f5e9e902234410503a2;hpb=40782548cf82ac1e4c0fe417113a4cb3072e9390;p=kivitendo-erp.git diff --git a/bin/mozilla/ct.pl b/bin/mozilla/ct.pl index 6c119be5d..bc4f42829 100644 --- a/bin/mozilla/ct.pl +++ b/bin/mozilla/ct.pl @@ -37,12 +37,15 @@ # $locale->text('Add Customer') # $locale->text('Add Vendor') -use SL::CT; use CGI::Ajax; -use CGI; -use Data::Dumper; +use POSIX qw(strftime); + +use SL::CT; +use SL::CVar; +use SL::ReportGenerator; require "bin/mozilla/common.pl"; +require "bin/mozilla/reportgenerator.pl"; 1; @@ -51,10 +54,12 @@ require "bin/mozilla/common.pl"; sub add { $lxdebug->enter_sub(); + $auth->assert('customer_vendor_edit'); + $form->{title} = "Add"; $form->{callback} = - "$form->{script}?action=add&db=$form->{db}&path=$form->{path}&login=$form->{login}&password=$form->{password}" + "$form->{script}?action=add&db=$form->{db}" unless $form->{callback}; CT->populate_drop_down_boxes(\%myconfig, \%$form); @@ -68,505 +73,152 @@ sub add { sub search { $lxdebug->enter_sub(); - my $vc_business_type = $form->{db} eq "customer" ? - $locale->text("Customer type") : $locale->text("Vendor type"); + $auth->assert('customer_vendor_edit'); + + $form->{IS_CUSTOMER} = $form->{db} eq 'customer'; $form->get_lists("business_types" => "ALL_BUSINESS_TYPES"); - my (%labels, @values); - - my $business_types; - if (scalar(@{ $form->{ALL_BUSINESS_TYPES} }) != 0) { - push(@values, undef); - foreach my $item (@{ $form->{ALL_BUSINESS_TYPES} }) { - push(@values, $item->{id}); - $labels{$item->{id}} = $item->{description}; - } + $form->{SHOW_BUSINESS_TYPES} = scalar @{ $form->{ALL_BUSINESS_TYPES} } > 0; - $business_types = - qq|