mirror of
https://github.com/Karaka-Management/oms-HumanResourceManagement.git
synced 2026-02-14 11:58:40 +00:00
remove some getter/setter
This commit is contained in:
parent
29ee4f20c6
commit
93e6d2175c
|
|
@ -77,13 +77,13 @@ final class ApiController extends Controller
|
||||||
{
|
{
|
||||||
if (!empty($val = $this->validateEmployeeFromAccountCreate($request))) {
|
if (!empty($val = $this->validateEmployeeFromAccountCreate($request))) {
|
||||||
$response->set('employee_create', new FormValidation($val));
|
$response->set('employee_create', new FormValidation($val));
|
||||||
$response->getHeader()->setStatusCode(RequestStatusCode::R_400);
|
$response->header->status = RequestStatusCode::R_400;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$employees = $this->createEmployeeFromAccountFromRequest($request);
|
$employees = $this->createEmployeeFromAccountFromRequest($request);
|
||||||
$this->createModels($request->getHeader()->getAccount(), $employees, EmployeeMapper::class, 'employee', $request->getOrigin());
|
$this->createModels($request->header->account, $employees, EmployeeMapper::class, 'employee', $request->getOrigin());
|
||||||
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Employee', 'Employee(s) successfully created', $employees);
|
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Employee', 'Employee(s) successfully created', $employees);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -144,13 +144,13 @@ final class ApiController extends Controller
|
||||||
{
|
{
|
||||||
if (!empty($val = $this->validateEmployeeNewCreate($request))) {
|
if (!empty($val = $this->validateEmployeeNewCreate($request))) {
|
||||||
$response->set('employee_create', new FormValidation($val));
|
$response->set('employee_create', new FormValidation($val));
|
||||||
$response->getHeader()->setStatusCode(RequestStatusCode::R_400);
|
$response->header->status = RequestStatusCode::R_400;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$employee = $this->createEmployeeNewFromRequest($request);
|
$employee = $this->createEmployeeNewFromRequest($request);
|
||||||
$this->createModel($request->getHeader()->getAccount(), $employee, EmployeeMapper::class, 'employee', $request->getOrigin());
|
$this->createModel($request->header->account, $employee, EmployeeMapper::class, 'employee', $request->getOrigin());
|
||||||
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Employee', 'Employee successfully created', $employee);
|
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Employee', 'Employee successfully created', $employee);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -185,13 +185,13 @@ final class ApiController extends Controller
|
||||||
private function createEmployeeNewFromRequest(RequestAbstract $request) : Employee
|
private function createEmployeeNewFromRequest(RequestAbstract $request) : Employee
|
||||||
{
|
{
|
||||||
$account = new Account();
|
$account = new Account();
|
||||||
$account->setName1((string) ($request->getData('name1') ?? ''));
|
$account->name1 = (string) ($request->getData('name1') ?? '');
|
||||||
$account->setName2((string) ($request->getData('name2') ?? ''));
|
$account->name2 = (string) ($request->getData('name2') ?? '');
|
||||||
$account->setName3((string) ($request->getData('name3') ?? ''));
|
$account->name3 = (string) ($request->getData('name3') ?? '');
|
||||||
$account->setName3((string) ($request->getData('email') ?? ''));
|
$account->name3 = (string) ($request->getData('email') ?? '');
|
||||||
|
|
||||||
$profile = new Profile($account);
|
$profile = new Profile($account);
|
||||||
$profile->setBirthday(new \DateTime((string) ($request->getData('birthday') ?? 'now')));
|
$profile->birthday = new \DateTime((string) ($request->getData('birthday') ?? 'now'));
|
||||||
|
|
||||||
$employee = new Employee($profile);
|
$employee = new Employee($profile);
|
||||||
|
|
||||||
|
|
@ -215,13 +215,13 @@ final class ApiController extends Controller
|
||||||
{
|
{
|
||||||
if (!empty($val = $this->validateEmployeeHistoryCreate($request))) {
|
if (!empty($val = $this->validateEmployeeHistoryCreate($request))) {
|
||||||
$response->set('history_create', new FormValidation($val));
|
$response->set('history_create', new FormValidation($val));
|
||||||
$response->getHeader()->setStatusCode(RequestStatusCode::R_400);
|
$response->header->status = RequestStatusCode::R_400;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$history = $this->createEmployeeHistoryFromRequest($request);
|
$history = $this->createEmployeeHistoryFromRequest($request);
|
||||||
$this->createModel($request->getHeader()->getAccount(), $history, EmployeeHistoryMapper::class, 'history', $request->getOrigin());
|
$this->createModel($request->header->account, $history, EmployeeHistoryMapper::class, 'history', $request->getOrigin());
|
||||||
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'History', 'History successfully created', $history);
|
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'History', 'History successfully created', $history);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ class Employee implements \JsonSerializable, ArrayableInterface
|
||||||
* @var null|int|Profile
|
* @var null|int|Profile
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private $profile = null;
|
public $profile = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Employee image.
|
* Employee image.
|
||||||
|
|
@ -51,7 +51,7 @@ class Employee implements \JsonSerializable, ArrayableInterface
|
||||||
* @var null|int|Media
|
* @var null|int|Media
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private $image = null;
|
public $image = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Employee department/position history.
|
* Employee department/position history.
|
||||||
|
|
@ -110,6 +110,7 @@ class Employee implements \JsonSerializable, ArrayableInterface
|
||||||
{
|
{
|
||||||
$this->profile = $profile;
|
$this->profile = $profile;
|
||||||
$this->semiPrivateHash = \random_bytes(self::SEMI_PRIVATE_HASH_LENGTH);
|
$this->semiPrivateHash = \random_bytes(self::SEMI_PRIVATE_HASH_LENGTH);
|
||||||
|
$this->image = new NullMedia();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -124,44 +125,6 @@ class Employee implements \JsonSerializable, ArrayableInterface
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get profile.
|
|
||||||
*
|
|
||||||
* @return null|int|Profile
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public function getProfile()
|
|
||||||
{
|
|
||||||
return $this->profile;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get image.
|
|
||||||
*
|
|
||||||
* @return int|Media
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public function getImage()
|
|
||||||
{
|
|
||||||
return $this->image ?? new NullMedia();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set image.
|
|
||||||
*
|
|
||||||
* @param null|int|Media $image Employee image
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public function setImage($image) : void
|
|
||||||
{
|
|
||||||
$this->image = $image;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update semi private hash.
|
* Update semi private hash.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ use Modules\Admin\Models\AccountMapper;
|
||||||
use Modules\Profile\Models\ProfileMapper;
|
use Modules\Profile\Models\ProfileMapper;
|
||||||
use phpOMS\DataStorage\Database\DataMapperAbstract;
|
use phpOMS\DataStorage\Database\DataMapperAbstract;
|
||||||
use phpOMS\DataStorage\Database\Query\Builder;
|
use phpOMS\DataStorage\Database\Query\Builder;
|
||||||
|
use Modules\Media\Models\MediaMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Employe mapper class.
|
* Employe mapper class.
|
||||||
|
|
@ -55,6 +56,19 @@ final class EmployeeMapper extends DataMapperAbstract
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Has one relation.
|
||||||
|
*
|
||||||
|
* @var array<string, array{mapper:string, external:string, by?:string, column?:string, conditional?:bool}>
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
protected static array $ownsOne = [
|
||||||
|
'image' => [
|
||||||
|
'mapper' => MediaMapper::class,
|
||||||
|
'external' => 'hr_staff_image',
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Has many relation.
|
* Has many relation.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -43,9 +43,9 @@ echo $this->getData('nav')->render(); ?>
|
||||||
$url = \phpOMS\Uri\UriFactory::build('{/prefix}hr/department/single?{?}&id=' . $value->getId()); ?>
|
$url = \phpOMS\Uri\UriFactory::build('{/prefix}hr/department/single?{?}&id=' . $value->getId()); ?>
|
||||||
<tr tabindex="0" data-href="<?= $url; ?>">
|
<tr tabindex="0" data-href="<?= $url; ?>">
|
||||||
<td data-label="<?= $this->getHtml('ID', '0', '0'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getId()); ?></a>
|
<td data-label="<?= $this->getHtml('ID', '0', '0'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getId()); ?></a>
|
||||||
<td data-label="<?= $this->getHtml('Name'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getName()); ?></a>
|
<td data-label="<?= $this->getHtml('Name'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->name); ?></a>
|
||||||
<td data-label="<?= $this->getHtml('Employees'); ?>">
|
<td data-label="<?= $this->getHtml('Employees'); ?>">
|
||||||
<td data-label="<?= $this->getHtml('Parent'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getParent()->getName()); ?></a>
|
<td data-label="<?= $this->getHtml('Parent'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->parent->getName()); ?></a>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<?php if ($c === 0) : ?>
|
<?php if ($c === 0) : ?>
|
||||||
<tr><td colspan="4" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
<tr><td colspan="4" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<div class="b b-1 c24-1 c24" id="i24-1-1">
|
<div class="b b-1 c24-1 c24" id="i24-1-1">
|
||||||
<header><h1><?= $this->printHtml($this->app->accountManager->get($request->getHeader()->getAccount())->getL11n()->lang['HumanResourceManagement']['Vacation']); ?></h1></header>
|
<header><h1><?= $this->printHtml($this->app->accountManager->get($request->header->account)->l11n->lang['HumanResourceManagement']['Vacation']); ?></h1></header>
|
||||||
|
|
||||||
<div class="bc-1">
|
<div class="bc-1">
|
||||||
<div class="cT">
|
<div class="cT">
|
||||||
|
|
@ -26,13 +26,13 @@
|
||||||
<!-- @formatter:on -->
|
<!-- @formatter:on -->
|
||||||
<div class="cT">
|
<div class="cT">
|
||||||
<a tabindex="0" href="<?= \phpOMS\Uri\UriFactory::build('{/prefix}sales/analysis/clients/dashboard'); ?>"
|
<a tabindex="0" href="<?= \phpOMS\Uri\UriFactory::build('{/prefix}sales/analysis/clients/dashboard'); ?>"
|
||||||
class="button"><?= $this->printHtml($this->app->accountManager->get($request->getHeader()->getAccount())->getL11n()->lang[0]['More']); ?></a>
|
class="button"><?= $this->printHtml($this->app->accountManager->get($request->header->account)->l11n->lang[0]['More']); ?></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="b b-1 c24-1 c24" id="i24-1-1">
|
<div class="b b-1 c24-1 c24" id="i24-1-1">
|
||||||
<header><h1><?= $this->printHtml($this->app->accountManager->get($request->getHeader()->getAccount())->getL11n()->lang['HumanResourceManagement']['Shifts']); ?></h1></header>
|
<header><h1><?= $this->printHtml($this->app->accountManager->get($request->header->account)->l11n->lang['HumanResourceManagement']['Shifts']); ?></h1></header>
|
||||||
|
|
||||||
<div class="bc-1">
|
<div class="bc-1">
|
||||||
<div class="cT">
|
<div class="cT">
|
||||||
|
|
@ -59,13 +59,13 @@
|
||||||
<!-- @formatter:on -->
|
<!-- @formatter:on -->
|
||||||
<div class="cT">
|
<div class="cT">
|
||||||
<a tabindex="0" href=""
|
<a tabindex="0" href=""
|
||||||
class="button"><?= $this->printHtml($this->app->accountManager->get($request->getHeader()->getAccount())->getL11n()->lang[0]['More']); ?></a>
|
class="button"><?= $this->printHtml($this->app->accountManager->get($request->header->account)->l11n->lang[0]['More']); ?></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="b b-1 c24-1 c24" id="i24-1-1">
|
<div class="b b-1 c24-1 c24" id="i24-1-1">
|
||||||
<header><h1><?= $this->printHtml($this->app->accountManager->get($request->getHeader()->getAccount())->getL11n()->lang['HumanResourceManagement']['Personnel']); ?></h1></header>
|
<header><h1><?= $this->printHtml($this->app->accountManager->get($request->header->account)->l11n->lang['HumanResourceManagement']['Personnel']); ?></h1></header>
|
||||||
|
|
||||||
<div class="bc-1">
|
<div class="bc-1">
|
||||||
<div class="cT">
|
<div class="cT">
|
||||||
|
|
@ -92,7 +92,7 @@
|
||||||
<!-- @formatter:on -->
|
<!-- @formatter:on -->
|
||||||
<div class="cT">
|
<div class="cT">
|
||||||
<a tabindex="0" href=""
|
<a tabindex="0" href=""
|
||||||
class="button"><?= $this->printHtml($this->app->accountManager->get($request->getHeader()->getAccount())->getL11n()->lang[0]['More']); ?></a>
|
class="button"><?= $this->printHtml($this->app->accountManager->get($request->header->account)->l11n->lang[0]['More']); ?></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ echo $this->getData('nav')->render(); ?>
|
||||||
<tr tabindex="0" data-href="<?= $url; ?>">
|
<tr tabindex="0" data-href="<?= $url; ?>">
|
||||||
<td data-label="<?= $this->getHtml('ID', '0', '0'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getId()); ?></a>
|
<td data-label="<?= $this->getHtml('ID', '0', '0'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->getId()); ?></a>
|
||||||
<td data-label="<?= $this->getHtml('Name'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml(
|
<td data-label="<?= $this->getHtml('Name'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml(
|
||||||
\sprintf('%3$s %2$s %1$s', $value->getProfile()->getAccount()->getName1(), $value->getProfile()->getAccount()->getName2(), $value->getProfile()->getAccount()->getName3())
|
\sprintf('%3$s %2$s %1$s', $value->profile->account->name1, $value->profile->account->name2, $value->profile->account->name3)
|
||||||
); ?></a>
|
); ?></a>
|
||||||
<td><?= $this->printHtml($value->getNewestHistory()->getUnit()->getName()); ?>
|
<td><?= $this->printHtml($value->getNewestHistory()->getUnit()->getName()); ?>
|
||||||
<td><?= $this->printHtml($value->getNewestHistory()->getPosition()->getName()); ?>
|
<td><?= $this->printHtml($value->getNewestHistory()->getPosition()->getName()); ?>
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ declare(strict_types=1);
|
||||||
|
|
||||||
use Modules\Media\Models\NullMedia;
|
use Modules\Media\Models\NullMedia;
|
||||||
use phpOMS\Uri\UriFactory;
|
use phpOMS\Uri\UriFactory;
|
||||||
|
use Modules\HumanResourceManagement\Models\NullEmployeeHistory;
|
||||||
|
|
||||||
$employee = $this->getData('employee');
|
$employee = $this->getData('employee');
|
||||||
$history = $employee->getHistorY();
|
$history = $employee->getHistorY();
|
||||||
|
|
@ -35,12 +36,12 @@ echo $this->getData('nav')->render(); ?>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
<input type="radio" id="c-tab-1" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-1' ? ' checked' : ''; ?>>
|
<input type="radio" id="c-tab-1" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-1' ? ' checked' : ''; ?>>
|
||||||
<div class="tab">
|
<div class="tab">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12 col-md-6">
|
<div class="col-xs-12 col-md-6">
|
||||||
<section itemscope itemtype="http://schema.org/Person" class="box wf-100">
|
<section itemscope itemtype="http://schema.org/Person" class="box wf-100">
|
||||||
<header><h1><span itemprop="familyName"><?= $this->printHtml($employee->getProfile()->getAccount()->getName2()); ?></span>, <span itemprop="givenName"><?= $this->printHtml($employee->getProfile()->getAccount()->getName1()); ?></span></h1></header>
|
<header><h1><span itemprop="familyName"><?= $this->printHtml($employee->profile->account->name2); ?></span>, <span itemprop="givenName"><?= $this->printHtml($employee->profile->account->name1); ?></span></h1></header>
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
<!-- @formatter:off -->
|
<!-- @formatter:off -->
|
||||||
<span class="rf">
|
<span class="rf">
|
||||||
|
|
@ -48,11 +49,11 @@ echo $this->getData('nav')->render(); ?>
|
||||||
alt="<?= $this->getHtml('ProfileImage'); ?>"
|
alt="<?= $this->getHtml('ProfileImage'); ?>"
|
||||||
itemprop="logo" loading="lazy"
|
itemprop="logo" loading="lazy"
|
||||||
src="<?=
|
src="<?=
|
||||||
$employee->getImage() instanceof NullMedia ?
|
$employee->image instanceof NullMedia ?
|
||||||
$employee->getProfile()->getImage() instanceof NullMedia ?
|
$employee->profile->image instanceof NullMedia ?
|
||||||
UriFactory::build('Web/Backend/img/user_default_' . \mt_rand(1, 6) .'.png') :
|
UriFactory::build('Web/Backend/img/user_default_' . \mt_rand(1, 6) .'.png') :
|
||||||
UriFactory::build('{/prefix}' . $employee->getProfile()->getImage()->getPath()) :
|
UriFactory::build('{/prefix}' . $employee->profile->image->getPath()) :
|
||||||
UriFactory::build('{/prefix}' . $employee->getImage()->getPath()); ?>"
|
UriFactory::build('{/prefix}' . $employee->image->getPath()); ?>"
|
||||||
>
|
>
|
||||||
</span>
|
</span>
|
||||||
<table class="list">
|
<table class="list">
|
||||||
|
|
@ -70,7 +71,7 @@ echo $this->getData('nav')->render(); ?>
|
||||||
<td itemprop="birthDate">06.09.1934
|
<td itemprop="birthDate">06.09.1934
|
||||||
<tr>
|
<tr>
|
||||||
<th><?= $this->getHtml('Email'); ?>
|
<th><?= $this->getHtml('Email'); ?>
|
||||||
<td itemprop="email"><a href="mailto:<?= $this->printHtml($employee->getProfile()->getAccount()->getEmail()); ?>"><?= $this->printHtml($employee->getProfile()->getAccount()->getEmail()); ?></a>
|
<td itemprop="email"><a href="mailto:<?= $this->printHtml($employee->profile->account->getEmail()); ?>"><?= $this->printHtml($employee->profile->account->getEmail()); ?></a>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Address
|
<th>Address
|
||||||
<td>
|
<td>
|
||||||
|
|
@ -127,7 +128,7 @@ echo $this->getData('nav')->render(); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-2' ? ' checked' : ''; ?>>
|
<input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-2' ? ' checked' : ''; ?>>
|
||||||
<div class="tab">
|
<div class="tab">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
|
|
@ -139,7 +140,7 @@ echo $this->getData('nav')->render(); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<input type="radio" id="c-tab-3" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-3' ? ' checked' : ''; ?>>
|
<input type="radio" id="c-tab-3" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-3' ? ' checked' : ''; ?>>
|
||||||
<div class="tab">
|
<div class="tab">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
|
|
@ -151,7 +152,7 @@ echo $this->getData('nav')->render(); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<input type="radio" id="c-tab-4" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-4' ? ' checked' : ''; ?>>
|
<input type="radio" id="c-tab-4" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-4' ? ' checked' : ''; ?>>
|
||||||
<div class="tab">
|
<div class="tab">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
|
|
@ -163,7 +164,7 @@ echo $this->getData('nav')->render(); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<input type="radio" id="c-tab-5" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-5' ? ' checked' : ''; ?>>
|
<input type="radio" id="c-tab-5" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-5' ? ' checked' : ''; ?>>
|
||||||
<div class="tab">
|
<div class="tab">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
|
|
@ -175,7 +176,7 @@ echo $this->getData('nav')->render(); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<input type="radio" id="c-tab-6" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-6' ? ' checked' : ''; ?>>
|
<input type="radio" id="c-tab-6" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-6' ? ' checked' : ''; ?>>
|
||||||
<div class="tab">
|
<div class="tab">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
|
|
@ -187,7 +188,7 @@ echo $this->getData('nav')->render(); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<input type="radio" id="c-tab-7" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-7' ? ' checked' : ''; ?>>
|
<input type="radio" id="c-tab-7" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-7' ? ' checked' : ''; ?>>
|
||||||
<div class="tab">
|
<div class="tab">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
|
|
@ -199,7 +200,7 @@ echo $this->getData('nav')->render(); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<input type="radio" id="c-tab-8" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-8' ? ' checked' : ''; ?>>
|
<input type="radio" id="c-tab-8" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-8' ? ' checked' : ''; ?>>
|
||||||
<div class="tab">
|
<div class="tab">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,8 @@ class EmployeeMapperTest extends \PHPUnit\Framework\TestCase
|
||||||
if (($profile = ProfileMapper::getFor(1, 'account'))->getId() === 0) {
|
if (($profile = ProfileMapper::getFor(1, 'account'))->getId() === 0) {
|
||||||
$profile = new Profile();
|
$profile = new Profile();
|
||||||
|
|
||||||
$profile->setAccount(AccountMapper::get(1));
|
$profile->account = AccountMapper::get(1);
|
||||||
$profile->setBirthday($date = new \DateTime('now'));
|
$profile->birthday = ($date = new \DateTime('now'));
|
||||||
|
|
||||||
$id = ProfileMapper::create($profile);
|
$id = ProfileMapper::create($profile);
|
||||||
}
|
}
|
||||||
|
|
@ -47,6 +47,6 @@ class EmployeeMapperTest extends \PHPUnit\Framework\TestCase
|
||||||
self::assertEquals($id, $employee->getId());
|
self::assertEquals($id, $employee->getId());
|
||||||
|
|
||||||
$employeeR = EmployeeMapper::get($employee->getId());
|
$employeeR = EmployeeMapper::get($employee->getId());
|
||||||
self::assertEquals($employee->getProfile()->getId(), $employeeR->getProfile()->getId());
|
self::assertEquals($employee->profile->getId(), $employeeR->profile->getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ class EmployeeTest extends \PHPUnit\Framework\TestCase
|
||||||
self::assertEquals(0, $employee->getId());
|
self::assertEquals(0, $employee->getId());
|
||||||
self::assertGreaterThan(0, \strlen($employee->getSemiPrivateHash()));
|
self::assertGreaterThan(0, \strlen($employee->getSemiPrivateHash()));
|
||||||
self::assertFalse($employee->compareSemiPrivateHash('123'));
|
self::assertFalse($employee->compareSemiPrivateHash('123'));
|
||||||
self::assertInstanceOf('\Modules\Media\Models\NullMedia', $employee->getImage());
|
self::assertInstanceOf('\Modules\Media\Models\NullMedia', $employee->image);
|
||||||
self::assertInstanceOf('\Modules\HumanResourceManagement\Models\NullEmployeeHistory', $employee->getNewestHistory());
|
self::assertInstanceOf('\Modules\HumanResourceManagement\Models\NullEmployeeHistory', $employee->getNewestHistory());
|
||||||
self::assertEquals([], $employee->getHistory());
|
self::assertEquals([], $employee->getHistory());
|
||||||
self::assertEquals([], $employee->getEducationHistory());
|
self::assertEquals([], $employee->getEducationHistory());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user