mirror of
https://github.com/Karaka-Management/oms-HumanResourceManagement.git
synced 2026-02-15 20:28:41 +00:00
bug fixes
This commit is contained in:
parent
fbbc8a12a9
commit
dfb60a76a8
2
.github/workflows/greetings.yml
vendored
2
.github/workflows/greetings.yml
vendored
|
|
@ -9,5 +9,5 @@ jobs:
|
||||||
- uses: actions/first-interaction@v1
|
- uses: actions/first-interaction@v1
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
issue-message: 'Thank you for createing this issue. We will check it as soon as possible.'
|
issue-message: 'Thank you for creating this issue. We will check it as soon as possible.'
|
||||||
pr-message: 'Thank you for your pull request. We will check it as soon as possible.'
|
pr-message: 'Thank you for your pull request. We will check it as soon as possible.'
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,11 @@
|
||||||
"primary": true,
|
"primary": true,
|
||||||
"autoincrement": true
|
"autoincrement": true
|
||||||
},
|
},
|
||||||
|
"hr_staff_status": {
|
||||||
|
"name": "hr_staff_status",
|
||||||
|
"type": "TINYINT(1)",
|
||||||
|
"null": false
|
||||||
|
},
|
||||||
"hr_staff_profile": {
|
"hr_staff_profile": {
|
||||||
"name": "hr_staff_profile",
|
"name": "hr_staff_profile",
|
||||||
"type": "INT",
|
"type": "INT",
|
||||||
|
|
|
||||||
|
|
@ -478,7 +478,7 @@ final class ApiController extends Controller
|
||||||
pathSettings: PathSettings::FILE_PATH,
|
pathSettings: PathSettings::FILE_PATH,
|
||||||
hasAccountRelation: false,
|
hasAccountRelation: false,
|
||||||
readContent: $request->getDataBool('parse_content') ?? false,
|
readContent: $request->getDataBool('parse_content') ?? false,
|
||||||
type: $request->getDataInt('type'),
|
tag: $request->getDataInt('tag'),
|
||||||
rel: $employee->id,
|
rel: $employee->id,
|
||||||
mapper: EmployeeMapper::class,
|
mapper: EmployeeMapper::class,
|
||||||
field: 'files'
|
field: 'files'
|
||||||
|
|
|
||||||
|
|
@ -26,12 +26,6 @@ use Modules\Profile\Models\Profile;
|
||||||
* @license OMS License 2.0
|
* @license OMS License 2.0
|
||||||
* @link https://jingga.app
|
* @link https://jingga.app
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*
|
|
||||||
* @question Consider to add employee status (active, inactive, ...)
|
|
||||||
* We might not need it because we can see the activity from the workHistory.
|
|
||||||
* However, we have no easy way to see if someone is on maternity leave etc.
|
|
||||||
* We would have to parse TimeRecording for this which may not be installed.
|
|
||||||
* https://github.com/Karaka-Management/oms-HumanResourceManagement/issues/10
|
|
||||||
*/
|
*/
|
||||||
class Employee implements \JsonSerializable
|
class Employee implements \JsonSerializable
|
||||||
{
|
{
|
||||||
|
|
@ -54,6 +48,8 @@ class Employee implements \JsonSerializable
|
||||||
*/
|
*/
|
||||||
public Profile $profile;
|
public Profile $profile;
|
||||||
|
|
||||||
|
public int $status = EmployeeStatus::ACTIVE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Employee image.
|
* Employee image.
|
||||||
*
|
*
|
||||||
|
|
@ -152,46 +148,6 @@ class Employee implements \JsonSerializable
|
||||||
return \hash_equals($this->semiPrivateHash, $hash);
|
return \hash_equals($this->semiPrivateHash, $hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get media file by type
|
|
||||||
*
|
|
||||||
* @param int $type Media type
|
|
||||||
*
|
|
||||||
* @return Media
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public function getFileByType(int $type) : Media
|
|
||||||
{
|
|
||||||
foreach ($this->files as $file) {
|
|
||||||
if ($file->hasMediaTypeId($type)) {
|
|
||||||
return $file;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return new NullMedia();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get all media files by type name
|
|
||||||
*
|
|
||||||
* @param string $type Media type
|
|
||||||
*
|
|
||||||
* @return Media
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public function getFileByTypeName(string $type) : Media
|
|
||||||
{
|
|
||||||
foreach ($this->files as $file) {
|
|
||||||
if ($file->hasMediaTypeName($type)) {
|
|
||||||
return $file;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return new NullMedia();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get employee company history.
|
* Get employee company history.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -82,46 +82,6 @@ class EmployeeEducationHistory implements \JsonSerializable
|
||||||
$this->address = new Address();
|
$this->address = new Address();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get media file by type
|
|
||||||
*
|
|
||||||
* @param int $type Media type
|
|
||||||
*
|
|
||||||
* @return Media
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public function getFileByType(int $type) : Media
|
|
||||||
{
|
|
||||||
foreach ($this->files as $file) {
|
|
||||||
if ($file->hasMediaTypeId($type)) {
|
|
||||||
return $file;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return new NullMedia();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get all media files by type name
|
|
||||||
*
|
|
||||||
* @param string $type Media type
|
|
||||||
*
|
|
||||||
* @return Media
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public function getFileByTypeName(string $type) : Media
|
|
||||||
{
|
|
||||||
foreach ($this->files as $file) {
|
|
||||||
if ($file->hasMediaTypeName($type)) {
|
|
||||||
return $file;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return new NullMedia();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -106,46 +106,6 @@ class EmployeeHistory implements \JsonSerializable
|
||||||
$this->position = new NullPosition();
|
$this->position = new NullPosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get media file by type
|
|
||||||
*
|
|
||||||
* @param int $type Media type
|
|
||||||
*
|
|
||||||
* @return Media
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public function getFileByType(int $type) : Media
|
|
||||||
{
|
|
||||||
foreach ($this->files as $file) {
|
|
||||||
if ($file->hasMediaTypeId($type)) {
|
|
||||||
return $file;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return new NullMedia();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get all media files by type name
|
|
||||||
*
|
|
||||||
* @param string $type Media type
|
|
||||||
*
|
|
||||||
* @return Media
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public function getFileByTypeName(string $type) : Media
|
|
||||||
{
|
|
||||||
foreach ($this->files as $file) {
|
|
||||||
if ($file->hasMediaTypeName($type)) {
|
|
||||||
return $file;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return new NullMedia();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ final class EmployeeMapper extends DataMapperFactory
|
||||||
*/
|
*/
|
||||||
public const COLUMNS = [
|
public const COLUMNS = [
|
||||||
'hr_staff_id' => ['name' => 'hr_staff_id', 'type' => 'int', 'internal' => 'id'],
|
'hr_staff_id' => ['name' => 'hr_staff_id', 'type' => 'int', 'internal' => 'id'],
|
||||||
|
'hr_staff_status' => ['name' => 'hr_staff_status', 'type' => 'int', 'internal' => 'status'],
|
||||||
'hr_staff_profile' => ['name' => 'hr_staff_profile', 'type' => 'int', 'internal' => 'profile'],
|
'hr_staff_profile' => ['name' => 'hr_staff_profile', 'type' => 'int', 'internal' => 'profile'],
|
||||||
'hr_staff_smiPHash' => ['name' => 'hr_staff_smiPHash', 'type' => 'string', 'internal' => 'semiPrivateHash', 'private' => true],
|
'hr_staff_smiPHash' => ['name' => 'hr_staff_smiPHash', 'type' => 'string', 'internal' => 'semiPrivateHash', 'private' => true],
|
||||||
'hr_staff_image' => ['name' => 'hr_staff_image', 'type' => 'int', 'internal' => 'image', 'annotations' => ['gdpr' => true]],
|
'hr_staff_image' => ['name' => 'hr_staff_image', 'type' => 'int', 'internal' => 'image', 'annotations' => ['gdpr' => true]],
|
||||||
|
|
|
||||||
34
Models/EmployeeStatus.php
Normal file
34
Models/EmployeeStatus.php
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Jingga
|
||||||
|
*
|
||||||
|
* PHP Version 8.2
|
||||||
|
*
|
||||||
|
* @package Modules\HumanResourceManagement\Models
|
||||||
|
* @copyright Dennis Eichhorn
|
||||||
|
* @license OMS License 2.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link https://jingga.app
|
||||||
|
*/
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Modules\HumanResourceManagement\Models;
|
||||||
|
|
||||||
|
use phpOMS\Stdlib\Base\Enum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Employee status enum.
|
||||||
|
*
|
||||||
|
* @package Modules\HumanResourceManagement\Models
|
||||||
|
* @license OMS License 2.0
|
||||||
|
* @link https://jingga.app
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
abstract class EmployeeStatus extends Enum
|
||||||
|
{
|
||||||
|
public const ACTIVE = 1;
|
||||||
|
|
||||||
|
public const INACTIVE = 2;
|
||||||
|
|
||||||
|
public const UNAVAILABLE = 3;
|
||||||
|
}
|
||||||
|
|
@ -78,46 +78,6 @@ class EmployeeWorkHistory implements \JsonSerializable
|
||||||
$this->address = new Address();
|
$this->address = new Address();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get media file by type
|
|
||||||
*
|
|
||||||
* @param int $type Media type
|
|
||||||
*
|
|
||||||
* @return Media
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public function getFileByType(int $type) : Media
|
|
||||||
{
|
|
||||||
foreach ($this->files as $file) {
|
|
||||||
if ($file->hasMediaTypeId($type)) {
|
|
||||||
return $file;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return new NullMedia();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get all media files by type name
|
|
||||||
*
|
|
||||||
* @param string $type Media type
|
|
||||||
*
|
|
||||||
* @return Media
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public function getFileByTypeName(string $type) : Media
|
|
||||||
{
|
|
||||||
foreach ($this->files as $file) {
|
|
||||||
if ($file->hasMediaTypeName($type)) {
|
|
||||||
return $file;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return new NullMedia();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -48,4 +48,7 @@ return ['HumanResourceManagement' => [
|
||||||
'Work' => 'Arbeiten',
|
'Work' => 'Arbeiten',
|
||||||
'Total' => 'Gesamt',
|
'Total' => 'Gesamt',
|
||||||
'FTE' => 'MAK',
|
'FTE' => 'MAK',
|
||||||
|
':status-1' => 'Aktiv',
|
||||||
|
':status-2' => 'Inaktiv',
|
||||||
|
':status-3' => 'Nicht Verfügbar',
|
||||||
]];
|
]];
|
||||||
|
|
|
||||||
|
|
@ -48,4 +48,7 @@ return ['HumanResourceManagement' => [
|
||||||
'Work' => 'Work',
|
'Work' => 'Work',
|
||||||
'Total' => 'Total',
|
'Total' => 'Total',
|
||||||
'FTE' => 'FTE',
|
'FTE' => 'FTE',
|
||||||
|
':status-1' => 'Active',
|
||||||
|
':status-2' => 'Inactive',
|
||||||
|
':status-3' => 'Unavailable',
|
||||||
]];
|
]];
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ echo $this->data['nav']->render(); ?>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
<div class="portlet">
|
<section class="portlet">
|
||||||
<div class="portlet-head"><?= $this->getHtml('Departments'); ?><i class="g-icon download btn end-xs">download</i></div>
|
<div class="portlet-head"><?= $this->getHtml('Departments'); ?><i class="g-icon download btn end-xs">download</i></div>
|
||||||
<div class="slider">
|
<div class="slider">
|
||||||
<table class="default sticky">
|
<table class="default sticky">
|
||||||
|
|
@ -48,6 +48,6 @@ echo $this->data['nav']->render(); ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
*/
|
*/
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
use Modules\HumanResourceManagement\Models\EmployeeStatus;
|
||||||
use Modules\HumanResourceTimeRecording\Models\ClockingStatus;
|
use Modules\HumanResourceTimeRecording\Models\ClockingStatus;
|
||||||
use Modules\HumanResourceTimeRecording\Models\ClockingType;
|
use Modules\HumanResourceTimeRecording\Models\ClockingType;
|
||||||
use phpOMS\Stdlib\Base\SmartDateTime;
|
use phpOMS\Stdlib\Base\SmartDateTime;
|
||||||
|
|
@ -23,6 +24,8 @@ $education = $employee->getEducationHistory();
|
||||||
$work = $employee->getWorkHistory();
|
$work = $employee->getWorkHistory();
|
||||||
$recentHistory = $employee->getNewestHistory();
|
$recentHistory = $employee->getNewestHistory();
|
||||||
|
|
||||||
|
$staffStatus = EmployeeStatus::getConstants();
|
||||||
|
|
||||||
echo $this->data['nav']->render(); ?>
|
echo $this->data['nav']->render(); ?>
|
||||||
<div class="tabview tab-2">
|
<div class="tabview tab-2">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
|
|
@ -59,6 +62,14 @@ echo $this->data['nav']->render(); ?>
|
||||||
: UriFactory::build($employee->image->getPath()); ?>"
|
: UriFactory::build($employee->image->getPath()); ?>"
|
||||||
>
|
>
|
||||||
</span>
|
</span>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="iStatus"><?= $this->getHtml('Status'); ?></label>
|
||||||
|
<select id="iStatus" name="status">
|
||||||
|
<?php foreach ($staffStatus as $status) : ?>
|
||||||
|
<option value="<?= $status; ?>"<?= $employee->status === $status ? ' selected': ''; ?>><?= $this->getHtml(':status-' . $status); ?>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
<table class="list">
|
<table class="list">
|
||||||
<tr>
|
<tr>
|
||||||
<th><?= $this->getHtml('Position'); ?>
|
<th><?= $this->getHtml('Position'); ?>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user