Replace activity types and activity type categories models (#1556)
This PR adds the first step towards supporting custom activity types and custom activity type categories.
This commit is contained in:
@@ -155,42 +155,33 @@ class ContactsController extends Controller
|
||||
if ($contact->is_partial) {
|
||||
return redirect('/people');
|
||||
}
|
||||
|
||||
$contact->load(['notes' => function ($query) {
|
||||
$query->orderBy('updated_at', 'desc');
|
||||
}]);
|
||||
|
||||
$contact->last_consulted_at = Carbon::now(auth()->user()->timezone);
|
||||
$contact->save();
|
||||
|
||||
$relationships = $contact->relationships;
|
||||
|
||||
// get love relationship type
|
||||
$loveRelationships = $relationships->filter(function ($item) {
|
||||
return $item->relationshipType->relationshipTypeGroup->name == 'love';
|
||||
});
|
||||
|
||||
// get family relationship type
|
||||
$familyRelationships = $relationships->filter(function ($item) {
|
||||
return $item->relationshipType->relationshipTypeGroup->name == 'family';
|
||||
});
|
||||
|
||||
// get friend relationship type
|
||||
$friendRelationships = $relationships->filter(function ($item) {
|
||||
return $item->relationshipType->relationshipTypeGroup->name == 'friend';
|
||||
});
|
||||
|
||||
// get work relationship type
|
||||
$workRelationships = $relationships->filter(function ($item) {
|
||||
return $item->relationshipType->relationshipTypeGroup->name == 'work';
|
||||
});
|
||||
|
||||
// reminders
|
||||
$reminders = $contact->reminders;
|
||||
$relevantRemindersFromRelatedContacts = $contact->getBirthdayRemindersAboutRelatedContacts();
|
||||
$reminders = $reminders->merge($relevantRemindersFromRelatedContacts)
|
||||
->sortBy('next_expected_date');
|
||||
|
||||
// list of active features
|
||||
$modules = $contact->account->modules()->active()->get();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user