Lieferanten/Kunden Namen richtig escapen
[kivitendo-erp.git] / bin / mozilla / common.pl
index 6ace578..f03911c 100644 (file)
@@ -351,6 +351,14 @@ sub format_dates {
   $dateformat = $myconfig{"dateformat"} unless ($dateformat);
 
   foreach my $idx (@indices) {
+    if ($form->{TEMPLATE_ARRAYS} && (ref($form->{TEMPLATE_ARRAYS}->{$idx}) eq "ARRAY")) {
+      for (my $i = 0; $i < scalar(@{$form->{TEMPLATE_ARRAYS}->{$idx}}); $i++) {
+        $form->{TEMPLATE_ARRAYS}->{$idx}->[$i] =
+          $locale->reformat_date(\%myconfig, $form->{TEMPLATE_ARRAYS}->{$idx}->[$i],
+                                 $dateformat, $longformat);
+      }
+    }
+
     next unless (defined($form->{$idx}));
 
     if (!ref($form->{$idx})) {
@@ -378,6 +386,12 @@ sub reformat_numbers {
     if (!$numberformat || ($numberformat eq $myconfig{"numberformat"}));
 
   foreach my $idx (@indices) {
+    if ($form->{TEMPLATE_ARRAYS} && (ref($form->{TEMPLATE_ARRAYS}->{$idx}) eq "ARRAY")) {
+      for (my $i = 0; $i < scalar(@{$form->{TEMPLATE_ARRAYS}->{$idx}}); $i++) {
+        $form->{TEMPLATE_ARRAYS}->{$idx}->[$i] = $form->parse_amount(\%myconfig, $form->{TEMPLATE_ARRAYS}->{$idx}->[$i]);
+      }
+    }
+
     next unless (defined($form->{$idx}));
 
     if (!ref($form->{$idx})) {
@@ -395,6 +409,12 @@ sub reformat_numbers {
   $myconfig{"numberformat"} = $numberformat;
 
   foreach my $idx (@indices) {
+    if ($form->{TEMPLATE_ARRAYS} && (ref($form->{TEMPLATE_ARRAYS}->{$idx}) eq "ARRAY")) {
+      for (my $i = 0; $i < scalar(@{$form->{TEMPLATE_ARRAYS}->{$idx}}); $i++) {
+        $form->{TEMPLATE_ARRAYS}->{$idx}->[$i] = $form->format_amount(\%myconfig, $form->{TEMPLATE_ARRAYS}->{$idx}->[$i], $places);
+      }
+    }
+
     next unless (defined($form->{$idx}));
 
     if (!ref($form->{$idx})) {