ActionBar: ReportGenerator: get('actionbar') liefert Array von Bars
authorMoritz Bunkus <m.bunkus@linet-services.de>
Thu, 16 Mar 2017 09:55:28 +0000 (10:55 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Thu, 16 Mar 2017 09:55:28 +0000 (10:55 +0100)
bin/mozilla/reportgenerator.pl

index 5ba261f..f2eb1ef 100644 (file)
@@ -37,23 +37,25 @@ sub report_generator_set_default_sort {
 sub report_generator_setup_action_bar {
   my ($type, %params) = @_;
 
-  $::request->layout->get('actionbar')->add(
-    combobox => [
-      action => [
-        $type eq 'pdf' ? $::locale->text('PDF export') : $::locale->text('CSV export'),
-        submit => [ '#report_generator_form', { 'report_generator_dispatch_to' => "report_generator_export_as_${type}" } ],
+  for my $bar ($::request->layout->get('actionbar')) {
+    $bar->add(
+      combobox => [
+        action => [
+          $type eq 'pdf' ? $::locale->text('PDF export') : $::locale->text('CSV export'),
+          submit => [ '#report_generator_form', { 'report_generator_dispatch_to' => "report_generator_export_as_${type}" } ],
+        ],
+        action => [
+          $::locale->text('PDF export with attachments'),
+          submit  => [ '#report_generator_form', { report_generator_dispatch_to => "report_generator_export_as_pdf", report_generator_addattachments => 1 } ],
+          only_if => $params{allow_attachments},
+        ],
       ],
       action => [
-        $::locale->text('PDF export with attachments'),
-        submit  => [ '#report_generator_form', { report_generator_dispatch_to => "report_generator_export_as_pdf", report_generator_addattachments => 1 } ],
-        only_if => $params{allow_attachments},
+        $::locale->text('Back'),
+        submit => [ '#report_generator_form', { 'report_generator_dispatch_to' => "report_generator_back" } ],
       ],
-    ],
-    action => [
-      $::locale->text('Back'),
-      submit => [ '#report_generator_form', { 'report_generator_dispatch_to' => "report_generator_back" } ],
-    ],
-  );
+    );
+  }
 }
 
 sub report_generator_export_as_pdf {