Revision 71e2b75e
Von Sven Schöling vor etwa 11 Jahren hinzugefügt
SL/DB/Manager/Project.pm | ||
---|---|---|
6 | 6 |
|
7 | 7 |
use SL::DB::Helper::Paginated; |
8 | 8 |
use SL::DB::Helper::Sorted; |
9 |
use SL::DB::Helper::Filtered; |
|
9 | 10 |
|
10 | 11 |
sub object_class { 'SL::DB::Project' } |
11 | 12 |
|
12 | 13 |
__PACKAGE__->make_manager_methods; |
14 |
__PACKAGE__->add_filter_specs( |
|
15 |
active => sub { |
|
16 |
my ($key, $value, $prefix) = @_; |
|
17 |
# TODO add boolean context |
|
18 |
return () if $value eq 'both'; |
|
19 |
return ($prefix . "active" => 1) if $value eq 'active'; |
|
20 |
return (or => [ $prefix . "active" => 0, $prefix . "active" => undef ]) if $value eq 'inactive'; |
|
21 |
}, |
|
22 |
valid => sub { |
|
23 |
my ($key, $value, $prefix) = @_; |
|
24 |
return () if $value eq 'both'; |
|
25 |
return ($prefix . "valid" => 1) if $value eq 'valid'; |
|
26 |
return (or => [ $prefix . "valid" => 0, $prefix . "valid" => undef ]) if $value eq 'invalid'; |
|
27 |
}, |
|
28 |
status => sub { |
|
29 |
my ($key, $value, $prefix) = @_; |
|
30 |
return () if $value eq 'all'; |
|
31 |
return __PACKAGE__->is_not_used_filter($prefix); |
|
32 |
}, |
|
33 |
); |
|
13 | 34 |
|
14 | 35 |
our %project_id_column_prefixes = ( |
15 | 36 |
ar => 'global', |
... | ... | |
40 | 61 |
return ("!${prefix}id" => [ \"(${query})" ]); |
41 | 62 |
} |
42 | 63 |
|
64 |
sub default_objects_per_page { |
|
65 |
20; |
|
66 |
} |
|
67 |
|
|
43 | 68 |
1; |
44 | 69 |
__END__ |
45 | 70 |
|
Auch abrufbar als: Unified diff
Manager/Project: custom filter und paginate default.