From: Sven Schöling Date: Wed, 9 Apr 2014 14:44:48 +0000 (+0200) Subject: P.part_picker reicht jetzt das flag fat_set_item durch und schluckt nicht mehr class X-Git-Tag: release-3.2.0beta~470 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=ee74ea829d19e553d14e0f7bbdf9ee189cff3c36;p=kivitendo-erp.git P.part_picker reicht jetzt das flag fat_set_item durch und schluckt nicht mehr class --- diff --git a/SL/Presenter/Part.pm b/SL/Presenter/Part.pm index daa7d7310..9533e1d6c 100644 --- a/SL/Presenter/Part.pm +++ b/SL/Presenter/Part.pm @@ -29,9 +29,14 @@ 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); diff --git a/js/autocomplete_part.js b/js/autocomplete_part.js index a08130b63..d0984eb01 100644 --- a/js/autocomplete_part.js +++ b/js/autocomplete_part.js @@ -16,8 +16,7 @@ namespace('kivi', function(k){ var o = $.extend({ limit: 20, delay: 50, - fat_set_item: 0, // use this option to get a fat item json with all - // relevant data instead of the guaranteed id + name + fat_set_item: $real.hasClass('partpicker_fat_set_item'), }, options); var STATES = { UNIQUE: 1,