commit 6ebacae90e52d35ce729638490a015060f12fee3
Author: Moritz Bunkus <m.bunkus@linet.de>
Date:   Thu Jan 26 14:53:43 2017 +0100

    ActionBar: Verwendung bei Wiedervorlagen

diff --git a/bin/mozilla/fu.pl b/bin/mozilla/fu.pl
index 660e98283..9b19ba8d7 100644
--- a/bin/mozilla/fu.pl
+++ b/bin/mozilla/fu.pl
@@ -1,6 +1,7 @@
 use POSIX qw(strftime);
 
 use SL::FU;
+use SL::Locale::String qw(t8);
 use SL::ReportGenerator;
 
 require "bin/mozilla/reportgenerator.pl";
@@ -99,6 +100,8 @@ sub display_form {
   $params{trans_id}   = $form->{LINKS}->[0]->{trans_id} if (@{ $form->{LINKS} });
   $form->{FOLLOW_UPS} = FU->follow_ups(%params);
 
+  setup_fu_display_form_action_bar() unless $::form->{POPUP_MODE};
+
   $form->header(no_layout => $::form->{POPUP_MODE});
   print $form->parse_html_template('fu/add_edit');
 
@@ -232,6 +235,7 @@ sub search {
 
   $form->{title}    = $locale->text('Follow-Ups');
 
+  setup_fu_search_action_bar();
   $form->header();
   print $form->parse_html_template('fu/search');
 
@@ -347,6 +351,7 @@ sub report {
     $report->add_data($row);
   }
 
+  setup_fu_report_action_bar();
   $report->generate_with_headers();
 
   $main::lxdebug->leave_sub();
@@ -409,6 +414,8 @@ sub edit_access_rights {
 
   $form->{title} = $locale->text('Edit Access Rights for Follow-Ups');
 
+  setup_fu_edit_access_rights_action_bar();
+
   $form->header();
   print $form->parse_html_template('fu/edit_access_rights');
 
@@ -475,4 +482,77 @@ sub dispatcher {
   $form->error($locale->text('No action defined.'));
 }
 
+sub setup_fu_search_action_bar {
+  my %params = @_;
+
+  for my $bar ($::request->layout->get('actionbar')) {
+    $bar->add(
+      action => [
+        t8('Show'),
+        submit    => [ '#form', { action => "report" } ],
+        accesskey => 'enter',
+      ],
+    );
+  }
+}
+
+sub setup_fu_display_form_action_bar {
+  my %params = @_;
+
+  for my $bar ($::request->layout->get('actionbar')) {
+    $bar->add(
+      action => [
+        t8('Save'),
+        submit    => [ '#form', { action => "save" } ],
+        accesskey => 'enter',
+      ],
+      action => [
+        t8('Finish'),
+        submit   => [ '#form', { action => "finish" } ],
+        disabled => !$::form->{id} ? t8('The object has not been saved yet.') : undef,
+      ],
+      action => [
+        t8('Delete'),
+        submit   => [ '#form', { action => "delete" } ],
+        disabled => !$::form->{id} ? t8('The object has not been saved yet.') : undef,
+        confirm  => t8('Do you really want to delete this object?'),
+      ],
+    );
+  }
+}
+
+sub setup_fu_report_action_bar {
+  my %params = @_;
+
+  for my $bar ($::request->layout->get('actionbar')) {
+    $bar->add(
+      action => [
+        t8('Finish'),
+        submit => [ '#form', { action => "finish" } ],
+        checks => [ [ 'kivi.check_if_entries_selected', '[name^=selected_]' ] ],
+      ],
+      action => [
+        t8('Delete'),
+        submit  => [ '#form', { action => "delete" } ],
+        checks  => [ [ 'kivi.check_if_entries_selected', '[name^=selected_]' ] ],
+        confirm => t8('Do you really want to delete the selected objects?'),
+      ],
+    );
+  }
+}
+
+sub setup_fu_edit_access_rights_action_bar {
+  my %params = @_;
+
+  for my $bar ($::request->layout->get('actionbar')) {
+    $bar->add(
+      action => [
+        t8('Save'),
+        submit    => [ '#form', { action => "save_access_rights" } ],
+        accesskey => 'enter',
+      ],
+    );
+  }
+}
+
 1;
diff --git a/locale/de/all b/locale/de/all
index 664669f5f..280e2b905 100755
--- a/locale/de/all
+++ b/locale/de/all
@@ -989,6 +989,7 @@ $self->{texts} = {
   'Do you really want to delete GL transaction #1?' => 'Wollen Sie wirklich die Dialogbuchung #1 löschen?',
   'Do you really want to delete the selected documents?' => 'Wollen Sie wirklich diese Dateien löschen?',
   'Do you really want to delete the selected links?' => 'Wollen Sie wirklich die ausgewählten Verknüpfungen löschen?',
+  'Do you really want to delete the selected objects?' => 'Wollen Sie die ausgewählten Objekte wirklich löschen?',
   'Do you really want to delete this draft?' => 'Wollen Sie diesen Entwurf wirklich löschen?',
   'Do you really want to delete this object?' => 'Wollen Sie dieses Objekt wirklich löschen?',
   'Do you really want to delete this record template?' => 'Wollen Sie diese Belegvorlage wirklich löschen?',
diff --git a/templates/webpages/fu/add_edit.html b/templates/webpages/fu/add_edit.html
index e3b3191d2..3db4c4b59 100644
--- a/templates/webpages/fu/add_edit.html
+++ b/templates/webpages/fu/add_edit.html
@@ -7,7 +7,7 @@
    $(function(){ document.Form.subject.focus(); });
  </script>
 
- <form action="fu.pl" method="post" name="Form">
+ <form action="fu.pl" method="post" name="Form" id="form">
 
   [%- IF SAVED_MESSAGE %]
   <p>[% SAVED_MESSAGE %]</p>
@@ -51,6 +51,7 @@
    </table>
   </p>
 
+ [%- IF POPUP_MODE %]
   <p>
    <input type="hidden" name="action" value="dispatcher">
    <input type="submit" class="submit" name="action_save" value="[% 'Save' | $T8 %]">
@@ -58,12 +59,9 @@
    <input type="submit" class="submit" name="action_finish" value="[% 'Finish' | $T8 %]">
    <input type="submit" class="submit" name="action_delete" value="[% 'Delete' | $T8 %]">
    [%- END %]
-   [%- IF POPUP_MODE %]
    <input type="submit" class="submit" onclick="window.close()" value="[% 'Cancel' | $T8 %]">
-   [%- END %]
   </p>
 
-  [%- IF POPUP_MODE %]
   [%- IF FOLLOW_UPS.size %]
   <hr height="3" noshade>
 
@@ -99,4 +97,3 @@
 
   <input type="hidden" name="trans_rowcount" value="[% LINKS.size %]">
  </form>
-
diff --git a/templates/webpages/fu/edit_access_rights.html b/templates/webpages/fu/edit_access_rights.html
index b2c6536ff..c2389cfa1 100644
--- a/templates/webpages/fu/edit_access_rights.html
+++ b/templates/webpages/fu/edit_access_rights.html
@@ -9,7 +9,7 @@
 
  <p>[% 'Allow the following users access to my follow-ups:' | $T8 %]</p>
 
- <form action="fu.pl" method="post" name="Form">
+ <form action="fu.pl" method="post" name="Form" id="form">
   <p>
    <table>
     <tr>
@@ -36,10 +36,4 @@
   </p>
 
   <input type="hidden" name="rowcount" value="[% EMPLOYEES.size %]">
-  <input type="hidden" name="save_nextsub" value="save_access_rights">
-
-  <p>
-   <input type="submit" class="submit" name="action" value="[% 'Save' | $T8 %]">
-  </p>
-
  </form>
diff --git a/templates/webpages/fu/report_bottom.html b/templates/webpages/fu/report_bottom.html
index 54927a759..432449ccd 100644
--- a/templates/webpages/fu/report_bottom.html
+++ b/templates/webpages/fu/report_bottom.html
@@ -4,11 +4,4 @@
  [%- FOREACH item = HIDDEN %]
  <input type="hidden" name="[% HTML.escape(item.key) %]" value="[% HTML.escape(item.value) %]">
  [%- END %]
-
- <p>
-  [% 'Follow-Ups' | $T8 %]<br>
-  <input type="hidden" name="action" value="dispatcher">
-  <input type="submit" name="action_finish" value="[% 'Finish' | $T8 %]">
-  <input type="submit" name="action_delete" value="[% 'Delete' | $T8 %]">
- </p>
 </form>
diff --git a/templates/webpages/fu/report_top.html b/templates/webpages/fu/report_top.html
index 2c0fa1b82..f41a750de 100644
--- a/templates/webpages/fu/report_top.html
+++ b/templates/webpages/fu/report_top.html
@@ -10,5 +10,4 @@
 </p>
 [%- END %]
 
-<form action="fu.pl" method="post" name="Form">
-
+<form action="fu.pl" method="post" name="Form" id="form">
diff --git a/templates/webpages/fu/search.html b/templates/webpages/fu/search.html
index 0d1a22a40..073adcd96 100644
--- a/templates/webpages/fu/search.html
+++ b/templates/webpages/fu/search.html
@@ -7,9 +7,7 @@
    $(function(){ document.Form.subject.focus(); });
  </script>
 
- <form action="fu.pl" method="post" name="Form">
-  <input type="hidden" name="nextsub" value="report">
-
+ <form action="fu.pl" method="post" name="Form" id="form">
   <p>
    <table>
     <tr>
@@ -100,9 +98,4 @@
 
    </table>
   </p>
-
-  <p>
-   <input type="submit" name="action" value="[% 'Continue' | $T8 %]">
-  </p>
  </form>
-
