Revision bcb43619
Von Sven Schöling vor mehr als 10 Jahren hinzugefügt
SL/Controller/Project.pm | ||
---|---|---|
30 | 30 |
|
31 | 31 |
__PACKAGE__->run_before('check_auth'); |
32 | 32 |
__PACKAGE__->run_before('load_project', only => [ qw(edit update destroy) ]); |
33 |
__PACKAGE__->run_before('load_project_types', only => [ qw(search edit new) ]); |
|
34 |
__PACKAGE__->run_before('load_project_status', only => [ qw(search edit new) ]); |
|
33 |
__PACKAGE__->run_before('load_project_types', only => [ qw(search edit new list) ]);
|
|
34 |
__PACKAGE__->run_before('load_project_status', only => [ qw(search edit new list) ]);
|
|
35 | 35 |
|
36 | 36 |
# |
37 | 37 |
# actions |
... | ... | |
54 | 54 |
sub action_list { |
55 | 55 |
my ($self) = @_; |
56 | 56 |
|
57 |
# $self->make_filter_summary;
|
|
57 |
$self->make_filter_summary; |
|
58 | 58 |
|
59 | 59 |
my $projects = $self->models->get; |
60 | 60 |
|
... | ... | |
228 | 228 |
std_column_visibility => 1, |
229 | 229 |
controller_class => 'Project', |
230 | 230 |
output_format => 'HTML', |
231 |
top_info_text => $::locale->text('Projects'), |
|
231 |
raw_top_info_text => $self->render('project/report_top', { output => 0 }), |
|
232 |
raw_bottom_info_text => $self->render('project/report_bottom', { output => 0 }), |
|
232 | 233 |
title => $::locale->text('Projects'), |
233 | 234 |
allow_pdf_export => 1, |
234 | 235 |
allow_csv_export => 1, |
... | ... | |
262 | 263 |
); |
263 | 264 |
} |
264 | 265 |
|
266 |
sub make_filter_summary { |
|
267 |
my ($self) = @_; |
|
268 |
|
|
269 |
my $filter = $::form->{filter} || {}; |
|
270 |
my @filter_strings; |
|
271 |
|
|
272 |
my @filters = ( |
|
273 |
[ $filter->{"projectnumber:substr::ilike"}, t8('Project Number') ], |
|
274 |
[ $filter->{"description:substr::ilike"}, t8('Description') ], |
|
275 |
[ $filter->{customer}{"name:substr::ilike"}, t8('Customer') ], |
|
276 |
[ $filter->{"project_type_id"}, t8('Project Type'), sub { SL::DB::Manager::ProjectType->find_by(id => $filter->{"project_type_id"})->description } ], |
|
277 |
[ $filter->{"project_status_id"}, t8('Project Status'), sub { SL::DB::Manager::ProjectStatus->find_by(id => $filter->{"project_status_id"})->description } ], |
|
278 |
); |
|
279 |
|
|
280 |
my @flags = ( |
|
281 |
[ $filter->{active} eq 'active', $::locale->text('Active') ], |
|
282 |
[ $filter->{active} eq 'inactive', $::locale->text('Inactive') ], |
|
283 |
[ $filter->{valid} eq 'valid', $::locale->text('Valid') ], |
|
284 |
[ $filter->{valid} eq 'invalid', $::locale->text('Invalid') ], |
|
285 |
[ $filter->{orphaned}, $::locale->text('Orphaned') ], |
|
286 |
); |
|
287 |
|
|
288 |
for (@flags) { |
|
289 |
push @filter_strings, "$_->[1]" if $_->[0]; |
|
290 |
} |
|
291 |
for (@filters) { |
|
292 |
push @filter_strings, "$_->[1]: " . ($_->[2] ? $_->[2]->() : $_->[0]) if $_->[0]; |
|
293 |
} |
|
294 |
|
|
295 |
$self->{filter_summary} = join ', ', @filter_strings; |
|
296 |
} |
|
297 |
|
|
265 | 298 |
sub load_project_types { |
266 | 299 |
$_[0]{ALL_PROJECT_TYPES} = SL::DB::Manager::ProjectType->get_all_sorted; |
267 | 300 |
} |
Auch abrufbar als: Unified diff
Projektsuche auf simpel+filter umgestellt