X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fct.pl;h=f169be0d17c605df9ba789e69caf307c665c9581;hb=81d7a3d732eac0e68a4edc8306e48532e9deb637;hp=5bffd7c2961ab5bdee141c49592c2a1bad199d91;hpb=ddbe3ea5ec297a58acc9ee3afc17156fb97be7f2;p=kivitendo-erp.git diff --git a/bin/mozilla/ct.pl b/bin/mozilla/ct.pl index 5bffd7c29..f169be0d1 100644 --- a/bin/mozilla/ct.pl +++ b/bin/mozilla/ct.pl @@ -36,13 +36,24 @@ # $locale->text('Vendors') # $locale->text('Add Customer') # $locale->text('Add Vendor') +# $locale->text('Edit Customer') +# $locale->text('Edit Vendor') +# $locale->text('Customer saved!') +# $locale->text('Vendor saved!') +# $locale->text('Customer deleted!') +# $locale->text('Cannot delete customer!') +# $locale->text('Vendor deleted!') +# $locale->text('Cannot delete 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,11 +62,10 @@ require "bin/mozilla/common.pl"; sub add { $lxdebug->enter_sub(); - $form->{title} = "Add"; + $auth->assert('customer_vendor_edit'); - $form->{callback} = - "$form->{script}?action=add&db=$form->{db}&path=$form->{path}&login=$form->{login}&password=$form->{password}" - unless $form->{callback}; + $form->{title} = "Add"; + $form->{callback} = "$form->{script}?action=add&db=$form->{db}" unless $form->{callback}; CT->populate_drop_down_boxes(\%myconfig, \%$form); @@ -68,505 +78,168 @@ 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|