mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 18:14:32 -04:00
Ensure activities have account_id set
This commit is contained in:
parent
57bc2f555a
commit
67a7449ffc
@ -49,6 +49,7 @@ class ArchivedUserActivity implements ShouldQueue
|
|||||||
|
|
||||||
$fields->company_id = $event->company->id;
|
$fields->company_id = $event->company->id;
|
||||||
$fields->activity_type_id = Activity::ARCHIVE_USER;
|
$fields->activity_type_id = Activity::ARCHIVE_USER;
|
||||||
|
$fields->account_id = $event->company->account_id;
|
||||||
|
|
||||||
$this->activityRepo->save($fields, $event->user, $event->event_vars);
|
$this->activityRepo->save($fields, $event->user, $event->event_vars);
|
||||||
}
|
}
|
||||||
|
@ -48,6 +48,7 @@ class CreatedUserActivity implements ShouldQueue
|
|||||||
$fields->user_id = $user_id;
|
$fields->user_id = $user_id;
|
||||||
$fields->company_id = $event->company->id;
|
$fields->company_id = $event->company->id;
|
||||||
$fields->activity_type_id = Activity::CREATE_USER;
|
$fields->activity_type_id = Activity::CREATE_USER;
|
||||||
|
$fields->account_id = $event->company->account_id;
|
||||||
|
|
||||||
$this->activityRepo->save($fields, $event->user, $event->event_vars);
|
$this->activityRepo->save($fields, $event->user, $event->event_vars);
|
||||||
}
|
}
|
||||||
|
@ -55,6 +55,7 @@ class DeletedUserActivity implements ShouldQueue
|
|||||||
$fields->user_id = $user_id;
|
$fields->user_id = $user_id;
|
||||||
$fields->company_id = $event->company->id;
|
$fields->company_id = $event->company->id;
|
||||||
$fields->activity_type_id = Activity::DELETE_USER;
|
$fields->activity_type_id = Activity::DELETE_USER;
|
||||||
|
$fields->account_id = $event->company->account_id;
|
||||||
|
|
||||||
$this->activityRepo->save($fields, $event->user, $event->event_vars);
|
$this->activityRepo->save($fields, $event->user, $event->event_vars);
|
||||||
}
|
}
|
||||||
|
@ -48,6 +48,7 @@ class RestoredUserActivity implements ShouldQueue
|
|||||||
|
|
||||||
$fields->company_id = $event->company->id;
|
$fields->company_id = $event->company->id;
|
||||||
$fields->activity_type_id = Activity::RESTORE_USER;
|
$fields->activity_type_id = Activity::RESTORE_USER;
|
||||||
|
$fields->account_id = $event->company->account_id;
|
||||||
|
|
||||||
$this->activityRepo->save($fields, $event->user, $event->event_vars);
|
$this->activityRepo->save($fields, $event->user, $event->event_vars);
|
||||||
}
|
}
|
||||||
|
@ -47,6 +47,8 @@ class UpdatedUserActivity implements ShouldQueue
|
|||||||
$fields->user_id = $user_id;
|
$fields->user_id = $user_id;
|
||||||
|
|
||||||
$fields->company_id = $event->company->id;
|
$fields->company_id = $event->company->id;
|
||||||
|
$fields->account_id = $event->company->account_id;
|
||||||
|
|
||||||
$fields->activity_type_id = Activity::UPDATE_USER;
|
$fields->activity_type_id = Activity::UPDATE_USER;
|
||||||
|
|
||||||
$this->activityRepo->save($fields, $event->user, $event->event_vars);
|
$this->activityRepo->save($fields, $event->user, $event->event_vars);
|
||||||
|
@ -576,7 +576,7 @@ class Company extends BaseModel
|
|||||||
|
|
||||||
public function activities(): HasMany
|
public function activities(): HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(Activity::class)->orderBy('id', 'DESC')->take(50);
|
return $this->hasMany(Activity::class)->where('account_id', $this->account_id)->orderBy('id', 'DESC')->take(50);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user