X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fct.pl;h=de0a436596f99bb3a4dda02adf73a3b4d49905ff;hb=540030ff9826439d94f3f4292ab79b9be8795acc;hp=92ef085d4216668f219efd4e26412f57ccff70c7;hpb=a65c8e991906fc1ad47af84decc066672348ce1b;p=kivitendo-erp.git diff --git a/bin/mozilla/ct.pl b/bin/mozilla/ct.pl index 92ef085d4..de0a43659 100644 --- a/bin/mozilla/ct.pl +++ b/bin/mozilla/ct.pl @@ -45,12 +45,12 @@ # $locale->text('Vendor deleted!') # $locale->text('Cannot delete vendor!') -use CGI::Ajax; use POSIX qw(strftime); use SL::CT; use SL::CVar; use SL::DB::Business; +use SL::DB::Default; use SL::ReportGenerator; require "bin/mozilla/common.pl"; @@ -286,6 +286,8 @@ sub edit { # format discount $form->{discount} *= 100; + # format uri + $form->{homepage} = 'http://' . $form->{homepage} unless $form->{homepage} =~ m|^https?://|; &form_header; &form_footer; @@ -311,15 +313,15 @@ sub form_header { my %myconfig = %main::myconfig; my $locale = $main::locale; - $form->get_lists(employees => "ALL_EMPLOYEES", - taxzones => "ALL_TAXZONES"); + $form->get_lists(employees => "ALL_EMPLOYEES", + taxzones => "ALL_TAXZONES", + currencies => "ALL_CURRENCIES"); $form->get_pricegroup(\%myconfig, { all => 1 }); $form->get_lists(customers => { key => "ALL_SALESMAN_CUSTOMERS", business_is_salesman => 1 }) if $::lx_office_conf{features}->{vertreter}; $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'; $form->{salesman_label} = sub { $_[0]->{name} ne "" ? $_[0]->{name} : $_[0]->{login} }; $form->{shipto_label} = \&_shipto_label; @@ -327,7 +329,6 @@ sub form_header { $form->{taxzone_id} = 0 if !$form->{id}; $form->{jsscript} = 1; $form->{fokus} = "ct.greeting"; - $form->{AJAX} = [ new CGI::Ajax( map {; "get_$_" => "$form->{script}?action=get_$_" } qw(delivery) ) ]; $form->{SHIPTO_ALL} = [ +{ shipto_id => '0', shiptoname => $::locale->text('All') }, @{ $form->{SHIPTO} } ]; $form->{title} = $form->{title_save} @@ -338,6 +339,19 @@ sub form_header { $form->{NOTES} ||= [ ]; + if (!$form->{'language_id'}) { + my $l_id = SL::DB::Default->get->{'language_id'}; + if ($l_id) { + $form->{'default_language_id'} = $l_id; + } + } + + if (!$form->{'id'}) { + $form->{'currency'} = $form->get_default_currency(\%myconfig); + } else { + $form->{currency} = $form->{curr}; + } + $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} });