]> wagnertech.de Git - mfinanz.git/blobdiff - SL/Controller/Part.pm
CustomerVendor Picker auf displayable_name umgestellt
[mfinanz.git] / SL / Controller / Part.pm
index e64a774a76f0fb9c56a69f903e0fef13223a7e64..e1bbcd9a74a6e4b2c96d0d47283374176d66102e 100644 (file)
@@ -52,6 +52,7 @@ sub action_ajax_autocomplete {
      description => $_->description,
      type        => $_->type,
      unit        => $_->unit,
      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
 
     }
   } @{ $self->parts }; # neato: if exact match triggers we don't even need the init_parts
 
@@ -59,8 +60,6 @@ sub action_ajax_autocomplete {
 }
 
 sub action_test_page {
 }
 
 sub action_test_page {
-  $::request->{layout}->add_javascripts('autocomplete_part.js');
-
   $_[0]->render('part/test_page');
 }
 
   $_[0]->render('part/test_page');
 }
 
@@ -80,9 +79,8 @@ sub action_show {
     if (!$self->part) {
       # TODO error
     } else {
     if (!$self->part) {
       # TODO error
     } else {
-      require Rose::DB::Object::Helpers;
-        $part_hash          = $self->part->as_tree;
-        $part_hash->{cvars} = $self->part->cvar_as_hashref;
+      $part_hash          = $self->part->as_tree;
+      $part_hash->{cvars} = $self->part->cvar_as_hashref;
     }
 
     $self->render(\ SL::JSON::to_json($part_hash), { layout => 0, type => 'json', process => 0 });
     }
 
     $self->render(\ SL::JSON::to_json($part_hash), { layout => 0, type => 'json', process => 0 });