1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00
invoiceninja/app/Http/Controllers/TimeTrackerController.php
2017-12-20 10:41:40 +02:00

35 lines
1006 B
PHP

<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Models\Task;
use App\Models\TaskStatus;
use App\Models\Client;
use App\Models\Project;
class TimeTrackerController extends Controller
{
public function index()
{
$user = auth()->user();
$account = $user->account;
if (! $account->hasFeature(FEATURE_TASKS)) {
return trans('texts.tasks_not_enabled');
}
$data = [
'title' => trans('texts.time_tracker'),
'tasks' => Task::scope()->with('project', 'client.contacts', 'task_status')->whereNull('invoice_id')->get(),
'clients' => Client::scope()->with('contacts')->orderBy('name')->get(),
'projects' => Project::scope()->with('client.contacts')->orderBy('name')->get(),
'statuses' => TaskStatus::scope()->orderBy('sort_order')->get(),
'account' => $account,
];
return view('tasks.time_tracker', $data);
}
}