From 864656c09c7daa2218d065cab06683b26beec4ec Mon Sep 17 00:00:00 2001 From: Torsten Oppermann <torsten@sgalinski.de> Date: Mon, 11 Dec 2017 14:00:57 +0100 Subject: [PATCH] [TASK] Correcting the job id in application model --- Classes/Domain/Model/JobApplication.php | 19 ++++++++------ ...tx_sgjobs_domain_model_job_application.php | 25 +++++-------------- ext_tables.sql | 2 +- 3 files changed, 18 insertions(+), 28 deletions(-) diff --git a/Classes/Domain/Model/JobApplication.php b/Classes/Domain/Model/JobApplication.php index 82b6d27c..48bf133e 100644 --- a/Classes/Domain/Model/JobApplication.php +++ b/Classes/Domain/Model/JobApplication.php @@ -35,9 +35,12 @@ use TYPO3\CMS\Extbase\Persistence\ObjectStorage; class JobApplication extends AbstractEntity { /** - * @var \SGalinski\SgJobs\Domain\Model\Job $job + * this is a sharepoint id. nothing from the db + * + * @var string $jobId + * @validate NotEmpty */ - protected $job = ''; + protected $jobId = ''; /** * @var string $gender @@ -141,17 +144,17 @@ class JobApplication extends AbstractEntity { } /** - * @return \SGalinski\SgJobs\Domain\Model\Job + * @return string */ - public function getJob() { - return $this->job; + public function getJobId() { + return $this->jobId; } /** - * @param \SGalinski\SgJobs\Domain\Model\Job $job + * @param string $jobId */ - public function setJob(Job $job) { - $this->job = $job; + public function setJob($jobId) { + $this->jobId = $jobId; } /** diff --git a/Configuration/TCA/tx_sgjobs_domain_model_job_application.php b/Configuration/TCA/tx_sgjobs_domain_model_job_application.php index 45409745..40cdb3ab 100644 --- a/Configuration/TCA/tx_sgjobs_domain_model_job_application.php +++ b/Configuration/TCA/tx_sgjobs_domain_model_job_application.php @@ -32,7 +32,7 @@ return [ '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, + country, nationality, education, birth_date, phone, mobile, email, message, cover_letter, cv, certificates, div;;richtext[*]:rte_transform[mode=ts], --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime', ], @@ -124,27 +124,14 @@ return [ ], ], ], - 'job' => [ + 'job_id' => [ '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, - ] - ], - ] + 'type' => 'input', + 'size' => 30, + 'eval' => 'trim, required' + ], ], 'gender' => [ 'exclude' => 0, diff --git a/ext_tables.sql b/ext_tables.sql index 683d4cb7..63c423dd 100644 --- a/ext_tables.sql +++ b/ext_tables.sql @@ -143,7 +143,7 @@ CREATE TABLE tx_sgjobs_domain_model_job_application ( pid int(11) DEFAULT '0' NOT NULL, -- Custom fields - job int(11) unsigned DEFAULT '0' NOT NULL, + job_id text DEFAULT '' NOT NULL, gender varchar(30) DEFAULT '' NOT NULL, first_name text DEFAULT '' NOT NULL, last_name text DEFAULT '' NOT NULL, -- GitLab