mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-13 22:54:25 +01:00
Fixes for activity controller
This commit is contained in:
parent
e37dd8f1f0
commit
5138dc8092
@ -97,19 +97,21 @@ class ActivityController extends BaseController
|
||||
|
||||
$data = $activities->cursor()->map(function ($activity) use($system){
|
||||
|
||||
return ctrans('texts.activity_'.$activity->activity_type_id,[
|
||||
'client' => $activity->client ? $activity->client->present()->name() : $system,
|
||||
'contact' => $activity->contact ? $activity->contact->first_name . " " .$activity->contact->last_name : $system,
|
||||
'quote' => $activity->quote ? $activity->quote->number : $system,
|
||||
'user' => $activity->user ? $activity->user->present()->name() : $system,
|
||||
'expense' => $activity->expense ? $activity->expense->number : $system,
|
||||
'invoice' => $activity->invoice ? $activity->invoice->number : $system,
|
||||
'recurring_invoice' => $activity->recurring_invoice ? $activity->recurring_invoice->number : $system,
|
||||
'payment' => $activity->payment ? $activity->payment->number : $system,
|
||||
'credit' => $activity->credit ? $activity->credit->number : $system,
|
||||
'task' => $activity->task ? $activity->task->number : $system,
|
||||
$arr['string'] = ctrans('texts.activity_'.$activity->activity_type_id,[
|
||||
'client' => $activity->client ? $activity->client : '',
|
||||
'contact' => $activity->contact ? $activity->contact : '',
|
||||
'quote' => $activity->quote ? $activity->quote : '',
|
||||
'user' => $activity->user ? $activity->user : '',
|
||||
'expense' => $activity->expense ? $activity->expense : '',
|
||||
'invoice' => $activity->invoice ? $activity->invoice : '',
|
||||
'recurring_invoice' => $activity->recurring_invoice ? $activity->recurring_invoice : '',
|
||||
'payment' => $activity->payment ? $activity->payment : '',
|
||||
'credit' => $activity->credit ? $activity->credit : '',
|
||||
'task' => $activity->task ? $activity->task : '',
|
||||
]);
|
||||
|
||||
return array_merge($arr, $activity->toArray());
|
||||
|
||||
});
|
||||
|
||||
return response()->json(['data' => $data->toArray()], 200);
|
||||
|
Loading…
Reference in New Issue
Block a user