Skip to content
Snippets Groups Projects
Commit 4fa7ca7b authored by Sergiu-Lucian Petrica's avatar Sergiu-Lucian Petrica
Browse files

Merge branch 'master' of gitlab.sgalinski.de:typo3/sg_jobs

parents 858f6ee5 ef0bad6d
No related branches found
No related tags found
No related merge requests found
Showing
with 660 additions and 174 deletions
...@@ -47,7 +47,6 @@ class JoblistController extends AbstractAjaxController { ...@@ -47,7 +47,6 @@ class JoblistController extends AbstractAjaxController {
* Show all job offers and options to manage them * Show all job offers and options to manage them
* *
* @return void * @return void
* @throws \TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
*/ */
public function filterAction() { public function filterAction() {
......
...@@ -28,7 +28,6 @@ namespace SGalinski\SgJobs\Controller; ...@@ -28,7 +28,6 @@ namespace SGalinski\SgJobs\Controller;
use SGalinski\SgJobs\Domain\Model\JobApplication; use SGalinski\SgJobs\Domain\Model\JobApplication;
use SGalinski\SgMail\Service\MailTemplateService; use SGalinski\SgMail\Service\MailTemplateService;
use TYPO3\CMS\Core\Exception;
use TYPO3\CMS\Core\Resource\DuplicationBehavior; use TYPO3\CMS\Core\Resource\DuplicationBehavior;
use TYPO3\CMS\Core\Resource\ResourceFactory; use TYPO3\CMS\Core\Resource\ResourceFactory;
use TYPO3\CMS\Core\Utility\File\ExtendedFileUtility; use TYPO3\CMS\Core\Utility\File\ExtendedFileUtility;
...@@ -41,12 +40,6 @@ use TYPO3\CMS\Extbase\Object\ObjectManager; ...@@ -41,12 +40,6 @@ use TYPO3\CMS\Extbase\Object\ObjectManager;
* The joblist plugin controller * The joblist plugin controller
*/ */
class JoblistController extends ActionController { class JoblistController extends ActionController {
/**
* @var \TYPO3\CMS\Extbase\Object\ObjectManager
* @inject
*/
protected $objectManager;
/** /**
* @var \SGalinski\SgJobs\Domain\Repository\CompanyRepository * @var \SGalinski\SgJobs\Domain\Repository\CompanyRepository
* @inject * @inject
...@@ -67,7 +60,7 @@ class JoblistController extends ActionController { ...@@ -67,7 +60,7 @@ class JoblistController extends ActionController {
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
*/ */
public function indexAction() { public function indexAction() {
$recordPageId = $this->configurationManager->getConfiguration( $recordPageId = (int) $this->configurationManager->getConfiguration(
ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK
)['persistence']['storagePid']; )['persistence']['storagePid'];
...@@ -79,53 +72,49 @@ class JoblistController extends ActionController { ...@@ -79,53 +72,49 @@ class JoblistController extends ActionController {
} }
/** /**
* Renders the application form with an optional job
* *
* @param JobApplication $applyData
*/ */
public function applyFormAction() { public function applyFormAction(JobApplication $applyData = NULL) {
if ($this->request->getOriginalRequest()) { if ($this->request->getOriginalRequest()) {
$uploadedFiles = $this->request->getOriginalRequest()->getArguments()['uploadedFiles']; $uploadedFiles = $this->request->getOriginalRequest()->getArguments()['uploadedFiles'];
$this->view->assign('uploadedFiles', $uploadedFiles); $this->view->assign('uploadedFiles', $uploadedFiles);
} }
$jobId = $this->request->getArguments()['jobData']['uid']; $jobId = $this->request->getArguments()['jobData']['uid'];
if (!empty($jobId)) { if (!empty($jobId)) {
$jobData = $this->jobRepository->findByUid($jobId); $jobData = $this->jobRepository->findByUid($jobId);
$this->view->assign('job', $jobData); $this->view->assign('job', $jobData);
} }
$allowedMimeTypes = $this->settings['allowedMimeTypes']; $allowedMimeTypes = $this->settings['allowedMimeTypes'];
$this->view->assign('allowedMimeTypes', $allowedMimeTypes); $this->view->assign('allowedMimeTypes', $allowedMimeTypes);
$allowedFileExtensions = $this->settings['allowedFileExtensions']; $allowedFileExtensions = $this->settings['allowedFileExtensions'];
$this->view->assign('allowedFileExtensions', $allowedFileExtensions); $this->view->assign('allowedFileExtensions', $allowedFileExtensions);
$this->view->assign('jobApplication', $applyData);
} }
/** /**
* Saves the application send by the applyFormAction
*
* @param JobApplication $applyData * @param JobApplication $applyData
* @return void
* @throws \TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException
* @throws \TYPO3\CMS\Core\Resource\Exception\InvalidTargetFolderException
* @throws \TYPO3\CMS\Core\Resource\Exception\IllegalFileExtensionException
* @throws \TYPO3\CMS\Core\Exception
* @throws \RuntimeException
* @throws \BadFunctionCallException
* @throws \TYPO3\CMS\Core\Resource\Exception\InsufficientFolderWritePermissionsException
* @throws \TYPO3\CMS\Core\Resource\Exception\InsufficientFolderAccessPermissionsException
* @throws \TYPO3\CMS\Core\Resource\Exception\ExistingTargetFolderException
* @throws \Exception
* @throws \InvalidArgumentException
*/ */
public function applyAction(JobApplication $applyData) { public function applyAction(JobApplication $applyData) {
$this->submitApplicationFiles($GLOBALS['TSFE']->fe_user->id, $applyData);
// get an instance of the mail service
/** @var MailTemplateService $mailService */
$mailService = $this->objectManager->get(
MailTemplateService::class, 'application_mail', 'sg_jobs',
$this->getApplicationMailMarkers((array) $applyData)
);
$mailService->setIgnoreMailQueue(TRUE);
$mailService->setToAddresses($this->settings['applicationEmail']);
try { try {
$mailService->sendEmail(); $this->submitApplicationFiles($GLOBALS['TSFE']->fe_user->id, $applyData);
} catch (Exception $exception) {
/** @noinspection PhpMethodParametersCountMismatchInspection */
$mailService = $this->objectManager->get(
MailTemplateService::class, 'application_mail', 'sg_jobs',
$this->getApplicationMailMarkers((array) $applyData)
);
$mailService->setIgnoreMailQueue(TRUE);
$mailService->setToAddresses($this->settings['applicationEmail']);
$mailService->sendEmail();
} catch (\Exception $exception) {
// possible errors, because of wrong mails (maybe log that somewhere? Does this makes sense?)
} }
} }
...@@ -133,20 +122,20 @@ class JoblistController extends ActionController { ...@@ -133,20 +122,20 @@ class JoblistController extends ActionController {
* Pre-apply action setup, configures model-property mapping and handles file upload * Pre-apply action setup, configures model-property mapping and handles file upload
* *
* @return void * @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\InvalidArgumentNameException
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\NoSuchArgumentException * @throws \TYPO3\CMS\Extbase\Mvc\Exception\NoSuchArgumentException
* @throws \Exception * @throws \Exception
*/ */
protected function initializeApplyAction() { protected function initializeApplyAction() {
$this->handleFileUpload('coverLetter'); try {
$this->handleFileUpload('cv'); $this->handleFileUpload('coverLetter');
$this->handleFileUpload('certificates'); $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 = $this->arguments->getArgument('applyData')->getPropertyMappingConfiguration();
$propertyMappingConfiguration->forProperty('coverLetter')->allowAllProperties(); $propertyMappingConfiguration->forProperty('coverLetter')->allowAllProperties();
$propertyMappingConfiguration->forProperty('cv')->allowAllProperties(); $propertyMappingConfiguration->forProperty('cv')->allowAllProperties();
...@@ -157,31 +146,30 @@ class JoblistController extends ActionController { ...@@ -157,31 +146,30 @@ class JoblistController extends ActionController {
} }
/** /**
* Assign filter values
*
* @param int $rootPageId * @param int $rootPageId
*/ */
private function assignFilterValues($rootPageId) { private function assignFilterValues($rootPageId) {
// get all countries
$countries = $this->companyRepository->getAllCountries($rootPageId); $countries = $this->companyRepository->getAllCountries($rootPageId);
$this->view->assign('countries', $countries); $this->view->assign('countries', $countries);
// get all cities
$cities = $this->companyRepository->getAllCities($rootPageId); $cities = $this->companyRepository->getAllCities($rootPageId);
$this->view->assign('cities', $cities); $this->view->assign('cities', $cities);
// get all cities
$companies = $this->companyRepository->getAllCompanyNames($rootPageId); $companies = $this->companyRepository->getAllCompanyNames($rootPageId);
$this->view->assign('companies', $companies); $this->view->assign('companies', $companies);
// get all areas
$areas = $this->jobRepository->getAllAreas($rootPageId); $areas = $this->jobRepository->getAllAreas($rootPageId);
$this->view->assign('areas', $areas); $this->view->assign('areas', $areas);
// get all areas
$functions = $this->jobRepository->getAllFunctions($rootPageId); $functions = $this->jobRepository->getAllFunctions($rootPageId);
$this->view->assign('functions', $functions); $this->view->assign('functions', $functions);
} }
/** /**
* Returns the application mail markers
*
* @param array $applyData * @param array $applyData
* @return array * @return array
*/ */
...@@ -277,22 +265,26 @@ class JoblistController extends ActionController { ...@@ -277,22 +265,26 @@ class JoblistController extends ActionController {
} }
$targetFolder = $storage->getFolder('/Extension/JobApplication/'); $targetFolder = $storage->getFolder('/Extension/JobApplication/');
$applicationFile = $storage->createFile($newName . '.txt', $sourceFolder); $applicationFile = $storage->createFile($newName . '.csv', $sourceFolder);
$applicationFilePath = str_replace( $applicationFilePath = str_replace('/', '', $storage->getConfiguration()['basePath']) .
'/', '', $storage->getConfiguration()['basePath'] $applicationFile->getIdentifier();
) . $applicationFile->getIdentifier();
$this->writeApplicationFile($applicationData, $applicationFilePath, $fileNames); $this->writeApplicationFile($applicationData, $applicationFilePath, $fileNames);
$storage->moveFolder($sourceFolder, $targetFolder); $storage->moveFolder($sourceFolder, $targetFolder);
} }
/** /**
* Writes the application files
*
* @param JobApplication $data * @param JobApplication $data
* @param string $filePath * @param string $filePath
* @param array $fileNames
* @throws \RuntimeException * @throws \RuntimeException
*/ */
private function writeApplicationFile(JobApplication $data, $filePath, $fileNames) { private function writeApplicationFile(JobApplication $data, $filePath, $fileNames) {
$certificateNames = '';
$certificatesArr = []; $certificatesArr = [];
/** @var array[][] $fileNames */
if (isset($fileNames['certificates'])) { if (isset($fileNames['certificates'])) {
foreach ($fileNames['certificates'] as $certificateName) { foreach ($fileNames['certificates'] as $certificateName) {
$certificatesArr[] = $certificateName; $certificatesArr[] = $certificateName;
...@@ -321,10 +313,10 @@ class JoblistController extends ActionController { ...@@ -321,10 +313,10 @@ class JoblistController extends ActionController {
try { try {
$file = fopen($filePath, 'wb+'); $file = fopen($filePath, 'wb+');
fputcsv($file, $dataToInsertArr, '|'); fputcsv($file, $dataToInsertArr);
fclose($file); fclose($file);
} catch (\RuntimeException $ex) { } catch (\RuntimeException $exception) {
throw new \RuntimeException($ex->getMessage()); throw new \RuntimeException($exception->getMessage());
} }
} }
...@@ -338,6 +330,10 @@ class JoblistController extends ActionController { ...@@ -338,6 +330,10 @@ class JoblistController extends ActionController {
* @return void * @return void
*/ */
private function registerUploadField(array &$data, $namespace, $fieldName, $targetDirectory = '1:/_temp_/') { private function registerUploadField(array &$data, $namespace, $fieldName, $targetDirectory = '1:/_temp_/') {
if (!\is_array($_FILES[$namespace])) {
return;
}
if (!isset($data['upload'])) { if (!isset($data['upload'])) {
$data['upload'] = []; $data['upload'] = [];
} }
...@@ -383,9 +379,7 @@ class JoblistController extends ActionController { ...@@ -383,9 +379,7 @@ class JoblistController extends ActionController {
// Initializing: // Initializing:
/** @var \TYPO3\CMS\Core\Utility\File\ExtendedFileUtility $fileProcessor */ /** @var \TYPO3\CMS\Core\Utility\File\ExtendedFileUtility $fileProcessor */
$fileProcessor = GeneralUtility::makeInstance( $fileProcessor = GeneralUtility::makeInstance(ExtendedFileUtility::class);
ExtendedFileUtility::class
);
$fileProcessor->setActionPermissions(['addFile' => TRUE]); $fileProcessor->setActionPermissions(['addFile' => TRUE]);
$fileProcessor->setFileExtensionPermissions($this->settings['allowedFileExtensions'], ''); $fileProcessor->setFileExtensionPermissions($this->settings['allowedFileExtensions'], '');
...@@ -396,9 +390,8 @@ class JoblistController extends ActionController { ...@@ -396,9 +390,8 @@ class JoblistController extends ActionController {
$result = $fileProcessor->processData(); $result = $fileProcessor->processData();
$uploadedFiles = []; $uploadedFiles = [];
// Do whatever you want with $result (array of File objects) foreach ((array) $result['upload'] as $files) {
foreach ($result['upload'] as $files) { /** @var array $files */
/** @var \TYPO3\CMS\Core\Resource\File $file */
foreach ($files as $file) { foreach ($files as $file) {
$uploadedFiles[] = $file; $uploadedFiles[] = $file;
} }
......
...@@ -33,16 +33,11 @@ use TYPO3\CMS\Extbase\Persistence\ObjectStorage; ...@@ -33,16 +33,11 @@ use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
* The JobApplication model * The JobApplication model
*/ */
class JobApplication extends AbstractEntity { class JobApplication extends AbstractEntity {
/**
* @var string $jobTitle
* @validate NotEmpty
*/
protected $jobTitle = '';
/** /**
* @var string $jobTitle * @var \SGalinski\SgJobs\Domain\Model\Job $job
*/ */
protected $jobId = ''; protected $job = '';
/** /**
* @var string $gender * @var string $gender
...@@ -98,7 +93,7 @@ class JobApplication extends AbstractEntity { ...@@ -98,7 +93,7 @@ class JobApplication extends AbstractEntity {
protected $education = ''; protected $education = '';
/** /**
* @var string $birthDate * @var int $birthDate
*/ */
protected $birthDate = ''; protected $birthDate = '';
...@@ -146,31 +141,17 @@ class JobApplication extends AbstractEntity { ...@@ -146,31 +141,17 @@ class JobApplication extends AbstractEntity {
} }
/** /**
* @return string * @return \SGalinski\SgJobs\Domain\Model\Job
*/
public function getJobTitle() {
return $this->jobTitle;
}
/**
* @param string $jobTitle
*/ */
public function setJobTitle(string $jobTitle) { public function getJob() {
$this->jobTitle = $jobTitle; return $this->job;
} }
/** /**
* @return string * @param \SGalinski\SgJobs\Domain\Model\Job $job
*/ */
public function getJobId() { public function setJob(Job $job) {
return $this->jobId; $this->job = $job;
}
/**
* @param string $jobId
*/
public function setJobId(string $jobId) {
$this->jobId = $jobId;
} }
/** /**
...@@ -300,17 +281,17 @@ class JobApplication extends AbstractEntity { ...@@ -300,17 +281,17 @@ class JobApplication extends AbstractEntity {
} }
/** /**
* @return string * @return int
*/ */
public function getBirthDate() { public function getBirthDate() {
return $this->birthDate; return $this->birthDate;
} }
/** /**
* @param string $birthDate * @param int $birthDate
*/ */
public function setBirthDate(string $birthDate) { public function setBirthDate(string $birthDate) {
$this->birthDate = $birthDate; $this->birthDate = (int) $birthDate;
} }
/** /**
...@@ -365,7 +346,7 @@ class JobApplication extends AbstractEntity { ...@@ -365,7 +346,7 @@ class JobApplication extends AbstractEntity {
/** /**
* @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> $coverLetter * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> $coverLetter
*/ */
public function setCoverLetter(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $coverLetter) { public function setCoverLetter(ObjectStorage $coverLetter) {
$this->coverLetter = $coverLetter; $this->coverLetter = $coverLetter;
} }
...@@ -379,7 +360,7 @@ class JobApplication extends AbstractEntity { ...@@ -379,7 +360,7 @@ class JobApplication extends AbstractEntity {
/** /**
* @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> $cv * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> $cv
*/ */
public function setCV(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $cv) { public function setCV(ObjectStorage $cv) {
$this->cv = $cv; $this->cv = $cv;
} }
...@@ -393,7 +374,7 @@ class JobApplication extends AbstractEntity { ...@@ -393,7 +374,7 @@ class JobApplication extends AbstractEntity {
/** /**
* @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> $certificates * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> $certificates
*/ */
public function setCertificates(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $certificates) { public function setCertificates(ObjectStorage $certificates) {
$this->certificates = $certificates; $this->certificates = $certificates;
} }
......
...@@ -48,20 +48,20 @@ class CompanyRepository extends Repository { ...@@ -48,20 +48,20 @@ class CompanyRepository extends Repository {
} }
/** /**
* Returns all countries filtered by page id
*
* @param int $pageUid * @param int $pageUid
* @param array $filters
* @return mixed * @return mixed
*/ */
public function getAllCountries($pageUid, array $filters = []) { public function getAllCountries($pageUid) {
/** @var DatabaseConnection $db */ /** @var DatabaseConnection $db */
$db = $GLOBALS['TYPO3_DB']; $db = $GLOBALS['TYPO3_DB'];
$result = $db->exec_SELECTquery( $result = $db->exec_SELECTquery(
'country', 'tx_sgjobs_domain_model_company', 'pid = ' . $pageUid, 'country' 'country', 'tx_sgjobs_domain_model_company', 'pid = ' . (int) $pageUid, 'country'
)->fetch_all(); )->fetch_all();
$countryArray = []; $countryArray = [''];
$countryArray[] = ''; foreach ($result as $country) {
foreach($result as $country) {
$countryArray[$country[0]] = $country[0]; $countryArray[$country[0]] = $country[0];
} }
...@@ -69,6 +69,8 @@ class CompanyRepository extends Repository { ...@@ -69,6 +69,8 @@ class CompanyRepository extends Repository {
} }
/** /**
* Returns all filtered cities
*
* @param int $pageUid * @param int $pageUid
* @param array $filters * @param array $filters
* @return mixed * @return mixed
...@@ -80,14 +82,10 @@ class CompanyRepository extends Repository { ...@@ -80,14 +82,10 @@ class CompanyRepository extends Repository {
if ($filters['country'] && $filters['country'] !== 0) { if ($filters['country'] && $filters['country'] !== 0) {
$where .= ' AND country = ' . $db->quoteStr($filters['country'], self::TABLENAME); $where .= ' AND country = ' . $db->quoteStr($filters['country'], self::TABLENAME);
} }
$result = $db->exec_SELECTquery('city', self::TABLENAME, $where, 'city')->fetch_all();
$result = $db->exec_SELECTquery( $cityArray = [''];
'city', self::TABLENAME, $where, 'city' foreach ($result as $city) {
)->fetch_all();
$cityArray = [];
$cityArray[] = '';
foreach($result as $city) {
$cityArray[$city[0]] = $city[0]; $cityArray[$city[0]] = $city[0];
} }
...@@ -95,6 +93,8 @@ class CompanyRepository extends Repository { ...@@ -95,6 +93,8 @@ class CompanyRepository extends Repository {
} }
/** /**
* Returns all companies filtered by page id
*
* @param int $pageUid * @param int $pageUid
* @return mixed * @return mixed
*/ */
...@@ -102,12 +102,11 @@ class CompanyRepository extends Repository { ...@@ -102,12 +102,11 @@ class CompanyRepository extends Repository {
/** @var DatabaseConnection $db */ /** @var DatabaseConnection $db */
$db = $GLOBALS['TYPO3_DB']; $db = $GLOBALS['TYPO3_DB'];
$result = $db->exec_SELECTquery( $result = $db->exec_SELECTquery(
'name', 'tx_sgjobs_domain_model_company', 'pid = ' . $pageUid, 'name' 'name', 'tx_sgjobs_domain_model_company', 'pid = ' . (int) $pageUid, 'name'
)->fetch_all(); )->fetch_all();
$namesArray = []; $namesArray = [''];
$namesArray[] = ''; foreach ($result as $name) {
foreach($result as $name) {
$namesArray[$name[0]] = $name[0]; $namesArray[$name[0]] = $name[0];
} }
......
...@@ -36,7 +36,6 @@ use TYPO3\CMS\Extbase\Persistence\Repository; ...@@ -36,7 +36,6 @@ use TYPO3\CMS\Extbase\Persistence\Repository;
* Job Repository * Job Repository
*/ */
class JobRepository extends Repository { class JobRepository extends Repository {
const TABLENAME = 'tx_sgjobs_domain_model_job'; const TABLENAME = 'tx_sgjobs_domain_model_job';
/** /**
...@@ -73,14 +72,14 @@ class JobRepository extends Repository { ...@@ -73,14 +72,14 @@ class JobRepository extends Repository {
$constraints = []; $constraints = [];
if (isset($filters['locations']) && is_array($filters['locations']) && count($filters['locations'])) { if (isset($filters['locations']) && \is_array($filters['locations']) && \count($filters['locations'])) {
$locationConstraints = []; $locationConstraints = [];
foreach ($filters['locations'] as $location) { foreach ((array) $filters['locations'] as $location) {
if ((int) $location) { if ((int) $location) {
$locationConstraints[] = $query->contains('location', $location); $locationConstraints[] = $query->contains('location', $location);
} }
} }
if (count($locationConstraints)) { if (\count($locationConstraints)) {
$constraints[] = $query->logicalOr($locationConstraints); $constraints[] = $query->logicalOr($locationConstraints);
} }
} }
...@@ -94,9 +93,9 @@ class JobRepository extends Repository { ...@@ -94,9 +93,9 @@ class JobRepository extends Repository {
$constraints[] = $query->logicalOr($searchConstraints); $constraints[] = $query->logicalOr($searchConstraints);
} }
if (count($constraints) > 1) { if (\count($constraints) > 1) {
$query->matching($query->logicalAnd($constraints)); $query->matching($query->logicalAnd($constraints));
} elseif (count($constraints)) { } elseif (\count($constraints)) {
$query->matching($constraints[0]); $query->matching($constraints[0]);
} }
...@@ -104,6 +103,8 @@ class JobRepository extends Repository { ...@@ -104,6 +103,8 @@ class JobRepository extends Repository {
} }
/** /**
* Returns all areas filtered by page id
*
* @param int $pageUid * @param int $pageUid
* @return mixed * @return mixed
*/ */
...@@ -114,8 +115,7 @@ class JobRepository extends Repository { ...@@ -114,8 +115,7 @@ class JobRepository extends Repository {
'area', 'tx_sgjobs_domain_model_job', 'pid = ' . $pageUid, 'area' 'area', 'tx_sgjobs_domain_model_job', 'pid = ' . $pageUid, 'area'
)->fetch_all(); )->fetch_all();
$areaArray = []; $areaArray = [''];
$areaArray[] = '';
foreach ($result as $area) { foreach ($result as $area) {
$areaArray[$area[0]] = $area[0]; $areaArray[$area[0]] = $area[0];
} }
...@@ -124,6 +124,8 @@ class JobRepository extends Repository { ...@@ -124,6 +124,8 @@ class JobRepository extends Repository {
} }
/** /**
* Returns all function filtered by page id
*
* @param int $pageUid * @param int $pageUid
* @return mixed * @return mixed
*/ */
...@@ -134,8 +136,7 @@ class JobRepository extends Repository { ...@@ -134,8 +136,7 @@ class JobRepository extends Repository {
'job_function', 'tx_sgjobs_domain_model_job', 'pid = ' . $pageUid, 'job_function' 'job_function', 'tx_sgjobs_domain_model_job', 'pid = ' . $pageUid, 'job_function'
)->fetch_all(); )->fetch_all();
$functionArray = []; $functionArray = [''];
$functionArray[] = '';
foreach ($result as $function) { foreach ($result as $function) {
$functionArray[$function[0]] = $function[0]; $functionArray[$function[0]] = $function[0];
} }
...@@ -144,6 +145,8 @@ class JobRepository extends Repository { ...@@ -144,6 +145,8 @@ class JobRepository extends Repository {
} }
/** /**
* Returns a job filtered by company and page id
*
* @param int $pageUid * @param int $pageUid
* @param array $companyIds * @param array $companyIds
* @return QueryResultInterface * @return QueryResultInterface
...@@ -163,19 +166,19 @@ class JobRepository extends Repository { ...@@ -163,19 +166,19 @@ class JobRepository extends Repository {
$constraints = []; $constraints = [];
if (isset($companyIds) && is_array($companyIds) && count($companyIds)) { if (isset($companyIds) && \is_array($companyIds) && \count($companyIds)) {
$companyConstraints = []; $companyConstraints = [];
foreach ($companyIds as $companyId) { foreach ($companyIds as $companyId) {
if ((int) $companyId) { if ((int) $companyId) {
$companyConstraints[] = $query->equals('company', $companyId); $companyConstraints[] = $query->equals('company', $companyId);
} }
} }
if (count($companyConstraints)) { if (\count($companyConstraints)) {
$constraints[] = $query->logicalOr($companyConstraints); $constraints[] = $query->logicalOr($companyConstraints);
} }
} }
if (count($constraints)) { if (\count($constraints)) {
$query->matching($query->logicalAnd($constraints)); $query->matching($query->logicalAnd($constraints));
} }
......
...@@ -274,12 +274,12 @@ class FrontendFilterService { ...@@ -274,12 +274,12 @@ class FrontendFilterService {
) )
); );
$functions = $statement->execute()->fetchAll(); $jobFunctions = $statement->execute()->fetchAll();
$result = []; $result = [];
$result[0] = ''; $result[0] = '';
foreach ($functions as $function) { foreach ($jobFunctions as $jobFunction) {
$result[$function['function']] = $function['function']; $result[$jobFunction['job_function']] = $jobFunction['job_function'];
} }
return $result; return $result;
......
<?php <?php
namespace SGalinski\SgJobs\ViewHelpers; namespace SGalinski\SgJobs\ViewHelpers;
/*************************************************************** /***************************************************************
* Copyright notice * Copyright notice
* *
...@@ -25,6 +27,7 @@ namespace SGalinski\SgJobs\ViewHelpers; ...@@ -25,6 +27,7 @@ namespace SGalinski\SgJobs\ViewHelpers;
***************************************************************/ ***************************************************************/
use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Utility\LocalizationUtility; use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
/** /**
* View helper to render language labels to * View helper to render language labels to
* json array to be used in js applications. * json array to be used in js applications.
...@@ -46,7 +49,7 @@ class InlineLanguageLabelsViewHelper extends AbstractViewHelper { ...@@ -46,7 +49,7 @@ class InlineLanguageLabelsViewHelper extends AbstractViewHelper {
public function render($labels = '', $htmlEscape = FALSE) { public function render($labels = '', $htmlEscape = FALSE) {
$extensionName = $this->controllerContext->getRequest()->getControllerExtensionName(); $extensionName = $this->controllerContext->getRequest()->getControllerExtensionName();
$labels = GeneralUtility::trimExplode(',', $labels, TRUE); $labels = GeneralUtility::trimExplode(',', $labels, TRUE);
$languageArray = array(); $languageArray = [];
foreach ($labels as $key) { foreach ($labels as $key) {
$value = LocalizationUtility::translate($key, $extensionName); $value = LocalizationUtility::translate($key, $extensionName);
$languageArray[$key] = ($htmlEscape ? htmlentities($value) : $value); $languageArray[$key] = ($htmlEscape ? htmlentities($value) : $value);
......
<?php <?php
namespace SGalinski\SgJobs\ViewHelpers; namespace SGalinski\SgJobs\ViewHelpers;
/*************************************************************** /***************************************************************
......
...@@ -31,8 +31,8 @@ return [ ...@@ -31,8 +31,8 @@ return [
], ],
'types' => [ 'types' => [
'1' => [ '1' => [
'showitem' => '--palette--;;sysLanguageAndHidden,title, job_id, --palette--;;pallete_title_start,,--palette--;;pallete_area_function, 'showitem' => '--palette--;;sysLanguageAndHidden,title, job_id, --palette--;;palette_title_start,,--palette--;;palette_area_function,
--palette--;;pallete_location_contact, description, --div--; LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tca.qualification_tab, task, qualification, div;;richtext[*]:rte_transform[mode=ts], --palette--;;palette_location_contact, description, --div--; LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tca.qualification_tab, task, qualification, div;;richtext[*]:rte_transform[mode=ts],
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime', --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime',
], ],
], ],
...@@ -41,9 +41,9 @@ return [ ...@@ -41,9 +41,9 @@ return [
'showitem' => 'sys_language_uid;;;;1-1-1, l10n_diffsource, hidden;;1, ', 'showitem' => 'sys_language_uid;;;;1-1-1, l10n_diffsource, hidden;;1, ',
'canNotCollapse' => 1, 'canNotCollapse' => 1,
], ],
'pallete_title_start' => ['showitem' => 'start_date, alternative_start_date', 'canNotCollapse' => 1], 'palette_title_start' => ['showitem' => 'start_date, alternative_start_date', 'canNotCollapse' => 1],
'pallete_area_function' => ['showitem' => 'area, job_function', 'canNotCollapse' => 1], 'palette_area_function' => ['showitem' => 'area, job_function', 'canNotCollapse' => 1],
'pallete_location_contact' => ['showitem' => 'company, contact', 'canNotCollapse' => 1] 'palette_location_contact' => ['showitem' => 'company, contact', 'canNotCollapse' => 1]
], ],
'columns' => [ 'columns' => [
'sys_language_uid' => [ 'sys_language_uid' => [
......
<?php
return [
'ctrl' => [
'title' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job_application',
'label' => 'first_name, last_name',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'dividers2tabs' => TRUE,
'searchFields' => 'job_id, gender, first_name, last_name, street, city, zip, country, nationality, education, birth_date, phone, mobile, email, message, cover_letter, certificates, cv',
'versioningWS' => 2,
'versioning_followPages' => TRUE,
'origUid' => 't3_origuid',
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l10n_parent',
'transOrigDiffSourceField' => 'l10n_diffsource',
'delete' => 'deleted',
'enablecolumns' => [
'disabled' => 'hidden',
'starttime' => 'starttime',
'endtime' => 'endtime',
],
'sortby' => 'sorting',
'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('sg_jobs') .
'Resources/Public/Icons/tx_sgjobs_domain_model_job.svg'
],
'interface' => [
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, pid, job_id, area, job_function, start_date, alternative_start_date,
company, task, qualification, description, contact',
],
'types' => [
'1' => [
'showitem' => '--palette--;;sysLanguageAndHidden,job_id, gender, first_name, last_name, street, city, zip,
country, nationality, education, birth_date, phone, mobile, email, message, cover_letter, certificates, cv,
div;;richtext[*]:rte_transform[mode=ts],
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime',
],
],
'palettes' => [
'sysLanguageAndHidden' => [
'showitem' => 'sys_language_uid;;;;1-1-1, l10n_diffsource, hidden;;1, ',
'canNotCollapse' => 1,
]
],
'columns' => [
'sys_language_uid' => [
'exclude' => 1,
'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xml:LGL.language',
'config' => [
'type' => 'select',
'special' => 'languages',
],
],
'l10n_parent' => [
'displayCond' => 'FIELD:sys_language_uid:>:0',
'exclude' => 1,
'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xml:LGL.l18n_parent',
'config' => [
'type' => 'select',
'items' => [
['', 0],
],
'foreign_table' => 'tx_sgjobs_domain_model_job_application',
'foreign_table_where' => 'AND tx_sgjobs_domain_model_job_application.pid=###CURRENT_PID### AND tx_sgjobs_domain_model_job_application.sys_language_uid IN (-1,0)',
],
],
'l10n_diffsource' => [
'config' => [
'type' => 'passthrough',
],
],
't3ver_label' => [
'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xml:LGL.versionLabel',
'config' => [
'type' => 'input',
'size' => 30,
'max' => 255,
]
],
'pid' => [
'exclude' => 0,
'label' => 'PID',
'config' => [
'type' => 'none',
]
],
'hidden' => [
'exclude' => 1,
'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xml:LGL.hidden',
'config' => [
'type' => 'check',
],
],
'starttime' => [
'exclude' => 1,
'l10n_mode' => 'mergeIfNotBlank',
'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xml:LGL.starttime',
'config' => [
'type' => 'input',
'size' => 13,
'max' => 20,
'eval' => 'datetime',
'checkbox' => 0,
'default' => 0,
'range' => [
'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
],
],
],
'endtime' => [
'exclude' => 1,
'l10n_mode' => 'mergeIfNotBlank',
'label' => 'LLL:EXT:lang/Resources/Private/Language/locallang_general.xml:LGL.endtime',
'config' => [
'type' => 'input',
'size' => 13,
'max' => 20,
'eval' => 'datetime',
'checkbox' => 0,
'default' => 0,
'range' => [
'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
],
],
],
'job' => [
'exclude' => 0,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job_application.job',
'config' => [
'type' => 'select',
'eval' => 'required',
'renderType' => 'selectSingle',
'internal_type' => 'db',
'foreign_table' => 'tx_sgjobs_domain_model_job',
'size' => 1,
'maxitems' => 1,
'multiple' => 0,
'fieldControl' => [
'editPopup' => [
'disabled' => FALSE,
],
'addRecord' => [
'disabled' => FALSE,
]
],
]
],
'gender' => [
'exclude' => 0,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job_application.gender',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim, required'
],
],
'first_name' => [
'exclude' => 0,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job_application.first_name',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim, required'
],
],
'last_name' => [
'exclude' => 0,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job_application.last_name',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim, required'
],
],
'street' => [
'exclude' => 0,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job_application.street',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim, required'
],
],
'city' => [
'exclude' => 0,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job_application.city',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim, required'
],
],
'zip' => [
'exclude' => 0,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job_application.zip',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim, required'
],
],
'country' => [
'exclude' => 0,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job_application.country',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim, required'
],
],
'nationality' => [
'exclude' => 0,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job_application.nationality',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim, required'
],
],
'education' => [
'exclude' => 0,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job_application.education',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim, required'
],
],
'birth_date' => [
'exclude' => 1,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job_application.birth_date',
'config' => [
'type' => 'input',
'size' => 13,
'max' => 20,
'eval' => 'date, required',
'checkbox' => 0,
'range' => [
'lower' => mktime(date('m'), date('d'), date('Y'))
],
],
],
'phone' => [
'exclude' => 0,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job_application.phone',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim, required'
],
],
'mobile' => [
'exclude' => 0,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job_application.mobile',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim, required'
],
],
'email' => [
'exclude' => 0,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job_application.email',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim, required'
],
],
'message' => [
'exclude' => 0,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job_application.message',
'config' => [
'type' => 'text',
'cols' => 40,
'rows' => 10,
'eval' => 'required'
],
],
'cover_letter' => [
'exclude' => 0,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job_application.cover_letter',
'config' => [
'type' => 'group',
'internal_type' => 'file',
'allowed' => 'pdf, doc',
'size' => 1,
'uploadfolder' => 'uploads/tx_sgjobs/',
'max_size' => 2000,
'eval' => 'required'
],
],
'certificates' => [
'exclude' => 0,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job_application.certificates',
'config' => [
'type' => 'group',
'internal_type' => 'file',
'allowed' => 'pdf, doc',
'size' => 3,
'uploadfolder' => 'uploads/tx_sgjobs/',
'max_size' => 2000,
'eval' => 'required'
],
],
'cv' => [
'exclude' => 0,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job_application.cv',
'config' => [
'type' => 'group',
'internal_type' => 'file',
'allowed' => 'pdf, doc',
'size' => 1,
'uploadfolder' => 'uploads/tx_sgjobs/',
'max_size' => 2000,
'eval' => 'required'
],
]
],
];
\ No newline at end of file
...@@ -101,18 +101,14 @@ ...@@ -101,18 +101,14 @@
<source>Job offer</source> <source>Job offer</source>
<target>Stellenanzeige</target> <target>Stellenanzeige</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job.plugin_options" approved="yes"> <trans-unit id="tx_sgjobs_domain_model_job.alternative_start_date" approved="yes">
<source>Joblist plugin options</source> <source>Alternative start date</source>
<target>Joblist Plugin-Optionen</target> <target>Alternativer Eintrittszeitpunkt</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job.application_form_page" approved="yes"> <trans-unit id="tx_sgjobs_domain_model_job.application_form_page" approved="yes">
<source>Page containing the application form</source> <source>Page containing the application form</source>
<target>Seite, die das Bewerbungs-Formular enthält</target> <target>Seite, die das Bewerbungs-Formular enthält</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job.alternative_start_date" approved="yes">
<source>Alternative start date</source>
<target>Alternativer Eintrittszeitpunkt</target>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job.area" approved="yes"> <trans-unit id="tx_sgjobs_domain_model_job.area" approved="yes">
<source>Area</source> <source>Area</source>
<target>Bereich</target> <target>Bereich</target>
...@@ -137,6 +133,10 @@ ...@@ -137,6 +133,10 @@
<source>Location</source> <source>Location</source>
<target>Arbeitsort</target> <target>Arbeitsort</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job.plugin_options" approved="yes">
<source>Joblist plugin options</source>
<target>Joblist Plugin-Optionen</target>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job.qualification" approved="yes"> <trans-unit id="tx_sgjobs_domain_model_job.qualification" approved="yes">
<source>Qualification</source> <source>Qualification</source>
<target>Qualifikation</target> <target>Qualifikation</target>
...@@ -161,6 +161,82 @@ ...@@ -161,6 +161,82 @@
<source>Job title</source> <source>Job title</source>
<target>Stellenbezeichnung</target> <target>Stellenbezeichnung</target>
</trans-unit> </trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application" approved="yes">
<source>Job application</source>
<target>Bewerbung</target>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.birth_date" approved="yes">
<source>Birthdate</source>
<target>Geburtsdatum</target>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.certificates" approved="yes">
<source>Certificates</source>
<target>Zeugnisse</target>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.city" approved="yes">
<source>City</source>
<target>Ort</target>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.country" approved="yes">
<source>Country</source>
<target>Land</target>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.cover_letter" approved="yes">
<source>Cover letter</source>
<target>Motivationsschreiben</target>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.cv" approved="yes">
<source>CV</source>
<target>Lebenslauf</target>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.education" approved="yes">
<source>Education</source>
<target>Höchster Abschluss</target>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.email" approved="yes">
<source>Email</source>
<target>E-Mail</target>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.first_name" approved="yes">
<source>First name</source>
<target>Vorname</target>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.gender" approved="yes">
<source>Gender</source>
<target>Geschlecht</target>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.job" approved="yes">
<source>Job</source>
<target>Stelle</target>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.last_name" approved="yes">
<source>Last name</source>
<target>Nachname</target>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.message" approved="yes">
<source>Message</source>
<target>Nachricht</target>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.mobile" approved="yes">
<source>Mobile</source>
<target>Mobil</target>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.nationality" approved="yes">
<source>Nationality</source>
<target>Nationalität</target>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.phone" approved="yes">
<source>Phone</source>
<target>Telefon</target>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.street" approved="yes">
<source>Street</source>
<target>Strasse</target>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.zip" approved="yes">
<source>Zip</source>
<target>PLZ</target>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_location" approved="yes"> <trans-unit id="tx_sgjobs_domain_model_location" approved="yes">
<source>Location</source> <source>Location</source>
<target>Arbeitsort</target> <target>Arbeitsort</target>
......
...@@ -78,15 +78,12 @@ ...@@ -78,15 +78,12 @@
<trans-unit id="tx_sgjobs_domain_model_job"> <trans-unit id="tx_sgjobs_domain_model_job">
<source>Job offer</source> <source>Job offer</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job.plugin_options"> <trans-unit id="tx_sgjobs_domain_model_job.alternative_start_date">
<source>Joblist plugin options</source> <source>Alternative start date</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job.application_form_page"> <trans-unit id="tx_sgjobs_domain_model_job.application_form_page">
<source>Page containing the application form</source> <source>Page containing the application form</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job.alternative_start_date">
<source>Alternative start date</source>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job.area"> <trans-unit id="tx_sgjobs_domain_model_job.area">
<source>Area</source> <source>Area</source>
</trans-unit> </trans-unit>
...@@ -102,9 +99,15 @@ ...@@ -102,9 +99,15 @@
<trans-unit id="tx_sgjobs_domain_model_job.function"> <trans-unit id="tx_sgjobs_domain_model_job.function">
<source>Function</source> <source>Function</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job.jobId">
<source>Job ID</source>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job.location"> <trans-unit id="tx_sgjobs_domain_model_job.location">
<source>Location</source> <source>Location</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job.plugin_options">
<source>Joblist plugin options</source>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job.qualification"> <trans-unit id="tx_sgjobs_domain_model_job.qualification">
<source>Qualification</source> <source>Qualification</source>
</trans-unit> </trans-unit>
...@@ -123,8 +126,62 @@ ...@@ -123,8 +126,62 @@
<trans-unit id="tx_sgjobs_domain_model_job.title"> <trans-unit id="tx_sgjobs_domain_model_job.title">
<source>Job title</source> <source>Job title</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job.jobId"> <trans-unit id="tx_sgjobs_domain_model_job_application">
<source>Job ID</source> <source>Job application</source>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.birth_date">
<source>Birthdate</source>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.certificates">
<source>Certificates</source>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.city">
<source>City</source>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.country">
<source>Country</source>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.cover_letter">
<source>Cover letter</source>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.cv">
<source>CV</source>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.education">
<source>Education</source>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.email">
<source>Email</source>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.first_name">
<source>First name</source>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.gender">
<source>Gender</source>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.job">
<source>Job</source>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.last_name">
<source>Last name</source>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.message">
<source>Message</source>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.mobile">
<source>Mobile</source>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.nationality">
<source>Nationality</source>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.phone">
<source>Phone</source>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.street">
<source>Street</source>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_job_application.zip">
<source>Zip</source>
</trans-unit> </trans-unit>
<trans-unit id="tx_sgjobs_domain_model_location"> <trans-unit id="tx_sgjobs_domain_model_location">
<source>Location</source> <source>Location</source>
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<f:translate key="frontend.function" /> <f:translate key="frontend.job_function" />
</td> </td>
<td> <td>
{job.function} {job.function}
......
...@@ -2,19 +2,14 @@ ...@@ -2,19 +2,14 @@
<f:section name="main"> <f:section name="main">
<f:form action="apply" controller="Joblist" method="post" objectName="applyData" object="{applyData}" enctype="multipart/form-data"> <f:form action="apply" controller="Joblist" method="post" objectName="applyData" object="{applyData}" enctype="multipart/form-data">
<f:form.hidden value="{job.jobId}" property="jobId" /> <f:form.hidden value="{job.uid}" property="jobId" />
<label for="apply-jobTitle"><f:translate key="frontend.apply.title" /></label>
<f:form.textfield property="jobTitle" id="apply-jobTitle" data="{}" class="" value="{job.title}" />
<f:form.validationResults for="applyData.jobTitle">
<f:for each="{validationResults.errors}" as="error">
<div class="sg-jobs-validation-error">
{error.message}
</div>
</f:for>
</f:form.validationResults>
<br />
<label for="apply-gender"><f:translate key="frontend.apply.gender" /></label> <label for="apply-gender"><f:translate key="frontend.apply.gender" /></label>
<<<<<<< HEAD
<f:form.select property="gender" id="apply-gender" data="{}" class="" options="{Male: 'Male', Female: 'Female'}" /> <f:form.select property="gender" id="apply-gender" data="{}" class="" options="{Male: 'Male', Female: 'Female'}" />
=======
<f:form.select property="gender" id="apply-gender" class="" options="{None: '', Male: 'Male', Female: 'Female'}" />
>>>>>>> ef0bad6dbd9fd1503cfce001734cb83f277d8404
<f:form.validationResults for="applyData.gender"> <f:form.validationResults for="applyData.gender">
<f:for each="{validationResults.errors}" as="error"> <f:for each="{validationResults.errors}" as="error">
<div class="sg-jobs-validation-error"> <div class="sg-jobs-validation-error">
...@@ -24,7 +19,7 @@ ...@@ -24,7 +19,7 @@
</f:form.validationResults> </f:form.validationResults>
<br /> <br />
<label for="apply-firstName"><f:translate key="frontend.apply.first_name" /></label> <label for="apply-firstName"><f:translate key="frontend.apply.first_name" /></label>
<f:form.textfield property="firstName" id="apply-firstName" data="{}" class="" /> <f:form.textfield property="firstName" id="apply-firstName" class="" />
<f:form.validationResults for="applyData.firstName"> <f:form.validationResults for="applyData.firstName">
<f:for each="{validationResults.errors}" as="error"> <f:for each="{validationResults.errors}" as="error">
<div class="sg-jobs-validation-error"> <div class="sg-jobs-validation-error">
...@@ -34,7 +29,7 @@ ...@@ -34,7 +29,7 @@
</f:form.validationResults> </f:form.validationResults>
<br /> <br />
<label for="apply-lastName"><f:translate key="frontend.apply.last_name" /></label> <label for="apply-lastName"><f:translate key="frontend.apply.last_name" /></label>
<f:form.textfield property="lastName" id="apply-lastName" data="{}" class="" /> <f:form.textfield property="lastName" id="apply-lastName" class="" />
<f:form.validationResults for="applyData.lastName"> <f:form.validationResults for="applyData.lastName">
<f:for each="{validationResults.errors}" as="error"> <f:for each="{validationResults.errors}" as="error">
<div class="sg-jobs-validation-error"> <div class="sg-jobs-validation-error">
...@@ -44,7 +39,7 @@ ...@@ -44,7 +39,7 @@
</f:form.validationResults> </f:form.validationResults>
<br /> <br />
<label for="apply-street"><f:translate key="frontend.apply.street" /></label> <label for="apply-street"><f:translate key="frontend.apply.street" /></label>
<f:form.textfield property="street" id="apply-street" data="{}" class="" /> <f:form.textfield property="street" id="apply-street" class="" />
<f:form.validationResults for="applyData.street"> <f:form.validationResults for="applyData.street">
<f:for each="{validationResults.errors}" as="error"> <f:for each="{validationResults.errors}" as="error">
<div class="sg-jobs-validation-error"> <div class="sg-jobs-validation-error">
...@@ -54,7 +49,7 @@ ...@@ -54,7 +49,7 @@
</f:form.validationResults> </f:form.validationResults>
<br /> <br />
<label for="apply-city"><f:translate key="frontend.apply.city" /></label> <label for="apply-city"><f:translate key="frontend.apply.city" /></label>
<f:form.textfield property="city" id="apply-city" data="{}" class="" /> <f:form.textfield property="city" id="apply-city" class="" />
<f:form.validationResults for="applyData.city"> <f:form.validationResults for="applyData.city">
<f:for each="{validationResults.errors}" as="error"> <f:for each="{validationResults.errors}" as="error">
<div class="sg-jobs-validation-error"> <div class="sg-jobs-validation-error">
...@@ -64,7 +59,7 @@ ...@@ -64,7 +59,7 @@
</f:form.validationResults> </f:form.validationResults>
<br /> <br />
<label for="apply-zip"><f:translate key="frontend.apply.zip" /></label> <label for="apply-zip"><f:translate key="frontend.apply.zip" /></label>
<f:form.textfield property="zip" id="apply-zip" data="{}" class="" /> <f:form.textfield property="zip" id="apply-zip" class="" />
<f:form.validationResults for="applyData.zip"> <f:form.validationResults for="applyData.zip">
<f:for each="{validationResults.errors}" as="error"> <f:for each="{validationResults.errors}" as="error">
<div class="sg-jobs-validation-error"> <div class="sg-jobs-validation-error">
...@@ -72,9 +67,9 @@ ...@@ -72,9 +67,9 @@
</div> </div>
</f:for> </f:for>
</f:form.validationResults> </f:form.validationResults>
<br/> <br />
<label for="apply-country"><f:translate key="frontend.apply.country" /></label> <label for="apply-country"><f:translate key="frontend.apply.country" /></label>
<f:form.textfield property="country" id="apply-country" data="{}" class="" /> <f:form.textfield property="country" id="apply-country" class="" />
<f:form.validationResults for="applyData.country"> <f:form.validationResults for="applyData.country">
<f:for each="{validationResults.errors}" as="error"> <f:for each="{validationResults.errors}" as="error">
<div class="sg-jobs-validation-error"> <div class="sg-jobs-validation-error">
...@@ -84,7 +79,7 @@ ...@@ -84,7 +79,7 @@
</f:form.validationResults> </f:form.validationResults>
<br /> <br />
<label for="apply-nationality"><f:translate key="frontend.apply.nationality" /></label> <label for="apply-nationality"><f:translate key="frontend.apply.nationality" /></label>
<f:form.textfield property="nationality" id="apply-nationality" data="{}" class="" /> <f:form.textfield property="nationality" id="apply-nationality" class="" />
<f:form.validationResults for="applyData.nationality"> <f:form.validationResults for="applyData.nationality">
<f:for each="{validationResults.errors}" as="error"> <f:for each="{validationResults.errors}" as="error">
<div class="sg-jobs-validation-error"> <div class="sg-jobs-validation-error">
...@@ -92,9 +87,9 @@ ...@@ -92,9 +87,9 @@
</div> </div>
</f:for> </f:for>
</f:form.validationResults> </f:form.validationResults>
<br/> <br />
<label for="apply-education"><f:translate key="frontend.apply.education" /></label> <label for="apply-education"><f:translate key="frontend.apply.education" /></label>
<f:form.textfield property="education" id="apply-education" data="{}" class="" /> <f:form.textfield property="education" id="apply-education" class="" />
<f:form.validationResults for="applyData.education"> <f:form.validationResults for="applyData.education">
<f:for each="{validationResults.errors}" as="error"> <f:for each="{validationResults.errors}" as="error">
<div class="sg-jobs-validation-error"> <div class="sg-jobs-validation-error">
...@@ -102,9 +97,9 @@ ...@@ -102,9 +97,9 @@
</div> </div>
</f:for> </f:for>
</f:form.validationResults> </f:form.validationResults>
<br/> <br />
<label for="apply-birthDate"><f:translate key="frontend.apply.birthDate" /></label> <label for="apply-birthDate"><f:translate key="frontend.apply.birthDate" /></label>
<f:form.textfield property="birthDate" id="apply-birthDate" data="{}" class="" /> <f:form.textfield property="birthDate" id="apply-birthDate" class="" />
<f:form.validationResults for="applyData.birthDate"> <f:form.validationResults for="applyData.birthDate">
<f:for each="{validationResults.errors}" as="error"> <f:for each="{validationResults.errors}" as="error">
<div class="sg-jobs-validation-error"> <div class="sg-jobs-validation-error">
...@@ -114,7 +109,7 @@ ...@@ -114,7 +109,7 @@
</f:form.validationResults> </f:form.validationResults>
<br /> <br />
<label for="apply-phone"><f:translate key="frontend.apply.phone" /></label> <label for="apply-phone"><f:translate key="frontend.apply.phone" /></label>
<f:form.textfield property="phone" id="apply-phone" data="{}" class="" /> <f:form.textfield property="phone" id="apply-phone" class="" />
<f:form.validationResults for="applyData.phone"> <f:form.validationResults for="applyData.phone">
<f:for each="{validationResults.errors}" as="error"> <f:for each="{validationResults.errors}" as="error">
<div class="sg-jobs-validation-error"> <div class="sg-jobs-validation-error">
...@@ -124,7 +119,7 @@ ...@@ -124,7 +119,7 @@
</f:form.validationResults> </f:form.validationResults>
<br /> <br />
<label for="apply-mobile"><f:translate key="frontend.apply.mobile" /></label> <label for="apply-mobile"><f:translate key="frontend.apply.mobile" /></label>
<f:form.textfield property="mobile" id="apply-mobile" data="{}" class="" /> <f:form.textfield property="mobile" id="apply-mobile" class="" />
<f:form.validationResults for="applyData.mobile"> <f:form.validationResults for="applyData.mobile">
<f:for each="{validationResults.errors}" as="error"> <f:for each="{validationResults.errors}" as="error">
<div class="sg-jobs-validation-error"> <div class="sg-jobs-validation-error">
...@@ -191,7 +186,7 @@ ...@@ -191,7 +186,7 @@
</f:for> </f:for>
<br /> <br />
<label for="apply-message"><f:translate key="frontend.apply.message" /></label> <label for="apply-message"><f:translate key="frontend.apply.message" /></label>
<f:form.textarea property="message" id="apply-message" data="{}" class="" /> <f:form.textarea property="message" id="apply-message" class="" />
<br /> <br />
<f:form.submit value="{f:translate(key:'frontend.applyNow')}" /> <f:form.submit value="{f:translate(key:'frontend.applyNow')}" />
</f:form> </f:form>
......
...@@ -23,6 +23,7 @@ if (TYPO3_MODE === 'BE') { ...@@ -23,6 +23,7 @@ if (TYPO3_MODE === 'BE') {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_sgjobs_domain_model_job'); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_sgjobs_domain_model_job');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_sgjobs_domain_model_contact'); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_sgjobs_domain_model_contact');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_sgjobs_domain_model_company'); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_sgjobs_domain_model_company');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_sgjobs_domain_model_job_application');
// Register backend modules // Register backend modules
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule( \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
......
...@@ -137,3 +137,60 @@ CREATE TABLE tx_sgjobs_domain_model_contact ( ...@@ -137,3 +137,60 @@ CREATE TABLE tx_sgjobs_domain_model_contact (
KEY t3ver_oid (t3ver_oid,t3ver_wsid), KEY t3ver_oid (t3ver_oid,t3ver_wsid),
KEY language (l10n_parent,sys_language_uid) KEY language (l10n_parent,sys_language_uid)
); );
CREATE TABLE tx_sgjobs_domain_model_job_application (
uid int(11) NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL,
-- Custom fields
job int(11) unsigned DEFAULT '0' NOT NULL,
gender varchar(30) DEFAULT '' NOT NULL,
first_name text DEFAULT '' NOT NULL,
last_name text DEFAULT '' NOT NULL,
street text DEFAULT '' NOT NULL,
city text DEFAULT '' NOT NULL,
zip text DEFAULT '' NOT NULL,
country text DEFAULT '' NOT NULL,
nationality text DEFAULT '' NOT NULL,
education text DEFAULT '' NOT NULL,
birth_date int(11) unsigned DEFAULT '0' NOT NULL,
phone text DEFAULT '' NOT NULL,
mobile text DEFAULT '' NOT NULL,
email text DEFAULT '' NOT NULL,
message text DEFAULT '' NOT NULL,
cover_letter int(11) unsigned DEFAULT '0' NOT NULL,
certificates int(11) unsigned DEFAULT '0' NOT NULL,
cv int(11) unsigned DEFAULT '0' NOT NULL,
-- TYPO3 fields
sorting int(11) unsigned DEFAULT '0' NOT NULL,
starttime int(11) unsigned DEFAULT '0' NOT NULL,
endtime int(11) unsigned DEFAULT '0' NOT NULL,
tstamp int(11) unsigned DEFAULT '0' NOT NULL,
crdate int(11) unsigned DEFAULT '0' NOT NULL,
cruser_id int(11) unsigned DEFAULT '0' NOT NULL,
deleted tinyint(4) unsigned DEFAULT '0' NOT NULL,
hidden tinyint(4) unsigned DEFAULT '0' NOT NULL,
-- TYPO3 workspace fields
t3ver_oid int(11) DEFAULT '0' NOT NULL,
t3ver_id int(11) DEFAULT '0' NOT NULL,
t3ver_wsid int(11) DEFAULT '0' NOT NULL,
t3ver_label varchar(255) DEFAULT '' NOT NULL,
t3ver_state tinyint(4) DEFAULT '0' NOT NULL,
t3ver_stage int(11) DEFAULT '0' NOT NULL,
t3ver_count int(11) DEFAULT '0' NOT NULL,
t3ver_tstamp int(11) DEFAULT '0' NOT NULL,
t3ver_move_id int(11) DEFAULT '0' NOT NULL,
t3_origuid int(11) DEFAULT '0' NOT NULL,
-- TYPO3 multi language fields
sys_language_uid int(11) DEFAULT '0' NOT NULL,
l10n_parent int(11) DEFAULT '0' NOT NULL,
l10n_diffsource mediumblob,
PRIMARY KEY (uid),
KEY parent (pid),
KEY t3ver_oid (t3ver_oid,t3ver_wsid),
KEY language (l10n_parent,sys_language_uid)
);
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