Skip to content
Snippets Groups Projects
Commit d3e2eab5 authored by Matthias Adrowski's avatar Matthias Adrowski
Browse files

[TASK] get 8.1 frontend working

parent 9cb13d4a
No related branches found
No related tags found
1 merge request!35Feature upgrade to typo3 11
...@@ -134,7 +134,9 @@ class JoblistController extends ActionController { ...@@ -134,7 +134,9 @@ class JoblistController extends ActionController {
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentNameException * @throws \TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentNameException
*/ */
public function initializeIndexAction() { public function initializeIndexAction() {
$currentPageBrowserPage = (int) GeneralUtility::_GP('tx_sgjobs_pagebrowser')['currentPage']; $currentPageBrowserPage = GeneralUtility::_GP('tx_sgjobs_pagebrowser') ? (int) GeneralUtility::_GP(
'tx_sgjobs_pagebrowser'
)['currentPage'] : 0;
if ($currentPageBrowserPage > 0) { if ($currentPageBrowserPage > 0) {
$this->request->setArgument('currentPageBrowserPage', $currentPageBrowserPage); $this->request->setArgument('currentPageBrowserPage', $currentPageBrowserPage);
} }
...@@ -151,7 +153,8 @@ class JoblistController extends ActionController { ...@@ -151,7 +153,8 @@ class JoblistController extends ActionController {
* @throws ImmediateResponseException * @throws ImmediateResponseException
* @throws \TYPO3\CMS\Core\Package\Exception * @throws \TYPO3\CMS\Core\Package\Exception
*/ */
public function indexAction(array $filters = [], int $jobId = NULL, int $currentPageBrowserPage = 0): ?\Psr\Http\Message\ResponseInterface { public function indexAction(array $filters = [], int $jobId = NULL, int $currentPageBrowserPage = 0
): ?\Psr\Http\Message\ResponseInterface {
if ($filters) { if ($filters) {
$this->view->assign('selectedCountry', $filters['filterCountry']); $this->view->assign('selectedCountry', $filters['filterCountry']);
$this->view->assign('selectedCompany', $filters['filterCompany']); $this->view->assign('selectedCompany', $filters['filterCompany']);
...@@ -257,7 +260,8 @@ class JoblistController extends ActionController { ...@@ -257,7 +260,8 @@ class JoblistController extends ActionController {
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentNameException * @throws \TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentNameException
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException
*/ */
public function applyFormAction(JobApplication $applyData = NULL, string $error = '', int $jobId = NULL): ?\Psr\Http\Message\ResponseInterface { public function applyFormAction(JobApplication $applyData = NULL, string $error = '', int $jobId = NULL
): ?\Psr\Http\Message\ResponseInterface {
if ($error !== '') { if ($error !== '') {
$this->view->assign('internalError', $error); $this->view->assign('internalError', $error);
$this->request->setArgument('error', NULL); $this->request->setArgument('error', NULL);
...@@ -344,7 +348,7 @@ class JoblistController extends ActionController { ...@@ -344,7 +348,7 @@ class JoblistController extends ActionController {
// This fixes a bug in the form ViewHelper that wants to serialize a Model with closures in it // This fixes a bug in the form ViewHelper that wants to serialize a Model with closures in it
$arguments = $this->request->getArguments(); $arguments = $this->request->getArguments();
if ($arguments['applyData']) { if (isset($arguments['applyData']) && $arguments['applyData']) {
$arguments['applyData'] = (string) $arguments['applyData']; $arguments['applyData'] = (string) $arguments['applyData'];
$this->request->setArguments($arguments); $this->request->setArguments($arguments);
} }
...@@ -368,7 +372,9 @@ class JoblistController extends ActionController { ...@@ -368,7 +372,9 @@ class JoblistController extends ActionController {
} catch (NoSuchArgumentException $exception) { } catch (NoSuchArgumentException $exception) {
$exceptionMessage = 'Some file could not be uploaded. Is it too large?'; $exceptionMessage = 'Some file could not be uploaded. Is it too large?';
if (version_compare(\TYPO3\CMS\Core\Utility\VersionNumberUtility::getCurrentTypo3Version(), '11.0.0', '<')) { if (version_compare(
\TYPO3\CMS\Core\Utility\VersionNumberUtility::getCurrentTypo3Version(), '11.0.0', '<'
)) {
$this->redirect('applyForm', NULL, NULL, ['error' => $exceptionMessage]); $this->redirect('applyForm', NULL, NULL, ['error' => $exceptionMessage]);
return NULL; return NULL;
} else { } else {
...@@ -694,6 +700,7 @@ class JoblistController extends ActionController { ...@@ -694,6 +700,7 @@ class JoblistController extends ActionController {
/** /**
* Build Typo3 11 Response * Build Typo3 11 Response
*
* @param string|NULL $html * @param string|NULL $html
* @return \Psr\Http\Message\ResponseInterface * @return \Psr\Http\Message\ResponseInterface
*/ */
......
...@@ -221,23 +221,23 @@ class JobRepository extends Repository { ...@@ -221,23 +221,23 @@ class JobRepository extends Repository {
} }
$constraints = []; $constraints = [];
if ($filters['filterCountry'] !== '0' && $filters['filterCountry'] !== NULL) { if (isset($filters['filterCountry']) && $filters['filterCountry'] !== '0') {
$constraints[] = $query->equals('company.country', $filters['filterCountry']); $constraints[] = $query->equals('company.country', $filters['filterCountry']);
} }
if ($filters['filterRemote'] !== '' && $filters['filterRemote'] !== NULL) { if (isset($filters['filterRemote']) && $filters['filterRemote'] !== '') {
$constraints[] = $query->equals('telecommutePossible', TRUE); $constraints[] = $query->equals('telecommutePossible', TRUE);
} }
if ($filters['filterLocation'] !== '0' && $filters['filterLocation'] !== NULL) { if (isset($filters['filterLocation']) && $filters['filterLocation'] !== '0') {
$constraints[] = $query->equals('company.city', $filters['filterLocation']); $constraints[] = $query->equals('company.city', $filters['filterLocation']);
} }
if ($filters['filterDepartment'] !== '0' && $filters['filterDepartment'] !== NULL) { if (isset($filters['filterDepartment']) && $filters['filterDepartment'] !== '0') {
$constraints[] = $query->equals('department', $filters['filterDepartment']); $constraints[] = $query->equals('department', $filters['filterDepartment']);
} }
if ($filters['filterExperienceLevel'] !== '0' && $filters['filterExperienceLevel'] !== NULL) { if (isset($filters['filterExperienceLevel']) && $filters['filterExperienceLevel'] !== '0') {
$constraints[] = $query->equals('experienceLevel', $filters['filterExperienceLevel']); $constraints[] = $query->equals('experienceLevel', $filters['filterExperienceLevel']);
} }
......
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