title => t8('Record templates'),
},
})
- ->focus("#record_template_dialog_new_template_name")
+ ->focus("#template_filter")
->render;
}
->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
#
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})
+ ],
);
}
'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',
[% L.button_tag("kivi.RecordTemplate.create()", LxERP.t8("Save")) %]
</p>
+<h2 class="listheading">[% LxERP.t8("Filter record template") %]</h2>
+<p>
+<form method="post" action="javascript:kivi.RecordTemplate.filter_templates()">
+ [% 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')) %]
+</form>
+</p>
+
[% SET templates = SELF.templates.as_list %]
[% IF templates.size %]