From: Sven Schöling Date: Tue, 18 Nov 2014 14:49:35 +0000 (+0100) Subject: PartPicker: javascript direkt im P.part_picker adden. X-Git-Tag: release-3.2.0beta~241 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=b58bafbbefa6513abb2cfb171a5fe12306826ff5;p=kivitendo-erp.git PartPicker: javascript direkt im P.part_picker adden. --- diff --git a/SL/Controller/ClientConfig.pm b/SL/Controller/ClientConfig.pm index df485c0a4..2279ef1da 100644 --- a/SL/Controller/ClientConfig.pm +++ b/SL/Controller/ClientConfig.pm @@ -218,8 +218,6 @@ sub check_auth { sub edit_form { my ($self) = @_; - $::request->layout->use_javascript("${_}.js") for qw(autocomplete_part); - $self->render('client_config/form', title => t8('Client Configuration'), make_chart_title => sub { $_[0]->accno . '--' . $_[0]->description }, make_templates_value => sub { 'templates/' . $_[0] }, diff --git a/SL/Controller/Part.pm b/SL/Controller/Part.pm index d5a7f2a5f..eff036976 100644 --- a/SL/Controller/Part.pm +++ b/SL/Controller/Part.pm @@ -60,8 +60,6 @@ sub action_ajax_autocomplete { } sub action_test_page { - $::request->{layout}->add_javascripts('autocomplete_part.js'); - $_[0]->render('part/test_page'); } diff --git a/SL/Controller/RequirementSpecOrder.pm b/SL/Controller/RequirementSpecOrder.pm index 352cf636c..c031a8935 100644 --- a/SL/Controller/RequirementSpecOrder.pm +++ b/SL/Controller/RequirementSpecOrder.pm @@ -193,7 +193,7 @@ sub setup { my ($self) = @_; $::auth->assert('requirement_spec_edit'); - $::request->{layout}->use_stylesheet("${_}.css") for qw(jquery.contextMenu requirement_spec autocomplete_part); + $::request->{layout}->use_stylesheet("${_}.css") for qw(jquery.contextMenu requirement_spec); $::request->{layout}->use_javascript("${_}.js") for qw(jquery.jstree jquery/jquery.contextMenu client_js requirement_spec); return 1; diff --git a/SL/Form.pm b/SL/Form.pm index e35464a57..0b29646eb 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -476,7 +476,7 @@ sub header { $layout->use_javascript("$_.js") for (qw( jquery jquery-ui jquery.cookie jquery.checkall jquery.download jquery/jquery.form jquery/fixes client_js - common part_selection switchmenuframe autocomplete_part + common part_selection switchmenuframe ), "jquery/ui/i18n/jquery.ui.datepicker-$::myconfig{countrycode}"); $self->{favicon} ||= "favicon.ico"; diff --git a/SL/Presenter/Part.pm b/SL/Presenter/Part.pm index 1fbce1e06..baa5e22bc 100644 --- a/SL/Presenter/Part.pm +++ b/SL/Presenter/Part.pm @@ -40,6 +40,7 @@ sub part_picker { 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');