Revision c22bd347
Von Bernd Bleßmann vor mehr als 3 Jahren hinzugefügt
SL/Controller/TimeRecording.pm | ||
---|---|---|
18 | 18 |
use Rose::Object::MakeMethods::Generic |
19 | 19 |
( |
20 | 20 |
# scalar => [ qw() ], |
21 |
'scalar --get_set_init' => [ qw(time_recording models all_time_recording_types all_employees) ], |
|
21 |
'scalar --get_set_init' => [ qw(time_recording models all_time_recording_types all_employees can_view_all) ],
|
|
22 | 22 |
); |
23 | 23 |
|
24 | 24 |
|
... | ... | |
126 | 126 |
return $time_recording; |
127 | 127 |
} |
128 | 128 |
|
129 |
sub init_can_view_all { |
|
130 |
$::auth->assert('time_recording_show_all', 1) || $::auth->assert('time_recording_edit_all', 1) |
|
131 |
} |
|
132 |
|
|
129 | 133 |
sub init_models { |
134 |
my ($self) = @_; |
|
135 |
|
|
136 |
my @where; |
|
137 |
push @where, (staff_member_id => SL::DB::Manager::Employee->current->id) if !$self->can_view_all; |
|
138 |
|
|
130 | 139 |
SL::Controller::Helper::GetModels->new( |
131 | 140 |
controller => $_[0], |
132 | 141 |
sorted => \%sort_columns, |
133 | 142 |
disable_plugin => 'paginated', |
143 |
query => \@where, |
|
134 | 144 |
with_objects => [ 'customer', 'type', 'project', 'staff_member', 'employee' ], |
135 | 145 |
); |
136 | 146 |
} |
Auch abrufbar als: Unified diff
Zeiterfassung: Recht berücksichtigen, Einträge von anderen (nicht) zu sehen