Merge branch 'release/v27.0.0.OS'
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
$migrationList = [];
|
||||
$migrationList[] = 'v20200530_270009_update_module_names';
|
||||
$migrationList[] = 'v20200518_270011_add_al_language';
|
||||
$migrationList[] = 'v20200429_270010_setting_groups';
|
||||
$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) {
|
||||
$this->includeCientConfig($client);
|
||||
$this->say("Supported Languages for ". $client);
|
||||
$language = new \Metadata\Common\Model\SupportedLanguage();
|
||||
$langs = $language->Find('1 = 1');
|
||||
$this->includeCientConfig($client);
|
||||
$this->say("Supported Languages for ". $client);
|
||||
$language = new \Metadata\Common\Model\SupportedLanguage();
|
||||
$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) {
|
||||
$this->includeCientConfig($client);
|
||||
$language = new \Metadata\Common\Model\SupportedLanguage();
|
||||
$languages = $language->Find('1 = 1 order by id');
|
||||
$data = [];
|
||||
$data[0] = [];
|
||||
$data[0][] = 'Key';
|
||||
foreach ($languages as $lang) {
|
||||
$data[0][] = $lang->name;
|
||||
$trans = \Classes\LanguageManager::getTranslations($lang->name);
|
||||
$trans = json_decode($trans, true)['messages'][''];
|
||||
$count = 1;
|
||||
foreach ($trans as $enVal => $langVal) {
|
||||
if (!isset($data[$count])) {
|
||||
$data[$count] = [];
|
||||
$data[$count][] = $enVal;
|
||||
}
|
||||
$data[$count][] = $langVal[0];
|
||||
$count += 1;
|
||||
}
|
||||
}
|
||||
$fp = fopen(CLIENT_BASE_PATH.'data/translations_export.csv', 'w');
|
||||
foreach ($data as $fields) {
|
||||
fprintf($fp, chr(0xEF).chr(0xBB).chr(0xBF));
|
||||
fputcsv($fp, $fields);
|
||||
}
|
||||
fclose($fp);
|
||||
$this->say('File saved');
|
||||
$this->includeCientConfig($client);
|
||||
$language = new \Metadata\Common\Model\SupportedLanguage();
|
||||
$languages = $language->Find('1 = 1 order by id');
|
||||
$data = [];
|
||||
$data[0] = [];
|
||||
$data[0][] = 'Key';
|
||||
foreach ($languages as $lang) {
|
||||
$data[0][] = $lang->name;
|
||||
$trans = \Classes\LanguageManager::getTranslations($lang->name);
|
||||
$trans = json_decode($trans, true)['messages'][''];
|
||||
$count = 1;
|
||||
foreach ($trans as $enVal => $langVal) {
|
||||
if (!isset($data[$count])) {
|
||||
$data[$count] = [];
|
||||
$data[$count][] = $enVal;
|
||||
}
|
||||
$data[$count][] = $langVal[0];
|
||||
$count += 1;
|
||||
}
|
||||
}
|
||||
$fp = fopen(CLIENT_BASE_PATH.'data/translations_export.csv', 'w');
|
||||
foreach ($data as $fields) {
|
||||
fprintf($fp, chr(0xEF).chr(0xBB).chr(0xBF));
|
||||
fputcsv($fp, $fields);
|
||||
}
|
||||
fclose($fp);
|
||||
$this->say('File saved');
|
||||
}
|
||||
|
||||
public function languageImport($client, $file) {
|
||||
$this->includeCientConfig($client);
|
||||
$this->includeCientConfig($client);
|
||||
|
||||
$language = new \Metadata\Common\Model\SupportedLanguage();
|
||||
$languages = $language->Find('1 = 1 order by id');
|
||||
foreach ($languages as $language) {
|
||||
$str = $this->getUpdatedTranslationString($language->name, $file);
|
||||
file_put_contents(
|
||||
__DIR__.'/../lang/'.$language->name.'.po',
|
||||
$str);
|
||||
$this->say('Updated :'.realpath(__DIR__.'/../lang/'.$language->name.'.po'));
|
||||
}
|
||||
}
|
||||
$language = new \Metadata\Common\Model\SupportedLanguage();
|
||||
$languages = $language->Find('1 = 1 order by id');
|
||||
foreach ($languages as $language) {
|
||||
$str = $this->getUpdatedTranslationString($language->name, $file);
|
||||
file_put_contents(
|
||||
__DIR__.'/../lang/'.$language->name.'.po',
|
||||
$str);
|
||||
$this->say('Updated :'.realpath(__DIR__.'/../lang/'.$language->name.'.po'));
|
||||
}
|
||||
}
|
||||
|
||||
public function migrate($client, $action){
|
||||
$this->includeCientConfig($client);
|
||||
@@ -195,45 +195,45 @@ class RoboFile extends \Robo\Tasks
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $lang
|
||||
* @param $file
|
||||
* @return mixed
|
||||
*/
|
||||
protected function getUpdatedTranslationString($lang, $file)
|
||||
{
|
||||
$handle = fopen(CLIENT_BASE_PATH . 'data/' . $file, "r");
|
||||
$langColumn = null;
|
||||
/* @var \Gettext\Translations $trans */
|
||||
$trans = \Classes\LanguageManager::getTranslationsObject($lang);
|
||||
while (($data = fgetcsv($handle)) !== FALSE) {
|
||||
if ($langColumn === null) {
|
||||
$currentColumn = 0;
|
||||
foreach ($data as $language) {
|
||||
if ($language === $lang) {
|
||||
$langColumn = $currentColumn;
|
||||
break;
|
||||
}
|
||||
$currentColumn++;
|
||||
}
|
||||
/**
|
||||
* @param $lang
|
||||
* @param $file
|
||||
* @return mixed
|
||||
*/
|
||||
protected function getUpdatedTranslationString($lang, $file)
|
||||
{
|
||||
$handle = fopen(CLIENT_BASE_PATH . 'data/' . $file, "r");
|
||||
$langColumn = null;
|
||||
/* @var \Gettext\Translations $trans */
|
||||
$trans = \Classes\LanguageManager::getTranslationsObject($lang);
|
||||
while (($data = fgetcsv($handle)) !== FALSE) {
|
||||
if ($langColumn === null) {
|
||||
$currentColumn = 0;
|
||||
foreach ($data as $language) {
|
||||
if ($language === $lang) {
|
||||
$langColumn = $currentColumn;
|
||||
break;
|
||||
}
|
||||
$currentColumn++;
|
||||
}
|
||||
|
||||
if ($langColumn === null) {
|
||||
$this->say('Invalid Language');
|
||||
exit();
|
||||
}
|
||||
} else {
|
||||
/* @var \Gettext\Translation $tran */
|
||||
$tran = $trans->find('', $data[0]);
|
||||
if ($tran !== false) {
|
||||
$tran->setTranslation($data[$langColumn]);
|
||||
} else {
|
||||
$trans->insert('', $data[0]);
|
||||
if ($langColumn === null) {
|
||||
$this->say('Invalid Language');
|
||||
exit();
|
||||
}
|
||||
} else {
|
||||
/* @var \Gettext\Translation $tran */
|
||||
$tran = $trans->find('', $data[0]);
|
||||
if ($tran !== false) {
|
||||
$tran->setTranslation($data[$langColumn]);
|
||||
} else {
|
||||
$trans->insert('', $data[0]);
|
||||
$tran = $trans->find('', $data[0]);
|
||||
$tran->setTranslation($data[$langColumn]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $trans->toPoString();
|
||||
}
|
||||
return $trans->toPoString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -285,8 +285,8 @@ class BaseService
|
||||
|
||||
$childCompaniesIds = array();
|
||||
if (\Classes\SettingsManager::getInstance()->getSetting(
|
||||
'System: Child Company Structure Managers Enabled'
|
||||
) == '1'
|
||||
'System: Child Company Structure Managers Enabled'
|
||||
) == '1'
|
||||
) {
|
||||
$childCompaniesResp = \Company\Common\Model\CompanyStructure::getAllChildCompanyStructures(
|
||||
$cempObj->department
|
||||
@@ -479,8 +479,8 @@ class BaseService
|
||||
|
||||
$childCompaniesIds = array();
|
||||
if (SettingsManager::getInstance()->getSetting(
|
||||
'System: Child Company Structure Managers Enabled'
|
||||
) == '1'
|
||||
'System: Child Company Structure Managers Enabled'
|
||||
) == '1'
|
||||
) {
|
||||
$childCompaniesResp = CompanyStructure::getAllChildCompanyStructures($cempObj->department);
|
||||
$childCompanies = $childCompaniesResp->getObject();
|
||||
@@ -560,8 +560,8 @@ class BaseService
|
||||
|
||||
$childCompaniesIds = array();
|
||||
if (SettingsManager::getInstance()->getSetting(
|
||||
'System: Child Company Structure Managers Enabled'
|
||||
) == '1'
|
||||
'System: Child Company Structure Managers Enabled'
|
||||
) == '1'
|
||||
) {
|
||||
$childCompaniesResp = CompanyStructure::getAllChildCompanyStructures($cempObj->department);
|
||||
$childCompanies = $childCompaniesResp->getObject();
|
||||
@@ -1350,7 +1350,6 @@ class BaseService
|
||||
$settings->name = "Instance: Key";
|
||||
}
|
||||
$settings->value = $key;
|
||||
$settings->category = 'Instance';
|
||||
$settings->Save();
|
||||
}
|
||||
|
||||
@@ -1377,17 +1376,11 @@ class BaseService
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
$data = AesCtr::decrypt($key, $instanceId, 256);
|
||||
$arr = explode("|", $data);
|
||||
if ($arr[0] == KEY_PREFIX && $arr[1] == $instanceId) {
|
||||
return true;
|
||||
}
|
||||
*/
|
||||
|
||||
if (strlen($key) > 20) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -1786,8 +1779,8 @@ END;
|
||||
) {
|
||||
$departmentHeadFound = true;
|
||||
} elseif (SettingsManager::getInstance()->getSetting(
|
||||
'System: Child Company Structure Managers Enabled'
|
||||
) == '1'
|
||||
'System: Child Company Structure Managers Enabled'
|
||||
) == '1'
|
||||
) {
|
||||
$companyStructure = new CompanyStructure();
|
||||
$companyStructure->Load('id = ?', array($subordinate->department));
|
||||
@@ -1807,7 +1800,7 @@ END;
|
||||
$companyStructure->Load('id = ?', array($parentCompanyStructure));
|
||||
}
|
||||
} while (!empty($companyStructure->id)
|
||||
&& !empty($parentCompanyStructure)
|
||||
&& !empty($parentCompanyStructure)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,8 @@ services:
|
||||
- 8090:8090
|
||||
logging:
|
||||
driver: none
|
||||
depends_on:
|
||||
- mysql-testing
|
||||
|
||||
# Cypress container
|
||||
cypress:
|
||||
|
||||
@@ -25,7 +25,7 @@ $ cd icehrm
|
||||
$ 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`
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Refer [docker documentation](https://docs.docker.com/develop/dev-best-practices/) for best practices
|
||||
|
||||
|
||||
IceHrm Mobile App (Beta)
|
||||
------------------------
|
||||
|
||||
|
||||
@@ -749,7 +749,12 @@ class EmployeeAdapter extends SubProfileEnabledAdapterBase {
|
||||
deleteBtn = '';
|
||||
}
|
||||
// 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(/_BASE_/g, this.baseUrl);
|
||||
return html;
|
||||
@@ -1213,7 +1218,7 @@ class TerminatedEmployeeAdapter extends EmployeeAdapter {
|
||||
|
||||
getActionButtonsHtml(id) {
|
||||
// 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/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>
|
||||
@@ -1298,7 +1303,7 @@ class ArchivedEmployeeAdapter extends SubProfileEnabledAdapterBase {
|
||||
|
||||
getActionButtonsHtml(id) {
|
||||
// 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(/_BASE_/g, this.baseUrl);
|
||||
return html;
|
||||
|
||||
@@ -170,7 +170,13 @@ class EmployeeTravelRecordApproverAdapter extends EmployeeTravelRecordAdminAdapt
|
||||
*/
|
||||
|
||||
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 = {
|
||||
|
||||
Reference in New Issue
Block a user