From 678f57a3852524663977b8903c47404070d17469 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Tue, 7 Oct 2014 16:57:21 +0200 Subject: [PATCH] =?utf8?q?PriceRule:=20Report=20inlinef=C3=A4hig=20gemacht?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Controller/PriceRule.pm | 7 ++++--- templates/webpages/price_rule/report_bottom.html | 2 ++ templates/webpages/price_rule/report_top.html | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/SL/Controller/PriceRule.pm b/SL/Controller/PriceRule.pm index 60870e2ad..c77a2da48 100644 --- a/SL/Controller/PriceRule.pm +++ b/SL/Controller/PriceRule.pm @@ -37,7 +37,7 @@ sub action_list { $self->prepare_report; - $self->report_generator_list_objects(report => $self->{report}, objects => $price_rules); + $self->report_generator_list_objects(report => $self->{report}, objects => $price_rules, $::form->{inline} ? (layout => 0, header => 0) : ()); } sub action_new { @@ -167,13 +167,14 @@ sub prepare_report { controller_class => 'PriceRule', output_format => 'HTML', title => ($self->vc eq 'customer' ? t8('Sales Price Rules') : t8('Purchase Price Rules')) , - allow_pdf_export => 1, - allow_csv_export => 1, + allow_pdf_export => !$::form->{inline}, + allow_csv_export => !$::form->{inline}, ); $report->set_columns(%column_defs); $report->set_column_order(@columns); $report->set_export_options(qw(list filter)); $report->set_options_from_form; + $self->models->get_models_url_params(sub{ map { $_ => $::form->{$_} } qw(inline) }); $self->models->set_report_generator_sort_options(report => $report, sortable_columns => \@sortable); $report->set_options( raw_bottom_info_text => $self->render('price_rule/report_bottom', { output => 0 }), diff --git a/templates/webpages/price_rule/report_bottom.html b/templates/webpages/price_rule/report_bottom.html index cee635dcb..97254866a 100644 --- a/templates/webpages/price_rule/report_bottom.html +++ b/templates/webpages/price_rule/report_bottom.html @@ -3,4 +3,6 @@ [% USE HTML %] [%- L.paginate_controls(models=SELF.models) %] +[%- UNLESS FORM.inline %] [% 'New Price Rule' | $T8 %] +[%- END %] diff --git a/templates/webpages/price_rule/report_top.html b/templates/webpages/price_rule/report_top.html index 2d2e52ccc..0af23b4d5 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 %] +[%- PROCESS 'price_rule/_filter.html' filter=SELF.filter UNLESS FORM.inline %]
-- 2.20.1