@php
$editTimelogPermission = user()->permission('edit_timelogs');
$addTaskPermission = user()->permission('add_tasks');
@endphp
@if (!is_null($myActiveTimer))
@lang('modules.timeLogs.myActiveTimer')
{{ $myActiveTimer->start_time->timezone(global_setting()->timezone)->format('M d, Y' . ' - ' . global_setting()->time_format) }}
@php
$endTime = now();
$totalHours = $endTime->diff($myActiveTimer->start_time)->format('%d') * 24 + $endTime->diff($myActiveTimer->start_time)->format('%H');
$totalMinutes = $totalHours * 60 + $endTime->diff($myActiveTimer->start_time)->format('%i');
$totalMinutes = $totalMinutes - $myActiveTimer->breaks->sum('total_minutes');
$timeLog = intdiv($totalMinutes, 60) . ' ' . __('app.hrs') . ' ';
if ($totalMinutes % 60 > 0) {
$timeLog .= $totalMinutes % 60 . ' ' . __('app.mins');
}
@endphp
@lang('modules.timeLogs.totalHours'): {{ $timeLog }}
-
@lang('modules.timeLogs.startTime')
{{ $myActiveTimer->start_time->timezone(global_setting()->timezone)->format(global_setting()->time_format) }}
-
@lang('app.task')
{{ $myActiveTimer->task->heading }}
@foreach ($myActiveTimer->breaks as $item)
-
@if (!is_null($item->end_time))
@php
$endTime = $item->end_time;
$totalHours = $endTime->diff($item->start_time)->format('%d') * 24 + $endTime->diff($item->start_time)->format('%H');
$totalMinutes = $totalHours * 60 + $endTime->diff($item->start_time)->format('%i');
$timeLog = intdiv($totalMinutes, 60) . ' ' . __('app.hrs') . ' ';
if ($totalMinutes % 60 > 0) {
$timeLog .= $totalMinutes % 60 . ' ' . __('app.mins');
}
@endphp
@lang('modules.timeLogs.break') ({{ $timeLog }})
{{ $item->start_time->timezone(global_setting()->timezone)->format(global_setting()->time_format) . ' - ' . $item->end_time->timezone(global_setting()->timezone)->format(global_setting()->time_format) }}
@else
@lang('modules.timeLogs.break')
{{ $item->start_time->timezone(global_setting()->timezone)->format(global_setting()->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')
@lang('modules.timeLogs.stopTimer')
@else
@lang('modules.timeLogs.resumeTimer')
@endif
@endif
@else
@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(global_setting()->timezone)->format(global_setting()->date_format . ' ' . global_setting()->time_format) }}
@if (is_null($item->activeBreak))
@php
$endTime = now();
$totalHours = $endTime->diff($item->start_time)->format('%d') * 24 + $endTime->diff($item->start_time)->format('%H');
$totalMinutes = $totalHours * 60 + $endTime->diff($item->start_time)->format('%i');
$totalMinutes = $totalMinutes - $item->breaks->sum('total_minutes');
$timeLog = intdiv($totalMinutes, 60) . ' ' . __('app.hrs') . ' ';
if ($totalMinutes % 60 > 0) {
$timeLog .= $totalMinutes % 60 . ' ' . __('app.mins');
}
@endphp
{{ $timeLog }}
@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