]> wagnertech.de Git - kivitendo-erp.git/blobdiff - SL/Controller/TimeRecording.pm
Zeiterfassung: Eingabe: Einträge f. andere Mitarbeiter erlauben, wenn berechtigt
[kivitendo-erp.git] / SL / Controller / TimeRecording.pm
index d326522be5636f5f2068f828ee8c6180eaefc889..5c442cc4c8c0b99dbcaf64a93e00d4f8ad1fbe07 100644 (file)
@@ -184,10 +184,10 @@ sub init_time_recording {
   }
 
   # do not overwrite staff member if you do not have the right
-  delete $attributes{staff_member_id} if !$_[0]->can_edit_all;
-  $attributes{staff_member_id} = SL::DB::Manager::Employee->current->id if $is_new;
+  delete $attributes{staff_member_id}                                     if !$_[0]->can_edit_all;
+  $attributes{staff_member_id} ||= SL::DB::Manager::Employee->current->id if $is_new;
 
-  $attributes{employee_id}     = SL::DB::Manager::Employee->current->id;
+  $attributes{employee_id}       = SL::DB::Manager::Employee->current->id;
 
   $time_recording->assign_attributes(%attributes);