X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fct.pl;h=8abe73a121607b8f9d55ccd3ae3474bb0b4ea615;hb=b71b35308c2f7c628666e4a69e6c3b90cefc5ed0;hp=10ff70675c38e89ff7e58405168decfa233f7c0b;hpb=3ae0915da839e710ea997a984e6825466aafb411;p=kivitendo-erp.git diff --git a/bin/mozilla/ct.pl b/bin/mozilla/ct.pl index 10ff70675..8abe73a12 100644 --- a/bin/mozilla/ct.pl +++ b/bin/mozilla/ct.pl @@ -347,8 +347,8 @@ sub add_transaction { # # saving the history # if(!exists $form->{addition}) { -# $form->{addition} = "ADD TRANSACTION"; -# $form->save_history($form->dbconnect(\%myconfig)); +# $form->{addition} = "ADD TRANSACTION"; +# $form->save_history($form->dbconnect(\%myconfig)); # } # # /saving the history @@ -381,8 +381,8 @@ sub save_and_ap_transaction { # saving the history if(!exists $form->{addition}) { $form->{snumbers} = qq|invnumber_| . $form->{invnumber}; - $form->{addition} = "SAVED"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->{addition} = "SAVED"; + $form->save_history($form->dbconnect(\%myconfig)); } # /saving the history &add_transaction; @@ -401,8 +401,8 @@ sub save_and_ar_transaction { # saving the history if(!exists $form->{addition}) { $form->{snumbers} = qq|invnumber_| . $form->{invnumber}; - $form->{addition} = "SAVED"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->{addition} = "SAVED"; + $form->save_history($form->dbconnect(\%myconfig)); } # /saving the history &add_transaction; @@ -426,8 +426,8 @@ sub save_and_invoice { # saving the history if(!exists $form->{addition}) { $form->{snumbers} = qq|invnumber_| . $form->{invnumber}; - $form->{addition} = "SAVED"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->{addition} = "SAVED"; + $form->save_history($form->dbconnect(\%myconfig)); } # /saving the history &add_transaction; @@ -447,8 +447,8 @@ sub save_and_rfq { # saving the history if(!exists $form->{addition}) { $form->{snumbers} = qq|ordnumber_| . $form->{ordnumber}; - $form->{addition} = "SAVED"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->{addition} = "SAVED"; + $form->save_history($form->dbconnect(\%myconfig)); } # /saving the history &add_transaction; @@ -468,8 +468,8 @@ sub save_and_quotation { # saving the history if(!exists $form->{addition}) { $form->{snumbers} = qq|ordnumber_| . $form->{ordnumber}; - $form->{addition} = "SAVED"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->{addition} = "SAVED"; + $form->save_history($form->dbconnect(\%myconfig)); } # /saving the history &add_transaction; @@ -494,8 +494,8 @@ sub save_and_order { # saving the history if(!exists $form->{addition}) { $form->{snumbers} = qq|ordnumber_| . $form->{ordnumber}; - $form->{addition} = "SAVED"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->{addition} = "SAVED"; + $form->save_history($form->dbconnect(\%myconfig)); } # /saving the history &add_transaction; @@ -528,7 +528,7 @@ sub save_and_close { if(!exists $form->{addition}) { $form->{snumbers} = ($form->{"db"} eq "customer" ? qq|customernumber_| . $form->{customernumber} : qq|vendornumber_| . $form->{vendornumber}); $form->{addition} = "SAVED"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->save_history($form->dbconnect(\%myconfig)); } # /saving the history $form->redirect($locale->text($msg)); @@ -567,8 +567,8 @@ sub save { # saving the history if(!exists $form->{addition}) { $form->{snumbers} = ($form->{"db"} eq "customer" ? qq|customernumber_| . $form->{customernumber} : qq|vendornumber_| . $form->{vendornumber}); - $form->{addition} = "SAVED"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->{addition} = "SAVED"; + $form->save_history($form->dbconnect(\%myconfig)); } # /saving the history &edit; @@ -592,8 +592,8 @@ sub delete { # saving the history if(!exists $form->{addition}) { $form->{snumbers} = ($form->{"db"} eq "customer" ? qq|customernumber_| . $form->{customernumber} : qq|vendornumber_| . $form->{vendornumber}); - $form->{addition} = "DELETED"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->{addition} = "DELETED"; + $form->save_history($form->dbconnect(\%myconfig)); } # /saving the history $form->redirect($locale->text($msg)); @@ -662,6 +662,7 @@ sub get_delivery { $main::lxdebug->enter_sub(); $main::auth->assert('customer_vendor_edit'); + $main::auth->assert('sales_all_edit'); my $form = $main::form; my %myconfig = %main::myconfig; @@ -714,4 +715,25 @@ sub delete_contact { $main::lxdebug->leave_sub(); } +sub ajax_autocomplete { + $main::lxdebug->enter_sub(); + + my $form = $main::form; + my %myconfig = %main::myconfig; + + $form->{column} = 'name' unless $form->{column} =~ /^name$/; + $form->{vc} = 'customer' unless $form->{vc} =~ /^customer|vendor$/; + $form->{db} = $form->{vc}; # CT expects this + $form->{$form->{column}} = $form->{q} || ''; + $form->{limit} = ($form->{limit} * 1) || 10; + $form->{searchitems} ||= ''; + + CT->search(\%myconfig, $form); + + print $form->ajax_response_header(), + $form->parse_html_template('ct/ajax_autocomplete'); + + $main::lxdebug->leave_sub(); +} + sub continue { call_sub($main::form->{nextsub}); }