From: Moritz Bunkus Date: Mon, 26 Mar 2007 08:18:36 +0000 (+0000) Subject: Überflüssigen Code bzgl. salesman entfernt (wird eh nicht benutzt, wenn Auswahl über... X-Git-Tag: release-2.4.3^2~574 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=4671a79f086eb9031d0715d24ed4338aa190b163;p=kivitendo-erp.git Überflüssigen Code bzgl. salesman entfernt (wird eh nicht benutzt, wenn Auswahl über Drop-Down-Box erfolgt). --- diff --git a/bin/mozilla/ct.pl b/bin/mozilla/ct.pl index 84e495122..bfeacf45c 100644 --- a/bin/mozilla/ct.pl +++ b/bin/mozilla/ct.pl @@ -1471,179 +1471,10 @@ sub display { sub update { $lxdebug->enter_sub(); - &check_salesman($form->{salesman}); - - # $form->get_salesman(\%myconfig, $form->{salesman}); &display(); $lxdebug->leave_sub(); } -sub check_salesman { - $lxdebug->enter_sub(); - - my ($name) = @_; - - my ($new_name, $new_id) = split /--/, $form->{$name}; - my $i = 0; - - # check name, combine name and id - if ($form->{"oldsalesman"} ne $form->{"salesman"}) { - - # return one name or a list of names in $form->{name_list} - if (($i = $form->get_salesman(\%myconfig, $name)) > 1) { - &select_salesman($name); - exit; - } - - if ($i == 1) { - - # we got one name - $form->{"salesman_id"} = $form->{salesman_list}[0]->{id}; - $form->{salesman} = $form->{salesman_list}[0]->{name}; - $form->{"oldsalesman"} = $form->{salesman}; - - } else { - - # name is not on file - # $locale->text('Customer not on file or locked!') - # $locale->text('Vendor not on file or locked!') - $msg = ucfirst $name . " not on file or locked!"; - $form->error($locale->text($msg)); - } - } - - $lxdebug->leave_sub(); - - return $i; -} - -sub select_salesman { - $lxdebug->enter_sub(); - - my ($table) = @_; - - @column_index = qw(ndx name); - - $label = ucfirst $table; - $column_data{ndx} = qq| |; - $column_data{name} = - qq|| . $locale->text($label) . qq||; - - # list items with radio button on a form - $form->header; - - $title = $locale->text('Select from one of the names below'); - - print qq| - - -
{script}> - - - - - - - - - - - - -
$title
- - |; - - map { print "\n$column_data{$_}" } @column_index; - - print qq| - -|; - - my $i = 0; - foreach $ref (@{ $form->{salesman_list} }) { - $checked = ($i++) ? "" : "checked"; - - $ref->{name} =~ s/\"/"/g; - - $column_data{ndx} = - qq||; - $column_data{name} = - qq||; - - $j++; - $j %= 2; - print qq| - |; - - map { print "\n$column_data{$_}" } @column_index; - - print qq| - - -{id}> - -|; - - } - - print qq| -
$ref->{name}
-

- - - -|; - - # delete variables - map { delete $form->{$_} } qw(action name_list header); - - # save all other form variables - foreach $key (keys %${form}) { - $form->{$key} =~ s/\"/"/g; - print qq|\n|; - } - - print qq| - - - -
- -
- - - -|; - - $lxdebug->leave_sub(); -} - -sub salesman_selected { - $lxdebug->enter_sub(); - - # replace the variable with the one checked - - # index for new item - $i = $form->{ndx}; - - $form->{salesman} = $form->{"new_name_$i"}; - $form->{"salesman_id"} = $form->{"new_id_$i"}; - $form->{"oldsalesman"} = $form->{salesman}; - - # delete all the new_ variables - for $i (1 .. $form->{lastndx}) { - map { delete $form->{"new_${_}_$i"} } (id, name); - } - - map { delete $form->{$_} } qw(ndx lastndx nextsub); - - &update(1); - - $lxdebug->leave_sub(); -} - sub get_contact { $lxdebug->enter_sub();