mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Add in task item log entry to task exports
This commit is contained in:
parent
344603123a
commit
92f1ef98d0
@ -451,6 +451,7 @@ class BaseExport
|
||||
'project' => 'task.project_id',
|
||||
'billable' => 'task.billable',
|
||||
'item_notes' => 'task.item_notes',
|
||||
'time_log' => 'task.time_log',
|
||||
];
|
||||
|
||||
protected array $forced_client_fields = [
|
||||
|
@ -156,7 +156,7 @@ class TaskExport extends BaseExport
|
||||
$entity[$key] = $transformed_entity[$parts[1]];
|
||||
} elseif (array_key_exists($key, $transformed_entity)) {
|
||||
$entity[$key] = $transformed_entity[$key];
|
||||
} elseif (in_array($key, ['task.start_date', 'task.end_date', 'task.duration', 'task.billable', 'task.item_notes'])) {
|
||||
} elseif (in_array($key, ['task.start_date', 'task.end_date', 'task.duration', 'task.billable', 'task.item_notes', 'task.time_log'])) {
|
||||
$entity[$key] = '';
|
||||
} else {
|
||||
$entity[$key] = $this->decorator->transform($key, $task);
|
||||
@ -207,6 +207,9 @@ class TaskExport extends BaseExport
|
||||
$seconds = $task->calcDuration();
|
||||
$entity['task.duration'] = $seconds;
|
||||
$entity['task.duration_words'] = $seconds > 86400 ? CarbonInterval::seconds($seconds)->locale($this->company->locale())->cascade()->forHumans() : now()->startOfDay()->addSeconds($seconds)->format('H:i:s');
|
||||
|
||||
$entity['task.time_log'] = (isset($item[1]) && $item[1] != 0) ? $item[1] - $item[0] : ctrans('texts.is_running');
|
||||
|
||||
}
|
||||
|
||||
if (in_array('task.billable', $this->input['report_keys']) || in_array('billable', $this->input['report_keys'])) {
|
||||
|
@ -67,7 +67,7 @@ class UpdateTaskRequest extends Request
|
||||
if(is_string($values)) {
|
||||
$values = json_decode($values, true);
|
||||
}
|
||||
|
||||
|
||||
if(!is_array($values)) {
|
||||
$fail('The '.$attribute.' must be a valid array.');
|
||||
return;
|
||||
@ -133,7 +133,7 @@ class UpdateTaskRequest extends Request
|
||||
|
||||
}
|
||||
|
||||
if(!isset($input['time_log']) || empty($input['time_log']) || $input['time_log'] == '{}') {
|
||||
if(!isset($input['time_log']) || empty($input['time_log']) || $input['time_log'] == '{}' || $input['time_log'] == '[""]') {
|
||||
$input['time_log'] = json_encode([]);
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@ class AdjustEmailQuota implements ShouldQueue
|
||||
|
||||
/** Use redis pipelines to execute bulk deletes efficiently */
|
||||
$redis = Redis::connection('sentinel-cache');
|
||||
$prefix = config('cache.prefix'). ":email_quota*";
|
||||
$prefix = config('cache.prefix'). "email_quota*";
|
||||
|
||||
$keys = $redis->keys($prefix);
|
||||
|
||||
@ -92,7 +92,7 @@ class AdjustEmailQuota implements ShouldQueue
|
||||
}
|
||||
$keys = null;
|
||||
|
||||
$prefix = config('cache.prefix'). ":throttle_notified*";
|
||||
$prefix = config('cache.prefix'). "throttle_notified*";
|
||||
|
||||
$keys = $redis->keys($prefix);
|
||||
|
||||
|
@ -2,6 +2,13 @@
|
||||
@section('meta_title', ctrans('texts.dashboard'))
|
||||
|
||||
@section('body')
|
||||
|
||||
@if($client->getSetting('custom_message_dashboard'))
|
||||
@component('portal.ninja2020.components.message')
|
||||
<pre>{{ $client->getSetting('custom_message_dashboard') }}</pre>
|
||||
@endcomponent
|
||||
@endif
|
||||
|
||||
<div class="flex flex-col xl:flex-row gap-4">
|
||||
<div class="w-full rounded-md border border-[#E5E7EB] bg-white p-5 text-sm text-[#6C727F]">
|
||||
<h3 class="mb-4 text-xl font-semibold text-[#212529]">{{ $contact->first_name }} {{ $contact->last_name }}</h3>
|
||||
|
@ -224,6 +224,25 @@ class TaskApiTest extends TestCase
|
||||
])->postJson("/api/v1/tasks", $data);
|
||||
|
||||
$response->assertStatus(200);
|
||||
$arr = $response->json();
|
||||
|
||||
$data = [
|
||||
'client_id' => $this->client->hashed_id,
|
||||
'description' => 'Test Task',
|
||||
'time_log' => '[""]',
|
||||
'assigned_user' => [],
|
||||
'project' => [],
|
||||
'user' => [],
|
||||
];
|
||||
|
||||
|
||||
$response = $this->withHeaders([
|
||||
'X-API-SECRET' => config('ninja.api_secret'),
|
||||
'X-API-TOKEN' => $this->token,
|
||||
])->putJson("/api/v1/tasks/".$arr['data']['id'], $data);
|
||||
|
||||
$response->assertStatus(200);
|
||||
|
||||
|
||||
}
|
||||
public function testUserFilters()
|
||||
|
Loading…
x
Reference in New Issue
Block a user