mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-24 22:48:18 +00:00
First code for YNAB import #145
This commit is contained in:
@@ -78,9 +78,15 @@ class IndexController extends Controller
|
||||
{
|
||||
Log::debug(sprintf('Will create job for provider "%s"', $importProvider));
|
||||
|
||||
$importJob = $this->repository->create($importProvider);
|
||||
$hasPreReq = (bool)config(sprintf('import.has_prereq.%s', $importProvider));
|
||||
$hasConfig = (bool)config(sprintf('import.has_job_config.%s', $importProvider));
|
||||
$importJob = $this->repository->create($importProvider);
|
||||
$hasPreReq = (bool)config(sprintf('import.has_prereq.%s', $importProvider));
|
||||
$hasConfig = (bool)config(sprintf('import.has_job_config.%s', $importProvider));
|
||||
$allowedForDemo = (bool)config(sprintf('import.allowed_for_demo.%s', $importProvider));
|
||||
$isDemoUser = $this->userRepository->hasRole(auth()->user(), 'demo');
|
||||
|
||||
if ($isDemoUser && !$allowedForDemo) {
|
||||
return redirect(route('import.index'));
|
||||
}
|
||||
|
||||
Log::debug(sprintf('Created job #%d for provider %s', $importJob->id, $importProvider));
|
||||
|
||||
@@ -180,7 +186,8 @@ class IndexController extends Controller
|
||||
$providers = $this->providers;
|
||||
$subTitle = (string)trans('import.index_breadcrumb');
|
||||
$subTitleIcon = 'fa-home';
|
||||
$isDemoUser = $this->userRepository->hasRole(auth()->user(), 'demo');
|
||||
|
||||
return view('import.index', compact('subTitle', 'subTitleIcon', 'providers'));
|
||||
return view('import.index', compact('subTitle', 'subTitleIcon', 'providers', 'isDemoUser'));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user