X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/f33995ff79013afbf0543453a73dd745354b129a..db1c48a0a8d4cc30261f37dc4b89147b38121d57:/SL/Presenter/Part.pm diff --git a/SL/Presenter/Part.pm b/SL/Presenter/Part.pm index daa7d7310..1091667bf 100644 --- a/SL/Presenter/Part.pm +++ b/SL/Presenter/Part.pm @@ -29,12 +29,18 @@ sub part_picker { $value = SL::DB::Manager::Part->find_by(id => $value) if $value && !ref $value; my $id = delete($params{id}) || $self->name_to_id($name); + my $fat_set_item = delete $params{fat_set_item}; + + my @classes = $params{class} ? ($params{class}) : (); + push @classes, 'part_autocomplete'; + push @classes, 'partpicker_fat_set_item' if $fat_set_item; my $ret = - $self->input_tag($name, (ref $value && $value->can('id') ? $value->id : ''), class => 'part_autocomplete', type => 'hidden', id => $id) . + $self->input_tag($name, (ref $value && $value->can('id') ? $value->id : ''), class => "@classes", type => 'hidden', id => $id) . join('', map { $params{$_} ? $self->input_tag("", delete $params{$_}, id => "${id}_${_}", type => 'hidden') : '' } qw(column type unit convertible_unit)) . $self->input_tag("", (ref $value && $value->can('description')) ? $value->description : '', id => "${id}_name", %params); + $::request->layout->add_javascripts('autocomplete_part.js'); $::request->presenter->need_reinit_widgets($id); $self->html_tag('span', $ret, class => 'part_picker'); @@ -83,7 +89,7 @@ to the corresponding 'edit' action. =back -=back +=back =over 2 @@ -114,8 +120,9 @@ 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. -Currently you must include C in your controller, the -presenter can not do this from the template. +Currently you must include C in old bin/mozilla-style +controllers if C<<$form->header>> is called before the template. In all other +cases, C will add the javascript for you. =back