X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fct.pl;h=75c10a3401b3a80cf748c616af58e4851b269361;hb=f83ca50608bd8cb2af24bef702c4d0fd9fea9324;hp=95c6e3315ba1843ca2a5cdf8be286bc859064498;hpb=4dbb09950c9f5596646537c12d991c99086fe7c1;p=kivitendo-erp.git diff --git a/bin/mozilla/ct.pl b/bin/mozilla/ct.pl index 95c6e3315..75c10a340 100644 --- a/bin/mozilla/ct.pl +++ b/bin/mozilla/ct.pl @@ -36,841 +36,518 @@ # $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 CGI::Ajax; +use POSIX qw(strftime); use SL::CT; +use SL::CVar; +use SL::ReportGenerator; -1; -# end of main +require "bin/mozilla/common.pl"; +require "bin/mozilla/reportgenerator.pl"; +1; +# end of main sub add { $lxdebug->enter_sub(); + $auth->assert('customer_vendor_edit'); - $form->{title} = "Add"; + $form->{title} = "Add"; + $form->{callback} = "$form->{script}?action=add&db=$form->{db}" unless $form->{callback}; - $form->{callback} = "$form->{script}?action=add&db=$form->{db}&path=$form->{path}&login=$form->{login}&password=$form->{password}" unless $form->{callback}; + CT->populate_drop_down_boxes(\%myconfig, \%$form); - CT->taxaccounts(\%myconfig, \%$form); - &form_header; &form_footer; - + $lxdebug->leave_sub(); } - sub search { $lxdebug->enter_sub(); + $auth->assert('customer_vendor_edit'); - $label = ucfirst $form->{db}; - $form->{title} = $locale->text($label."s"); + $form->{IS_CUSTOMER} = $form->{db} eq 'customer'; + + $form->get_lists("business_types" => "ALL_BUSINESS_TYPES"); + $form->{SHOW_BUSINESS_TYPES} = scalar @{ $form->{ALL_BUSINESS_TYPES} } > 0; + + $form->{CUSTOM_VARIABLES} = CVar->get_configs('module' => 'CT'); + ($form->{CUSTOM_VARIABLES_FILTER_CODE}, + $form->{CUSTOM_VARIABLES_INCLUSION_CODE}) = CVar->render_search_options('variables' => $form->{CUSTOM_VARIABLES}, + 'include_prefix' => 'l_', + 'include_value' => 'Y'); + + $form->{jsscript} = 1; + $form->{title} = $form->{IS_CUSTOMER} ? $locale->text('Customers') : $locale->text('Vendors'); + $form->{fokus} = 'Form.name'; + + $form->header(); + print $form->parse_html_template('ct/search'); - if ($form->{db} eq 'vendor') { - $gifi = qq| -