Revision 2ba42577
Von Bernd Bleßmann vor fast 4 Jahren hinzugefügt
SL/Controller/TimeRecording.pm | ||
---|---|---|
use Rose::Object::MakeMethods::Generic
|
||
(
|
||
# scalar => [ qw() ],
|
||
'scalar --get_set_init' => [ qw(time_recording models all_time_recording_types all_employees) ],
|
||
'scalar --get_set_init' => [ qw(time_recording models all_time_recording_types all_employees can_view_all) ],
|
||
);
|
||
|
||
|
||
... | ... | |
return $time_recording;
|
||
}
|
||
|
||
sub init_can_view_all {
|
||
$::auth->assert('time_recording_show_all', 1) || $::auth->assert('time_recording_edit_all', 1)
|
||
}
|
||
|
||
sub init_models {
|
||
my ($self) = @_;
|
||
|
||
my @where;
|
||
push @where, (staff_member_id => SL::DB::Manager::Employee->current->id) if !$self->can_view_all;
|
||
|
||
SL::Controller::Helper::GetModels->new(
|
||
controller => $_[0],
|
||
sorted => \%sort_columns,
|
||
disable_plugin => 'paginated',
|
||
query => \@where,
|
||
with_objects => [ 'customer', 'type', 'project', 'staff_member', 'employee' ],
|
||
);
|
||
}
|
templates/webpages/time_recording/_filter.html | ||
---|---|---|
<th align="right">[% 'Customer Number' | $T8 %]</th>
|
||
<td>[% L.input_tag('filter.customer.customernumber:substr::ilike', filter.customer.customernumber_substr__ilike, size = 20) %]</td>
|
||
</tr>
|
||
|
||
[%- IF SELF.can_view_all -%]
|
||
<tr>
|
||
<th align="right">[% 'Mitarbeiter' | $T8 %]</th>
|
||
<td>
|
||
... | ... | |
style => 'width: 200px') %]
|
||
</td>
|
||
</tr>
|
||
[%- END -%]
|
||
|
||
</table>
|
||
|
||
[% L.hidden_tag('sort_by', FORM.sort_by) %]
|
Auch abrufbar als: Unified diff
Zeiterfassung: Recht berücksichtigen, Einträge von anderen (nicht) zu sehen