@php
$editTimelogPermission = user()->permission('edit_timelogs');
$addTaskPermission = user()->permission('add_tasks');
@endphp
@include('sections.datatable_css')
@if (!is_null($myActiveTimer))
@lang('modules.timeLogs.myActiveTimer')
{{ $myActiveTimer->start_time->timezone(company()->timezone)->translatedFormat('M d, Y' . ' - ' . company()->time_format) }}
@php
$totalMinutes = now()->diffInMinutes($myActiveTimer->start_time) - $myActiveTimer->breaks->sum('total_minutes');
@endphp
@lang('modules.timeLogs.totalHours'):
{{\Carbon\CarbonInterval::formatHuman($totalMinutes)}}
-
@lang('modules.timeLogs.startTime')
{{ $myActiveTimer->start_time->timezone(company()->timezone)->translatedFormat(company()->time_format) }}
-
@lang('app.task')
{{ $myActiveTimer->task->heading }}
@foreach ($myActiveTimer->breaks as $item)
-
@if (!is_null($item->end_time))
@lang('modules.timeLogs.break')
{{\Carbon\CarbonInterval::formatHuman($item->end_time->diffInMinutes($item->start_time))}}
{{ $item->start_time->timezone(company()->timezone)->translatedFormat(company()->time_format) . ' - ' . $item->end_time->timezone(company()->timezone)->translatedFormat(company()->time_format) }}
@else
@lang('modules.timeLogs.break')
{{ $item->start_time->timezone(company()->timezone)->translatedFormat(company()->time_format) }}
@endif
@endforeach
@if (
$editTimelogPermission == 'all'
|| ($editTimelogPermission == 'added' && $myActiveTimer->added_by == user()->id)
|| ($editTimelogPermission == 'owned'
&& (($myActiveTimer->project && $myActiveTimer->project->client_id == user()->id) || $myActiveTimer->user_id == user()->id)
)
|| ($editTimelogPermission == 'both' && (($myActiveTimer->project && $myActiveTimer->project->client_id == user()->id) || $myActiveTimer->user_id == user()->id || $myActiveTimer->added_by == user()->id))
)
@if (is_null($myActiveTimer->activeBreak))
@lang('modules.timeLogs.pauseTimer')
@else
@lang('modules.timeLogs.resumeTimer')
@endif
@lang('modules.timeLogs.stopTimer')
@endif
@else
@foreach ($projects as $data)
@endforeach
@if ($addTaskPermission == 'all' || $addTaskPermission == 'added')
@endif
@lang('modules.timeLogs.startTimer')
@endif
# |
@lang('app.task') |
@lang('app.employee') |
@lang('modules.timeLogs.startTime') |
@lang('app.action') |
@forelse ($activeTimers as $key => $item)
{{ $key + 1 }} |
{{ $item->task->heading }}
@if ($item->task->project_id)
{{ $item->task->project->project_name }}
@endif
|
|
{{ $item->start_time->timezone(company()->timezone)->translatedFormat(company()->date_format . ' ' . company()->time_format) }}
@if (is_null($item->activeBreak))
{{\Carbon\CarbonInterval::formatHuman(now()->diffInMinutes($item->start_time) - $item->breaks->sum('total_minutes'))}}
@else
@lang('modules.timeLogs.paused')
@endif
|
@if (
$editTimelogPermission == 'all'
|| ($editTimelogPermission == 'added' && $item->added_by == user()->id)
|| ($editTimelogPermission == 'owned'
&& (($item->project && $item->project->client_id == user()->id) || $item->user_id == user()->id)
)
|| ($editTimelogPermission == 'both' && (($item->project && $item->project->client_id == user()->id) || $item->user_id == user()->id || $item->added_by == user()->id))
)
@lang('app.stop')
@endif
|
@empty
|
@endforelse