X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fcommon.pl;h=7f557fb435a2d5563730d33a251e98da5e763c96;hb=bab39fc246bed0c9bb6906032bd47c1d61b8e2ec;hp=f4a07f6674b29025799aafdebbcf6d02f4522c5f;hpb=599030d5e26bcef0f9850ddbbedba106ded70ebb;p=kivitendo-erp.git diff --git a/bin/mozilla/common.pl b/bin/mozilla/common.pl index f4a07f667..7f557fb43 100644 --- a/bin/mozilla/common.pl +++ b/bin/mozilla/common.pl @@ -45,20 +45,27 @@ sub restore_form { sub build_std_url { $lxdebug->enter_sub(); - my $url = "$form->{script}?"; - my $first = 1; + my $script = $form->{script}; + + my @parts; + foreach my $key ((qw(login password), @_)) { next unless ($key); - $url .= "&" unless ($first); - $first = 0; - if ($key =~ /=/) { - $url .= $key; + if ($key =~ /(.*?)=(.*)/) { + if ($1 eq 'script') { + $script = $2; + } else { + push @parts, $key; + } + } else { - $url .= "${key}=" . E($form->{$key}); + push @parts, "${key}=" . E($form->{$key}); } } + my $url = "${script}?" . join('&', @parts); + $lxdebug->leave_sub(); return $url; @@ -563,4 +570,24 @@ sub call_sub { $lxdebug->leave_sub(); } +sub show_vc_details { + $lxdebug->enter_sub(); + + $form->{vc} = $form->{vc} eq "customer" ? "customer" : "vendor"; + $form->isblank("vc_id", + $form->{vc} eq "customer" ? + $locale->text("No customer has been selected yet.") : + $locale->text("No vendor has been selected yet.")); + + Common->get_vc_details(\%myconfig, $form, $form->{vc}, $form->{vc_id}); + + $form->{title} = $form->{vc} eq "customer" ? + $locale->text("Customer details") : $locale->text("Vendor details"); + $form->header(); + print($form->parse_html_template("common/show_vc_details", + { "is_customer" => $form->{vc} eq "customer" })); + + $lxdebug->leave_sub(); +} + 1;