Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision c22bd347

Von Bernd Bleßmann vor fast 4 Jahren hinzugefügt

  • ID c22bd347ffd94f0f46fa1090317e897def7d798d
  • Vorgänger b3e6a759
  • Nachfolger 61799336

Zeiterfassung: Recht berücksichtigen, Einträge von anderen (nicht) zu sehen

Unterschiede anzeigen:

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
}
templates/webpages/time_recording/_filter.html
26 26
    <th align="right">[% 'Customer Number' | $T8 %]</th>
27 27
    <td>[% L.input_tag('filter.customer.customernumber:substr::ilike', filter.customer.customernumber_substr__ilike, size = 20) %]</td>
28 28
  </tr>
29

  
30
  [%- IF SELF.can_view_all -%]
29 31
  <tr>
30 32
   <th align="right">[% 'Mitarbeiter' | $T8 %]</th>
31 33
   <td>
......
37 39
                     style      => 'width: 200px') %]
38 40
   </td>
39 41
  </tr>
42
  [%- END -%]
43

  
40 44
 </table>
41 45

  
42 46
[% L.hidden_tag('sort_by', FORM.sort_by) %]

Auch abrufbar als: Unified diff