X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fct.pl;h=bfeacf45c531d0ad61ea6b94b7f63b900aa59a6d;hb=71196b75e9beb984ead25c605ab91443269de88d;hp=84e49512275ede22c39b40553d07ae90dc277fca;hpb=a751b16cead5e56b62e18ee616e04323919f5fe1;p=kivitendo-erp.git 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();