mirror of
https://github.com/Karaka-Management/oms-HumanResourceManagement.git
synced 2026-01-11 20:28:40 +00:00
Went through todos
This commit is contained in:
parent
a463db65df
commit
fbbc8a12a9
|
|
@ -37,6 +37,7 @@ use phpOMS\Message\Http\RequestStatusCode;
|
|||
use phpOMS\Message\NotificationLevel;
|
||||
use phpOMS\Message\RequestAbstract;
|
||||
use phpOMS\Message\ResponseAbstract;
|
||||
use phpOMS\Security\EncryptionHelper;
|
||||
use phpOMS\Stdlib\Base\AddressType;
|
||||
|
||||
/**
|
||||
|
|
@ -46,6 +47,9 @@ use phpOMS\Stdlib\Base\AddressType;
|
|||
* @license OMS License 2.0
|
||||
* @link https://jingga.app
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @feature List of assets and documents handed over to employees (to be returned on leave)
|
||||
* https://github.com/Karaka-Management/oms-HumanResourceManagement/issues/4
|
||||
*/
|
||||
final class ApiController extends Controller
|
||||
{
|
||||
|
|
@ -423,9 +427,12 @@ final class ApiController extends Controller
|
|||
$history->start = $request->getDataDateTime('start') ?? new \DateTime('now');
|
||||
$history->end = $request->getDataDateTime('end');
|
||||
$history->educationTitle = $request->getDataString('title') ?? '';
|
||||
$history->score = $request->getDataString('score') ?? '';
|
||||
$history->passed = $request->getDataBool('passed') ?? true;
|
||||
|
||||
$history->score = !empty($request->getDataString('score') ?? '') && !empty($_SERVER['OMS_PRIVATE_KEY_I'] ?? '')
|
||||
? (EncryptionHelper::encryptShared($request->getDataString('score') ?? '', $_SERVER['OMS_PRIVATE_KEY_I']))
|
||||
: ($request->getDataString('score') ?? '');
|
||||
|
||||
$history->address = $this->app->moduleManager->get('Admin', 'Api')->createAddressFromRequest($request);
|
||||
$history->address->type = AddressType::EDUCATION;
|
||||
|
||||
|
|
@ -467,6 +474,7 @@ final class ApiController extends Controller
|
|||
account: $request->header->account,
|
||||
basePath: __DIR__ . '/../../../Modules/Media/Files' . $path,
|
||||
virtualPath: $path,
|
||||
encryptionKey: $_SERVER['OMS_PRIVATE_KEY_I'] ?? '',
|
||||
pathSettings: PathSettings::FILE_PATH,
|
||||
hasAccountRelation: false,
|
||||
readContent: $request->getDataBool('parse_content') ?? false,
|
||||
|
|
@ -553,7 +561,10 @@ final class ApiController extends Controller
|
|||
return;
|
||||
}
|
||||
|
||||
$request->setData('isencrypted', true, true);
|
||||
$request->setData('isvisible', false, true);
|
||||
$request->setData('virtualpath', '/Modules/HumanResourceManagement/Employee/' . $request->getData('id'), true);
|
||||
|
||||
$this->app->moduleManager->get('Editor', 'Api')->apiEditorCreate($request, $response, $data);
|
||||
|
||||
if ($response->header->status !== RequestStatusCode::R_200) {
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ use phpOMS\DataStorage\Database\Query\OrderType;
|
|||
use phpOMS\Message\Http\RequestStatusCode;
|
||||
use phpOMS\Message\RequestAbstract;
|
||||
use phpOMS\Message\ResponseAbstract;
|
||||
use phpOMS\Security\EncryptionHelper;
|
||||
use phpOMS\Stdlib\Base\SmartDateTime;
|
||||
use phpOMS\Views\View;
|
||||
|
||||
|
|
@ -153,6 +154,24 @@ final class BackendController extends Controller
|
|||
return $view;
|
||||
}
|
||||
|
||||
if (!empty($_SERVER['OMS_PRIVATE_KEY_I'] ?? '')) {
|
||||
foreach ($view->data['employee']->educationHistory as $history) {
|
||||
$history->score = !empty($history->score)
|
||||
? (EncryptionHelper::decryptShared($history->score, $_SERVER['OMS_PRIVATE_KEY_I']))
|
||||
: $history->score;
|
||||
}
|
||||
|
||||
foreach ($view->data['employee']->notes as $note) {
|
||||
$note->plain = !empty($note->plain)
|
||||
? (EncryptionHelper::decryptShared($note->plain, $_SERVER['OMS_PRIVATE_KEY_I']))
|
||||
: $note->plain;
|
||||
|
||||
$note->content = !empty($note->content)
|
||||
? (EncryptionHelper::decryptShared($note->content, $_SERVER['OMS_PRIVATE_KEY_I']))
|
||||
: $note->content;
|
||||
}
|
||||
}
|
||||
|
||||
$view->setTemplate('/Modules/HumanResourceManagement/Theme/Backend/staff-view');
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002402001, $request, $response);
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,12 @@ use Modules\Profile\Models\Profile;
|
|||
* @license OMS License 2.0
|
||||
* @link https://jingga.app
|
||||
* @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
|
||||
{
|
||||
|
|
@ -40,6 +46,9 @@ class Employee implements \JsonSerializable
|
|||
/**
|
||||
* Account profile.
|
||||
*
|
||||
* @question Employees are linked to profiles, they should probably be linked to accounts?
|
||||
* https://github.com/Karaka-Management/oms-HumanResourceManagement/issues/11
|
||||
*
|
||||
* @var Profile
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user