mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 19:14:40 -04:00
Added projects to history sidebar
This commit is contained in:
parent
cfddcc940a
commit
e936e9ccef
@ -37,7 +37,7 @@ class HistoryUtils
|
|||||||
ACTIVITY_TYPE_VIEW_QUOTE,
|
ACTIVITY_TYPE_VIEW_QUOTE,
|
||||||
];
|
];
|
||||||
|
|
||||||
$activities = Activity::with(['client.contacts', 'invoice', 'task', 'expense'])
|
$activities = Activity::with(['client.contacts', 'invoice', 'task.project', 'expense'])
|
||||||
->whereIn('user_id', $userIds)
|
->whereIn('user_id', $userIds)
|
||||||
->whereIn('activity_type_id', $activityTypes)
|
->whereIn('activity_type_id', $activityTypes)
|
||||||
->orderBy('id', 'desc')
|
->orderBy('id', 'desc')
|
||||||
@ -53,6 +53,12 @@ class HistoryUtils
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$entity->setRelation('client', $activity->client);
|
$entity->setRelation('client', $activity->client);
|
||||||
|
|
||||||
|
if ($entity->project) {
|
||||||
|
$project = $entity->project;
|
||||||
|
$project->setRelation('client', $activity->client);
|
||||||
|
static::trackViewed($project);
|
||||||
|
}
|
||||||
} elseif ($activity->activity_type_id == ACTIVITY_TYPE_CREATE_EXPENSE || $activity->activity_type_id == ACTIVITY_TYPE_UPDATE_EXPENSE) {
|
} elseif ($activity->activity_type_id == ACTIVITY_TYPE_CREATE_EXPENSE || $activity->activity_type_id == ACTIVITY_TYPE_UPDATE_EXPENSE) {
|
||||||
$entity = $activity->expense;
|
$entity = $activity->expense;
|
||||||
if (! $entity) {
|
if (! $entity) {
|
||||||
@ -80,6 +86,7 @@ class HistoryUtils
|
|||||||
ENTITY_QUOTE,
|
ENTITY_QUOTE,
|
||||||
ENTITY_TASK,
|
ENTITY_TASK,
|
||||||
ENTITY_EXPENSE,
|
ENTITY_EXPENSE,
|
||||||
|
ENTITY_PROJECT,
|
||||||
//ENTITY_RECURRING_EXPENSE,
|
//ENTITY_RECURRING_EXPENSE,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ class EntityPresenter extends Presenter
|
|||||||
$entity = $this->entity;
|
$entity = $this->entity;
|
||||||
$entityType = $entity->getEntityType();
|
$entityType = $entity->getEntityType();
|
||||||
|
|
||||||
return sprintf('%s %s', trans('texts.' . $entityType), $entity->getDisplayName());
|
return sprintf('%s: %s', trans('texts.' . $entityType), $entity->getDisplayName());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function calendarEvent($subColors = false)
|
public function calendarEvent($subColors = false)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user