From: Moritz Bunkus Date: Thu, 27 Feb 2014 14:56:04 +0000 (+0100) Subject: Partpicker: Benutzerdefinierte Variablen mitschicken X-Git-Tag: release-3.2.0beta~411^2~55 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=a261c69386e610e9653098d1e6ec2c6aa5a4b6db;p=kivitendo-erp.git Partpicker: Benutzerdefinierte Variablen mitschicken --- diff --git a/SL/Controller/Part.pm b/SL/Controller/Part.pm index e64a774a7..d5a7f2a5f 100644 --- a/SL/Controller/Part.pm +++ b/SL/Controller/Part.pm @@ -52,6 +52,7 @@ sub action_ajax_autocomplete { description => $_->description, type => $_->type, unit => $_->unit, + cvars => { map { ($_->config->name => { value => $_->value_as_text, is_valid => $_->is_valid }) } @{ $_->cvars_by_config } }, } } @{ $self->parts }; # neato: if exact match triggers we don't even need the init_parts diff --git a/SL/DB/CustomVariable.pm b/SL/DB/CustomVariable.pm index 3f894cd01..d9b154c09 100644 --- a/SL/DB/CustomVariable.pm +++ b/SL/DB/CustomVariable.pm @@ -118,7 +118,7 @@ sub is_valid { require SL::DB::CustomVariableValidity; my $query = [config_id => $self->config_id, trans_id => $self->trans_id]; - return SL::DB::Manager::CustomVariableValidity->get_all_count(query => $query) == 0; + return (SL::DB::Manager::CustomVariableValidity->get_all_count(query => $query) == 0) ? 1 : 0; } 1;