Skip to content

Commit

Permalink
Merge c168a76 into 28c2996
Browse files Browse the repository at this point in the history
  • Loading branch information
sergey-galenko committed Nov 22, 2018
2 parents 28c2996 + c168a76 commit 5481d44
Show file tree
Hide file tree
Showing 8 changed files with 1,548 additions and 2 deletions.
3 changes: 3 additions & 0 deletions module/Jobs/config/module.config.php
Expand Up @@ -335,6 +335,7 @@
'jobs/form/multiposting-checkboxes' => __DIR__ . '/../view/form/multiposting-checkboxes.phtml',
'jobs/form/ats-mode.view' => __DIR__ . '/../view/form/ats-mode.view.phtml',
'jobs/form/ats-mode.form' => __DIR__ . '/../view/form/ats-mode.form.phtml',
'jobs/form/salary-fieldset' => __DIR__ . '/../view/form/salary-fieldset.phtml',
'jobs/form/company-name-fieldset' => __DIR__ . '/../view/form/company-name-fieldset.phtml',
'jobs/form/preview' => __DIR__ . '/../view/form/preview.phtml',
'jobs/form/customer-note' => __DIR__ . '/../view/form/customer-note.phtml',
Expand Down Expand Up @@ -417,6 +418,8 @@
'Jobs/MultipostButtonFieldset' => 'Jobs\Form\MultipostButtonFieldset',
'Jobs/AtsMode' => 'Jobs\Form\AtsMode',
'Jobs/AtsModeFieldset' => 'Jobs\Form\AtsModeFieldset',
'Jobs/Salary' => 'Jobs\Form\Salary',
'Jobs/SalaryFieldset' => 'Jobs\Form\SalaryFieldset',
'Jobs/AdminSearch' => 'Jobs\Form\AdminSearchFormElementsFieldset',
'Jobs/ListFilter' => 'Jobs\Form\ListFilter',
'Jobs/ListFilterLocation' => 'Jobs\Form\ListFilterLocation',
Expand Down
15 changes: 15 additions & 0 deletions module/Jobs/src/Entity/Decorator/JsonLdProvider.php
Expand Up @@ -63,6 +63,7 @@ public function toJsonLd()
'@type' => 'JobPosting',
'title' => $this->job->getTitle(),
'description' => $this->getDescription($this->job->getTemplateValues()),
'rate' => $this->getRate(),
'datePosted' => $dateStart,
'identifier' => [
'@type' => 'PropertyValue',
Expand Down Expand Up @@ -136,4 +137,18 @@ private function getDescription(TemplateValuesInterface $values)
);
return $description;
}

/**
* Generates a rate from salary entity
*
* @return string
*/
private function getRate()
{
$salary = $this->job->getSalary();

return ($salary && !is_null($salary->getValue())) ?
($salary->getValue() . ' ' . $salary->getCurrency() . '/' . $salary->getUnit()) :
/*@translate*/ 'Undefined';
}
}
37 changes: 35 additions & 2 deletions module/Jobs/src/Entity/Job.php
Expand Up @@ -46,7 +46,7 @@ class Job extends BaseEntity implements


private $cloneProperties = [
'classifications', 'atsMode',
'classifications', 'atsMode', 'salary',
];

/**
Expand Down Expand Up @@ -259,7 +259,15 @@ class Job extends BaseEntity implements
* @ODM\Field(type="boolean")
*/
protected $atsEnabled;


/**
* The Salary entity.
*
* @var Salary
* @ODM\EmbedOne(targetDocument="\Jobs\Entity\Salary")
*/
protected $salary;

/**
* Permissions
*
Expand Down Expand Up @@ -822,6 +830,31 @@ public function setAtsEnabled($atsEnabled)
$this->atsEnabled = $atsEnabled;
return $this;
}

/**
* @param \Jobs\Entity\Salary $salary
*
* @return self
*/
public function setSalary(Salary $salary)
{
$this->salary = $salary;

return $this;
}

/**
* @return \Jobs\Entity\Salary
*/
public function getSalary()
{
if (!$this->salary) {
$this->setSalary(new Salary());
}

return $this->salary;
}

/**
* returns an uri to the organization logo.
*
Expand Down

0 comments on commit 5481d44

Please sign in to comment.