Skip to content
Snippets Groups Projects
Commit 68f2cc34 authored by Stefan Galinski's avatar Stefan Galinski :video_game:
Browse files

[TASK] Save the application in the end finally

parent 3b8dc9ab
No related branches found
No related tags found
No related merge requests found
......@@ -53,6 +53,12 @@ class JoblistController extends ActionController {
*/
private $jobRepository;
/**
* @var \SGalinski\SgJobs\Domain\Repository\JobApplicationRepository
* @inject
*/
private $jobApplicationRepository;
/**
* Show all job offers and options to manage them
*
......@@ -104,15 +110,6 @@ class JoblistController extends ActionController {
* @param string|NULL $folderName
*/
public function applyFormAction(JobApplication $applyData = NULL, $error = NULL, $folderName = NULL) {
// $uploadedFiles = $this->getExistingApplicationFiles($uniqueFolderName);
// if (\count($uploadedFiles['coverLetter']) <= 0 && \count($uploadedFiles['cv']) <= 0
// && \count($uploadedFiles['certificate']) <= 0
// ) {
// $this->forward('applyForm', NULL, NULL, ['error' => 'Bitte laden Sie alle benötigten Dateien hoch!']);
// }
// $this->request->setArgument('uploadedFiles', $uploadedFiles);
if ($error !== NULL && $error !== '') {
$this->view->assign('internalError', $error);
}
......@@ -211,8 +208,13 @@ class JoblistController extends ActionController {
public function applyAction(JobApplication $applyData) {
try {
$applyData->setPid($GLOBALS['TSFE']->id);
// @TODO repository is missing / OR UPDATE!!!
// $this->jobApplicationRepository->add($applyData);
if ($applyData->_isNew()) {
$this->jobApplicationRepository->add($applyData);
} else {
$this->jobApplicationRepository->update($applyData);
}
$folderName = $this->request->getArgument('folderName');
$this->submitApplicationFiles($applyData, $folderName);
......
<?php
namespace SGalinski\SgJobs\Domain\Repository;
/***************************************************************
* Copyright notice
*
* (c) sgalinski Internet Services (https://www.sgalinski.de)
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use TYPO3\CMS\Extbase\Persistence\Repository;
/**
* Job Repository
*/
class JobApplicationRepository extends Repository {
}
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