From: Jan Büren Date: Sat, 30 Sep 2017 07:45:08 +0000 (+0200) Subject: Filter nach Namen für Buchungsvorlagen implementiert X-Git-Tag: release-3.5.4~751 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=c4409bf66a835166b3a50c0de9c5bdedbb5b5c69;hp=2c5a4b0d406212de474b8aaa807d8e4ee9290b44;p=kivitendo-erp.git Filter nach Namen für Buchungsvorlagen implementiert Hintergrund: Nachdem einige Vorlagen erstellt worden sind, ist der Standard-Fall nicht mehr Anlegen oder Ändern, sondern Suchen und Buchen. Entsprechend den Focus auch auf das Suchfeld gesetzt. --- diff --git a/SL/Controller/RecordTemplate.pm b/SL/Controller/RecordTemplate.pm index a349378f9..9ce8e152c 100644 --- a/SL/Controller/RecordTemplate.pm +++ b/SL/Controller/RecordTemplate.pm @@ -52,7 +52,7 @@ sub action_show_dialog { title => t8('Record templates'), }, }) - ->focus("#record_template_dialog_new_template_name") + ->focus("#template_filter") ->render; } @@ -84,6 +84,20 @@ sub action_delete { ->render; } +sub action_filter_templates { + my ($self) = @_; + + $self->{template_filter} = $::form->{template_filter}; + + $self + ->js + ->html('#record_template_dialog', $self->dialog_html) + ->focus("#record_template_dialog_new_template_name") + ->reinit_widgets + ->focus("#template_filter") + ->render(); +} + # # helpers # @@ -98,9 +112,10 @@ sub init_template { SL::DB::RecordTemplate->new(id => $::form->{id})->load sub init_templates { my ($self) = @_; - return scalar SL::DB::Manager::RecordTemplate->get_all_sorted( - where => [ template_type => $self->template_type ], + where => [ template_type => $self->template_type, + (template_name => { ilike => '%' . $::form->{template_filter} . '%' })x!! ($::form->{template_filter}) + ], ); } diff --git a/locale/de/all b/locale/de/all index 181141fd2..4c2ff465f 100755 --- a/locale/de/all +++ b/locale/de/all @@ -1371,6 +1371,7 @@ $self->{texts} = { 'Filter for customer variables' => 'Filter für benutzerdefinierte Kundenvariablen', 'Filter for item variables' => 'Filter für benutzerdefinierte Artikelvariablen', 'Filter parts' => 'Artikel filtern', + 'Filter record template' => 'Filter für Buchungsvorlagen', 'Financial Controlling' => 'Finanzcontrolling', 'Financial Controlling Report' => 'Finanzcontrollingbericht', 'Financial Overview' => 'Finanzübersicht', diff --git a/templates/webpages/record_template/dialog.html b/templates/webpages/record_template/dialog.html index 4131b9bb5..d51a72b95 100644 --- a/templates/webpages/record_template/dialog.html +++ b/templates/webpages/record_template/dialog.html @@ -17,6 +17,16 @@ [% L.button_tag("kivi.RecordTemplate.create()", LxERP.t8("Save")) %]

+

[% LxERP.t8("Filter record template") %]

+

+

+ [% LxERP.t8("Name") %]: + [% L.input_tag("template_filter", SELF.template_filter) %] + [% L.submit_tag('', LxERP.t8("Filter")) %] + [% L.button_tag('$("#template_filter").val("")', LxERP.t8('Reset')) %] +
+

+ [% SET templates = SELF.templates.as_list %] [% IF templates.size %]