Skip to content
Snippets Groups Projects
Commit 00a381b7 authored by Torsten Oppermann's avatar Torsten Oppermann
Browse files

[TASK] Fixing cgl issues

parent 91cf53cd
No related branches found
No related tags found
No related merge requests found
...@@ -131,11 +131,11 @@ class JoblistController extends ActionController { ...@@ -131,11 +131,11 @@ class JoblistController extends ActionController {
* *
* @param JobApplication $applyData * @param JobApplication $applyData
* @param string $error * @param string $error
* @param int $uid * @param int $jobId
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentNameException * @throws \TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentNameException
*/ */
public function applyFormAction(JobApplication $applyData = NULL, $error = NULL, $uid = NULL) { public function applyFormAction(JobApplication $applyData = NULL, $error = NULL, $jobId = NULL) {
if ($error !== NULL && $error !== '') { if ($error !== NULL && $error !== '') {
$this->view->assign('internalError', $error); $this->view->assign('internalError', $error);
$this->request->setArgument('error', NULL); $this->request->setArgument('error', NULL);
...@@ -157,19 +157,19 @@ class JoblistController extends ActionController { ...@@ -157,19 +157,19 @@ class JoblistController extends ActionController {
$job = NULL; $job = NULL;
if (!$uid !== NULL) { if ($jobId !== NULL) {
/** @var Job $job */ /** @var Job $job */
$job = $this->jobRepository->findByUid($uid); $job = $this->jobRepository->findByUid($jobId);
if ($job) { if ($job) {
$GLOBALS['TSFE']->page['titlebyextension'] = $job->getTitle(); $GLOBALS['TSFE']->page['titlebyextension'] = $job->getTitle();
$GLOBALS['TSFE']->page['description'] = substr($job->getDescription(), 0, 200); $GLOBALS['TSFE']->page['description'] = substr($job->getDescription(), 0, 200);
} else {
$storagePid = (int) $this->configurationManager->getConfiguration(
ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK
)['persistence']['storagePid'];
$this->view->assign('companies', $this->companyRepository->getAllCompanies($storagePid));
} }
$this->view->assign('job', $job); $this->view->assign('job', $job);
} else {
$storagePid = (int) $this->configurationManager->getConfiguration(
ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK
)['persistence']['storagePid'];
$this->view->assign('companies', $this->companyRepository->getAllCompanies($storagePid));
} }
// display country options // display country options
...@@ -292,7 +292,7 @@ class JoblistController extends ActionController { ...@@ -292,7 +292,7 @@ class JoblistController extends ActionController {
); );
// get email from the job contact, fallback is TS settings // get email from the job contact, fallback is TS settings
$contact = NULL;
if ($job !== NULL) { if ($job !== NULL) {
/** @var Contact $contact */ /** @var Contact $contact */
$contact = $job->getContact(); $contact = $job->getContact();
...@@ -301,7 +301,12 @@ class JoblistController extends ActionController { ...@@ -301,7 +301,12 @@ class JoblistController extends ActionController {
if ($contact !== NULL) { if ($contact !== NULL) {
$mailService->setToAddresses($contact->getEmail()); $mailService->setToAddresses($contact->getEmail());
} else { } else {
$mailService->setToAddresses($applyData->getCompany()->getContact()->getEmail()); $company = $applyData->getCompany();
if ($company !== NULL) {
if ($company->getContact() !== NULL) {
$mailService->setToAddresses($company->getContact()->getEmail());
}
}
} }
$mailService->setMarkers(['application' => $applyData]); $mailService->setMarkers(['application' => $applyData]);
......
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
</div> </div>
<div class="pia-card-footer"> <div class="pia-card-footer">
<f:link.action class="cta-link" pageUid="{settings.applyPage}" controller="Joblist" action="applyForm" <f:link.action class="cta-link" pageUid="{settings.applyPage}" controller="Joblist" action="applyForm"
pluginName="JobApplication" arguments="{uid: job.uid}"> pluginName="JobApplication" arguments="{jobId: job.uid}">
<f:translate key="frontend.applyNow" /> <f:translate key="frontend.applyNow" />
</f:link.action> </f:link.action>
</div> </div>
......
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