From: Moritz Bunkus Date: Mon, 19 Aug 2013 13:09:01 +0000 (+0200) Subject: Pflichtenhefte: per Default die abgeschlossenen nicht anzeigen X-Git-Tag: release-3.2.0beta~467^2~10 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=0ba48077d82fbbedc9db571bf9b2c6281affa94c;p=kivitendo-erp.git Pflichtenhefte: per Default die abgeschlossenen nicht anzeigen --- diff --git a/SL/Controller/RequirementSpec.pm b/SL/Controller/RequirementSpec.pm index fc5a81562..72d5859f0 100644 --- a/SL/Controller/RequirementSpec.pm +++ b/SL/Controller/RequirementSpec.pm @@ -33,6 +33,7 @@ use Rose::Object::MakeMethods::Generic ); __PACKAGE__->run_before('setup'); +__PACKAGE__->run_before('set_default_filter_args', only => [ qw(list) ]); my %sort_columns = ( customer => t8('Customer'), @@ -446,6 +447,18 @@ sub render_pasted_text_block { ->jstree->open_node( '#tree', "#tb-${front_back}"); } +sub set_default_filter_args { + my ($self) = @_; + + if (!$::form->{filter}) { + $::form->{filter} = { + status_id => [ map { $_->{id} } grep { $_->name ne 'done' } @{ $self->statuses } ], + }; + } + + return 1; +} + sub render_pasted_section { my ($self, $item, $parent_id) = @_; diff --git a/templates/webpages/requirement_spec/_filter.html b/templates/webpages/requirement_spec/_filter.html index 82da89b07..19c03dae0 100644 --- a/templates/webpages/requirement_spec/_filter.html +++ b/templates/webpages/requirement_spec/_filter.html @@ -35,7 +35,7 @@ [% LxERP.t8("Requirement Spec Status") %] - [% L.select_tag('filter.status_id', SELF.statuses, default=filter.status_id, title_key="description", with_empty=1) %] + [% L.select_tag('filter.status_id[]', SELF.statuses, default=filter.status_id_, title_key="description", multiple=1) %][%# NOTE: the trailing '_' is NOT a mistake -- look at SL::Controller::Helper::Filtered for the explanation! %]