diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 0ecde2f8c..e05b21f0b 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -14,10 +14,10 @@ */ class HomeController extends AppBaseController { - /** @var DashboardRepository $dashboardRepo */ + /** @var DashboardRepository */ private $dashboardRepo; - /** @var UserRepository $userRepository */ + /** @var UserRepository */ private $userRepository; /** diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.php index c1e3309d9..7c3148308 100644 --- a/app/Http/Controllers/ProjectController.php +++ b/app/Http/Controllers/ProjectController.php @@ -54,8 +54,10 @@ public function __construct( public function index(Request $request, ClientRepository $clientRepository) { if ($request->ajax()) { - return Datatables::of((new ProjectDataTable())->get( - $request->only('filter_client')) + return Datatables::of( + (new ProjectDataTable())->get( + $request->only('filter_client') + ) )->make(true); } diff --git a/app/Http/Controllers/ReportController.php b/app/Http/Controllers/ReportController.php index 8120dc509..a2e94d296 100644 --- a/app/Http/Controllers/ReportController.php +++ b/app/Http/Controllers/ReportController.php @@ -28,19 +28,19 @@ */ class ReportController extends AppBaseController { - /** @var ReportRepository $reportRepository */ + /** @var ReportRepository */ private $reportRepository; - /** @var UserRepository $userRepo */ + /** @var UserRepository */ private $userRepo; - /** @var TagRepository $tagRepo */ + /** @var TagRepository */ private $tagRepo; - /** @var ClientRepository $clientRepo */ + /** @var ClientRepository */ private $clientRepo; - /** @var ProjectRepository $projectRepository */ + /** @var ProjectRepository */ private $projectRepo; public function __construct( diff --git a/app/Http/Controllers/TaskController.php b/app/Http/Controllers/TaskController.php index 6125e03ee..07da88fbb 100644 --- a/app/Http/Controllers/TaskController.php +++ b/app/Http/Controllers/TaskController.php @@ -53,8 +53,10 @@ public function index(Request $request) })->filterColumn('title', function (Builder $query, $search) { $query->where(function (Builder $query) use ($search) { $query->where('title', 'like', "%$search%") - ->orWhereRaw("concat(ifnull(p.prefix,''),'-',ifnull(tasks.task_number,'')) LIKE ?", - ["%$search%"]); + ->orWhereRaw( + "concat(ifnull(p.prefix,''),'-',ifnull(tasks.task_number,'')) LIKE ?", + ["%$search%"] + ); }); }) ->make(true); diff --git a/app/Http/Controllers/TimeEntryController.php b/app/Http/Controllers/TimeEntryController.php index 160f22239..fff785ad2 100644 --- a/app/Http/Controllers/TimeEntryController.php +++ b/app/Http/Controllers/TimeEntryController.php @@ -43,15 +43,19 @@ public function __construct(TimeEntryRepository $timeEntryRepo) public function index(Request $request) { if ($request->ajax()) { - return Datatables::of((new TimeEntryDataTable())->get( - $request->only('filter_activity', 'filter_user', 'filter_project')) + return Datatables::of( + (new TimeEntryDataTable())->get( + $request->only('filter_activity', 'filter_user', 'filter_project') + ) )->editColumn('title', function (TimeEntry $timeEntry) { return $timeEntry->task->prefix_task_number.' '.$timeEntry->task->title; })->filterColumn('title', function (Builder $query, $search) { $query->where(function (Builder $query) use ($search) { $query->where('title', 'like', "%$search%") - ->orWhereRaw("concat(ifnull(p.prefix,''),'-',ifnull(t.task_number,'')) LIKE ?", - ["%$search%"]); + ->orWhereRaw( + "concat(ifnull(p.prefix,''),'-',ifnull(t.task_number,'')) LIKE ?", + ["%$search%"] + ); }); })->make(true); } diff --git a/app/Queries/ProjectDataTable.php b/app/Queries/ProjectDataTable.php index 051337d87..5d8a89547 100644 --- a/app/Queries/ProjectDataTable.php +++ b/app/Queries/ProjectDataTable.php @@ -20,15 +20,19 @@ public function get($input) /** @var Project $query */ $query = Project::with(['client'])->select('projects.*'); - $query->when(isset($input['filter_client']) && !empty($input['filter_client']), + $query->when( + isset($input['filter_client']) && !empty($input['filter_client']), function (Builder $q) use ($input) { $q->where('client_id', $input['filter_client']); - }); + } + ); - $query->when(isset($input['filter_team']) && !empty($input['filter_team']), + $query->when( + isset($input['filter_team']) && !empty($input['filter_team']), function (Builder $q) use ($input) { $q->where('team', $input['filter_team']); - }); + } + ); return $query; } diff --git a/app/Queries/TaskDataTable.php b/app/Queries/TaskDataTable.php index 068f6c7f8..016e94f94 100644 --- a/app/Queries/TaskDataTable.php +++ b/app/Queries/TaskDataTable.php @@ -28,27 +28,35 @@ public function get($input = []) ->with(['project', 'taskAssignee', 'createdUser']) ->select(['tasks.*']); - $query->when(isset($input['filter_project']) && !empty($input['filter_project']), + $query->when( + isset($input['filter_project']) && !empty($input['filter_project']), function (Builder $q) use ($input) { $q->ofProject($input['filter_project']); - }); + } + ); - $query->when(isset($input['filter_status']) && $input['filter_status'] != Task::STATUS_ALL, + $query->when( + isset($input['filter_status']) && $input['filter_status'] != Task::STATUS_ALL, function (Builder $q) use ($input) { $q->where('status', $input['filter_status']); - }); + } + ); - $query->when(isset($input['due_date_filter']) && !empty($input['due_date_filter']), + $query->when( + isset($input['due_date_filter']) && !empty($input['due_date_filter']), function (Builder $q) use ($input) { $q->where('due_date', $input['due_date_filter']); - }); + } + ); - $query->when(isset($input['filter_user']), + $query->when( + isset($input['filter_user']), function (Builder $q) use ($input) { $q->whereHas('taskAssignee', function (Builder $q) use ($input) { $q->where('user_id', $input['filter_user']); }); - }); + } + ); return $query; } diff --git a/app/Queries/TimeEntryDataTable.php b/app/Queries/TimeEntryDataTable.php index 0576d0cb2..4291f69ea 100644 --- a/app/Queries/TimeEntryDataTable.php +++ b/app/Queries/TimeEntryDataTable.php @@ -29,11 +29,14 @@ public function get($input) /** @var User $user */ $user = Auth::user(); - $query->when(isset($input['filter_activity']) && !empty($input['filter_activity']), + $query->when( + isset($input['filter_activity']) && !empty($input['filter_activity']), function (Builder $q) use ($input) { $q->where('activity_type_id', $input['filter_activity']); - }); - $query->when(isset($input['filter_project']) && !empty($input['filter_project']), + } + ); + $query->when( + isset($input['filter_project']) && !empty($input['filter_project']), function (Builder $q) use ($input,$user) { if ($user->can('manage_time_entries')) { $taskIds = Task::whereProjectId($input['filter_project'])->get()->pluck('id')->toArray(); @@ -47,14 +50,17 @@ function (Builder $q) use ($input,$user) { })->get()->pluck('id')->toArray(); $q->whereIn('task_id', $taskIds); } - }); + } + ); if (!$user->can('manage_time_entries')) { return $query->OfCurrentUser(); } - $query->when(isset($input['filter_user']) && !empty($input['filter_user']), + $query->when( + isset($input['filter_user']) && !empty($input['filter_user']), function (Builder $q) use ($input) { $q->where('user_id', $input['filter_user']); - }); + } + ); return $query; } diff --git a/app/Repositories/AccountRepository.php b/app/Repositories/AccountRepository.php index 685530fb4..68aa240be 100644 --- a/app/Repositories/AccountRepository.php +++ b/app/Repositories/AccountRepository.php @@ -25,11 +25,14 @@ public function sendConfirmEmail($username, $email, $activateCode) $data['username'] = $username; try { - Mail::send('auth.emails.account_verification', ['data' => $data], + Mail::send( + 'auth.emails.account_verification', + ['data' => $data], function (Message $message) use ($email) { $message->subject('Activate your account'); $message->to($email); - }); + } + ); } catch (Exception $e) { throw new Exception('Account created, but unable to send email'); } diff --git a/app/Repositories/UserRepository.php b/app/Repositories/UserRepository.php index 86a362b46..9094d8443 100644 --- a/app/Repositories/UserRepository.php +++ b/app/Repositories/UserRepository.php @@ -151,7 +151,9 @@ public function profileUpdate($input) try { if (isset($input['photo']) && !empty($input['photo'])) { $input['image_path'] = ImageTrait::makeImage( - $input['photo'], User::IMAGE_PATH, ['width' => 150, 'height' => 150] + $input['photo'], + User::IMAGE_PATH, + ['width' => 150, 'height' => 150] ); $imagePath = $user->image_path; diff --git a/composer.json b/composer.json index 24307a4fd..942fbc2b7 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "infyomlabs/infy-tracker", "type": "project", - "version": "0.1.6-beta", + "version": "0.1.7-beta", "description": "Create Projects / Tasks, Track Time, Show Daily Reports", "keywords": [ "time", diff --git a/database/migrations/2019_09_14_060733_create_permission_tables.php b/database/migrations/2019_09_14_060733_create_permission_tables.php index 0cb0ada5a..07d767e63 100644 --- a/database/migrations/2019_09_14_060733_create_permission_tables.php +++ b/database/migrations/2019_09_14_060733_create_permission_tables.php @@ -45,8 +45,10 @@ public function up() ->references('id') ->on($tableNames['permissions']); - $table->primary(['permission_id', $columnNames['model_morph_key'], 'model_type'], - 'model_has_permissions_permission_model_type_primary'); + $table->primary( + ['permission_id', $columnNames['model_morph_key'], 'model_type'], + 'model_has_permissions_permission_model_type_primary' + ); }); Schema::create($tableNames['model_has_roles'], function (Blueprint $table) use ($tableNames, $columnNames) { @@ -60,8 +62,10 @@ public function up() ->references('id') ->on($tableNames['roles']); - $table->primary(['role_id', $columnNames['model_morph_key'], 'model_type'], - 'model_has_roles_role_model_type_primary'); + $table->primary( + ['role_id', $columnNames['model_morph_key'], 'model_type'], + 'model_has_roles_role_model_type_primary' + ); }); Schema::create($tableNames['role_has_permissions'], function (Blueprint $table) use ($tableNames) { diff --git a/package-lock.json b/package-lock.json index cabdb2990..aa01765de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1114,9 +1114,9 @@ } }, "acorn": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz", - "integrity": "sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", + "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==", "dev": true }, "acorn-dynamic-import": { diff --git a/resources/views/tasks/show.blade.php b/resources/views/tasks/show.blade.php index 33882bb65..254934256 100644 --- a/resources/views/tasks/show.blade.php +++ b/resources/views/tasks/show.blade.php @@ -86,7 +86,14 @@ class="flex-1">{{implode(", ",$task->taskAssignee->pluck('name')->toArray())}}timeEntries->isNotEmpty()))
Time Tracking - {{roundToQuarterHour($task->timeEntries()->sum('duration'))}} + + + + {{roundToQuarterHour($task->timeEntries()->sum('duration'))}} + + +
@endif diff --git a/resources/views/tasks/time_tracking_modal.blade.php b/resources/views/tasks/time_tracking_modal.blade.php index 3ae977faa..be20b7c2b 100644 --- a/resources/views/tasks/time_tracking_modal.blade.php +++ b/resources/views/tasks/time_tracking_modal.blade.php @@ -1,5 +1,5 @@