X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fcommon.pl;h=1bd92dc91c2a82ca2b8eef24fb2e48d8f901922c;hb=6ac037ceaeb565f385267b2f8794e28e7ce50af8;hp=d2ac1fa694d96b2c2ecf7749d6dd3d29773b851a;hpb=c9f49c186dd515927f964902ff736090f4a967e9;p=kivitendo-erp.git diff --git a/bin/mozilla/common.pl b/bin/mozilla/common.pl index d2ac1fa69..1bd92dc91 100644 --- a/bin/mozilla/common.pl +++ b/bin/mozilla/common.pl @@ -91,7 +91,7 @@ sub select_part_internal { my ($new_item, $callback_sub); - my $re = "^new_.*_" . $form->{selection}; + my $re = "^new_.*_$form->{selection}\$"; foreach (grep /$re/, keys %{ $form }) { my $new_key = $_; @@ -127,9 +127,19 @@ sub part_selection_internal { $order_dir = 1; $order_dir = $form->{"order_dir"} if (defined($form->{"order_dir"})); - %options = map { $_ => 1 } split m/:/, $form->{options}; + my %options; - map { $form->{$_} = 1 if ($options{$_}) } qw(no_services no_assemblies); + foreach my $opt (split m/:/, $form->{options}) { + if ($opt =~ /=/) { + my ($key, $value) = split m/=/, $opt, 2; + $options{$key} = $value; + + } else { + $options{$opt} = 1; + } + } + + map { $form->{$_} = $options{$_} if ($options{$_}) } qw(no_services no_assemblies assemblies click_button); $parts = Common->retrieve_parts(\%myconfig, $form, $order_by, $order_dir); @@ -156,6 +166,8 @@ sub part_selection_internal { }, @header_sort); + $form->{formname} ||= 'Form'; + $form->{title} = $locale->text("Select a part"); $form->header(); print $form->parse_html_template("generic/part_selection", { "HEADER" => \@header, @@ -316,11 +328,11 @@ sub set_longdescription { # ------------------------------------------------------------------------- sub H { - return $form->quote_html($_[0]); + return $locale->quote_special_chars('HTML', $_[0]); } sub Q { - return $form->quote($_[0]); + return $locale->quote_special_chars('URL@HTML', $_[0]); } sub E { @@ -503,7 +515,15 @@ sub mark_as_paid_common { } else { my $referer = $ENV{HTTP_REFERER}; - $referer =~ s/^(.*)action\=.*\&(.*)$/$1action\=mark_as_paid\&mark_as_paid\=1\&id\=$form->{id}\&$2/; + if ($referer =~ /action/) { + $referer =~ /^(.*)\?action\=[^\&]*(\&.*)$/; + $script = $1; + $callback = $2; + } else { + $script = $referer; + $callback = ""; + } + $referer = $script . "?action=mark_as_paid&mark_as_paid=1&id=$form->{id}" . $callback; $form->header(); print qq||; print qq|

|.$locale->text('Mark as paid?').qq|

|;