Skip to content
Snippets Groups Projects
Verified Commit 36aea4b1 authored by Stefan Galinski's avatar Stefan Galinski :video_game:
Browse files

[FEATURE] Add related jobs to the list/filter view, but still unused in the template

parent b5f74f8c
No related branches found
No related tags found
No related merge requests found
......@@ -355,6 +355,34 @@ class JoblistController extends ActionController {
$this->view->assign('numberOfPages', $numberOfPages);
$this->view->assign('data', $this->request->getAttribute('currentContentObject')->data);
if (!count($jobs)) {
$enableAutomaticRelatedJobs = (bool) $this->settings['enableAutomaticRelatedJobs'];
if ($enableAutomaticRelatedJobs) {
$automaticRelatedJobsLimit = (int) $this->settings['automaticRelatedJobsLimit'];
unset($filters['filterExperienceLevel']);
$relatedJobs = $this->jobRepository->findJobsByFilter(
$filters, $automaticRelatedJobsLimit, 0, $ordering
);
if (!count($relatedJobs)) {
unset($filters['filterDepartment']);
$relatedJobs = $this->jobRepository->findJobsByFilter(
$filters, $automaticRelatedJobsLimit, 0, $ordering
);
if (!count($relatedJobs)) {
unset($filters['filterLocation']);
$relatedJobs = $this->jobRepository->findJobsByFilter(
$filters, $automaticRelatedJobsLimit, 0, $ordering
);
if (!count($relatedJobs)) {
$relatedJobs = $this->jobRepository->findJobsByFilter([], $automaticRelatedJobsLimit, 0,
$ordering);
}
}
}
$this->view->assign('relatedJobs', $relatedJobs->toArray());
}
}
return $this->htmlResponse();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment