User Attribut "role" entfernt.
[kivitendo-erp.git] / bin / mozilla / io.pl
index e647db6..5df76ed 100644 (file)
@@ -38,7 +38,6 @@
 
 use Carp;
 use CGI;
-use CGI::Ajax;
 use List::Util qw(min max first);
 
 use SL::CVar;
@@ -113,7 +112,7 @@ sub display_row {
   my $form     = $main::form;
   my %myconfig = %main::myconfig;
   my $locale   = $main::locale;
-  my $cgi      = $main::cgi;
+  my $cgi      = $::request->{cgi};
 
   my $numrows = shift;
 
@@ -359,7 +358,7 @@ sub display_row {
 # calculate onhand
     if ($form->{"id_$i"}) {
       my $part         = IC->get_basic_part_info(id => $form->{"id_$i"});
-      my $onhand_color = 'color="#ff0000"' if  $part->{onhand} < $part->{rop};
+      my $onhand_color = $part->{onhand} < $part->{rop} ? 'color="#ff0000"' : '';
       push @ROW2, { value => sprintf "<b>%s</b> <font %s>%s %s</font>",
                       $locale->text('On Hand'),
                       $onhand_color,
@@ -415,7 +414,7 @@ sub set_pricegroup {
 
   my $form     = $main::form;
   my $locale   = $main::locale;
-  my $cgi      = $main::cgi;
+  my $cgi      = $::request->{cgi};
 
   _check_io_auth();
 
@@ -952,7 +951,7 @@ sub edit_e_mail {
                                      subject       => $subject,
                                      print_options => print_options('inline' => 1),
                                      HIDDEN        => [ map +{ name => $_, value => $form->{$_} }, @hidden_keys ],
-                                     SHOW_BCC      => $myconfig{role} eq 'admin' });
+                                     SHOW_BCC      => $::auth->assert('email_bcc', 'may fail') });
 
   $main::lxdebug->leave_sub();
 }
@@ -1341,6 +1340,10 @@ sub print_form {
     $output_longdates = 1;
   }
 
+  # Store the output number format so that the template modules know
+  # how to parse the amounts back if requested.
+  $myconfig{output_numberformat} = $output_numberformat || $myconfig{numberformat};
+
   ($form->{employee}) = split /--/, $form->{employee};
 
   # create the form variables
@@ -1457,7 +1460,7 @@ sub print_form {
     $extension            = 'xls';
   }
 
-  my $email_extension = '_email' if (($form->{media} eq 'email') && (-f "$myconfig{templates}/$form->{formname}_email$form->{language}${printer_code}.${extension}"));
+  my $email_extension = (($form->{media} eq 'email') && (-f "$myconfig{templates}/$form->{formname}_email$form->{language}${printer_code}.${extension}")) ? '_email' : '';
 
   $form->{IN}         = "$form->{formname}${email_extension}$form->{language}${printer_code}.${extension}";