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

Merge branch 'version_1_5' into 'master'

Version 1 5

See merge request !3
parents fece1eee ea9ac8e7
No related branches found
Tags 1.5.0
1 merge request!3Version 1 5
Showing
with 216 additions and 76 deletions
......@@ -156,12 +156,18 @@ class JoblistController extends ActionController {
$this->view->assign('folderName', $folderName);
$job = NULL;
if (!$uid !== NULL) {
/** @var Job $job */
$job = $this->jobRepository->findByUid($uid);
if ($job) {
$GLOBALS['TSFE']->page['titlebyextension'] = $job->getTitle();
$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);
}
......@@ -290,16 +296,14 @@ class JoblistController extends ActionController {
if ($job !== NULL) {
/** @var Contact $contact */
$contact = $job->getContact();
if ($contact === NULL) {
$contact = $this->contactRepository->findByUid((int) $this->settings['defaultContactId']);
}
} else {
$contact = $this->contactRepository->findByUid((int) $this->settings['defaultContactId']);
}
if ($contact !== NULL) {
$mailService->setToAddresses($contact->getEmail());
} else {
$mailService->setToAddresses($applyData->getCompany()->getContact()->getEmail());
}
$mailService->setMarkers(['application' => $applyData]);
$mailService->setIgnoreMailQueue(TRUE);
......
......@@ -57,6 +57,11 @@ class Company extends AbstractEntity {
*/
protected $description = '';
/**
* @var \SGalinski\SgJobs\Domain\Model\Contact $contact
*/
protected $contact;
/**
* @return string
*/
......@@ -126,4 +131,18 @@ class Company extends AbstractEntity {
public function setStreet(string $street) {
$this->street = $street;
}
/**
* @return \SGalinski\SgJobs\Domain\Model\Contact
*/
public function getContact() {
return $this->contact;
}
/**
* @param \SGalinski\SgJobs\Domain\Model\Contact $contact
*/
public function setContact(Contact $contact) {
$this->contact = $contact;
}
}
......@@ -42,11 +42,6 @@ class Contact extends AbstractEntity {
*/
protected $lastName = '';
/**
* @var string $company
*/
protected $company = '';
/**
* @var string $city
*/
......@@ -67,6 +62,11 @@ class Contact extends AbstractEntity {
*/
protected $phone = '';
/**
* @var bool
*/
protected $hideInFrontend = FALSE;
/**
* @return string
*/
......@@ -95,20 +95,6 @@ class Contact extends AbstractEntity {
$this->lastName = $lastName;
}
/**
* @return string
*/
public function getCompany() {
return $this->company;
}
/**
* @param string $company
*/
public function setCompany(string $company) {
$this->company = $company;
}
/**
* @return string
*/
......@@ -164,4 +150,18 @@ class Contact extends AbstractEntity {
public function setPhone(string $phone) {
$this->phone = $phone;
}
/**
* @return bool
*/
public function isHideInFrontend() {
return $this->hideInFrontend;
}
/**
* @param bool $hideInFrontend
*/
public function setHideInFrontend(bool $hideInFrontend) {
$this->hideInFrontend = $hideInFrontend;
}
}
......@@ -74,7 +74,7 @@ class Job extends AbstractEntity {
protected $startDate = 0;
/**
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\SGalinski\SgJobs\Domain\Model\Company> $company
* @var \SGalinski\SgJobs\Domain\Model\Company $company
*/
protected $company = '';
......@@ -159,16 +159,16 @@ class Job extends AbstractEntity {
}
/**
* @return string
* @return Company
*/
public function getCompany() {
return $this->company;
}
/**
* @param ObjectStorage $company
* @param Company $company
*/
public function setCompany(ObjectStorage $company) {
public function setCompany(Company $company) {
$this->company = $company;
}
......
......@@ -46,6 +46,12 @@ class JobApplication extends AbstractEntity {
*/
protected $jobTitle = '';
/**
* @var \SGalinski\SgJobs\Domain\Model\Company $company
* @validate NotEmpty
*/
protected $company;
/**
* @var \SGalinski\SgJobs\Domain\Model\Job $job
*/
......@@ -430,4 +436,18 @@ class JobApplication extends AbstractEntity {
public function setJob(Job $job) {
$this->job = $job;
}
/**
* @return Company
*/
public function getCompany() {
return $this->company;
}
/**
* @param Company $company
*/
public function setCompany(Company $company) {
$this->company = $company;
}
}
......@@ -152,4 +152,34 @@ class CompanyRepository extends Repository {
return $namesArray;
}
/**
* Returns all companies filtered by page id
*
* @param int $pageUid
* @return mixed
* @throws \InvalidArgumentException
*/
public function getAllCompanies($pageUid) {
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable(
self::TABLENAME
);
$queryBuilder
->getRestrictions()
->removeAll()
->add(GeneralUtility::makeInstance(DeletedRestriction::class))
->add(GeneralUtility::makeInstance(FrontendRestrictionContainer::class));
$statement = $queryBuilder->select('*')->from('tx_sgjobs_domain_model_company');
$statement->where(
$queryBuilder->expr()->eq(
'pid', $queryBuilder->createNamedParameter($pageUid)
)
);
return $statement->execute();
}
}
......@@ -8,7 +8,7 @@ return [
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'dividers2tabs' => TRUE,
'searchFields' => 'city, country, description, name, street',
'searchFields' => 'city, country, description, name, street, contact',
'versioningWS' => 2,
'versioning_followPages' => TRUE,
'origUid' => 't3_origuid',
......@@ -26,12 +26,12 @@ return [
'Resources/Public/Icons/tx_sgjobs_domain_model_company.svg'
],
'interface' => [
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, pid, city, street name, country, description',
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, pid, city, street name, country, description, contact',
],
'types' => [
'1' => [
'showitem' => '--palette--;;sysLanguageAndHidden,
city, street,name, country, description;;;richtext[*]:rte_transform[mode=ts],
city, street,name, country, description, contact;;;richtext[*]:rte_transform[mode=ts],
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime',
],
],
......@@ -167,5 +167,27 @@ return [
'eval' => 'trim'
],
],
'contact' => [
'exclude' => 0,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job.contact',
'config' => [
'type' => 'select',
'eval' => 'required',
'renderType' => 'selectSingle',
'internal_type' => 'db',
'foreign_table' => 'tx_sgjobs_domain_model_contact',
'size' => 1,
'maxitems' => 1,
'multiple' => 0,
'fieldControl' => [
'editPopup' => [
'disabled' => FALSE,
],
'addRecord' => [
'disabled' => FALSE,
]
],
]
]
],
];
\ No newline at end of file
......@@ -8,7 +8,7 @@ return [
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'dividers2tabs' => TRUE,
'searchFields' => 'first_name, last_name, company, city, zip, email, phone',
'searchFields' => 'first_name, last_name, city, zip, email, phone, hide_in_frontend',
'versioningWS' => 2,
'versioning_followPages' => TRUE,
'origUid' => 't3_origuid',
......@@ -26,12 +26,12 @@ return [
'Resources/Public/Icons/tx_sgjobs_domain_model_contact.svg'
],
'interface' => [
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, pid, first_name, last_name, company, city, zip, email, phone',
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, pid, first_name, last_name, city, zip, email, phone, hide_in_frontend',
],
'types' => [
'1' => [
'showitem' => '--palette--;;sysLanguageAndHidden,
first_name, last_name, company, city, zip, email, phone;;;richtext[*]:rte_transform[mode=ts],
hide_in_frontend, first_name, last_name, city, zip, email, phone;;;richtext[*]:rte_transform[mode=ts],
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime',
],
],
......@@ -145,15 +145,6 @@ return [
'eval' => 'trim, required'
],
],
'company' => [
'exclude' => 0,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_contact.company',
'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_contact.city',
......@@ -189,6 +180,13 @@ return [
'size' => 30,
'eval' => 'trim, required'
],
],
'hide_in_frontend' => [
'exclude' => 0,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_contact.hide_in_frontend',
'config' => [
'type' => 'check',
],
]
],
];
\ No newline at end of file
......@@ -218,7 +218,7 @@ return [
],
'company' => [
'exclude' => 0,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job.location',
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job.company',
'config' => [
'type' => 'select',
'eval' => 'required',
......
......@@ -12,7 +12,7 @@ $tx_sgjobs_domain_model_job_application = [
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'dividers2tabs' => TRUE,
'searchFields' => 'job_id, job, job_title, gender, first_name, last_name, street, city, zip, country, nationality, education, birth_date, phone, mobile, email, message, cover_letter, certificate, cv',
'searchFields' => 'job_id, job, job_title, company, gender, first_name, last_name, street, city, zip, country, nationality, education, birth_date, phone, mobile, email, message, cover_letter, certificate, cv',
'versioningWS' => 2,
'versioning_followPages' => TRUE,
'origUid' => 't3_origuid',
......@@ -30,12 +30,12 @@ $tx_sgjobs_domain_model_job_application = [
'Resources/Public/Icons/tx_sgjobs_domain_model_job.svg'
],
'interface' => [
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, pid, job, job_id, job_title, area, start_date, alternative_start_date,
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, pid, job, job_id, job_title, company, area, start_date, alternative_start_date,
company, task, qualification, description, contact',
],
'types' => [
'1' => [
'showitem' => '--palette--;;sysLanguageAndHidden,job_id, job, job_title, gender, first_name, last_name, street, city, zip,
'showitem' => '--palette--;;sysLanguageAndHidden,job_id, job, job_title, company, gender, first_name, last_name, street, city, zip,
country, nationality, education, birth_date, phone, mobile, email, message, cover_letter, cv, certificate,
div;;richtext[*]:rte_transform[mode=ts],
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.access, starttime, endtime',
......@@ -167,6 +167,28 @@ $tx_sgjobs_domain_model_job_application = [
'eval' => 'trim'
],
],
'company' => [
'exclude' => 0,
'label' => 'LLL:EXT:sg_jobs/Resources/Private/Language/locallang_db.xlf:tx_sgjobs_domain_model_job.company',
'config' => [
'type' => 'select',
'eval' => 'required',
'renderType' => 'selectSingle',
'internal_type' => 'db',
'foreign_table' => 'tx_sgjobs_domain_model_company',
'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',
......
......@@ -24,7 +24,6 @@ plugin.tx_sgjobs {
settings {
allowedFileExtensions = {$plugin.tx_sgjobs.settings.allowedFileExtensions}
allowedMimeTypes = {$plugin.tx_sgjobs.settings.allowedMimeTypes}
defaultContactId = 1
defaultJobId = 28
}
......
......@@ -38,22 +38,10 @@ The Backend module is found in the **WEB** section under the name **Job Offers**
You can create a new job offer by clicking on the **New Job Offer** button.
## Defining a default Job (unsoliticed Application)
In your typoscript settings you can set a job id, which will be used for all **unsoliticed Applications**.
If nothing is set, unsolicited applications are not connected to any job offer.
```
settings.defaultJobId = 1
```
## Setting the contact email
When a user applies to a job offer an email will be send. The adress of this email comes either from the
**contact person** assigned to the job, ot if no contact person is set, you can set a default contact person
in your TypoScript settings:
```
settings.defaultContactId = 1
```
**contact person** assigned to the job, ot if no contact person is set, the mail address is chosen from the selected
location.
Simply supply the uid of the contact record and every job without a contact person will use the desired contact.
......
......@@ -202,6 +202,10 @@
<source>Last name *</source>
<target>Nachname *</target>
</trans-unit>
<trans-unit id="frontend.apply.location" approved="yes">
<source>Location*</source>
<target>Standort*</target>
</trans-unit>
<trans-unit id="frontend.apply.message" approved="yes">
<source>Message</source>
<target>Ihre Nachricht</target>
......
......@@ -97,6 +97,10 @@
<source>First name</source>
<target>Vorname</target>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_contact.hide_in_frontend" approved="yes">
<source>Hide contact information on the website</source>
<target>Kontaktinformationen auf Website ausblenden</target>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_contact.last_name" approved="yes">
<source>Last name</source>
<target>Nachname</target>
......
......@@ -153,6 +153,9 @@
<trans-unit id="frontend.apply.last_name">
<source>Last name *</source>
</trans-unit>
<trans-unit id="frontend.apply.location">
<source>Location*</source>
</trans-unit>
<trans-unit id="frontend.apply.message">
<source>Message</source>
</trans-unit>
......
......@@ -75,6 +75,9 @@
<trans-unit id="tx_sgjobs_domain_model_contact.first_name">
<source>First name</source>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_contact.hide_in_frontend">
<source>Hide contact information on the website</source>
</trans-unit>
<trans-unit id="tx_sgjobs_domain_model_contact.last_name">
<source>Last name</source>
</trans-unit>
......
......@@ -4,7 +4,8 @@
<div class="pia-card-header">
<h2>{job.title}</h2>
<h3>
<f:for each="{job.company}" as="company">{company.city}</f:for>
<f:for each="{job.company}" as="company">{company.city}</f:for>
<f:if condition="{job.alternativeStartDate}">
<f:then>
{job.alternativeStartDate}
......@@ -30,14 +31,14 @@
<h3><f:translate key="frontend.location" /></h3>
<p>
{job.company.0.country} - {job.company.0.city}
{job.company.country} - {job.company.city}
</p>
<h3><f:translate key="frontend.area" /></h3>
<p>{job.area}</p>
<h3><f:translate key="frontend.organisation" /></h3>
<p>{job.company.0.name}</p>
<p>{job.company.name}</p>
<f:if condition="{job.task}">
<h3><f:translate key="frontend.task" /></h3>
......@@ -60,20 +61,24 @@
{job.contact.email}
</p>
</f:if>
<h3><f:translate key="frontend.apply_by_mail" /></h3>
<p>
<f:for each="{job.company}" as="company">{company.name}</f:for><br>
{job.contact.firstName} {job.contact.lastName}<br>
<f:for each="{job.company}" as="company">{company.street}</f:for><br>
<f:for each="{job.company}" as="company">{company.city}</f:for><br>
<f:if condition="{job.contact.email} && !{job.contact.hideInFrontend}">
<h3><f:translate key="frontend.apply_by_mail" /></h3>
<p>
{job.company.name}
<br>
{job.contact.firstName} {job.contact.lastName}<br>
{job.company.street}
<br>
{job.company.city}
<br>
{job.contact.email}<br>
{job.contact.phone}
</p>
</p>
</f:if>
</div>
<div class="pia-card-footer">
<f:link.action class="cta-link" pageUid="{settings.applyPage}" controller="Joblist" action="applyForm"
pluginName="JobApplication" arguments="{uid: job.uid}">
pluginName="JobApplication" arguments="{uid: job.uid}">
<f:translate key="frontend.applyNow" />
</f:link.action>
</div>
......
......@@ -21,6 +21,7 @@
<f:form.hidden property="job" value="{job}" />
<f:form.hidden property="jobId" value="{job.jobId}" />
<f:form.hidden property="jobTitle" value="{job.title}" />
<f:form.hidden property="company" value="{job.company.uid}" />
</f:then>
</f:if>
<input type="hidden" name="tx_sgjobs_jobapplication[folderName]" value="{folderName}" />
......@@ -51,6 +52,24 @@
</ul>
</f:if>
<f:if condition="!{job}">
<f:then>
<div class="form-group">
<label for="apply-company"><f:translate key="frontend.apply.company" /></label>
<f:form.select class="form-control" property="company" id="apply-company" multiple="0" size="1"
optionValueField="uid" optionLabelField="city" options="{companies}"
/>
<f:form.validationResults for="applyData.location">
<ul class="sg-jobs-validation-error parsley-errors-list filled">
<f:for each="{validationResults.errors}" as="error">
<li class="parsley-required">{error.message}</li>
</f:for>
</ul>
</f:form.validationResults>
</div>
</f:then>
</f:if>
<div class="form-group">
<label for="apply-gender"><f:translate key="frontend.apply.gender" /></label>
<f:form.select property="gender" id="apply-gender" class="form-control" options="{Male: '{f:translate(key: \'frontend.apply.gender.male\')}', Female: '{f:translate(key: \'frontend.apply.gender.female\')}'}" />
......
......@@ -6,7 +6,7 @@
"license": [
"GPL-2.0+"
],
"version": "1.4.1",
"version": "1.5.0",
"support": {
"issues": "https://gitlab.sgalinski.de/typo3/sg_jobs"
},
......
......@@ -4,7 +4,7 @@ $EM_CONF[$_EXTKEY] = array (
'title' => 'Jobs',
'description' => 'Manage and display your Job offers.',
'category' => 'plugin',
'version' => '1.4.1',
'version' => '1.5.0',
'state' => 'stable',
'uploadfolder' => FALSE,
'createDirs' => '',
......
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