Merge branch 'release/v27.0.0.OS'
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
$migrationList = [];
|
$migrationList = [];
|
||||||
|
$migrationList[] = 'v20200530_270009_update_module_names';
|
||||||
$migrationList[] = 'v20200518_270011_add_al_language';
|
$migrationList[] = 'v20200518_270011_add_al_language';
|
||||||
$migrationList[] = 'v20200429_270010_setting_groups';
|
$migrationList[] = 'v20200429_270010_setting_groups';
|
||||||
$migrationList[] = 'v20200411_270009_email_log';
|
$migrationList[] = 'v20200411_270009_email_log';
|
||||||
|
|||||||
16
core/migrations/v20200530_270009_update_module_names.php
Normal file
16
core/migrations/v20200530_270009_update_module_names.php
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
namespace Classes\Migration;
|
||||||
|
|
||||||
|
class v20200530_270009_update_module_names extends AbstractMigration {
|
||||||
|
|
||||||
|
public function up(){
|
||||||
|
$sql = <<<'SQL'
|
||||||
|
Update Settings set value = '1' where name = 'System: Reset Module Names';
|
||||||
|
SQL;
|
||||||
|
return $this->executeQuery($sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -28,57 +28,57 @@ class RoboFile extends \Robo\Tasks
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function languageList($client) {
|
public function languageList($client) {
|
||||||
$this->includeCientConfig($client);
|
$this->includeCientConfig($client);
|
||||||
$this->say("Supported Languages for ". $client);
|
$this->say("Supported Languages for ". $client);
|
||||||
$language = new \Metadata\Common\Model\SupportedLanguage();
|
$language = new \Metadata\Common\Model\SupportedLanguage();
|
||||||
$langs = $language->Find('1 = 1');
|
$langs = $language->Find('1 = 1');
|
||||||
|
|
||||||
$this->say(print_r(array_column($langs, 'name'), true));
|
$this->say(print_r(array_column($langs, 'name'), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function languageExport($client) {
|
public function languageExport($client) {
|
||||||
$this->includeCientConfig($client);
|
$this->includeCientConfig($client);
|
||||||
$language = new \Metadata\Common\Model\SupportedLanguage();
|
$language = new \Metadata\Common\Model\SupportedLanguage();
|
||||||
$languages = $language->Find('1 = 1 order by id');
|
$languages = $language->Find('1 = 1 order by id');
|
||||||
$data = [];
|
$data = [];
|
||||||
$data[0] = [];
|
$data[0] = [];
|
||||||
$data[0][] = 'Key';
|
$data[0][] = 'Key';
|
||||||
foreach ($languages as $lang) {
|
foreach ($languages as $lang) {
|
||||||
$data[0][] = $lang->name;
|
$data[0][] = $lang->name;
|
||||||
$trans = \Classes\LanguageManager::getTranslations($lang->name);
|
$trans = \Classes\LanguageManager::getTranslations($lang->name);
|
||||||
$trans = json_decode($trans, true)['messages'][''];
|
$trans = json_decode($trans, true)['messages'][''];
|
||||||
$count = 1;
|
$count = 1;
|
||||||
foreach ($trans as $enVal => $langVal) {
|
foreach ($trans as $enVal => $langVal) {
|
||||||
if (!isset($data[$count])) {
|
if (!isset($data[$count])) {
|
||||||
$data[$count] = [];
|
$data[$count] = [];
|
||||||
$data[$count][] = $enVal;
|
$data[$count][] = $enVal;
|
||||||
}
|
}
|
||||||
$data[$count][] = $langVal[0];
|
$data[$count][] = $langVal[0];
|
||||||
$count += 1;
|
$count += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$fp = fopen(CLIENT_BASE_PATH.'data/translations_export.csv', 'w');
|
$fp = fopen(CLIENT_BASE_PATH.'data/translations_export.csv', 'w');
|
||||||
foreach ($data as $fields) {
|
foreach ($data as $fields) {
|
||||||
fprintf($fp, chr(0xEF).chr(0xBB).chr(0xBF));
|
fprintf($fp, chr(0xEF).chr(0xBB).chr(0xBF));
|
||||||
fputcsv($fp, $fields);
|
fputcsv($fp, $fields);
|
||||||
}
|
}
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
$this->say('File saved');
|
$this->say('File saved');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function languageImport($client, $file) {
|
public function languageImport($client, $file) {
|
||||||
$this->includeCientConfig($client);
|
$this->includeCientConfig($client);
|
||||||
|
|
||||||
$language = new \Metadata\Common\Model\SupportedLanguage();
|
$language = new \Metadata\Common\Model\SupportedLanguage();
|
||||||
$languages = $language->Find('1 = 1 order by id');
|
$languages = $language->Find('1 = 1 order by id');
|
||||||
foreach ($languages as $language) {
|
foreach ($languages as $language) {
|
||||||
$str = $this->getUpdatedTranslationString($language->name, $file);
|
$str = $this->getUpdatedTranslationString($language->name, $file);
|
||||||
file_put_contents(
|
file_put_contents(
|
||||||
__DIR__.'/../lang/'.$language->name.'.po',
|
__DIR__.'/../lang/'.$language->name.'.po',
|
||||||
$str);
|
$str);
|
||||||
$this->say('Updated :'.realpath(__DIR__.'/../lang/'.$language->name.'.po'));
|
$this->say('Updated :'.realpath(__DIR__.'/../lang/'.$language->name.'.po'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function migrate($client, $action){
|
public function migrate($client, $action){
|
||||||
$this->includeCientConfig($client);
|
$this->includeCientConfig($client);
|
||||||
@@ -195,45 +195,45 @@ class RoboFile extends \Robo\Tasks
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $lang
|
* @param $lang
|
||||||
* @param $file
|
* @param $file
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
protected function getUpdatedTranslationString($lang, $file)
|
protected function getUpdatedTranslationString($lang, $file)
|
||||||
{
|
{
|
||||||
$handle = fopen(CLIENT_BASE_PATH . 'data/' . $file, "r");
|
$handle = fopen(CLIENT_BASE_PATH . 'data/' . $file, "r");
|
||||||
$langColumn = null;
|
$langColumn = null;
|
||||||
/* @var \Gettext\Translations $trans */
|
/* @var \Gettext\Translations $trans */
|
||||||
$trans = \Classes\LanguageManager::getTranslationsObject($lang);
|
$trans = \Classes\LanguageManager::getTranslationsObject($lang);
|
||||||
while (($data = fgetcsv($handle)) !== FALSE) {
|
while (($data = fgetcsv($handle)) !== FALSE) {
|
||||||
if ($langColumn === null) {
|
if ($langColumn === null) {
|
||||||
$currentColumn = 0;
|
$currentColumn = 0;
|
||||||
foreach ($data as $language) {
|
foreach ($data as $language) {
|
||||||
if ($language === $lang) {
|
if ($language === $lang) {
|
||||||
$langColumn = $currentColumn;
|
$langColumn = $currentColumn;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$currentColumn++;
|
$currentColumn++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($langColumn === null) {
|
if ($langColumn === null) {
|
||||||
$this->say('Invalid Language');
|
$this->say('Invalid Language');
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* @var \Gettext\Translation $tran */
|
/* @var \Gettext\Translation $tran */
|
||||||
$tran = $trans->find('', $data[0]);
|
$tran = $trans->find('', $data[0]);
|
||||||
if ($tran !== false) {
|
if ($tran !== false) {
|
||||||
$tran->setTranslation($data[$langColumn]);
|
$tran->setTranslation($data[$langColumn]);
|
||||||
} else {
|
} else {
|
||||||
$trans->insert('', $data[0]);
|
$trans->insert('', $data[0]);
|
||||||
$tran = $trans->find('', $data[0]);
|
$tran = $trans->find('', $data[0]);
|
||||||
$tran->setTranslation($data[$langColumn]);
|
$tran->setTranslation($data[$langColumn]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $trans->toPoString();
|
return $trans->toPoString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -285,8 +285,8 @@ class BaseService
|
|||||||
|
|
||||||
$childCompaniesIds = array();
|
$childCompaniesIds = array();
|
||||||
if (\Classes\SettingsManager::getInstance()->getSetting(
|
if (\Classes\SettingsManager::getInstance()->getSetting(
|
||||||
'System: Child Company Structure Managers Enabled'
|
'System: Child Company Structure Managers Enabled'
|
||||||
) == '1'
|
) == '1'
|
||||||
) {
|
) {
|
||||||
$childCompaniesResp = \Company\Common\Model\CompanyStructure::getAllChildCompanyStructures(
|
$childCompaniesResp = \Company\Common\Model\CompanyStructure::getAllChildCompanyStructures(
|
||||||
$cempObj->department
|
$cempObj->department
|
||||||
@@ -479,8 +479,8 @@ class BaseService
|
|||||||
|
|
||||||
$childCompaniesIds = array();
|
$childCompaniesIds = array();
|
||||||
if (SettingsManager::getInstance()->getSetting(
|
if (SettingsManager::getInstance()->getSetting(
|
||||||
'System: Child Company Structure Managers Enabled'
|
'System: Child Company Structure Managers Enabled'
|
||||||
) == '1'
|
) == '1'
|
||||||
) {
|
) {
|
||||||
$childCompaniesResp = CompanyStructure::getAllChildCompanyStructures($cempObj->department);
|
$childCompaniesResp = CompanyStructure::getAllChildCompanyStructures($cempObj->department);
|
||||||
$childCompanies = $childCompaniesResp->getObject();
|
$childCompanies = $childCompaniesResp->getObject();
|
||||||
@@ -560,8 +560,8 @@ class BaseService
|
|||||||
|
|
||||||
$childCompaniesIds = array();
|
$childCompaniesIds = array();
|
||||||
if (SettingsManager::getInstance()->getSetting(
|
if (SettingsManager::getInstance()->getSetting(
|
||||||
'System: Child Company Structure Managers Enabled'
|
'System: Child Company Structure Managers Enabled'
|
||||||
) == '1'
|
) == '1'
|
||||||
) {
|
) {
|
||||||
$childCompaniesResp = CompanyStructure::getAllChildCompanyStructures($cempObj->department);
|
$childCompaniesResp = CompanyStructure::getAllChildCompanyStructures($cempObj->department);
|
||||||
$childCompanies = $childCompaniesResp->getObject();
|
$childCompanies = $childCompaniesResp->getObject();
|
||||||
@@ -1350,7 +1350,6 @@ class BaseService
|
|||||||
$settings->name = "Instance: Key";
|
$settings->name = "Instance: Key";
|
||||||
}
|
}
|
||||||
$settings->value = $key;
|
$settings->value = $key;
|
||||||
$settings->category = 'Instance';
|
|
||||||
$settings->Save();
|
$settings->Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1377,17 +1376,11 @@ class BaseService
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
$data = AesCtr::decrypt($key, $instanceId, 256);
|
$data = AesCtr::decrypt($key, $instanceId, 256);
|
||||||
$arr = explode("|", $data);
|
$arr = explode("|", $data);
|
||||||
if ($arr[0] == KEY_PREFIX && $arr[1] == $instanceId) {
|
if ($arr[0] == KEY_PREFIX && $arr[1] == $instanceId) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
if (strlen($key) > 20) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1786,8 +1779,8 @@ END;
|
|||||||
) {
|
) {
|
||||||
$departmentHeadFound = true;
|
$departmentHeadFound = true;
|
||||||
} elseif (SettingsManager::getInstance()->getSetting(
|
} elseif (SettingsManager::getInstance()->getSetting(
|
||||||
'System: Child Company Structure Managers Enabled'
|
'System: Child Company Structure Managers Enabled'
|
||||||
) == '1'
|
) == '1'
|
||||||
) {
|
) {
|
||||||
$companyStructure = new CompanyStructure();
|
$companyStructure = new CompanyStructure();
|
||||||
$companyStructure->Load('id = ?', array($subordinate->department));
|
$companyStructure->Load('id = ?', array($subordinate->department));
|
||||||
@@ -1807,7 +1800,7 @@ END;
|
|||||||
$companyStructure->Load('id = ?', array($parentCompanyStructure));
|
$companyStructure->Load('id = ?', array($parentCompanyStructure));
|
||||||
}
|
}
|
||||||
} while (!empty($companyStructure->id)
|
} while (!empty($companyStructure->id)
|
||||||
&& !empty($parentCompanyStructure)
|
&& !empty($parentCompanyStructure)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ services:
|
|||||||
- 8090:8090
|
- 8090:8090
|
||||||
logging:
|
logging:
|
||||||
driver: none
|
driver: none
|
||||||
|
depends_on:
|
||||||
|
- mysql-testing
|
||||||
|
|
||||||
# Cypress container
|
# Cypress container
|
||||||
cypress:
|
cypress:
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ $ cd icehrm
|
|||||||
$ docker-compose -f docker-compose-prod.yaml up -d
|
$ docker-compose -f docker-compose-prod.yaml up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
- Visit [http://localhost:8070/](http://localhost:8070/) to load icehrm, that's it
|
- Visit [http://localhost:8070/](http://localhost:8070/) to load icehrm
|
||||||
|
|
||||||
You can find database and app data under `icehrm/docker/production`
|
You can find database and app data under `icehrm/docker/production`
|
||||||
|
|
||||||
@@ -38,6 +38,9 @@ docker-compose -f docker-compose-prod.yaml down
|
|||||||
For setting up your development environment watch [https://www.youtube.com/watch?v=sz8OV_ON6S8](https://www.youtube.com/watch?v=sz8OV_ON6S8)
|
For setting up your development environment watch [https://www.youtube.com/watch?v=sz8OV_ON6S8](https://www.youtube.com/watch?v=sz8OV_ON6S8)
|
||||||
|
|
||||||
|
|
||||||
|
Refer [docker documentation](https://docs.docker.com/develop/dev-best-practices/) for best practices
|
||||||
|
|
||||||
|
|
||||||
IceHrm Mobile App (Beta)
|
IceHrm Mobile App (Beta)
|
||||||
------------------------
|
------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -749,7 +749,12 @@ class EmployeeAdapter extends SubProfileEnabledAdapterBase {
|
|||||||
deleteBtn = '';
|
deleteBtn = '';
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line max-len
|
// eslint-disable-next-line max-len
|
||||||
let html = `<div style="width:110px;"><img class="tableActionButton" src="_BASE_images/user.png" style="cursor:pointer;" rel="tooltip" title="Login as this Employee" onclick="modJs.setAdminProfile(_id_);return false;"></img><img class="tableActionButton" src="_BASE_images/view.png" style="cursor:pointer;margin-left:15px;" rel="tooltip" title="View" onclick="modJs.view(_id_);return false;"></img><img class="tableActionButton" src="_BASE_images/edit.png" style="cursor:pointer;margin-left:15px;" rel="tooltip" title="Edit" onclick="modJs.edit(_id_);return false;"></img>${deleteBtn}</div>`;
|
let html = `<div style="width:120px;">
|
||||||
|
<img class="tableActionButton" src="_BASE_images/user.png" style="cursor:pointer;" rel="tooltip" title="Login as this Employee" onclick="modJs.setAdminProfile(_id_);return false;"></img>
|
||||||
|
<img class="tableActionButton" src="_BASE_images/view.png" style="cursor:pointer;margin-left:15px;" rel="tooltip" title="View" onclick="modJs.view(_id_);return false;"></img>
|
||||||
|
<img class="tableActionButton" src="_BASE_images/edit.png" style="cursor:pointer;margin-left:15px;" rel="tooltip" title="Edit" onclick="modJs.edit(_id_);return false;"></img>
|
||||||
|
${deleteBtn}
|
||||||
|
</div>`;
|
||||||
html = html.replace(/_id_/g, id);
|
html = html.replace(/_id_/g, id);
|
||||||
html = html.replace(/_BASE_/g, this.baseUrl);
|
html = html.replace(/_BASE_/g, this.baseUrl);
|
||||||
return html;
|
return html;
|
||||||
@@ -1213,7 +1218,7 @@ class TerminatedEmployeeAdapter extends EmployeeAdapter {
|
|||||||
|
|
||||||
getActionButtonsHtml(id) {
|
getActionButtonsHtml(id) {
|
||||||
// eslint-disable-next-line max-len
|
// eslint-disable-next-line max-len
|
||||||
let html = `<div style="width:110px;">
|
let html = `<div style="width:120px;">
|
||||||
<img class="tableActionButton" src="_BASE_images/edit.png" style="cursor:pointer;margin-left:15px;" rel="tooltip" title="Edit" onclick="modJs.edit(_id_);return false;"></img>
|
<img class="tableActionButton" src="_BASE_images/edit.png" style="cursor:pointer;margin-left:15px;" rel="tooltip" title="Edit" onclick="modJs.edit(_id_);return false;"></img>
|
||||||
<img class="tableActionButton" src="_BASE_images/delete.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Archive Employee" onclick="modJs.deleteEmployee(_id_);return false;"></img>
|
<img class="tableActionButton" src="_BASE_images/delete.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Archive Employee" onclick="modJs.deleteEmployee(_id_);return false;"></img>
|
||||||
<img class="tableActionButton" src="_BASE_images/redo.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Restore Employee" onclick="modJs.activateEmployee(_id_);return false;"></img>
|
<img class="tableActionButton" src="_BASE_images/redo.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Restore Employee" onclick="modJs.activateEmployee(_id_);return false;"></img>
|
||||||
@@ -1298,7 +1303,7 @@ class ArchivedEmployeeAdapter extends SubProfileEnabledAdapterBase {
|
|||||||
|
|
||||||
getActionButtonsHtml(id) {
|
getActionButtonsHtml(id) {
|
||||||
// eslint-disable-next-line max-len
|
// eslint-disable-next-line max-len
|
||||||
let html = '<div style="width:110px;"><img class="tableActionButton" src="_BASE_images/download.png" style="cursor:pointer;" rel="tooltip" title="Download Archived Data" onclick="modJs.download(_id_);return false;"></img><img class="tableActionButton" src="_BASE_images/delete.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Remove Archived Data" onclick="modJs.deleteRow(_id_);return false;"></img></div>';
|
let html = '<div style="width:120px;"><img class="tableActionButton" src="_BASE_images/download.png" style="cursor:pointer;" rel="tooltip" title="Download Archived Data" onclick="modJs.download(_id_);return false;"></img><img class="tableActionButton" src="_BASE_images/delete.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Remove Archived Data" onclick="modJs.deleteRow(_id_);return false;"></img></div>';
|
||||||
html = html.replace(/_id_/g, id);
|
html = html.replace(/_id_/g, id);
|
||||||
html = html.replace(/_BASE_/g, this.baseUrl);
|
html = html.replace(/_BASE_/g, this.baseUrl);
|
||||||
return html;
|
return html;
|
||||||
|
|||||||
@@ -170,7 +170,13 @@ class EmployeeTravelRecordApproverAdapter extends EmployeeTravelRecordAdminAdapt
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
class SubordinateEmployeeTravelRecordAdapter extends EmployeeTravelRecordAdminAdapter {
|
class SubordinateEmployeeTravelRecordAdapter extends EmployeeTravelRecordAdminAdapter {
|
||||||
|
constructor(endPoint, tab, filter, orderBy) {
|
||||||
|
super(endPoint, tab, filter, orderBy);
|
||||||
|
this.itemName = 'Travel';
|
||||||
|
this.itemNameLower = 'employeetravelrecord';
|
||||||
|
this.modulePathName = 'travel';
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|||||||
Reference in New Issue
Block a user