all_vendor mit vclimit=0
[kivitendo-erp.git] / bin / mozilla / gl.pl
index db4196e..4b34a50 100644 (file)
@@ -46,10 +46,6 @@ require "bin/mozilla/reportgenerator.pl";
 
 use strict;
 
-1;
-
-# end of main
-
 # this is for our long dates
 # $locale->text('January')
 # $locale->text('February')
@@ -114,13 +110,13 @@ sub add {
 
   # departments
   $form->all_departments(\%myconfig);
-  if (@{ $form->{all_departments} }) {
+  if (@{ $form->{all_departments} || [] }) {
     $form->{selectdepartment} = "<option>\n";
 
     map {
       $form->{selectdepartment} .=
         "<option>$_->{description}--$_->{id}\n"
-    } (@{ $form->{all_departments} });
+    } (@{ $form->{all_departments} || [] });
   }
 
   $form->{show_details} = $myconfig{show_form_details} unless defined $form->{show_details};
@@ -150,13 +146,13 @@ sub prepare_transaction {
 
   # departments
   $form->all_departments(\%myconfig);
-  if (@{ $form->{all_departments} }) {
+  if (@{ $form->{all_departments} || [] }) {
     $form->{selectdepartment} = "<option>\n";
 
     map {
       $form->{selectdepartment} .=
         "<option>$_->{description}--$_->{id}\n"
-    } (@{ $form->{all_departments} });
+    } (@{ $form->{all_departments} || [] });
   }
 
   my $i        = 1;
@@ -244,13 +240,13 @@ sub search {
   $form->all_departments(\%myconfig);
 
   # departments
-  if (@{ $form->{all_departments} }) {
+  if (@{ $form->{all_departments} || [] }) {
     $form->{selectdepartment} = "<option>\n";
 
     map {
       $form->{selectdepartment} .=
         "<option>$_->{description}--$_->{id}\n"
-    } (@{ $form->{all_departments} });
+    } (@{ $form->{all_departments} || [] });
   }
 
   my $department = qq|
@@ -1659,3 +1655,5 @@ sub storno {
 sub continue {
   call_sub($main::form->{nextsub});
 }
+
+1;