From: Moritz Bunkus Date: Thu, 9 Jul 2015 13:24:56 +0000 (+0200) Subject: GetModels Filtered: gelaunderten Filter nicht mehr in Controller schreiben X-Git-Tag: release-3.3.0beta~32^2~8 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=8b7577d4312828059ef56715a7a26df2e87792ec;p=kivitendo-erp.git GetModels Filtered: gelaunderten Filter nicht mehr in Controller schreiben Statt dessen kann der gelaunderte Filter über das Filtered-Plugin abgefragt werden, z.B. im Controller: $self->models->filtered->laundered oder im Template: SELF.models.filtered.laundered --- diff --git a/SL/Controller/Chart.pm b/SL/Controller/Chart.pm index 274f2ea56..624a65b1d 100644 --- a/SL/Controller/Chart.pm +++ b/SL/Controller/Chart.pm @@ -10,7 +10,7 @@ use SL::Locale::String qw(t8); use SL::JSON; use Rose::Object::MakeMethods::Generic ( - 'scalar --get_set_init' => [ qw(charts models chart) ], + 'scalar --get_set_init' => [ qw(charts models chart filter) ], ); sub action_ajax_autocomplete { @@ -111,4 +111,6 @@ sub init_models { ); } +sub init_filter { $_[0]->models->filtered->laundered } + 1; diff --git a/SL/Controller/Helper/GetModels/Filtered.pm b/SL/Controller/Helper/GetModels/Filtered.pm index 849c0e065..63258154b 100644 --- a/SL/Controller/Helper/GetModels/Filtered.pm +++ b/SL/Controller/Helper/GetModels/Filtered.pm @@ -53,14 +53,6 @@ sub read_params { my %calculated_params = SL::Controller::Helper::ParseFilter::parse_filter($filter, %parse_filter_args); %calculated_params = $self->merge_args(\%calculated_params, \%filter_args, \%params); - if ($self->laundered) { - if ($self->get_models->controller->can('filter')) { - $self->get_models->controller->filter($self->laundered); - } else { - $self->get_models->controller->{filter} = $self->laundered; - } - } - # $::lxdebug->dump(0, "get_current_filter_params: ", \%calculated_params); $self->filter_params(\%calculated_params); diff --git a/templates/webpages/background_job_history/list.html b/templates/webpages/background_job_history/list.html index 1a2b94887..2f251e275 100644 --- a/templates/webpages/background_job_history/list.html +++ b/templates/webpages/background_job_history/list.html @@ -4,7 +4,7 @@ [%- INCLUDE 'common/flash.html' %] -[%- PROCESS 'background_job_history/_filter.html' filter=SELF.filter %] +[%- PROCESS 'background_job_history/_filter.html' filter=SELF.models.filtered.laundered %] [% IF !ENTRIES.size %]

diff --git a/templates/webpages/bank_transactions/report_top.html b/templates/webpages/bank_transactions/report_top.html index f6fbce1d6..8b98dcbb0 100644 --- a/templates/webpages/bank_transactions/report_top.html +++ b/templates/webpages/bank_transactions/report_top.html @@ -1,3 +1,3 @@ [%- USE L %] -[%- PROCESS 'bank_transactions/_filter.html' filter=SELF.filter %] +[%- PROCESS 'bank_transactions/_filter.html' filter=SELF.models.filtered.laundered %]


diff --git a/templates/webpages/delivery_plan/report_top.html b/templates/webpages/delivery_plan/report_top.html index cc35146be..01d0ff9af 100644 --- a/templates/webpages/delivery_plan/report_top.html +++ b/templates/webpages/delivery_plan/report_top.html @@ -1,3 +1,3 @@ [%- USE L %] -[%- PROCESS 'delivery_plan/_filter.html' filter=SELF.filter %] +[%- PROCESS 'delivery_plan/_filter.html' filter=SELF.models.filtered.laundered %]
diff --git a/templates/webpages/financial_controlling_report/report_top.html b/templates/webpages/financial_controlling_report/report_top.html index 5fb399cf9..1312d75a3 100644 --- a/templates/webpages/financial_controlling_report/report_top.html +++ b/templates/webpages/financial_controlling_report/report_top.html @@ -1,3 +1,3 @@ [%- USE L %] -[%- PROCESS 'financial_controlling_report/_filter.html' filter=SELF.filter %] +[%- PROCESS 'financial_controlling_report/_filter.html' filter=SELF.models.filtered.laundered %]
diff --git a/templates/webpages/part/part_picker_search.html b/templates/webpages/part/part_picker_search.html index 4d625c7ae..5669d8eef 100644 --- a/templates/webpages/part/part_picker_search.html +++ b/templates/webpages/part/part_picker_search.html @@ -5,7 +5,7 @@
-[% LxERP.t8("Filter") %]: [% L.input_tag('part_picker_filter', SELF.filter.all_substr_multi__ilike, class='part_picker_filter') %] +[% LxERP.t8("Filter") %]: [% L.input_tag('part_picker_filter', SELF.models.filtered.laundered.all_substr_multi__ilike, class='part_picker_filter') %] [% L.hidden_tag('part_picker_real_id', FORM.real_id) %]
diff --git a/templates/webpages/price_rule/report_top.html b/templates/webpages/price_rule/report_top.html index 0af23b4d5..a534a8733 100644 --- a/templates/webpages/price_rule/report_top.html +++ b/templates/webpages/price_rule/report_top.html @@ -1,4 +1,4 @@ [%- USE L %] [%- PROCESS 'common/flash.html' %] -[%- PROCESS 'price_rule/_filter.html' filter=SELF.filter UNLESS FORM.inline %] +[%- PROCESS 'price_rule/_filter.html' filter=SELF.models.filtered.laundered UNLESS FORM.inline %]
diff --git a/templates/webpages/project/report_top.html b/templates/webpages/project/report_top.html index df03f9ebe..87c7efee5 100644 --- a/templates/webpages/project/report_top.html +++ b/templates/webpages/project/report_top.html @@ -9,7 +9,7 @@