]> wagnertech.de Git - mfinanz.git/blobdiff - SL/Presenter/Part.pm
Partpicker: Filtermöglichkeit nach Einheiten ('unit')
[mfinanz.git] / SL / Presenter / Part.pm
index 44d701e67c08a2f193bd37d1d29c9a6cab6b4e4d..1b81ade4d50e63aa25d0fcb9af5c45e2a3608d3c 100644 (file)
@@ -15,9 +15,8 @@ sub part_picker {
 
   my $ret =
     $self->input_tag($name, (ref $value && $value->can('id') ? $value->id : ''), class => 'part_autocomplete', type => 'hidden', id => $id) .
-    $self->input_tag("", delete $params{type}, id => "${id}_type", type => 'hidden') .
-    $self->input_tag("", (ref $value && $value->can('description')) ? $value->description : '', id => "${id}_name", %params) .
-    $self->input_tag("", delete $params{column}, id => "${id}_column", type => 'hidden');
+    join('', map { $params{$_} ? $self->input_tag("", delete $params{$_}, id => "${id}_${_}", type => 'hidden') : '' } qw(column type unit)) .
+    $self->input_tag("", (ref $value && $value->can('description')) ? $value->description : '', id => "${id}_name", %params);
 
   $self->html_tag('span', $ret, class => 'part_picker');
 }
@@ -60,6 +59,10 @@ If C<%params> contains C<type> only parts of this type will be used
 for autocompletion. You may comma separate multiple types as in
 C<part,assembly>.
 
+If C<%params> contains C<unit> only parts with this unit will be used
+for autocompletion. You may comma separate multiple units as in
+C<h,min>.
+
 Obsolete parts will by default not displayed for selection. However they are
 accepted as default values and can persist during updates. As with other
 selectors though, they are not selectable once overridden.