Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions ProcessMaker/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,22 @@ public function index(Request $request)
if (Auth::check()) {
// Redirect to home dynamic only if the package was enable
if (hasPackage('package-dynamic-ui')) {
$user = \Auth::user();
$homePage = \ProcessMaker\Package\PackageDynamicUI\Models\DynamicUI::getHomePage($user);
$user = Auth::user();

return redirect($homePage);
// Check if there is at least one custom dashboard per user
$customDashboardExists = \ProcessMaker\Package\PackageDynamicUI\Models\DynamicUI::where('type', 'DASHBOARD')
->where('assignable_id', $user->id)
->count() > 0;

if ($customDashboardExists) {
$homePage = \ProcessMaker\Package\PackageDynamicUI\Models\DynamicUI::getHomePage($user);

return redirect($homePage);
}
}

// Redirect to the default view
return redirect('/requests');
return redirect('/tasks');
}
}

Expand Down