From: Moritz Bunkus Date: Thu, 26 Jan 2017 13:53:43 +0000 (+0100) Subject: ActionBar: Verwendung bei Wiedervorlagen X-Git-Tag: release-3.5.4~1280 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=6ebacae90e52d35ce729638490a015060f12fee3;p=kivitendo-erp.git 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(); }); -
+ [%- IF SAVED_MESSAGE %]

[% SAVED_MESSAGE %]

@@ -51,6 +51,7 @@

+ [%- IF POPUP_MODE %]

@@ -58,12 +59,9 @@ [%- END %] - [%- IF POPUP_MODE %] - [%- END %]

- [%- IF POPUP_MODE %] [%- IF FOLLOW_UPS.size %]
@@ -99,4 +97,3 @@
- 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 @@

[% 'Allow the following users access to my follow-ups:' | $T8 %]

-
+

@@ -36,10 +36,4 @@

- - -

- -

- 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 %] [%- END %] - -

- [% 'Follow-Ups' | $T8 %]
- - - -

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 @@

[%- END %] - - + 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(); }); - - - +

@@ -100,9 +98,4 @@

- -

- -

-