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

[TASK] Cleanup and fix the csv

parent 05faa0c7
No related branches found
No related tags found
No related merge requests found
......@@ -120,20 +120,19 @@ class JoblistController extends ActionController {
* Pre-apply action setup, configures model-property mapping and handles file upload
*
* @return void
* @throws \UnexpectedValueException
* @throws \TYPO3\CMS\Core\Resource\Exception\InsufficientFolderWritePermissionsException
* @throws \TYPO3\CMS\Core\Resource\Exception\InsufficientFolderAccessPermissionsException
* @throws \TYPO3\CMS\Core\Resource\Exception\ExistingTargetFolderException
* @throws \TYPO3\CMS\Core\Resource\Exception
* @throws \InvalidArgumentException
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentNameException
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\NoSuchArgumentException
* @throws \Exception
*/
protected function initializeApplyAction() {
$this->handleFileUpload('coverLetter');
$this->handleFileUpload('cv');
$this->handleFileUpload('certificates');
try {
$this->handleFileUpload('coverLetter');
$this->handleFileUpload('cv');
$this->handleFileUpload('certificates');
} catch (\Exception $e) {
// possible errors, because of wrong mails
// @TODO output them in some way?
}
$propertyMappingConfiguration = $this->arguments->getArgument('applyData')->getPropertyMappingConfiguration();
$propertyMappingConfiguration->forProperty('coverLetter')->allowAllProperties();
$propertyMappingConfiguration->forProperty('cv')->allowAllProperties();
......@@ -263,10 +262,9 @@ class JoblistController extends ActionController {
}
$targetFolder = $storage->getFolder('/Extension/JobApplication/');
$applicationFile = $storage->createFile($newName . '.txt', $sourceFolder);
$applicationFilePath = str_replace(
'/', '', $storage->getConfiguration()['basePath']
) . $applicationFile->getIdentifier();
$applicationFile = $storage->createFile($newName . '.csv', $sourceFolder);
$applicationFilePath = str_replace('/', '', $storage->getConfiguration()['basePath']) .
$applicationFile->getIdentifier();
$this->writeApplicationFile($applicationData, $applicationFilePath, $fileNames);
$storage->moveFolder($sourceFolder, $targetFolder);
......@@ -312,7 +310,7 @@ class JoblistController extends ActionController {
try {
$file = fopen($filePath, 'wb+');
fputcsv($file, $dataToInsertArr, '|');
fputcsv($file, $dataToInsertArr);
fclose($file);
} catch (\RuntimeException $exception) {
throw new \RuntimeException($exception->getMessage());
......
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