X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fct.pl;h=07a6d2ec86e537dd6e3b510aa489f62905bc14c2;hb=5eadc96699ee3f70f3a0bb3f473f3cfea7e8ea68;hp=8940fb950bf7d17bfe6ba69acca30c4f36aba207;hpb=befa8b79f46fa8815bed0da27cbf406ca8a9b94f;p=kivitendo-erp.git diff --git a/bin/mozilla/ct.pl b/bin/mozilla/ct.pl index 8940fb950..07a6d2ec8 100644 --- a/bin/mozilla/ct.pl +++ b/bin/mozilla/ct.pl @@ -36,555 +36,235 @@ # $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"; +use strict; 1; # end of main sub add { - $lxdebug->enter_sub(); + $main::lxdebug->enter_sub(); - $form->{title} = "Add"; + $main::auth->assert('customer_vendor_edit'); - $form->{callback} = - "$form->{script}?action=add&db=$form->{db}&login=$form->{login}&password=$form->{password}" - unless $form->{callback}; + my $form = $main::form; + my %myconfig = %main::myconfig; + + $form->{title} = "Add"; + $form->{callback} = "$form->{script}?action=add&db=$form->{db}" unless $form->{callback}; CT->populate_drop_down_boxes(\%myconfig, \%$form); &form_header; &form_footer; - $lxdebug->leave_sub(); + $main::lxdebug->leave_sub(); } sub search { - $lxdebug->enter_sub(); + $main::lxdebug->enter_sub(); + + $main::auth->assert('customer_vendor_edit'); - my $vc_business_type = $form->{db} eq "customer" ? - $locale->text("Customer type") : $locale->text("Vendor type"); + my $form = $main::form; + my $locale = $main::locale; + + $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|