Compare commits
25
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
704546fee2 | ||
|
|
5df15d39c1 | ||
|
|
143bcac1f9 | ||
|
|
84548c4f63 | ||
|
|
e5eccf32a7 | ||
|
|
f1dcc6b6a0 | ||
|
|
b6c0256b49 | ||
|
|
e31bf5a4b9 | ||
|
|
06a3172a38 | ||
|
|
e74ca00902 | ||
|
|
28aa16f35c | ||
|
|
fb3b5b562e | ||
|
|
8663a7aff1 | ||
|
|
e9baf45d7c | ||
|
|
2abe52963f | ||
|
|
da55c7a2d2 | ||
|
|
5cd7963f6f | ||
|
|
d986a2b5bb | ||
|
|
1ee4fb4ba1 | ||
|
|
b06780c466 | ||
|
|
5ec497e11d | ||
|
|
df3b6e968a | ||
|
|
3ceb427479 | ||
|
|
d3b4748cba | ||
|
|
2a9e65d8a8 |
No files matched your search
@@ -14,7 +14,6 @@ install:
|
|||||||
script: ant build-ci
|
script: ant build-ci
|
||||||
language: php
|
language: php
|
||||||
php:
|
php:
|
||||||
- '5.6'
|
|
||||||
- '7.0'
|
- '7.0'
|
||||||
- '7.1'
|
- '7.1'
|
||||||
- '7.2'
|
- '7.2'
|
||||||
|
|||||||
Vendored
+9
-3
@@ -3,8 +3,6 @@ Vagrant.configure("2") do |config|
|
|||||||
config.vm.box_version = "1.0.0"
|
config.vm.box_version = "1.0.0"
|
||||||
config.vm.network "private_network", ip: "192.168.10.12"
|
config.vm.network "private_network", ip: "192.168.10.12"
|
||||||
config.vm.synced_folder ".", "/vagrant", type: "nfs"
|
config.vm.synced_folder ".", "/vagrant", type: "nfs"
|
||||||
config.vm.synced_folder "./deployment/vagrant/sites-available", "/etc/nginx/sites-enabled", type: "nfs"
|
|
||||||
config.vm.synced_folder "./deployment/vagrant/ssl", "/etc/nginx/ssl", type: "nfs"
|
|
||||||
|
|
||||||
config.vm.provider "virtualbox" do |vb|
|
config.vm.provider "virtualbox" do |vb|
|
||||||
vb.memory = "1024"
|
vb.memory = "1024"
|
||||||
@@ -13,9 +11,17 @@ Vagrant.configure("2") do |config|
|
|||||||
end
|
end
|
||||||
|
|
||||||
config.vm.provision "shell", inline: <<-SHELL
|
config.vm.provision "shell", inline: <<-SHELL
|
||||||
|
sudo rm /etc/nginx/ssl/icehrm.*
|
||||||
|
sudo ln -s /vagrant/deployment/vagrant/ssl/icehrm.crt /etc/nginx/ssl/icehrm.crt
|
||||||
|
sudo ln -s /vagrant/deployment/vagrant/ssl/icehrm.key /etc/nginx/ssl/icehrm.key
|
||||||
|
|
||||||
|
sudo rm /etc/nginx/sites-enabled/default
|
||||||
|
sudo ln -s /vagrant/deployment/vagrant/sites-available/default /etc/nginx/sites-enabled/default
|
||||||
|
|
||||||
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
|
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
|
||||||
systemctl restart sshd.service
|
|
||||||
sudo service nginx restart
|
sudo service nginx restart
|
||||||
|
sudo chmod 755 -R /var/log
|
||||||
SHELL
|
SHELL
|
||||||
|
|
||||||
config.vm.hostname = "icehrm.os"
|
config.vm.hostname = "icehrm.os"
|
||||||
|
|||||||
@@ -17,6 +17,13 @@ if($group == 'admin' || $group == 'modules'){
|
|||||||
$name = str_replace("..","",$name);
|
$name = str_replace("..","",$name);
|
||||||
$name = str_replace("/","",$name);
|
$name = str_replace("/","",$name);
|
||||||
include APP_BASE_PATH.'/'.$group.'/'.$name.'/index.php';
|
include APP_BASE_PATH.'/'.$group.'/'.$name.'/index.php';
|
||||||
|
}else if ($group == 'extension'){
|
||||||
|
$name = str_replace("..","",$name);
|
||||||
|
$name = str_replace("/","",$name);
|
||||||
|
$moduleName = $name;
|
||||||
|
$moduleGroup = 'extensions';
|
||||||
|
$extensionIndex = APP_BASE_PATH.'/../extensions/'.$name.'/web/index.php';
|
||||||
|
include APP_BASE_PATH.'extensions/wrapper.php';
|
||||||
}else{
|
}else{
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
../core/lib/composer/vendor/gettext/languages/bin/export-plural-rules
|
||||||
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
../core/lib/composer/vendor/cebe/markdown/bin/markdown
|
||||||
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
../core/lib/composer/vendor/pdepend/pdepend/src/bin/pdepend
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
../core/lib/composer/vendor/mayflower/php-codebrowser/bin/phpcb
|
||||||
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
../core/lib/composer/vendor/squizlabs/php_codesniffer/scripts/phpcbf
|
||||||
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
../core/lib/composer/vendor/sebastian/phpcpd/composer/bin/phpcpd
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
../core/lib/composer/vendor/squizlabs/php_codesniffer/scripts/phpcs
|
||||||
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
../core/lib/composer/vendor/phploc/phploc/phploc
|
||||||
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
../core/lib/composer/vendor/phpunit/phpunit/phpunit
|
||||||
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
../core/lib/composer/vendor/consolidation/self-update/scripts/release
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project name="icehrm" default="build">
|
<project name="icehrm" default="build">
|
||||||
<!-- By default, we assume all tools to be on the $PATH -->
|
<!-- By default, we assume all tools to be on the $PATH -->
|
||||||
<property name="toolsdir" value="${basedir}/tools/"/>
|
<property name="toolsdir" value="${basedir}/bin/"/>
|
||||||
<property name="destination" value="${basedir}/build/app"/>
|
<property name="destination" value="${basedir}/build/app"/>
|
||||||
<property name="testdir" value="${basedir}/build/test"/>
|
<property name="testdir" value="${basedir}/build/test"/>
|
||||||
<property name="origin" value="${basedir}"/>
|
<property name="origin" value="${basedir}"/>
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
<?php
|
||||||
|
define('CLIENT_PATH',dirname(__FILE__));
|
||||||
|
include ("config.base.php");
|
||||||
|
include ("include.common.php");
|
||||||
|
include("server.includes.inc.php");
|
||||||
|
|
||||||
|
if(\Classes\SettingsManager::getInstance()->getSetting('Api: REST Api Enabled') == '1') {
|
||||||
|
|
||||||
|
if (defined('SYM_CLIENT')) {
|
||||||
|
define('REST_API_PATH', '/'.SYM_CLIENT.'/');
|
||||||
|
} else if (!defined('REST_API_PATH')){
|
||||||
|
define('REST_API_PATH', '/');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
\Utils\LogManager::getInstance()->info("Request: " . $_REQUEST);
|
||||||
|
|
||||||
|
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
|
||||||
|
http_response_code(200);
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
$echoRoute = \Classes\Macaw::get(REST_API_PATH . 'echo', function () {
|
||||||
|
echo "Echo " . rand();
|
||||||
|
});
|
||||||
|
|
||||||
|
\Utils\LogManager::getInstance()->debug('Api registered URI: '.$echoRoute);
|
||||||
|
|
||||||
|
$moduleManagers = \Classes\BaseService::getInstance()->getModuleManagers();
|
||||||
|
|
||||||
|
foreach ($moduleManagers as $moduleManagerObj) {
|
||||||
|
|
||||||
|
$moduleManagerObj->setupRestEndPoints();
|
||||||
|
}
|
||||||
|
$uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
|
||||||
|
$method = $_SERVER['REQUEST_METHOD'];
|
||||||
|
\Utils\LogManager::getInstance()->debug('Api dispatch URI: '.$uri);
|
||||||
|
\Utils\LogManager::getInstance()->debug('Api dispatch method: '.$uri);
|
||||||
|
if (!defined('SYM_CLIENT')) {
|
||||||
|
//For hosted installations, dispatch will be done in app/index
|
||||||
|
\Classes\Macaw::dispatch();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}else{
|
||||||
|
echo "REST Api is not enabled. Please set 'Api: REST Api Enabled' setting to true";
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
<?php
|
||||||
|
define('CLIENT_PATH',dirname(__FILE__));
|
||||||
|
include ("config.base.php");
|
||||||
|
include ("include.common.php");
|
||||||
|
include("server.includes.inc.php");
|
||||||
|
|
||||||
|
if(\Classes\SettingsManager::getInstance()->getSetting('Api: REST Api Enabled') == '1') {
|
||||||
|
|
||||||
|
\Utils\LogManager::getInstance()->info("Request: " . $_REQUEST);
|
||||||
|
|
||||||
|
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
|
||||||
|
http_response_code(200);
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
define('REST_API_PATH', '/');
|
||||||
|
|
||||||
|
$echoRoute = \Classes\Macaw::get(REST_API_PATH . 'echo', function () {
|
||||||
|
echo "Echo " . rand();
|
||||||
|
});
|
||||||
|
|
||||||
|
\Utils\LogManager::getInstance()->debug('Api registered URI: '.$echoRoute);
|
||||||
|
|
||||||
|
$moduleManagers = \Classes\BaseService::getInstance()->getModuleManagers();
|
||||||
|
|
||||||
|
foreach ($moduleManagers as $moduleManagerObj) {
|
||||||
|
|
||||||
|
$moduleManagerObj->setupRestEndPoints();
|
||||||
|
}
|
||||||
|
$method = $_SERVER['REQUEST_METHOD'];
|
||||||
|
if (strtoupper($method) === 'GET') {
|
||||||
|
\Classes\IceRoute::dispatch($_GET['url'], $method);
|
||||||
|
} else {
|
||||||
|
$method = strtoupper($_REQUEST['method']);
|
||||||
|
\Classes\IceRoute::dispatch($_REQUEST['url'], $method);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}else{
|
||||||
|
echo "REST Api is not enabled. Please set 'Api: REST Api Enabled' setting to true";
|
||||||
|
}
|
||||||
@@ -13,10 +13,10 @@ if(!defined('HOME_LINK_OTHERS')){
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Version
|
//Version
|
||||||
define('VERSION', '28.1.0.OS');
|
define('VERSION', '28.1.1.OS');
|
||||||
define('CACHE_VALUE', '28.1.0.OS.2020-10311445');
|
define('CACHE_VALUE', '28.1.1.OS.2020-11071143');
|
||||||
define('VERSION_NUMBER', '280100');
|
define('VERSION_NUMBER', '280101');
|
||||||
define('VERSION_DATE', '31/10/2020');
|
define('VERSION_DATE', '07/11/2020');
|
||||||
|
|
||||||
if(!defined('CONTACT_EMAIL')){define('CONTACT_EMAIL','icehrm@gamonoid.com');}
|
if(!defined('CONTACT_EMAIL')){define('CONTACT_EMAIL','icehrm@gamonoid.com');}
|
||||||
if(!defined('KEY_PREFIX')){define('KEY_PREFIX','IceHrm');}
|
if(!defined('KEY_PREFIX')){define('KEY_PREFIX','IceHrm');}
|
||||||
@@ -36,3 +36,7 @@ define('ALL_CLIENT_BASE_PATH', '/var/www/icehrm.app/icehrmapp/');
|
|||||||
define('LDAP_ENABLED', true);
|
define('LDAP_ENABLED', true);
|
||||||
define('RECRUITMENT_ENABLED', false);
|
define('RECRUITMENT_ENABLED', false);
|
||||||
define('APP_WEB_URL', 'https://icehrm.com');
|
define('APP_WEB_URL', 'https://icehrm.com');
|
||||||
|
|
||||||
|
if (!defined('EXTENSIONS_URL')) {
|
||||||
|
define('EXTENSIONS_URL', str_replace('/web/', '/extensions/', BASE_URL));
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
use Classes\ExtensionManager;
|
||||||
|
use Utils\LogManager;
|
||||||
|
|
||||||
|
if (!isset($extensionIndex)) {
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
define('MODULE_PATH',APP_BASE_PATH.'extensions/'.$moduleName);
|
||||||
|
include APP_BASE_PATH.'header.php';
|
||||||
|
$extensionManager = new ExtensionManager();
|
||||||
|
$meta = $extensionManager->getExtensionMetaData($moduleName);
|
||||||
|
if (!$meta) {
|
||||||
|
LogManager::getInstance()->error("Extension metadata.json not found for $moduleName");
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($meta->headless) {
|
||||||
|
LogManager::getInstance()->error("Extension running in headless mode for $moduleName");
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<script type="text/javascript" src="<?=BASE_URL.'dist/vendorReact.js'?>?v=<?=$jsVersion?>"></script>
|
||||||
|
<script type="text/javascript" src="<?=BASE_URL.'dist/vendorAntd.js'?>?v=<?=$jsVersion?>"></script>
|
||||||
|
<script type="text/javascript" src="<?=BASE_URL.'dist/vendorAntdIcons.js'?>?v=<?=$jsVersion?>"></script>
|
||||||
|
<script type="text/javascript" src="<?=BASE_URL.'dist/vendorAntv.js'?>?v=<?=$jsVersion?>"></script>
|
||||||
|
<script type="text/javascript" src="<?=BASE_URL.'dist/vendorOther.js'?>?v=<?=$jsVersion?>"></script>
|
||||||
|
<script type="text/javascript" src="<?=EXTENSIONS_URL.$moduleName.'/dist/'.$moduleName.'.js'?>?v=<?=$jsVersion?>"></script>
|
||||||
|
<?php
|
||||||
|
include $extensionIndex;
|
||||||
|
include APP_BASE_PATH.'footer.php';
|
||||||
|
?>
|
||||||
@@ -215,6 +215,26 @@ if (defined('SYM_CLIENT')) {
|
|||||||
|
|
||||||
<?php }?>
|
<?php }?>
|
||||||
|
|
||||||
|
<?php foreach($extensions as $menu){?>
|
||||||
|
<?php if(count($menu['menu']) == 0){continue;}?>
|
||||||
|
<li class="treeview" ref="<?="extension_".str_replace(" ", "_", $menu['name'])?>">
|
||||||
|
<a href="#">
|
||||||
|
<i class="fa <?=!isset($mainIcons[$menu['name']])?"fa-th":$mainIcons[$menu['name']];?>"></i></i> <span><?=\Classes\LanguageManager::tran($menu['name'])?></span>
|
||||||
|
<i class="fa fa-angle-left pull-right"></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<ul class="treeview-menu" id="<?="extension_".str_replace(" ", "_", $menu['name'])?>">
|
||||||
|
<?php foreach ($menu['menu'] as $item){?>
|
||||||
|
<li>
|
||||||
|
<a data-turbolinks="true" href="<?=CLIENT_BASE_URL?>?g=extension&n=<?=$item['name']?>&m=<?="extension_".str_replace(" ", "_", $menu['name'])?>">
|
||||||
|
<i class="fa <?=!isset($item['icon'])?"fa-angle-double-right":$item['icon']?>"></i> <?=\Classes\LanguageManager::tran($item['label'])?>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<?php }?>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<?php }?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if(file_exists(CLIENT_PATH.'/third_party_meta.json')){
|
if(file_exists(CLIENT_PATH.'/third_party_meta.json')){
|
||||||
$tpModules = json_decode(file_get_contents(CLIENT_PATH.'/third_party_meta.json'),true);
|
$tpModules = json_decode(file_get_contents(CLIENT_PATH.'/third_party_meta.json'),true);
|
||||||
|
|||||||
+1
-1
@@ -277,7 +277,7 @@ $csrfToken = sha1(rand(4500, 100000) . time(). CLIENT_BASE_URL);
|
|||||||
<div class="col-lg-6 col-md-8 col-xs-10">
|
<div class="col-lg-6 col-md-8 col-xs-10">
|
||||||
<div class="bg-white-2 h-100 px-11 pt-11 pb-7">
|
<div class="bg-white-2 h-100 px-11 pt-11 pb-7">
|
||||||
<div class="row d-flex justify-content-center">
|
<div class="row d-flex justify-content-center">
|
||||||
<img src="<?=$logoFileUrl?>"/>
|
<img src="<?=$logoFileUrl?>" style="max-width:100%;max-height:280px;"/>
|
||||||
</div>
|
</div>
|
||||||
<hr/>
|
<hr/>
|
||||||
<?php if ($gsuiteEnabled) {?>
|
<?php if ($gsuiteEnabled) {?>
|
||||||
|
|||||||
+49
-2
@@ -291,6 +291,12 @@ foreach ($ams as $am) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$extensionManager = new \Classes\ExtensionManager();
|
||||||
|
$extensionData = $extensionManager->setupExtensions();
|
||||||
|
$extensionIcons = $extensionData[0];
|
||||||
|
$extensionTemp = $extensionData[1];
|
||||||
|
$extensionMenus = array_keys($extensionIcons);
|
||||||
|
|
||||||
foreach ($adminModulesTemp as $k => $v) {
|
foreach ($adminModulesTemp as $k => $v) {
|
||||||
ksort($adminModulesTemp[$k]);
|
ksort($adminModulesTemp[$k]);
|
||||||
}
|
}
|
||||||
@@ -299,6 +305,10 @@ foreach ($userModulesTemp as $k => $v) {
|
|||||||
ksort($userModulesTemp[$k]);
|
ksort($userModulesTemp[$k]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach ($extensionTemp as $k => $v) {
|
||||||
|
ksort($extensionTemp[$k]);
|
||||||
|
}
|
||||||
|
|
||||||
$adminIcons = json_decode(file_get_contents(CLIENT_PATH.'/admin/meta.json'), true);
|
$adminIcons = json_decode(file_get_contents(CLIENT_PATH.'/admin/meta.json'), true);
|
||||||
$adminMenus = array_keys($adminIcons);
|
$adminMenus = array_keys($adminIcons);
|
||||||
|
|
||||||
@@ -332,8 +342,6 @@ foreach ($userMenus as $menu) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$mainIcons = array_merge($adminIcons, $userIcons);
|
|
||||||
|
|
||||||
foreach ($userModulesTemp as $k => $v) {
|
foreach ($userModulesTemp as $k => $v) {
|
||||||
if (!in_array($k, $added)) {
|
if (!in_array($k, $added)) {
|
||||||
$arr = array("name"=>$k,"menu"=>$userModulesTemp[$k]);
|
$arr = array("name"=>$k,"menu"=>$userModulesTemp[$k]);
|
||||||
@@ -341,6 +349,25 @@ foreach ($userModulesTemp as $k => $v) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$extensions = array();
|
||||||
|
foreach ($extensionMenus as $menu) {
|
||||||
|
if (isset($extensionTemp[$menu])) {
|
||||||
|
$arr = array("name"=>$menu,"menu"=>$extensionTemp[$menu]);
|
||||||
|
$extensions[] = $arr;
|
||||||
|
$added[] = $menu;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($extensionTemp as $k => $v) {
|
||||||
|
if (!in_array($k, $added)) {
|
||||||
|
$arr = array("name"=>$k,"menu"=>$extensionTemp[$k]);
|
||||||
|
$extensions[] = $arr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Merge icons
|
||||||
|
$mainIcons = array_merge($adminIcons, $userIcons, $extensionIcons);
|
||||||
|
|
||||||
//Remove modules having no permissions
|
//Remove modules having no permissions
|
||||||
if (!empty($user)) {
|
if (!empty($user)) {
|
||||||
if (!empty($user->user_roles)) {
|
if (!empty($user->user_roles)) {
|
||||||
@@ -393,4 +420,24 @@ if (!empty($user)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach ($extensions as $fk => $menu) {
|
||||||
|
foreach ($menu['menu'] as $key => $item) {
|
||||||
|
// If the user's once of the user roles are blacklisted for the module
|
||||||
|
$commonRoles = array_intersect($item['user_roles_blacklist'], $userRoles);
|
||||||
|
if (!empty($commonRoles)) {
|
||||||
|
unset($extensions[$fk]['menu'][$key]);
|
||||||
|
}
|
||||||
|
if (!in_array($user->user_level, $item['user_levels'])) {
|
||||||
|
if (!empty($userRoles)) {
|
||||||
|
$commonRoles = array_intersect($item['user_roles'], $userRoles);
|
||||||
|
if (empty($commonRoles)) {
|
||||||
|
unset($extensions[$fk]['menu'][$key]);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
unset($extensions[$fk]['menu'][$key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+4
-45
@@ -3,49 +3,8 @@ header('Access-Control-Allow-Origin: *');
|
|||||||
header('Access-Control-Allow-Methods: DELETE, POST, GET, OPTIONS');
|
header('Access-Control-Allow-Methods: DELETE, POST, GET, OPTIONS');
|
||||||
header('Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With');
|
header('Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With');
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
define('CLIENT_PATH',dirname(__FILE__));
|
if (isset($_REQUEST['method']) && isset($_REQUEST['url'])) {
|
||||||
include ("config.base.php");
|
include(APP_BASE_PATH . 'api-url-based.php');
|
||||||
include ("include.common.php");
|
} else {
|
||||||
include("server.includes.inc.php");
|
include(APP_BASE_PATH . 'api-rest.php');
|
||||||
|
|
||||||
if(\Classes\SettingsManager::getInstance()->getSetting('Api: REST Api Enabled') == '1') {
|
|
||||||
|
|
||||||
if (defined('SYM_CLIENT')) {
|
|
||||||
define('REST_API_PATH', '/'.SYM_CLIENT.'/');
|
|
||||||
} else if (!defined('REST_API_PATH')){
|
|
||||||
define('REST_API_PATH', '/');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
\Utils\LogManager::getInstance()->info("Request: " . $_REQUEST);
|
|
||||||
|
|
||||||
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
|
|
||||||
http_response_code(200);
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
$echoRoute = \Classes\Macaw::get(REST_API_PATH . 'echo', function () {
|
|
||||||
echo "Echo " . rand();
|
|
||||||
});
|
|
||||||
|
|
||||||
\Utils\LogManager::getInstance()->debug('Api registered URI: '.$echoRoute);
|
|
||||||
|
|
||||||
$moduleManagers = \Classes\BaseService::getInstance()->getModuleManagers();
|
|
||||||
|
|
||||||
foreach ($moduleManagers as $moduleManagerObj) {
|
|
||||||
|
|
||||||
$moduleManagerObj->setupRestEndPoints();
|
|
||||||
}
|
|
||||||
$uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
|
|
||||||
$method = $_SERVER['REQUEST_METHOD'];
|
|
||||||
\Utils\LogManager::getInstance()->debug('Api dispatch URI: '.$uri);
|
|
||||||
\Utils\LogManager::getInstance()->debug('Api dispatch method: '.$uri);
|
|
||||||
if (!defined('SYM_CLIENT')) {
|
|
||||||
//For hosted installations, dispatch will be done in app/index
|
|
||||||
\Classes\Macaw::dispatch();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}else{
|
|
||||||
echo "REST Api is not enabled. Please set 'Api: REST Api Enabled' setting to true";
|
|
||||||
}
|
}
|
||||||
@@ -278,4 +278,12 @@ abstract class AbstractModuleManager
|
|||||||
{
|
{
|
||||||
BaseService::getInstance()->addCalculationHook($code, $name, $class, $method);
|
BaseService::getInstance()->addCalculationHook($code, $name, $class, $method);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function install() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function uninstall() {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,143 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Classes;
|
||||||
|
|
||||||
|
use Utils\LogManager;
|
||||||
|
|
||||||
|
class ExtensionManager
|
||||||
|
{
|
||||||
|
const GROUP = 'extension';
|
||||||
|
protected function processExtensionInDB() {
|
||||||
|
$dbModule = new \Modules\Common\Model\Module();
|
||||||
|
$extensions = $dbModule->Find("mod_group = ?", array(self::GROUP));
|
||||||
|
|
||||||
|
$extensionsInDB = [];
|
||||||
|
foreach ($extensions as $dbm) {
|
||||||
|
$extensionsInDB[$dbm->name] = $dbm;
|
||||||
|
ModuleAccessService::getInstance()->setModule($dbm->name, self::GROUP, $dbm);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $extensionsInDB;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getExtensionsPath() {
|
||||||
|
return APP_BASE_PATH.'../extensions/';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getExtensionMetaData($extensionName)
|
||||||
|
{
|
||||||
|
return json_decode(file_get_contents($this->getExtensionsPath().$extensionName.'/meta.json'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setupExtensions() {
|
||||||
|
$menu = [];
|
||||||
|
$extensions = [];
|
||||||
|
$extensionDirs = scandir($this->getExtensionsPath());
|
||||||
|
$currentLocation = 0;
|
||||||
|
|
||||||
|
$extensionsInDB = $this->processExtensionInDB();
|
||||||
|
|
||||||
|
$needToInstall = false;
|
||||||
|
|
||||||
|
foreach ($extensionDirs as $extensionDir) {
|
||||||
|
if (is_dir($this->getExtensionsPath().$extensionDir) && $extensionDir != '.' && $extensionDir != '..') {
|
||||||
|
$meta = $this->getExtensionMetaData($extensionDir);
|
||||||
|
|
||||||
|
$arr = [];
|
||||||
|
$arr['name'] = $extensionDir;
|
||||||
|
$arr['label'] = $meta->label;
|
||||||
|
$arr['icon'] = $meta->icon;
|
||||||
|
$arr['menu'] = $meta->menu[0];
|
||||||
|
$arr['order'] = 0;
|
||||||
|
$arr['status'] = 'Enabled';
|
||||||
|
$arr['user_levels'] = $meta->user_levels;
|
||||||
|
$arr['user_roles'] = isset($meta->user_roles)?$meta->user_roles:"";
|
||||||
|
$arr['model_namespace'] = $meta->model_namespace;
|
||||||
|
$arr['manager'] = $meta->manager;
|
||||||
|
|
||||||
|
// Add menu
|
||||||
|
$menu[$meta->menu[0]] = $meta->menu[1];
|
||||||
|
|
||||||
|
//Check in admin dbmodules
|
||||||
|
if (isset($extensionsInDB[$arr['name']])) {
|
||||||
|
$dbModule = $extensionsInDB[$arr['name']];
|
||||||
|
|
||||||
|
$arr['name'] = $dbModule->name;
|
||||||
|
$arr['label'] = $dbModule->label;
|
||||||
|
$arr['icon'] = $dbModule->icon;
|
||||||
|
$arr['menu'] = $dbModule->menu;
|
||||||
|
$arr['status'] = $dbModule->status;
|
||||||
|
$arr['user_levels'] = json_decode($dbModule->user_levels);
|
||||||
|
$arr['user_roles'] = empty($dbModule->user_roles)
|
||||||
|
? [] : json_decode($dbModule->user_roles);
|
||||||
|
$arr['user_roles_blacklist'] = empty($dbModule->user_roles_blacklist)
|
||||||
|
? [] : json_decode($dbModule->user_roles_blacklist);
|
||||||
|
} else {
|
||||||
|
$dbModule = new \Modules\Common\Model\Module();
|
||||||
|
$dbModule->menu = $arr['menu'];
|
||||||
|
$dbModule->name = $arr['name'];
|
||||||
|
$dbModule->label = $arr['label'];
|
||||||
|
$dbModule->icon = $arr['icon'];
|
||||||
|
$dbModule->mod_group = self::GROUP;
|
||||||
|
$dbModule->mod_order = $arr['order'];
|
||||||
|
$dbModule->status = "Enabled";
|
||||||
|
$dbModule->version = isset($meta->version)?$meta->version:"";
|
||||||
|
$dbModule->update_path = self::GROUP.">".$extensionDir;
|
||||||
|
$dbModule->user_levels = isset($meta->user_levels)?json_encode($meta->user_levels):"";
|
||||||
|
$dbModule->user_roles = isset($meta->user_roles)?json_encode($meta->user_roles):"";
|
||||||
|
|
||||||
|
$ok = $dbModule->Save();
|
||||||
|
if (!$ok) {
|
||||||
|
LogManager::getInstance()->error('Error saving module: '.$dbModule->name);
|
||||||
|
}
|
||||||
|
$needToInstall = $ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* @var \Classes\AbstractModuleManager */
|
||||||
|
$manager = $this->includeModuleManager($extensionDir, $arr);
|
||||||
|
if ($dbModule->status == 'Disabled') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($needToInstall) {
|
||||||
|
$manager->install();
|
||||||
|
}
|
||||||
|
|
||||||
|
$menuName = $arr['menu'];
|
||||||
|
if (!isset($extensions[$menuName])) {
|
||||||
|
$extensions[$menuName] = array();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$meta->headless) {
|
||||||
|
if ($arr['order'] == '0' || $arr['order'] == '') {
|
||||||
|
$extensions[$menuName]["Z".$currentLocation] = $arr;
|
||||||
|
$currentLocation++;
|
||||||
|
} else {
|
||||||
|
$extensions[$arr['menu']]["A".$arr['order']] = $arr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$initializer = $manager->getInitializer();
|
||||||
|
if ($initializer !== null) {
|
||||||
|
$initializer->setBaseService(BaseService::getInstance());
|
||||||
|
$initializer->init();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return [$menu, $extensions];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function includeModuleManager($name, $data)
|
||||||
|
{
|
||||||
|
include($this->getExtensionsPath().$name.'/'.$name.'.php');
|
||||||
|
$moduleManagerClass = $data['manager'];
|
||||||
|
/* @var \Classes\AbstractModuleManager $moduleManagerObj*/
|
||||||
|
$moduleManagerObj = new $moduleManagerClass();
|
||||||
|
$moduleManagerObj->setModuleObject($data);
|
||||||
|
$moduleManagerObj->setModuleType(self::GROUP);
|
||||||
|
$moduleManagerObj->setModulePath(CLIENT_PATH.'/'.self::GROUP.'/'.$name);
|
||||||
|
\Classes\BaseService::getInstance()->addModuleManager($moduleManagerObj);
|
||||||
|
return $moduleManagerObj;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -94,6 +94,8 @@ class FileService
|
|||||||
$s3FileSys = new S3FileSystem($uploadFilesToS3Key, $uploadFilesToS3Secret);
|
$s3FileSys = new S3FileSystem($uploadFilesToS3Key, $uploadFilesToS3Secret);
|
||||||
$result = $s3FileSys->putObject($s3Bucket, $uploadname, $localFile, 'authenticated-read');
|
$result = $s3FileSys->putObject($s3Bucket, $uploadname, $localFile, 'authenticated-read');
|
||||||
|
|
||||||
|
$file->size = filesize($localFile);
|
||||||
|
|
||||||
unlink("/tmp/".$file->filename);
|
unlink("/tmp/".$file->filename);
|
||||||
unlink("/tmp/".$file->filename."_orig");
|
unlink("/tmp/".$file->filename."_orig");
|
||||||
|
|
||||||
@@ -101,7 +103,6 @@ class FileService
|
|||||||
|
|
||||||
$file->employee = $profileImage->employee;
|
$file->employee = $profileImage->employee;
|
||||||
$file->file_group = 'profile_image_small';
|
$file->file_group = 'profile_image_small';
|
||||||
$file->size = filesize(CLIENT_BASE_PATH.'data/'.$file->filename);
|
|
||||||
$file->size_text = $this->getReadableSize($file->size);
|
$file->size_text = $this->getReadableSize($file->size);
|
||||||
|
|
||||||
if (!empty($result)) {
|
if (!empty($result)) {
|
||||||
@@ -293,8 +294,7 @@ class FileService
|
|||||||
if ($file->employee == $profileId) {
|
if ($file->employee == $profileId) {
|
||||||
$ok = $file->Delete();
|
$ok = $file->Delete();
|
||||||
if ($ok) {
|
if ($ok) {
|
||||||
LogManager::getInstance()->info("Delete File:".CLIENT_BASE_PATH.$file->filename);
|
$this->deleteFileFromDisk($file);
|
||||||
unlink(CLIENT_BASE_PATH.'data/'.$file->filename);
|
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -306,8 +306,7 @@ class FileService
|
|||||||
if ($file->employee == $profileId) {
|
if ($file->employee == $profileId) {
|
||||||
$ok = $file->Delete();
|
$ok = $file->Delete();
|
||||||
if ($ok) {
|
if ($ok) {
|
||||||
LogManager::getInstance()->info("Delete File:".CLIENT_BASE_PATH.$file->filename);
|
$this->deleteFileFromDisk($file);
|
||||||
unlink(CLIENT_BASE_PATH.'data/'.$file->filename);
|
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -317,6 +316,30 @@ class FileService
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function deleteFileFromDisk($file)
|
||||||
|
{
|
||||||
|
$uploadFilesToS3 = SettingsManager::getInstance()->getSetting("Files: Upload Files to S3");
|
||||||
|
|
||||||
|
if ($uploadFilesToS3 == "1") {
|
||||||
|
$uploadFilesToS3Key = SettingsManager::getInstance()->getSetting(
|
||||||
|
"Files: Amazon S3 Key for File Upload"
|
||||||
|
);
|
||||||
|
$uploadFilesToS3Secret = SettingsManager::getInstance()->getSetting(
|
||||||
|
"Files: Amazone S3 Secret for File Upload"
|
||||||
|
);
|
||||||
|
$s3Bucket = SettingsManager::getInstance()->getSetting("Files: S3 Bucket");
|
||||||
|
|
||||||
|
$uploadname = CLIENT_NAME."/".$file->filename;
|
||||||
|
LogManager::getInstance()->info("Delete from S3:".$uploadname);
|
||||||
|
|
||||||
|
$s3FileSys = new S3FileSystem($uploadFilesToS3Key, $uploadFilesToS3Secret);
|
||||||
|
$s3FileSys->deleteObject($s3Bucket, $uploadname);
|
||||||
|
} else {
|
||||||
|
LogManager::getInstance()->info("Delete:".CLIENT_BASE_PATH.'data/'.$file->filename);
|
||||||
|
unlink(CLIENT_BASE_PATH.'data/'.$file->filename);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function deleteFileByField($value, $field)
|
public function deleteFileByField($value, $field)
|
||||||
{
|
{
|
||||||
LogManager::getInstance()->info("Delete file by field: $field / value: $value");
|
LogManager::getInstance()->info("Delete file by field: $field / value: $value");
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
namespace Classes;
|
||||||
|
|
||||||
|
abstract class IceExtension extends AbstractModuleManager
|
||||||
|
{
|
||||||
|
public function initializeUserClasses()
|
||||||
|
{
|
||||||
|
// TODO: Implement initializeUserClasses() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
public function initializeFieldMappings()
|
||||||
|
{
|
||||||
|
// TODO: Implement initializeFieldMappings() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
public function initializeDatabaseErrorMappings()
|
||||||
|
{
|
||||||
|
// TODO: Implement initializeDatabaseErrorMappings() method.
|
||||||
|
}
|
||||||
|
}
|
||||||
Executable
+177
@@ -0,0 +1,177 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Classes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @method static IceRoute get(string $route, Callable $callback)
|
||||||
|
* @method static IceRoute post(string $route, Callable $callback)
|
||||||
|
* @method static IceRoute put(string $route, Callable $callback)
|
||||||
|
* @method static IceRoute delete(string $route, Callable $callback)
|
||||||
|
* @method static IceRoute options(string $route, Callable $callback)
|
||||||
|
* @method static IceRoute head(string $route, Callable $callback)
|
||||||
|
*/
|
||||||
|
class IceRoute
|
||||||
|
{
|
||||||
|
|
||||||
|
public static $halts = false;
|
||||||
|
|
||||||
|
public static $routes = array();
|
||||||
|
|
||||||
|
public static $methods = array();
|
||||||
|
|
||||||
|
public static $callbacks = array();
|
||||||
|
|
||||||
|
public static $patterns = array(
|
||||||
|
':any' => '[^/]+',
|
||||||
|
':num' => '[0-9]+',
|
||||||
|
':all' => '.*'
|
||||||
|
);
|
||||||
|
|
||||||
|
public static $error_callback;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines a route w/ callback and method
|
||||||
|
*/
|
||||||
|
public static function __callstatic($method, $params)
|
||||||
|
{
|
||||||
|
|
||||||
|
$uri = $params[0][0];
|
||||||
|
$callback = $params[0][1];
|
||||||
|
|
||||||
|
array_push(self::$routes, $uri);
|
||||||
|
array_push(self::$methods, strtoupper($method));
|
||||||
|
array_push(self::$callbacks, $callback);
|
||||||
|
|
||||||
|
return $uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines callback if route is not found
|
||||||
|
*/
|
||||||
|
public static function error($callback)
|
||||||
|
{
|
||||||
|
self::$error_callback = $callback;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function haltOnMatch($flag = true)
|
||||||
|
{
|
||||||
|
self::$halts = $flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Runs the callback for the given request
|
||||||
|
*/
|
||||||
|
public static function dispatch($uri, $method)
|
||||||
|
{
|
||||||
|
|
||||||
|
$searches = array_keys(static::$patterns);
|
||||||
|
$replaces = array_values(static::$patterns);
|
||||||
|
|
||||||
|
$found_route = false;
|
||||||
|
|
||||||
|
self::$routes = str_replace('//', '/', self::$routes);
|
||||||
|
|
||||||
|
// check if route is defined without regex
|
||||||
|
if (in_array($uri, self::$routes)) {
|
||||||
|
$route_pos = array_keys(self::$routes, $uri);
|
||||||
|
foreach ($route_pos as $route) {
|
||||||
|
//using an ANY option to match both GET and POST requests
|
||||||
|
if (self::$methods[$route] == $method || self::$methods[$route] == 'ANY') {
|
||||||
|
$found_route = true;
|
||||||
|
|
||||||
|
//if route is not an object
|
||||||
|
if (!is_object(self::$callbacks[$route])) {
|
||||||
|
//grab all parts based on a / separator
|
||||||
|
$parts = explode('/', self::$callbacks[$route]);
|
||||||
|
|
||||||
|
//collect the last index of the array
|
||||||
|
$last = end($parts);
|
||||||
|
|
||||||
|
//grab the controller name and method call
|
||||||
|
$segments = explode('@', $last);
|
||||||
|
|
||||||
|
//instanitate controller
|
||||||
|
$controller = new $segments[0]();
|
||||||
|
|
||||||
|
//call method
|
||||||
|
$controller->$segments[1]();
|
||||||
|
|
||||||
|
if (self::$halts) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//call closure
|
||||||
|
call_user_func(self::$callbacks[$route]);
|
||||||
|
|
||||||
|
if (self::$halts) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// check if defined with regex
|
||||||
|
$pos = 0;
|
||||||
|
foreach (self::$routes as $route) {
|
||||||
|
if (strpos($route, ':') !== false) {
|
||||||
|
$route = str_replace($searches, $replaces, $route);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (preg_match('#^' . $route . '$#', $uri, $matched)) {
|
||||||
|
if (self::$methods[$pos] == $method) {
|
||||||
|
$found_route = true;
|
||||||
|
|
||||||
|
array_shift($matched); //remove $matched[0] as [1] is the first parameter.
|
||||||
|
|
||||||
|
|
||||||
|
if (!is_object(self::$callbacks[$pos])) {
|
||||||
|
//grab all parts based on a / separator
|
||||||
|
$parts = explode('/', self::$callbacks[$pos]);
|
||||||
|
|
||||||
|
//collect the last index of the array
|
||||||
|
$last = end($parts);
|
||||||
|
|
||||||
|
//grab the controller name and method call
|
||||||
|
$segments = explode('@', $last);
|
||||||
|
|
||||||
|
//instanitate controller
|
||||||
|
$controller = new $segments[0]();
|
||||||
|
|
||||||
|
//fix multi parameters
|
||||||
|
if (!method_exists($controller, $segments[1])) {
|
||||||
|
echo "controller and action not found";
|
||||||
|
} else {
|
||||||
|
call_user_func_array(array($controller, $segments[1]), $matched);
|
||||||
|
}
|
||||||
|
|
||||||
|
//call method and pass any extra parameters to the method
|
||||||
|
// $controller->$segments[1](implode(",", $matched));
|
||||||
|
|
||||||
|
if (self::$halts) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
call_user_func_array(self::$callbacks[$pos], $matched);
|
||||||
|
|
||||||
|
if (self::$halts) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$pos++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// run the error callback if the route was not found
|
||||||
|
if ($found_route == false) {
|
||||||
|
if (!self::$error_callback) {
|
||||||
|
self::$error_callback = function () {
|
||||||
|
header($_SERVER['SERVER_PROTOCOL']." 404 Not Found");
|
||||||
|
echo '404';
|
||||||
|
};
|
||||||
|
}
|
||||||
|
call_user_func(self::$error_callback);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -42,6 +42,8 @@ class Macaw
|
|||||||
array_push(self::$methods, strtoupper($method));
|
array_push(self::$methods, strtoupper($method));
|
||||||
array_push(self::$callbacks, $callback);
|
array_push(self::$callbacks, $callback);
|
||||||
|
|
||||||
|
call_user_func('\Classes\IceRoute::'.$method, $params);
|
||||||
|
|
||||||
return $uri;
|
return $uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
|
|
||||||
namespace Classes\Migration;
|
namespace Classes\Migration;
|
||||||
|
|
||||||
|
use Utils\LogManager;
|
||||||
|
|
||||||
abstract class AbstractMigration
|
abstract class AbstractMigration
|
||||||
{
|
{
|
||||||
protected $file;
|
protected $file;
|
||||||
@@ -16,7 +18,7 @@ abstract class AbstractMigration
|
|||||||
|
|
||||||
protected $lastError;
|
protected $lastError;
|
||||||
|
|
||||||
public function __construct($file)
|
public function __construct($file = null)
|
||||||
{
|
{
|
||||||
$this->file = $file;
|
$this->file = $file;
|
||||||
}
|
}
|
||||||
@@ -50,6 +52,7 @@ abstract class AbstractMigration
|
|||||||
$ret = $this->db()->Execute($sql);
|
$ret = $this->db()->Execute($sql);
|
||||||
if (!$ret) {
|
if (!$ret) {
|
||||||
$this->lastError = $this->db()->ErrorMsg();
|
$this->lastError = $this->db()->ErrorMsg();
|
||||||
|
LogManager::getInstance()->error('Error in migration: '.$this->lastError);
|
||||||
}
|
}
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class ModuleAccess
|
|||||||
* @param $name
|
* @param $name
|
||||||
* @param $group
|
* @param $group
|
||||||
*/
|
*/
|
||||||
public function __construct($name, $group)
|
public function __construct($name, $group = 'extension')
|
||||||
{
|
{
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
$this->group = $group;
|
$this->group = $group;
|
||||||
|
|||||||
@@ -420,6 +420,8 @@ class RestEndPoint
|
|||||||
if (preg_match('/Bearer\s(\S+)/', $headers, $matches)) {
|
if (preg_match('/Bearer\s(\S+)/', $headers, $matches)) {
|
||||||
$token = $matches[1];
|
$token = $matches[1];
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$token = $_GET['token'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strlen($token) > 32) {
|
if (strlen($token) > 32) {
|
||||||
|
|||||||
@@ -147,6 +147,10 @@ class EmployeesActionManager extends SubActionManager
|
|||||||
return new IceResponse(IceResponse::ERROR, "Error occurred while changing password");
|
return new IceResponse(IceResponse::ERROR, "Error occurred while changing password");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!PasswordManager::verifyPassword($req->current, $user->password)) {
|
||||||
|
return new IceResponse(IceResponse::ERROR, "Current password is incorrect");
|
||||||
|
}
|
||||||
|
|
||||||
$passwordStrengthResponse = PasswordManager::isQualifiedPassword($req->pwd);
|
$passwordStrengthResponse = PasswordManager::isQualifiedPassword($req->pwd);
|
||||||
if ($passwordStrengthResponse->getStatus() === IceResponse::ERROR) {
|
if ($passwordStrengthResponse->getStatus() === IceResponse::ERROR) {
|
||||||
return $passwordStrengthResponse;
|
return $passwordStrengthResponse;
|
||||||
@@ -158,6 +162,6 @@ class EmployeesActionManager extends SubActionManager
|
|||||||
return new IceResponse(IceResponse::ERROR, $user->ErrorMsg());
|
return new IceResponse(IceResponse::ERROR, $user->ErrorMsg());
|
||||||
}
|
}
|
||||||
|
|
||||||
return new IceResponse(IceResponse::SUCCESS, $user);
|
return new IceResponse(IceResponse::SUCCESS, []);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Executable
+1
@@ -0,0 +1 @@
|
|||||||
|
git keep
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"label": "My Tasks",
|
||||||
|
"menu": ["Tasks", "fa-list"],
|
||||||
|
"icon": "fa-tasks",
|
||||||
|
"user_levels": [
|
||||||
|
"Admin",
|
||||||
|
"Manager",
|
||||||
|
"User"
|
||||||
|
],
|
||||||
|
"model_namespace": "\\Tasks\\Model",
|
||||||
|
"manager": "\\Tasks\\Extension",
|
||||||
|
"headless": false
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
namespace Tasks;
|
||||||
|
|
||||||
|
use Classes\IceExtension;
|
||||||
|
|
||||||
|
class Extension extends IceExtension
|
||||||
|
{
|
||||||
|
|
||||||
|
public function install() {
|
||||||
|
$migration = new Migration();
|
||||||
|
return $migration->up();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function uninstall() {
|
||||||
|
$migration = new Migration();
|
||||||
|
return $migration->down();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setupModuleClassDefinitions()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setupRestEndPoints()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
namespace Tasks;
|
||||||
|
|
||||||
|
use Classes\Migration\AbstractMigration;
|
||||||
|
|
||||||
|
class Migration extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
$sql = <<<'SQL'
|
||||||
|
create table `Tasks` (
|
||||||
|
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||||
|
`employee` bigint(20) NULL,
|
||||||
|
`name` varchar(250) NOT NULL,
|
||||||
|
`description` TEXT NULL,
|
||||||
|
`attachment` varchar(100) NULL,
|
||||||
|
`created` DATETIME default NULL,
|
||||||
|
`updated` DATETIME default NULL,
|
||||||
|
primary key (`id`),
|
||||||
|
CONSTRAINT `Fk_EmployeeTasks_Employees` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||||
|
) engine=innodb default charset=utf8;
|
||||||
|
SQL;
|
||||||
|
return $this->executeQuery($sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
$sql = <<<'SQL'
|
||||||
|
DROP TABLE IF EXISTS `Tasks`;
|
||||||
|
SQL;
|
||||||
|
return $this->executeQuery($sql);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tasks\Model;
|
||||||
|
|
||||||
|
use Classes\ModuleAccess;
|
||||||
|
use Model\BaseModel;
|
||||||
|
|
||||||
|
class Task extends BaseModel
|
||||||
|
{
|
||||||
|
public $table = 'Tasks';
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
<?php
|
||||||
|
require_once __DIR__.'/src/Tasks/Extension.php';
|
||||||
|
require_once __DIR__.'/src/Tasks/Migration.php';
|
||||||
|
require_once __DIR__.'/src/Tasks/Model/Task.php';
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
$user = \Classes\BaseService::getInstance()->getCurrentUser();
|
||||||
|
echo "Welcome ".$user->username."<br/>";
|
||||||
|
|
||||||
|
echo "Creating a task <br/>";
|
||||||
|
|
||||||
|
$task = new \Tasks\Model\Task();
|
||||||
|
$taskName = 'Task-'.rand(rand(0, 100), 50000);
|
||||||
|
|
||||||
|
$task->name = $taskName;
|
||||||
|
$task->employee = $user->employee;
|
||||||
|
$task->description = $taskName.' description';
|
||||||
|
$task->created = date('Y-m-d H:i:s');
|
||||||
|
$task->updated = date('Y-m-d H:i:s');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Saving the task, $ok will be false if there were any error during the creation
|
||||||
|
*/
|
||||||
|
$ok = $task->Save();
|
||||||
|
|
||||||
|
if (!$ok) {
|
||||||
|
echo "Error: ".$task->ErrorMsg()." <br/>";
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "Find last task <br/>";
|
||||||
|
|
||||||
|
$taskFromDB = new \Tasks\Model\Task();
|
||||||
|
/**
|
||||||
|
* You can use load method to load the first matching task into an empty model
|
||||||
|
*/
|
||||||
|
$taskFromDB->Load('name = ?', [$taskName]);
|
||||||
|
|
||||||
|
var_dump($taskFromDB);
|
||||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
+42
@@ -359,6 +359,48 @@ gulp.task('modules-js', (done) => {
|
|||||||
.pipe(gulp.dest('./web/dist'));
|
.pipe(gulp.dest('./web/dist'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
gulp.task('extension-js', (done) => {
|
||||||
|
let extension = process.argv.filter((item) => item.substr(0, 3) === '--x');
|
||||||
|
if (extension.length === 1) {
|
||||||
|
extension = extension[0].substr(3);
|
||||||
|
}
|
||||||
|
|
||||||
|
// map them to our stream function
|
||||||
|
return browserify({
|
||||||
|
entries: [`extensions/${extension}/web/js/index.js`],
|
||||||
|
basedir: '.',
|
||||||
|
debug: true,
|
||||||
|
cache: {},
|
||||||
|
packageCache: {},
|
||||||
|
})
|
||||||
|
.external(vendorsFlat)
|
||||||
|
.transform('babelify', {
|
||||||
|
plugins: [
|
||||||
|
['@babel/plugin-proposal-class-properties', { loose: true }],
|
||||||
|
],
|
||||||
|
presets: ['@babel/preset-env', '@babel/preset-react'],
|
||||||
|
extensions: ['.js', '.jsx'],
|
||||||
|
})
|
||||||
|
.transform(require('browserify-css'))
|
||||||
|
.bundle()
|
||||||
|
.pipe(source(`${extension}.js`))
|
||||||
|
.pipe(buffer())
|
||||||
|
.pipe(ifElse(!isProduction, () => sourcemaps.init({ loadMaps: true })))
|
||||||
|
.pipe(ifElse(isProduction, () => uglifyes(
|
||||||
|
{
|
||||||
|
compress: true,
|
||||||
|
mangle: {
|
||||||
|
reserved: [],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
)))
|
||||||
|
.pipe(ifElse(isProduction, () => javascriptObfuscator({
|
||||||
|
compact: true,
|
||||||
|
})))
|
||||||
|
.pipe(ifElse(!isProduction, () => sourcemaps.write('./')))
|
||||||
|
.pipe(gulp.dest(`./extensions/${extension}/dist`));
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
gulp.task('watch', () => {
|
gulp.task('watch', () => {
|
||||||
gulp.watch('web/admin/src/*/*.js', gulp.series('admin-js'));
|
gulp.watch('web/admin/src/*/*.js', gulp.series('admin-js'));
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
<img src="web/images/logo-sq.png" align="right" />
|
|
||||||
|
|
||||||
IceHrm
|
IceHrm
|
||||||
===========
|
===========
|
||||||
[](https://travis-ci.org/gamonoid/icehrm)
|
[](https://travis-ci.org/gamonoid/icehrm)
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ class EmployeeDocumentAdapter extends AdapterBase {
|
|||||||
|
|
||||||
getFilters() {
|
getFilters() {
|
||||||
return [
|
return [
|
||||||
['employee', { label: 'Employee', type: 'select2', 'remote-source': ['Employee', 'id', 'first_name+last_name'] }],
|
['employee', { label: 'Employee', type: 'select2', 'remote-source': ['Employee', 'id', 'first_name+last_name', 'getActiveSubordinateEmployees'] }],
|
||||||
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ class AdapterBase extends ModuleBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setupApiClient(token) {
|
setupApiClient(token) {
|
||||||
this.apiClient = new IceApiClient(this.apiUrl, token);
|
this.apiClient = new IceApiClient(this.apiUrl, token, window.CLIENT_BASE_URL, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
setApiUrl(apiUrl) {
|
setApiUrl(apiUrl) {
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
const axios = require('axios');
|
||||||
|
|
||||||
|
class CustomAction {
|
||||||
|
constructor(adapter) {
|
||||||
|
this.adapter = adapter;
|
||||||
|
}
|
||||||
|
|
||||||
|
execute(subAction, module, request, isPost) {
|
||||||
|
if (!isPost) {
|
||||||
|
return axios.get(
|
||||||
|
this.adapter.moduleRelativeURL,
|
||||||
|
{
|
||||||
|
params: {
|
||||||
|
t: this.adapter.table, a: 'ca', sa: subAction, mod: module, req: request,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return axios.post(this.moduleRelativeURL, {
|
||||||
|
t: this.adapter.table, a: 'ca', sa: subAction, mod: module, req: request,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default CustomAction;
|
||||||
@@ -1,12 +1,19 @@
|
|||||||
const axios = require('axios');
|
const axios = require('axios');
|
||||||
|
|
||||||
class IceApiClient {
|
class IceApiClient {
|
||||||
constructor(baseUrl, token) {
|
constructor(baseUrl, token, clientBaseUrl, legacyApiWrapper = true) {
|
||||||
this.baseUrl = baseUrl;
|
this.baseUrl = baseUrl;
|
||||||
this.token = token;
|
this.token = token;
|
||||||
|
this.clientBaseUrl = clientBaseUrl;
|
||||||
|
this.legacyApiWrapper = legacyApiWrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
get(endpoint) {
|
get(endpoint) {
|
||||||
|
if (this.legacyApiWrapper) {
|
||||||
|
const url = `${this.clientBaseUrl}api/index.php?token=${this.token}&method=get&url=/${endpoint}`;
|
||||||
|
return axios.get(url);
|
||||||
|
}
|
||||||
|
|
||||||
return axios.get(this.baseUrl + endpoint, {
|
return axios.get(this.baseUrl + endpoint, {
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `Bearer ${this.token}`,
|
Authorization: `Bearer ${this.token}`,
|
||||||
|
|||||||
+20
-11
@@ -236,10 +236,11 @@ class ModuleBase {
|
|||||||
for (let i = 0; i < remoteSourceFields.length; i++) {
|
for (let i = 0; i < remoteSourceFields.length; i++) {
|
||||||
const fieldRemote = remoteSourceFields[i];
|
const fieldRemote = remoteSourceFields[i];
|
||||||
if (fieldRemote[1]['remote-source'] !== undefined && fieldRemote[1]['remote-source'] != null) {
|
if (fieldRemote[1]['remote-source'] !== undefined && fieldRemote[1]['remote-source'] != null) {
|
||||||
let key = `${fieldRemote[1]['remote-source'][0]}_${fieldRemote[1]['remote-source'][1]}_${fieldRemote[1]['remote-source'][2]}`;
|
// let key = `${fieldRemote[1]['remote-source'][0]}_${fieldRemote[1]['remote-source'][1]}_${fieldRemote[1]['remote-source'][2]}`;
|
||||||
if (fieldRemote[1]['remote-source'].length === 4) {
|
// if (fieldRemote[1]['remote-source'].length === 4) {
|
||||||
key = `${key}_${fieldRemote[1]['remote-source'][3]}`;
|
// key = `${key}_${fieldRemote[1]['remote-source'][3]}`;
|
||||||
}
|
// }
|
||||||
|
const key = this.getRemoteSourceKey(fieldRemote);
|
||||||
this.fieldMasterDataKeys[key] = false;
|
this.fieldMasterDataKeys[key] = false;
|
||||||
|
|
||||||
const callBackData = {};
|
const callBackData = {};
|
||||||
@@ -1177,7 +1178,12 @@ class ModuleBase {
|
|||||||
value = 'Not Selected';
|
value = 'Not Selected';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
value = this.fieldMasterData[`${rmf[0]}_${rmf[1]}_${rmf[2]}`][filters[prop]];
|
let key = `${rmf[0]}_${rmf[1]}_${rmf[2]}`;
|
||||||
|
if (rmf.length > 3) {
|
||||||
|
key = `${key}_${rmf[3]}`;
|
||||||
|
}
|
||||||
|
//value = this.fieldMasterData[`${rmf[0]}_${rmf[1]}_${rmf[2]}`][filters[prop]];
|
||||||
|
value = this.fieldMasterData[key][filters[prop]];
|
||||||
valueOrig = value;
|
valueOrig = value;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -1332,7 +1338,8 @@ class ModuleBase {
|
|||||||
try {
|
try {
|
||||||
modJs.filterQuery();
|
modJs.filterQuery();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// Do Nothing
|
console.log(err);
|
||||||
|
console.log(err.message);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
@@ -2094,7 +2101,8 @@ class ModuleBase {
|
|||||||
$(`${formId} #${fields[i][0]}`).html(object[fields[i][0]]);
|
$(`${formId} #${fields[i][0]}`).html(object[fields[i][0]]);
|
||||||
} else if (fields[i][1].type === 'placeholder') {
|
} else if (fields[i][1].type === 'placeholder') {
|
||||||
if (fields[i][1]['remote-source'] !== undefined && fields[i][1]['remote-source'] != null) {
|
if (fields[i][1]['remote-source'] !== undefined && fields[i][1]['remote-source'] != null) {
|
||||||
const key = `${fields[i][1]['remote-source'][0]}_${fields[i][1]['remote-source'][1]}_${fields[i][1]['remote-source'][2]}`;
|
//const key = `${fields[i][1]['remote-source'][0]}_${fields[i][1]['remote-source'][1]}_${fields[i][1]['remote-source'][2]}`;
|
||||||
|
const key = this.getRemoteSourceKey(fields[i]);
|
||||||
placeHolderVal = this.fieldMasterData[key][object[fields[i][0]]];
|
placeHolderVal = this.fieldMasterData[key][object[fields[i][0]]];
|
||||||
} else {
|
} else {
|
||||||
placeHolderVal = object[fields[i][0]];
|
placeHolderVal = object[fields[i][0]];
|
||||||
@@ -2218,10 +2226,11 @@ class ModuleBase {
|
|||||||
if (field[1].source !== undefined && field[1].source != null) {
|
if (field[1].source !== undefined && field[1].source != null) {
|
||||||
t = t.replace('_options_', this.renderFormSelectOptions(field[1].source, field));
|
t = t.replace('_options_', this.renderFormSelectOptions(field[1].source, field));
|
||||||
} else if (field[1]['remote-source'] !== undefined && field[1]['remote-source'] != null) {
|
} else if (field[1]['remote-source'] !== undefined && field[1]['remote-source'] != null) {
|
||||||
let key = `${field[1]['remote-source'][0]}_${field[1]['remote-source'][1]}_${field[1]['remote-source'][2]}`;
|
// let key = `${field[1]['remote-source'][0]}_${field[1]['remote-source'][1]}_${field[1]['remote-source'][2]}`;
|
||||||
if (field[1]['remote-source'].length === 4) {
|
// if (field[1]['remote-source'].length === 4) {
|
||||||
key = `${key}_${field[1]['remote-source'][3]}`;
|
// key = `${key}_${field[1]['remote-source'][3]}`;
|
||||||
}
|
// }
|
||||||
|
const key = this.getRemoteSourceKey(field);
|
||||||
t = t.replace('_options_', this.renderFormSelectOptionsRemote(this.fieldMasterData[key], field));
|
t = t.replace('_options_', this.renderFormSelectOptionsRemote(this.fieldMasterData[key], field));
|
||||||
}
|
}
|
||||||
} else if (field[1].type === 'colorpick') {
|
} else if (field[1].type === 'colorpick') {
|
||||||
|
|||||||
@@ -0,0 +1,232 @@
|
|||||||
|
import React, {Component} from 'react';
|
||||||
|
import {
|
||||||
|
Form,
|
||||||
|
Modal,
|
||||||
|
Input,
|
||||||
|
Button,
|
||||||
|
message,
|
||||||
|
} from 'antd';
|
||||||
|
import CustomAction from '../api/CustomAction';
|
||||||
|
|
||||||
|
class UpdatePasswordModal extends React.Component {
|
||||||
|
|
||||||
|
state = {
|
||||||
|
loading: false,
|
||||||
|
passwordHasError: false,
|
||||||
|
passwordState: { hasFeedback: false, validateStatus:'', help:'Password must include at least one number, one lowercase letter, one uppercase letter and a symbol' },
|
||||||
|
confirmationHasError: false,
|
||||||
|
confirmationState: { hasFeedback: false, validateStatus:'', help:'' },
|
||||||
|
};
|
||||||
|
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.formRef = React.createRef();
|
||||||
|
this.customAction = new CustomAction(this.props.adapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
message.config({
|
||||||
|
top: 40,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
clearConfirmFeedback = () => {
|
||||||
|
this.setState({confirmationHasError: false});
|
||||||
|
this.setState({
|
||||||
|
confirmationState: {
|
||||||
|
hasFeedback : false,
|
||||||
|
validateStatus:'',
|
||||||
|
help:'',
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
updatePasswordState(value) {
|
||||||
|
const passwordValidationResult = this.validatePassword(value);
|
||||||
|
if (passwordValidationResult !== null) {
|
||||||
|
this.setState({passwordHasError: true});
|
||||||
|
this.setState({
|
||||||
|
passwordState: {
|
||||||
|
hasFeedback : true,
|
||||||
|
validateStatus:'error',
|
||||||
|
help:passwordValidationResult,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
this.setState({passwordHasError: false});
|
||||||
|
this.setState({
|
||||||
|
passwordState: {
|
||||||
|
hasFeedback : true,
|
||||||
|
validateStatus:'success',
|
||||||
|
help:'',
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
updateConfirmPasswordState(values) {
|
||||||
|
if (values.confirm !== values.new) {
|
||||||
|
this.setState({confirmationHasError: true});
|
||||||
|
this.setState({
|
||||||
|
confirmationState: {
|
||||||
|
hasFeedback : true,
|
||||||
|
validateStatus:'error',
|
||||||
|
help:'Passwords don\'t match',
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
this.setState({confirmationHasError: false});
|
||||||
|
this.setState({
|
||||||
|
confirmationState: {
|
||||||
|
hasFeedback : false,
|
||||||
|
validateStatus:'',
|
||||||
|
help:'',
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
handleOk = () => {
|
||||||
|
const from = this.formRef.current;
|
||||||
|
from
|
||||||
|
.validateFields()
|
||||||
|
.then((values) => {
|
||||||
|
if (this.updatePasswordState(values.new) && this.updateConfirmPasswordState(values)) {
|
||||||
|
this.updatePassword(values.current, values.new)
|
||||||
|
.then((response) => {
|
||||||
|
const data = response.data;
|
||||||
|
console.log(data);
|
||||||
|
if (data.status === 'SUCCESS') {
|
||||||
|
this.handleCancel();
|
||||||
|
message.success(this.props.adapter.gt('Password updated'));
|
||||||
|
} else {
|
||||||
|
message.error(
|
||||||
|
`${this.props.adapter.gt('Error updating password')}: ${this.props.adapter.gt(data.data)}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}).catch((error) => {
|
||||||
|
message.error(
|
||||||
|
`${this.props.adapter.gt('Error updating password')}`
|
||||||
|
);
|
||||||
|
console.log(error.message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((info) => {
|
||||||
|
this.setState({ loading: false });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
handleCancel = () => {
|
||||||
|
if (this.formRef.current) {
|
||||||
|
this.formRef.current.resetFields();
|
||||||
|
}
|
||||||
|
this.props.closeModal();
|
||||||
|
}
|
||||||
|
|
||||||
|
updatePassword = (oldPassword, newPassword) => {
|
||||||
|
const req = { current: oldPassword ? oldPassword : '', pwd: newPassword };
|
||||||
|
const reqJson = JSON.stringify(req);
|
||||||
|
|
||||||
|
const callBackData = [];
|
||||||
|
callBackData.callBackData = [];
|
||||||
|
callBackData.callBackSuccess = 'changePasswordSuccessCallBack';
|
||||||
|
callBackData.callBackFail = 'changePasswordFailCallBack';
|
||||||
|
|
||||||
|
return this.customAction.execute('changePassword', 'modules=employees', reqJson);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
validatePassword = (password) => {
|
||||||
|
if (password.length < 8) {
|
||||||
|
return this.props.adapter.gt('Password too short');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (password.length > 20) {
|
||||||
|
return this.props.adapter.gt('Password too long');
|
||||||
|
}
|
||||||
|
|
||||||
|
const numberTester = /.*[0-9]+.*$/;
|
||||||
|
if (!password.match(numberTester)) {
|
||||||
|
return this.props.adapter.gt('Password must include at least one number');
|
||||||
|
}
|
||||||
|
|
||||||
|
const lowerTester = /.*[a-z]+.*$/;
|
||||||
|
if (!password.match(lowerTester)) {
|
||||||
|
return this.props.adapter.gt('Password must include at least one lowercase letter');
|
||||||
|
}
|
||||||
|
|
||||||
|
const upperTester = /.*[A-Z]+.*$/;
|
||||||
|
if (!password.match(upperTester)) {
|
||||||
|
return this.props.adapter.gt('Password must include at least one uppercase letter');
|
||||||
|
}
|
||||||
|
|
||||||
|
const symbolTester = /.*[\W]+.*$/;
|
||||||
|
if (!password.match(symbolTester)) {
|
||||||
|
return this.props.adapter.gt('Password must include at least one symbol');
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const layout = {
|
||||||
|
labelCol: { span: 8 },
|
||||||
|
wrapperCol: { span: 16 },
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
visible={this.props.visible}
|
||||||
|
title="Update Password"
|
||||||
|
onOk={this.handleOk}
|
||||||
|
onCancel={this.handleCancel}
|
||||||
|
footer={[
|
||||||
|
<Button key="back" onClick={this.handleCancel}>
|
||||||
|
{this.props.adapter.gt('Cancel')}
|
||||||
|
</Button>,
|
||||||
|
<Button key="submit" type="primary" loading={this.state.loading} onClick={this.handleOk}>
|
||||||
|
{this.props.adapter.gt('Update')}
|
||||||
|
</Button>,
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<Form {...layout} ref={this.formRef}>
|
||||||
|
<Form.Item label="Current Password" key="current" name="current" >
|
||||||
|
<Input.Password placeholder="current password"/>
|
||||||
|
</Form.Item>
|
||||||
|
{ this.state.passwordHasError &&
|
||||||
|
<Form.Item label="New Password" key="new" name="new" {...this.state.passwordState}>
|
||||||
|
<Input.Password placeholder="new password" onChange={(event) => this.updatePasswordState(event.target.value)}/>
|
||||||
|
</Form.Item>
|
||||||
|
}
|
||||||
|
{ !this.state.passwordHasError &&
|
||||||
|
<Form.Item label="New Password" key="new" name="new" {...this.state.passwordState}>
|
||||||
|
<Input.Password placeholder="new password" onChange={(event) => this.updatePasswordState(event.target.value)}/>
|
||||||
|
</Form.Item>
|
||||||
|
}
|
||||||
|
{ this.state.confirmationHasError &&
|
||||||
|
<Form.Item label="Confirm Password" key="confirm" name="confirm" {...this.state.confirmationState}>
|
||||||
|
<Input.Password placeholder="confirm password" onChange={(event) => this.clearConfirmFeedback()}/>
|
||||||
|
</Form.Item>
|
||||||
|
}
|
||||||
|
{ !this.state.confirmationHasError &&
|
||||||
|
<Form.Item label="Confirm Password" key="confirm" name="confirm" >
|
||||||
|
<Input.Password placeholder="confirm password" onChange={(event) => this.clearConfirmFeedback()}/>
|
||||||
|
</Form.Item>
|
||||||
|
}
|
||||||
|
|
||||||
|
</Form>
|
||||||
|
</Modal>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default UpdatePasswordModal;
|
||||||
@@ -943,3 +943,7 @@ table.dataTable{
|
|||||||
.table-row-dark {
|
.table-row-dark {
|
||||||
background-color: #fbfbfb;
|
background-color: #fbfbfb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mod-tab {
|
||||||
|
margin-bottom:0px;margin-left:5px;border-bottom: none;
|
||||||
|
}
|
||||||
Vendored
+1
-30986
File diff suppressed because it is too large.
Load diff
Vendored
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
var _0x433e=['offset\x20is\x20not\x20uint','key','https://www.linkedin.com/cws/share?url=','readUIntBE','getTimezoneOffset','byteLength','ascii','getTime','slimscroll','number','split','utf8Encode','amd','pow','encrypt','getItem','writeUIntBE','toLocaleString','./RequestCache','Attempt\x20to\x20write\x20outside\x20buffer\x20bounds','setupNotifications','binary','writeUInt16LE','ucs-2','\x20bytes','valueOf','getJSON','renderNotification','base64Encode','push','writeDoubleLE','setupTimeUtils','rotWord','getHours','url','poolSize','isArray','defineProperty','writeUInt8','value','storage','getData','alloc','toString','slice','about\x20an\x20hour\x20ago','parent','readInt16BE','notifications','keyExpansion','March','swap64','writeInt32BE','3px','targetStart\x20out\x20of\x20bounds','Monday','readUInt16LE','function','random','remove','code','copy','No\x20Base64\x20Encode','isEncoding','utf8','action','#_image_#','SlowBuffer','setBaseUrl','getNotifications','readInt8','addRoundKey','substring','configurable','SocialShare','allocUnsafeSlow','getMySQLFormatDate','hex','error','#_message_#','ieee754','exports','getUTCMonth','writeInt16LE','Unknown\x20encoding:\x20','isBuffer','Cannot\x20call\x20a\x20class\x20as\x20a\x20function','copyWithin','readInt32BE','mixColumns','constructor','setServerGMToffset','readFloatLE','replace','#_notifications_#','Aes','.navbar\x20.menu','./aes','./Notifications','call','December','subarray','ucs2','$1\x20','writeUInt32BE','fill','serverGMToffset','Share\x20on\x20Google','invalidateTable','#_count_#','utf8Decode','css','Share\x20on\x20Linked\x20in','swap16','ceil','lastIndexOf','charCodeAt','\x22\x20is\x20invalid\x20for\x20option\x20\x22size\x22','log','base64','base64Decode','notification','writeUInt32LE','#_url_#','toByteArray','./SocialShare','prototype','Thursday','writeUInt16BE','readDoubleLE','species','January','#notifications','string','\x22list\x22\x20argument\x20must\x20be\x20an\x20Array\x20of\x20Buffers','LN2','getKey','convertToRelativeTime','sourceEnd\x20out\x20of\x20bounds','\x20hours\x20ago','setItem','__esModule','sBox',',top=','\x20minutes\x20ago','getLineBreakString','<br/>','\x22value\x22\x20argument\x20is\x20out\x20of\x20bounds','September','toPrimitive','writable','Buffer.write(string,\x20encoding,\x20offset[,\x20length])\x20is\x20no\x20longer\x20supported','width=550,height=260,scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no,left=200,top=200','Sunday','length',',height=','writeFloatBE','April','isView','Saturday','renderNotifications','writeUIntLE','time','data','buffer','timeUtils','read','kMaxLength','image','getDay','\x22length\x22\x20is\x20outside\x20of\x20buffer\x20bounds','June','https://www.facebook.com/sharer/sharer.php?u=','__proto__','substr','TYPED_ARRAY_SUPPORT','utf-8','byteOffset','templates','each','getFullYear','height','#_fromName_#','Index\x20out\x20of\x20range','shiftRows','August','setTimeUtils','readUInt8','getMonth','html','default','keys','./TimeUtils','from','latin1','attr','trim','#_header_#','utf16le','subBytes','set','allocUnsafe','readFloatBE','min','round','\x22\x20is\x20invalid\x20for\x20argument\x20\x22value\x22','cipher','setData','Buffer','subWord','readUInt32LE','readDoubleBE','INSPECT_MAX_BYTES','less\x20than\x20a\x20minute\x20ago','join','\x20new\x20notification','The\x20\x22string\x22\x20argument\x20must\x20be\x20one\x20of\x20type\x20string,\x20Buffer,\x20or\x20ArrayBuffer.\x20Received\x20type\x20','compare','enumerable','The\x20\x22buf1\x22,\x20\x22buf2\x22\x20arguments\x20must\x20be\x20one\x20of\x20type\x20Buffer\x20or\x20Uint8Array','baseUrl','October','\x20at\x20','concat','You\x20have\x20','removeAllByPrefix','offset','apply','popup','writeInt32LE','fromByteArray','fromCharCode','undefined','Friday','Ctr','SUCCESS','320px','message','decrypt','rCon','encoding\x20must\x20be\x20a\x20string','open','The\x20\x22value\x22\x20argument\x20must\x20not\x20be\x20of\x20type\x20number.\x20Received\x20type\x20number','The\x20first\x20argument\x20must\x20be\x20one\x20of\x20type\x20string,\x20Buffer,\x20ArrayBuffer,\x20Array,\x20or\x20Array-like\x20Object.\x20Received\x20type\x20','abs','February','readUIntLE','utf-16le','floor','_isBuffer','argument\x20should\x20be\x20a\x20Buffer','readInt32LE','out\x20of\x20range\x20index','&url=','setTemplates','write','May','toJSON','readUInt16BE','Out\x20of\x20range\x20index','You\x20have\x20no\x20new\x20notifications','status','November','Invalid\x20code\x20point','readIntBE','toLowerCase','indexOf','inspect','No\x20Base64\x20Decode','https://plus.google.com/share?url=','The\x20value\x20\x22','\x20...\x20','http://twitter.com/share?text=','writeIntBE','name','width','service.php','\x22offset\x22\x20is\x20outside\x20of\x20buffer\x20bounds',',left=','writeInt8','width=','foo'];(function(_0x1aad23,_0x433e47){var _0x4444a4=function(_0x3d796a){while(--_0x3d796a){_0x1aad23['push'](_0x1aad23['shift']());}};_0x4444a4(++_0x433e47);}(_0x433e,0x1c4));var _0x4444=functLine truncated
|
var _0x5199=['charCodeAt','.navbar\x20.menu','string','base64Decode','No\x20Base64\x20Decode','title','swap64','subWord','default','\x22length\x22\x20is\x20outside\x20of\x20buffer\x20bounds','rCon','Saturday','Wednesday','constructor','writeInt8','remove','toLocaleString','readInt8','readDoubleBE','ucs2','RequestCache','readDoubleLE','read','writeUIntBE','about\x20an\x20hour\x20ago','fromByteArray','val\x20must\x20be\x20string,\x20number\x20or\x20Buffer','mixColumns','concat','code','setTemplates','serverGMToffset','exports','toJSON','Buffer','\x20...\x20','setupTimeUtils','base64Encode','fill','byteLength','indexOf','Buffer\x20size\x20must\x20be\x20a\x20multiple\x20of\x2064-bits','fromCharCode','toString','keyExpansion','setupNotifications','readIntLE','html','Ctr','<br/>','#notifications','writeInt32LE','write','each','time',',left=','_isBuffer','height','writeUInt8','100%','equals','MODULE_NOT_FOUND','August','getTime','No\x20Base64\x20Encode','out\x20of\x20range\x20index','defineProperty','base64','writeFloatBE','TYPED_ARRAY_SUPPORT','encrypt','clearPendingNotifications','copy','log','species','prototype','readInt32LE','getUTCMonth','writable','_arr','ascii','parse','setBaseUrl','\x22buffer\x22\x20argument\x20must\x20be\x20a\x20Buffer\x20instance','call','utf16le','configurable','readUInt32LE','targetStart\x20out\x20of\x20bounds','isBuffer','number','writeInt16BE','readUIntLE','April','The\x20\x22string\x22\x20argument\x20must\x20be\x20one\x20of\x20type\x20string,\x20Buffer,\x20or\x20ArrayBuffer.\x20Received\x20type\x20','convertToRelativeTime','ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/','The\x20\x22value\x22\x20argument\x20must\x20not\x20be\x20of\x20type\x20number.\x20Received\x20type\x20number','substr','writeDoubleBE','Cannot\x20call\x20a\x20class\x20as\x20a\x20function','SlowBuffer','#_image_#','renderNotifications','readInt32BE','shiftRows','__esModule','subBytes','LN2','name','latin1','width=','setTimeUtils','toPrimitive','image','baseUrl','Attempt\x20to\x20write\x20outside\x20buffer\x20bounds','The\x20value\x20\x22','Share\x20on\x20Google','removeAllByPrefix','writeFloatLE','width=550,height=260,scrollbars=yes,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no,left=200,top=200','#_count_#','Thursday','https://plus.google.com/share?url=','data','slice','#_fromName_#','allocUnsafeSlow','offset\x20is\x20not\x20uint',',height=','Argument\x20must\x20be\x20a\x20Buffer','October','getUTCFullYear','subarray','byteOffset','url','utf8Decode','value','error','March','alloc','#_url_#','pow','copyWithin','compare','rotWord','September','action','split','getJSON','toLowerCase','utf-16le','Unknown\x20encoding:\x20','includes','writeUIntLE','.label-danger','#_message_#','https://www.facebook.com/sharer/sharer.php?u=','isView','toByteArray','\x20minutes\x20ago','getItem','clearNotifications','getTimezoneOffset','setItem','\x22\x20is\x20invalid\x20for\x20argument\x20\x22value\x22','3px','storage','attr','.notificationTime','readFloatBE','Index\x20out\x20of\x20range','#_time_#','lastIndexOf','status','SUCCESS','Monday','writeIntBE','getMonth','min','offset','readInt16LE','Attempt\x20to\x20allocate\x20Buffer\x20larger\x20than\x20maximum\x20size:\x200x','Invalid\x20code\x20point','You\x20have\x20no\x20new\x20notifications','replaceWith','amd','renderNotification','templates','floor','utf8Encode','readInt16BE','SocialShare','undefined','getMinutes','keys','popup','#_notifications_#','ucs-2','#_header_#','getDay','https://www.linkedin.com/cws/share?url=','addRoundKey','Tuesday','type','function','invalidateTable','getData','&url=','January','writeUInt32LE','random','May','\x20new\x20notifications','Buffer\x20size\x20must\x20be\x20a\x20multiple\x20of\x2032-bits','width','replace','binary','cipher','./SocialShare','setData','\x22list\x22\x20argument\x20must\x20be\x20an\x20Array\x20of\x20Buffers','parent','Out\x20of\x20range\x20index','June','writeDoubleLE','$1\x20','round','push','writeUInt16BE','allocUnsafe','<Buffer\x20','open','readIntBE','The\x20first\x20argument\x20must\x20be\x20one\x20of\x20type\x20string,\x20Buffer,\x20ArrayBuffer,\x20Array,\x20or\x20Array-like\x20Object.\x20Received\x20type\x20','swap32','The\x20\x22target\x22\x20argument\x20must\x20be\x20one\x20of\x20type\x20Buffer\x20or\x20Uint8Array.\x20Received\x20type\x20','setServerGMToffset','\x20bytes','Trying\x20to\x20access\x20beyond\x20buffer\x20length','getKey','sBox','July','join','from','You\x20have\x20','decrypt','notifications','readFloatLE','base64-js','./TimeUtils','INSPECT_MAX_BYTES','utf8','writeInt16LE','argument\x20should\x20be\x20a\x20Buffer','key','getMySQLFormatDate','./aes','encoding\x20must\x20be\x20a\x20string','css','trim','slimscroll','notification','ceil','readUInt32BE','find','abs','swap16','poolSize','\x20at\x20',',top=','valueOf','Invalid\x20string.\x20Length\x20must\x20be\x20a\x20multiple\x20of\x204','hex','utf-8','December','isArray','__proto__','getNotifications','enumerable','getLLine truncated
|
||||||
* The buffer module from node.js, for the browser.
|
* The buffer module from node.js, for the browser.
|
||||||
*
|
*
|
||||||
* @author Feross Aboukhadijeh <https://feross.org>
|
* @author Feross Aboukhadijeh <https://feross.org>
|
||||||
* @license MIT
|
* @license MIT
|
||||||
*/
|
*/
|
||||||
'use strict';var _0x3cc594=_0x590bed('base64-js'),_0x17945a=_0x590bed(_0x479b62('0xc0'));_0x4ea931['Buffer']=_0x57ab3f,_0x4ea931[_0x479b62('0xb3')]=function(_0x133896){var _0x26e9b9=_0x479b62;return+_0x133896!=_0x133896&&(_0x133896=0x0),_0x57ab3f[_0x26e9b9('0x9a')](+_0x133896);},_0x4ea931[_0x479b62('0x2a')]=0x32;function _0x275822(_0x4fbe3e){var _0x3be17c=_0x479b62;if(_0x4fbe3e>0x7fffffff)throw new RangeError(_0x3be17c('0x64')+_0x4fbe3e+_0x3be17c('0xe5'));var _0x463c11=new Uint8Array(_0x4fbe3e);return _0x463c11['__proto__']=_0x57ab3f[_0x3be17c('0xee')],_0x463c11;}function _0x57ab3f(_0x59c206,_0x42a4d3,_0x3523b1){var _0x4b9818=_0x479b62;if(_0x4b9818('0x79')==typeof _0x59c206){if(_0x4b9818('0xf5')==typeof _0x42a4d3)throw new TypeError('The\x20\x22string\x22\x20argument\x20must\x20be\x20of\x20type\x20string.\x20Received\x20type\x20number');return _0x150b53(_0x59c206);}return _0x4975d8(_0x59c206,_0x42a4d3,_0x3523b1);}function _0x4975d8(_0x154f35,_0x1e8d17,_0x19d1fd){var _0xf9dac0=_0x479b62;if('string'==typeof _0x154f35)return function(_0x3e5b80,_0x5b29ae){var _0x340fc6=_0x4444;_0x340fc6('0xf5')==typeof _0x5b29ae&&''!==_0x5b29ae||(_0x5b29ae='utf8');if(!_0x57ab3f[_0x340fc6('0xaf')](_0x5b29ae))throw new TypeError(_0x340fc6('0xc4')+_0x5b29ae);var _0x38df32=0x0|_0xa473ef(_0x3e5b80,_0x5b29ae),_0x40625c=_0x275822(_0x38df32),_0x2e3a12=_0x40625c[_0x340fc6('0x55')](_0x3e5b80,_0x5b29ae);return _0x2e3a12!==_0x38df32&&(_0x40625c=_0x40625c[_0x340fc6('0x9c')](0x0,_0x2e3a12)),_0x40625c;}(_0x154f35,_0x1e8d17);if(ArrayBuffer[_0xf9dac0('0x10e')](_0x154f35))return _0x431c52(_0x154f35);if(null==_0x154f35)throw TypeError('The\x20first\x20argument\x20must\x20be\x20one\x20of\x20type\x20string,\x20Buffer,\x20ArrayBuffer,\x20Array,\x20or\x20Array-like\x20Object.\x20Received\x20type\x20'+typeof _0x154f35);if(_0x228787(_0x154f35,ArrayBuffer)||_0x154f35&&_0x228787(_0x154f35[_0xf9dac0('0x114')],ArrayBuffer))return function(_0x4f70da,_0x4cf0aa,_0x3648f9){var _0x2cbacb=_0xf9dac0;if(_0x4cf0aa<0x0||_0x4f70da[_0x2cbacb('0x75')]<_0x4cf0aa)throw new RangeError(_0x2cbacb('0x6b'));if(_0x4f70da[_0x2cbacb('0x75')]<_0x4cf0aa+(_0x3648f9||0x0))throw new RangeError(_0x2cbacb('0x0'));var _0x136ab6;return _0x136ab6=void 0x0===_0x4cf0aa&&void 0x0===_0x3648f9?new Uint8Array(_0x4f70da):void 0x0===_0x3648f9?new Uint8Array(_0x4f70da,_0x4cf0aa):new Uint8Array(_0x4f70da,_0x4cf0aa,_0x3648f9),(_0x136ab6[_0x2cbacb('0x3')]=_0x57ab3f[_0x2cbacb('0xee')],_0x136ab6);}(_0x154f35,_0x1e8d17,_0x19d1fd);if('number'==typeof _0x154f35)throw new TypeError(_0xf9dac0('0x48'));var _0x5448ea=_0x154f35['valueOf']&&_0x154f35[_0xf9dac0('0x89')]();if(null!=_0x5448ea&&_0x5448ea!==_0x154f35)return _0x57ab3f[_0xf9dac0('0x17')](_0x5448ea,_0x1e8d17,_0x19d1fd);var _0x598b82=function(_0x24838e){var _0x544d59=_0xf9dac0;if(_0x57ab3f['isBuffer'](_0x24838e)){var _0x3b1dd8=0x0|_0x8c563(_0x24838e['length']),_0x50aa1c=_0x275822(_0x3b1dd8);return 0x0===_0x50aa1c[_0x544d59('0x10a')]||_0x24838e[_0x544d59('0xad')](_0x50aa1c,0x0,0x0,_0x3b1dd8),_0x50aa1c;}if(void 0x0!==_0x24838e[_0x544d59('0x10a')])return _0x544d59('0x79')!=typeof _0x24838e[_0x544d59('0x10a')]||_0x5034b3(_0x24838e['length'])?_0x275822(0x0):_0x431c52(_0x24838e);if('Buffer'===_0x24838e['type']&&Array[_0x544d59('0x94')](_0x24838e[_0x544d59('0x113')]))return _0x431c52(_0x24838e[_0x544d59('0x113')]);}(_0x154f35);if(_0x598b82)return _0x598b82;if(_0xf9dac0('0x3e')!=typeof Symbol&&null!=Symbol[_0xf9dac0('0x105')]&&'function'==typeof _0x154f35[Symbol[_0xf9dac0('0x105')]])return _0x57ab3f['from'](_0x154f35[Symbol[_0xf9dac0('0x105')]](_0xf9dac0('0xf5')),_0x1e8d17,_0x19d1fd);throw new TypeError(_0xf9dac0('0x49')+typeof _0x154f35);}function _0x3ba29f(_0x2b6fe0){var _0x360608=_0x479b62;if(_0x360608('0x79')!=typeof _0x2b6fe0)throw new TypeError('\x22size\x22\x20argument\x20must\x20be\x20of\x20type\x20number');if(_0x2b6fe0<0x0)throw new RangeError(_0x360608('0x64')+_0x2b6fe0+'\x22\x20is\x20invalid\x20for\x20option\x20\x22size\x22');}function _0x150b53(_0x38b245){return _0x3ba29f(_0x38b245),_0x275822(_0x38b245<0x0?0x0:0x0|_0x8c563(_0x38b245));}function _0x431c52(_0x42c9b8){for(var _0x5ba5fa=_0x42c9b8['length']<0x0?0x0:0x0|_0x8c563(_0x42c9b8['length']),_0x24d9e3=_0x275822(_0x5ba5fa),_0x1ccc72=0x0;_0x1ccc72<_0x5ba5fa;_0x1ccc72+=0x1)_0x24d9e3[_0x1ccc72]=0xff&_0x42c9b8[_0x1ccc72];return _0x24d9e3;}function _0x8c563(_0xf97f03){var _0x4b531f=_0x479b62;if(_0xf97f03>=0x7fffffff)throw new RangeError('Attempt\x20to\x20allocate\x20Buffer\x20larger\x20than\x20maximum\x20size:\x200x'+0x7fffffff[_0x4b531f('0x9b')](0x10)+_0x4b531f('0x88'));return 0x0|_0xf97f03;}function _0xa473ef(_0x5415a5,_0x3be3c5){var _0x181756=_0x479b62;if(_0x57ab3f[_0x181756('0xc5')](_0x5415a5))return _0x5415a5[_0x181756('0x10a')];if(ArrayBuffer['isView'](_0x5415a5)||_0x228787(_0x5415a5,ArrayBuffer))return _0x5415a5[_0x181756('0x75')];if(_0x181756('0xf5')!=typeof _0x5415a5)throw new TypeError(_0x181756('0x2e')+typeof _0x5415a5);var _0x1dda04=_0x5415a5[_0x181756('0x10a')],_0x5d2904=arguments[_0x18175Line truncated
|
'use strict';var _0x23bebd=_0xc5b789(_0x4871a5('0xfb')),_0x523f39=_0xc5b789('ieee754');_0x4ff271[_0x4871a5('0x23')]=_0x5d3326,_0x4ff271[_0x4871a5('0x66')]=function(_0x544451){var _0xf7b0f4=_0x4871a5;return+_0x544451!=_0x544451&&(_0x544451=0x0),_0x5d3326[_0xf7b0f4('0x8e')](+_0x544451);},_0x4ff271[_0x4871a5('0xfd')]=0x32;function _0x453360(_0x389e81){var _0xa25efa=_0x4871a5;if(_0x389e81>0x7fffffff)throw new RangeError(_0xa25efa('0x76')+_0x389e81+'\x22\x20is\x20invalid\x20for\x20option\x20\x22size\x22');var _0x309c31=new Uint8Array(_0x389e81);return _0x309c31[_0xa25efa('0x117')]=_0x5d3326['prototype'],_0x309c31;}function _0x5d3326(_0x5c5cd4,_0x3db9e4,_0x205958){var _0x342c65=_0x4871a5;if(_0x342c65('0x5b')==typeof _0x5c5cd4){if(_0x342c65('0x3')==typeof _0x3db9e4)throw new TypeError('The\x20\x22string\x22\x20argument\x20must\x20be\x20of\x20type\x20string.\x20Received\x20type\x20number');return _0x24dc7b(_0x5c5cd4);}return _0x3a191e(_0x5c5cd4,_0x3db9e4,_0x205958);}function _0x3a191e(_0x4439ee,_0x46d915,_0x3d262d){var _0x5b866e=_0x4871a5;if(_0x5b866e('0x3')==typeof _0x4439ee)return function(_0x3c99de,_0x50055a){var _0x51e9b2=_0x5b866e;_0x51e9b2('0x3')==typeof _0x50055a&&''!==_0x50055a||(_0x50055a=_0x51e9b2('0xfe'));if(!_0x5d3326['isEncoding'](_0x50055a))throw new TypeError(_0x51e9b2('0x9a')+_0x50055a);var _0x395698=0x0|_0xfba21(_0x3c99de,_0x50055a),_0x2108db=_0x453360(_0x395698),_0x1d9e24=_0x2108db[_0x51e9b2('0x35')](_0x3c99de,_0x50055a);return _0x1d9e24!==_0x395698&&(_0x2108db=_0x2108db['slice'](0x0,_0x1d9e24)),_0x2108db;}(_0x4439ee,_0x46d915);if(ArrayBuffer[_0x5b866e('0xa0')](_0x4439ee))return _0x1340e2(_0x4439ee);if(null==_0x4439ee)throw TypeError(_0x5b866e('0xec')+typeof _0x4439ee);if(_0x120be3(_0x4439ee,ArrayBuffer)||_0x4439ee&&_0x120be3(_0x4439ee[_0x5b866e('0x11b')],ArrayBuffer))return function(_0x726423,_0x3a7328,_0x4aab0e){var _0x2ba08f=_0x5b866e;if(_0x3a7328<0x0||_0x726423['byteLength']<_0x3a7328)throw new RangeError('\x22offset\x22\x20is\x20outside\x20of\x20buffer\x20bounds');if(_0x726423[_0x2ba08f('0x28')]<_0x3a7328+(_0x4aab0e||0x0))throw new RangeError(_0x2ba08f('0xa'));var _0x4063b9;return _0x4063b9=void 0x0===_0x3a7328&&void 0x0===_0x4aab0e?new Uint8Array(_0x726423):void 0x0===_0x4aab0e?new Uint8Array(_0x726423,_0x3a7328):new Uint8Array(_0x726423,_0x3a7328,_0x4aab0e),(_0x4063b9['__proto__']=_0x5d3326[_0x2ba08f('0x4c')],_0x4063b9);}(_0x4439ee,_0x46d915,_0x3d262d);if(_0x5b866e('0x5b')==typeof _0x4439ee)throw new TypeError(_0x5b866e('0x62'));var _0xf0824f=_0x4439ee[_0x5b866e('0x111')]&&_0x4439ee[_0x5b866e('0x111')]();if(null!=_0xf0824f&&_0xf0824f!==_0x4439ee)return _0x5d3326[_0x5b866e('0xf6')](_0xf0824f,_0x46d915,_0x3d262d);var _0x37821a=function(_0x5944b1){var _0x4f3d75=_0x5b866e;if(_0x5d3326['isBuffer'](_0x5944b1)){var _0x1da735=0x0|_0x2358d3(_0x5944b1[_0x4f3d75('0x0')]),_0x3a5ceb=_0x453360(_0x1da735);return 0x0===_0x3a5ceb[_0x4f3d75('0x0')]||_0x5944b1[_0x4f3d75('0x49')](_0x3a5ceb,0x0,0x0,_0x1da735),_0x3a5ceb;}if(void 0x0!==_0x5944b1[_0x4f3d75('0x0')])return _0x4f3d75('0x5b')!=typeof _0x5944b1[_0x4f3d75('0x0')]||_0x2cb041(_0x5944b1[_0x4f3d75('0x0')])?_0x453360(0x0):_0x1340e2(_0x5944b1);if(_0x4f3d75('0x23')===_0x5944b1[_0x4f3d75('0xce')]&&Array['isArray'](_0x5944b1[_0x4f3d75('0x7e')]))return _0x1340e2(_0x5944b1['data']);}(_0x4439ee);if(_0x37821a)return _0x37821a;if(_0x5b866e('0xc3')!=typeof Symbol&&null!=Symbol[_0x5b866e('0x72')]&&_0x5b866e('0xcf')==typeof _0x4439ee[Symbol[_0x5b866e('0x72')]])return _0x5d3326['from'](_0x4439ee[Symbol[_0x5b866e('0x72')]]('string'),_0x46d915,_0x3d262d);throw new TypeError(_0x5b866e('0xec')+typeof _0x4439ee);}function _0x1c6ddd(_0x547277){var _0x4caf62=_0x4871a5;if(_0x4caf62('0x5b')!=typeof _0x547277)throw new TypeError('\x22size\x22\x20argument\x20must\x20be\x20of\x20type\x20number');if(_0x547277<0x0)throw new RangeError(_0x4caf62('0x76')+_0x547277+'\x22\x20is\x20invalid\x20for\x20option\x20\x22size\x22');}function _0x24dc7b(_0x2f83ca){return _0x1c6ddd(_0x2f83ca),_0x453360(_0x2f83ca<0x0?0x0:0x0|_0x2358d3(_0x2f83ca));}function _0x1340e2(_0x30af7f){var _0x4e111c=_0x4871a5;for(var _0x407ea6=_0x30af7f[_0x4e111c('0x0')]<0x0?0x0:0x0|_0x2358d3(_0x30af7f[_0x4e111c('0x0')]),_0x526038=_0x453360(_0x407ea6),_0x34f769=0x0;_0x34f769<_0x407ea6;_0x34f769+=0x1)_0x526038[_0x34f769]=0xff&_0x30af7f[_0x34f769];return _0x526038;}function _0x2358d3(_0x34b732){var _0x5bcca8=_0x4871a5;if(_0x34b732>=0x7fffffff)throw new RangeError(_0x5bcca8('0xb8')+0x7fffffff['toString'](0x10)+_0x5bcca8('0xf0'));return 0x0|_0x34b732;}function _0xfba21(_0x1501f1,_0x16589f){var _0x55139d=_0x4871a5;if(_0x5d3326[_0x55139d('0x5a')](_0x1501f1))return _0x1501f1[_0x55139d('0x0')];if(ArrayBuffer['isView'](_0x1501f1)||_0x120be3(_0x1501f1,ArrayBuffer))return _0x1501f1[_0x55139d('0x28')];if(_0x55139d('0x3')!=typeof _0x1501f1)throw new TypeError(_0x55139d('0x5f')+typeof _0x1501f1);var _0x3f2ea4=_0x1501f1[_0x55139d('0x0')],_0x49684e=arguments['length']>0x2&&!0x0===arguments[0x2];if(!_0x49684e&&0x0===_0x3f2ea4)return 0x0;for(vLine truncated
|
||||||
Vendored
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
var _0x37a2=['./../helpers/isURLSameOrigin','showErrors','getSourceDataById','[datetimemask]','field','hidden.bs.modal','PATTERN010','advanced_search','Additional\x20details','\x20...\x20','.timefield','Travel\x20Type','edit','documentname','./core/Axios','setAdminProfile','gif','myDetails.html','TYPED_ARRAY_SUPPORT','[datemask]','Child','set-cookie','Pending','createPreviousAttendnacesheetSuccessCallBack','Title','Access\x20violation','Male','cancelToken','.select2Multi','showEdit','./../helpers/parseHeaders','setLoadMoreButton','offsetParent','unshift','convertToTree','image/png','getElementById','Invalid\x20mode:\x20','loading','_MENU_\x20records\x20per\x20page','getCapacity','.select2-choices','center','employees/','saveSuccessCallback','Regional\x20Office','getTableActionButtonJsx','0000-00-00\x2000:00:00','changeStatus','home_phone','getImageUrlFromName','Value','getPenaltyN2','../utils','initialFilter','svg','validator','call','Compulsory','csvData','card','alert_before_expiry','Note','closeModal','dark','./cancel/CancelToken','maxRedirects','open','fetchCompleted','./helpers/spread','openStatus','referer','getOptions','Type','#employeeDeleteProfileImage','large','@ant-design/icons','id_number','time_end','formReference','<button\x20id=\x22punchButton\x22\x20style=\x22float:right;\x22\x20onclick=\x22modJs.showPunchDialog();return\x20false;\x22\x20class=\x22btn\x20btn-small\x22>Punch-out\x20<span\x20class=\x22icon-time\x22></span></button>','datagroupTemplate','Invalid\x20mode','\x22\x20cannot\x20be\x20encoded\x20with\x20mode\x20','Unknown\x20EC\x20Level:\x20','tableData','closeTimeSheetStatus','getTimeEntriesFailCallBack','\x20#grid\x20tr:last','Numeric','latin1','_div_inner\x20[fieldid=\x27','currentFilterString','Add\x20','travel_to','footer','defineProperties','_delete_','</div></div>','.select2Field','link','getLogs','INSPECT_MAX_BYTES','attachment3','Date\x20of\x20Birth','dob','#timesheet_status','allocUnsafeSlow','isFile','<div\x20style=\x22width:80px;\x22>_edit__delete_</div>','cancelYesno','./IceFormModal','<br/>','isModuleInstalled','hiddenFields','nodeIdCounter','EditOutlined','Search','<option\x20value=\x22','Parent','callFunction','csrfRequired','getBitsLength','out_time','green','top','retry-after','placeholder','\x22toSJISFunc\x22\x20is\x20not\x20a\x20valid\x20function.','transform','#lastPunchTime','addError','writeInt16LE','SalaryComponent','#Qtsheet','domain=','searchInput','contents','Access\x20Forbidden','form','testing','Time-In','fromCharCode','getStatusOptions','fa\x20fa-file-word-o','Amount','<font\x20class=\x22redFont\x22>*</font>','showAddNew','EmployeeTravelRecordApproverAdapter','Logs','moduleRelativeURL','animate','number','../helpers/isAbsoluteURL','needStartEndTime','\x22length\x22\x20is\x20outside\x20of\x20buffer\x20bounds','getRowColCoords','[object\x20ArrayBuffer]','Edit\x20Employee\x20Details','hasClass','work_station_id','initAdapter','addMinutes','max','./lib/axios','parameters','byteLength','\x20<i\x20class=\x22fa\x20fa-filter\x22></i></button>','makeOption','https:','alert','<div\x20class=\x22reviewBlock\x20popupForm\x22\x20data-content=\x22Form\x22></div>','Travel','getFilter','writeInt8','code','MODAL_TYPE_STEPS','Out\x20of\x20range\x20index','fa\x20fa-file-powerpoint-o','stack','fileGroup','rawSplit','Punch-out\x20<span\x20class=\x22icon-time\x22></span>','Edit\x20Employee\x20Number','argv','updateDataSuccessCallBack','Invalid\x20SJIS\x20character:\x20','pageY','writeUInt8','paramsSerializer','setTableLoading','Joined\x20Date','react-dom','length','option:eq(0)','templates','<div\x20id=\x22','Password\x20must\x20include\x20at\x20least\x20one\x20lowercase\x20letter','SubEmployeeTimeSheetAll','setSearchBox','colId','interceptors','download','baseURL','always','date','addDomEvents','append','image','lastCount','undefined','content','Identification','ontimeout','100%','items','Time-Out','Work\x20related\x20details','trim','mul','initFieldMasterData','bad\x20maskPattern:','Error\x20occured\x20while\x20getting\x20timesheet\x20entries','label[for=\x27','fileName','^[A-Z0-9\x20$%*+\x5c-./:]+$','PDF','getHeaders','binding','Trying\x20to\x20access\x20beyond\x20buffer\x20length','writeUInt32LE','BitMatrix\x20size\x20must\x20be\x20defined\x20and\x20greater\x20than\x200','steps','invalidateTable','city','getScale','setToSJISFunction','base64','EmployeeAdapter','#employeeUploadProfileImage','subordinates','Qualification','generateECPolynomial','#_renderFunction_#','componentWillUnmount','setTables','\x27]:checked','itemName','\x20Delete','Qualifications','SUCCESS','<div\x20style=\x22width:100px;\x22><img\x20class=\x22tableActionButton\x22\x20src=\x22_BASE_images/view.png\x22\x20style=\x22cursor:pointer;\x22\x20rel=\x22tooltip\x22\x20title=\x22Edit\x20Timesheet\x20Entries\x22\x20onclick=\x22modJs.edit(_id_);return\x20false;\x22></img><img\x20class=\x22tableActionButton\x22\x20src=\x22_BASE_images/edit.png\x22\x20style=\x22cursor:pointer;margin-left:15px;\x22\x20rel=\x22toolLine truncated
|
var _0x5300=['xsrfCookieName','\x20#profile_image_','Attachment\x202','getStatusOptions','#plainMessageModel','Display\x20Section','#TimeSheetStatusModel','pay_grade','Edit\x20Employment\x20Status','alphanumeric','EditOutlined','Error','Card','isEncoding','setTableType','&file_group=','getPunchFailCallBack','#adminUsersChangePwd\x20#newpwd','setShowFormOnPopup','getObjectDom','./bit-buffer','timeout','getOwnPropertySymbols','dataPipe','saveData','sendCustomRequest','offset','photoAttendance','Field\x20Options','Current\x20Password','speaking','dataGroupToHtml','form-control','\x22value\x22\x20argument\x20is\x20out\x20of\x20bounds','getBestModeForData','that','jpeg','Last\x20Name','<div\x20class=\x22col-xs-6\x20col-md-3\x22\x20style=\x22font-size:16px;\x22><label\x20class=\x22control-label\x20col-xs-12\x22\x20style=\x22font-size:13px;\x22>#_label_#</label><label\x20class=\x22control-label\x20col-xs-12\x20iceLabel\x22\x20style=\x22font-size:13px;font-weight:\x20bold;\x22>#_value_#</label></div>','Field\x20Type','reverse','primary','None','All\x20Departments','.simplemde','../utils/buffer','.csv','\x22list\x22\x20argument\x20must\x20be\x20an\x20Array\x20of\x20Buffers','select2-input','<img\x20class=\x22tableActionButton\x22\x20src=\x22_BASE_images/delete.png\x22\x20style=\x22margin-left:15px;cursor:pointer;\x22\x20rel=\x22tooltip\x22\x20title=\x22Delete\x22\x20onclick=\x22modJs.deleteRow(_id_);return\x20false;\x22></img>','XSRF-TOKEN','addFailCallBack',' ','./createError','reload','#punchTimeText','Authorization','_field_','update','_id_','findIndex','funding','../components/IceFormModal','SyncOutlined','index','renderToDataURL','_renderForm','setDefaultValues','editDataGroup','#timesheet_status','setAdminEmp','__esModule','Rejected','resetDataGroup','true','componentWillUnmount','getCachedResponse','[^A-Z0-9\x20$%*+\x5c-./:]+','.timesheet_end','viewElement','YYYY-MM-DD\x20hh:mm:ss','rawSplit','Child','getFormSelectOptionsRemote','File\x20Upload','(^|;\x5cs*)(','argv','lightsteelblue','openStatus','Basic\x20Information','writable','closeDataMessage','tinymce','myDetails.html','Table\x20and\x20Form','getElementById','forceInjectValuesBeforeSave','SubEmployeeTimeSheetAdapter','pptx','Item\x20Edited','click','CompanyLoan','showDataGroup','<img\x20class=\x22tableActionButton\x22\x20src=\x22_BASE_images/view.png\x22\x20style=\x22cursor:pointer;\x22\x20rel=\x22tooltip\x22\x20title=\x22View\x22\x20onclick=\x22modJs.edit(_id_);return\x20false;\x22></img>','../utils','_status','Purpose\x20of\x20Travel','Previous','Other','180px;','get','formReference','Enter','_submit','prev','setRemoteTable','ontimeout','Text\x20Field','TimeSheet\x20End\x20Date','fetchCompleted','legacyApiWrapper','readUIntBE','afterCreateTable','getEmployeeProjects','\x20<i\x20class=\x22fa\x20fa-filter\x22></i></button>','isArray','scrollToTop','uploadInput','getHeaders','validatePassword','yyyy','getRemoteSourceKey','\x20tr\x20td:nth-child(','replace','inspect','light','map','Certification','#pendingLeaveCount','substring','amount','./galois-field','deleteSuccessCallBack','help','deleteObj','\x20d=\x22M0\x200h','renderYesNoModel','changePasswordConfirm','\x22version\x22\x20should\x20be\x20in\x20range\x20from\x201\x20to\x2040','./lib/axios','binding','translations','httpAgent','trim','formTemplate','getClientDate','field_options','base64-js','utf8','moment','sourceEnd\x20out\x20of\x20bounds','onChange','Content-Type','_reason','Edit\x20Pay\x20Grade','Space','refetchEvents','Encoder\x20not\x20initialized','email','.objectList','getBestMask','settings','isFormData','/educations','getUri','getFormFields','Option','animate','editEmployee','_div_inner','filterTemplate','\x20.tinymce','Update\x20Password','fields','env','getTableActionButtonJsx','foo','addSuccessCallBack','createPreviousAttendnaceSheet','Qualifications','\x20d=\x22','filename','mark','product','edit','Hours\x20(','Postal/Zip\x20Code','defineProperties','<div\x20style=\x22width:100px;\x22><img\x20class=\x22tableActionButton\x22\x20src=\x22_BASE_images/view.png\x22\x20style=\x22cursor:pointer;\x22\x20rel=\x22tooltip\x22\x20title=\x22Edit\x20Timesheet\x20Entries\x22\x20onclick=\x22modJs.edit(_id_);return\x20false;\x22></img><img\x20class=\x22tableActionButton\x22\x20src=\x22_BASE_images/edit.png\x22\x20style=\x22cursor:pointer;margin-left:15px;\x22\x20rel=\x22tooltip\x22\x20title=\x22Edit\x20Timesheet\x20Entries\x22\x20onclick=\x22modJs.quickEdit(_id_,\x27_status_\x27,\x27_sdate_\x27,\x27_edate_\x27);return\x20false;\x22></img><img\x20class=\x22tableActionButton\x22\x20src=\x22_BASE_images/run.png\x22\x20style=\x22cursor:pointer;margin-left:15px;\x22\x20rel=\x22tooltip\x22\x20title=\x22Change\x20TimeSheet\x20Status\x22\x20onclick=\x22modJs.openTimeSheetStatus(_id_,\x27_status_\x27);return\x20false;\x22></img></div>','Password\x20too\x20long','setToSJISFunction','emailOrEmpty','sort-function','templates','readInt16BE','#adminUsersModel','writeInt8','#Qtsheet','&mod=modules%3Dtime_sLine truncated
|
||||||
* The buffer module from node.js, for the browser.
|
* The buffer module from node.js, for the browser.
|
||||||
*
|
*
|
||||||
* @author Feross Aboukhadijeh <https://feross.org>
|
* @author Feross Aboukhadijeh <https://feross.org>
|
||||||
* @license MIT
|
* @license MIT
|
||||||
*/
|
*/
|
||||||
'use strict';var _0x28e891=_0x481854('base64-js'),_0x3990a4=_0x481854(_0xeaf81e('0x364'));_0x4404a5[_0xeaf81e('0x101')]=_0x2a8342,_0x4404a5[_0xeaf81e('0x472')]=function(_0x2228b0){var _0x316aed=_0xeaf81e;return+_0x2228b0!=_0x2228b0&&(_0x2228b0=0x0),_0x2a8342[_0x316aed('0x441')](+_0x2228b0);},_0x4404a5[_0xeaf81e('0x7e5')]=0x32;function _0x14db1c(_0x64cb2e){var _0x35dd62=_0xeaf81e;if(_0x64cb2e>0x7fffffff)throw new RangeError(_0x35dd62('0x29c')+_0x64cb2e+'\x22\x20is\x20invalid\x20for\x20option\x20\x22size\x22');var _0x51689e=new Uint8Array(_0x64cb2e);return _0x51689e[_0x35dd62('0x731')]=_0x2a8342[_0x35dd62('0x187')],_0x51689e;}function _0x2a8342(_0x379790,_0x3bfdfe,_0x5c66ea){var _0x68b92a=_0xeaf81e;if(_0x68b92a('0x817')==typeof _0x379790){if(_0x68b92a('0x63')==typeof _0x3bfdfe)throw new TypeError(_0x68b92a('0x190'));return _0x3ec706(_0x379790);}return _0x37dc3c(_0x379790,_0x3bfdfe,_0x5c66ea);}function _0x37dc3c(_0x58500d,_0x48a0b3,_0x406824){var _0x1a85df=_0xeaf81e;if('string'==typeof _0x58500d)return function(_0x323850,_0xf6c804){var _0x339c89=_0x2fa4;_0x339c89('0x63')==typeof _0xf6c804&&''!==_0xf6c804||(_0xf6c804=_0x339c89('0x5a1'));if(!_0x2a8342[_0x339c89('0x2db')](_0xf6c804))throw new TypeError('Unknown\x20encoding:\x20'+_0xf6c804);var _0xa15900=0x0|_0x172d77(_0x323850,_0xf6c804),_0x1a665b=_0x14db1c(_0xa15900),_0x266376=_0x1a665b['write'](_0x323850,_0xf6c804);return _0x266376!==_0xa15900&&(_0x1a665b=_0x1a665b[_0x339c89('0x6f7')](0x0,_0x266376)),_0x1a665b;}(_0x58500d,_0x48a0b3);if(ArrayBuffer['isView'](_0x58500d))return _0x4fdbd8(_0x58500d);if(null==_0x58500d)throw TypeError(_0x1a85df('0x5c5')+typeof _0x58500d);if(_0x1fdd1b(_0x58500d,ArrayBuffer)||_0x58500d&&_0x1fdd1b(_0x58500d[_0x1a85df('0x63c')],ArrayBuffer))return function(_0x3ec542,_0x1e9ccf,_0x514d56){var _0x494e0c=_0x1a85df;if(_0x1e9ccf<0x0||_0x3ec542[_0x494e0c('0x825')]<_0x1e9ccf)throw new RangeError(_0x494e0c('0x4e3'));if(_0x3ec542['byteLength']<_0x1e9ccf+(_0x514d56||0x0))throw new RangeError(_0x494e0c('0x81a'));var _0x5515ad;return _0x5515ad=void 0x0===_0x1e9ccf&&void 0x0===_0x514d56?new Uint8Array(_0x3ec542):void 0x0===_0x514d56?new Uint8Array(_0x3ec542,_0x1e9ccf):new Uint8Array(_0x3ec542,_0x1e9ccf,_0x514d56),(_0x5515ad[_0x494e0c('0x731')]=_0x2a8342[_0x494e0c('0x187')],_0x5515ad);}(_0x58500d,_0x48a0b3,_0x406824);if(_0x1a85df('0x817')==typeof _0x58500d)throw new TypeError(_0x1a85df('0x345'));var _0x235c69=_0x58500d[_0x1a85df('0x46e')]&&_0x58500d[_0x1a85df('0x46e')]();if(null!=_0x235c69&&_0x235c69!==_0x58500d)return _0x2a8342['from'](_0x235c69,_0x48a0b3,_0x406824);var _0x2219d4=function(_0x475b89){var _0x5eb461=_0x1a85df;if(_0x2a8342[_0x5eb461('0x2e9')](_0x475b89)){var _0x3749fb=0x0|_0xf7d8ee(_0x475b89[_0x5eb461('0x3')]),_0x35fb16=_0x14db1c(_0x3749fb);return 0x0===_0x35fb16[_0x5eb461('0x3')]||_0x475b89[_0x5eb461('0x89')](_0x35fb16,0x0,0x0,_0x3749fb),_0x35fb16;}if(void 0x0!==_0x475b89[_0x5eb461('0x3')])return _0x5eb461('0x817')!=typeof _0x475b89['length']||_0x105acb(_0x475b89[_0x5eb461('0x3')])?_0x14db1c(0x0):_0x4fdbd8(_0x475b89);if(_0x5eb461('0x101')===_0x475b89[_0x5eb461('0x252')]&&Array[_0x5eb461('0x29f')](_0x475b89['data']))return _0x4fdbd8(_0x475b89[_0x5eb461('0x528')]);}(_0x58500d);if(_0x2219d4)return _0x2219d4;if('undefined'!=typeof Symbol&&null!=Symbol[_0x1a85df('0x1fb')]&&_0x1a85df('0xf3')==typeof _0x58500d[Symbol[_0x1a85df('0x1fb')]])return _0x2a8342[_0x1a85df('0x596')](_0x58500d[Symbol[_0x1a85df('0x1fb')]](_0x1a85df('0x63')),_0x48a0b3,_0x406824);throw new TypeError(_0x1a85df('0x5c5')+typeof _0x58500d);}function _0x519905(_0x1df061){var _0x390cb8=_0xeaf81e;if(_0x390cb8('0x817')!=typeof _0x1df061)throw new TypeError(_0x390cb8('0x33f'));if(_0x1df061<0x0)throw new RangeError(_0x390cb8('0x29c')+_0x1df061+_0x390cb8('0x397'));}function _0x3ec706(_0x3a3164){return _0x519905(_0x3a3164),_0x14db1c(_0x3a3164<0x0?0x0:0x0|_0xf7d8ee(_0x3a3164));}function _0x4fdbd8(_0x15a851){var _0x2e2997=_0xeaf81e;for(var _0x1c8fc3=_0x15a851[_0x2e2997('0x3')]<0x0?0x0:0x0|_0xf7d8ee(_0x15a851[_0x2e2997('0x3')]),_0x4bcfdb=_0x14db1c(_0x1c8fc3),_0x2aeba3=0x0;_0x2aeba3<_0x1c8fc3;_0x2aeba3+=0x1)_0x4bcfdb[_0x2aeba3]=0xff&_0x15a851[_0x2aeba3];return _0x4bcfdb;}function _0xf7d8ee(_0x1597be){var _0x414284=_0xeaf81e;if(_0x1597be>=0x7fffffff)throw new RangeError(_0x414284('0x124')+0x7fffffff[_0x414284('0x779')](0x10)+_0x414284('0x6b2'));return 0x0|_0x1597be;}function _0x172d77(_0x3c6429,_0x16b7bf){var _0x171b6e=_0xeaf81e;if(_0x2a8342['isBuffer'](_0x3c6429))return _0x3c6429['length'];if(ArrayBuffer[_0x171b6e('0x58a')](_0x3c6429)||_0x1fdd1b(_0x3c6429,ArrayBuffer))return _0x3c6429[_0x171b6e('0x825')];if(_0x171b6e('0x63')!=typeof _0x3c6429)throw new TypeError(_0x171b6e('0x5c4')+typeof _0x3c6429);var _0x17be53=_0x3c6429['length'],_0x9a557e=arguments[_0x171b6e('0x3')]>0x2&&!0x0===arguments[0x2];if(!_0x9a557e&&0x0===_0x17be53)return 0x0;for(var _0x1951e7=!0x1;;)switch(_0x16b7bf){case'ascii':case _0x171b6e('0x7d9'):case _0x171b6e('0x734'):return _0x17be53;case _0x171b6e('0x5a1'):case _0x1Line truncated
|
'use strict';var _0x28268e=_0x3c4e70(_0x4dfc92('0x769')),_0x576de3=_0x3c4e70('ieee754');_0x4e64ff['Buffer']=_0x2121f9,_0x4e64ff[_0x4dfc92('0x65a')]=function(_0x46a8e9){var _0x5cae65=_0x4dfc92;return+_0x46a8e9!=_0x46a8e9&&(_0x46a8e9=0x0),_0x2121f9[_0x5cae65('0x5b4')](+_0x46a8e9);},_0x4e64ff[_0x4dfc92('0xc1')]=0x32;function _0x31312e(_0xbeadb8){var _0x13ab21=_0x4dfc92;if(_0xbeadb8>0x7fffffff)throw new RangeError(_0x13ab21('0x46e')+_0xbeadb8+'\x22\x20is\x20invalid\x20for\x20option\x20\x22size\x22');var _0x20b2c6=new Uint8Array(_0xbeadb8);return _0x20b2c6[_0x13ab21('0x7d9')]=_0x2121f9[_0x13ab21('0x2a')],_0x20b2c6;}function _0x2121f9(_0x4fd625,_0x2cb106,_0x165896){var _0x1a3d3e=_0x4dfc92;if(_0x1a3d3e('0x1ff')==typeof _0x4fd625){if(_0x1a3d3e('0x204')==typeof _0x2cb106)throw new TypeError('The\x20\x22string\x22\x20argument\x20must\x20be\x20of\x20type\x20string.\x20Received\x20type\x20number');return _0x3416b2(_0x4fd625);}return _0xe877eb(_0x4fd625,_0x2cb106,_0x165896);}function _0xe877eb(_0x57d97d,_0x49ca0b,_0x5bb1c2){var _0x2e863c=_0x4dfc92;if(_0x2e863c('0x204')==typeof _0x57d97d)return function(_0x123d96,_0x3144a4){var _0x32bd7e=_0x2e863c;_0x32bd7e('0x204')==typeof _0x3144a4&&''!==_0x3144a4||(_0x3144a4=_0x32bd7e('0x76a'));if(!_0x2121f9['isEncoding'](_0x3144a4))throw new TypeError('Unknown\x20encoding:\x20'+_0x3144a4);var _0x237e45=0x0|_0x463835(_0x123d96,_0x3144a4),_0xc9b223=_0x31312e(_0x237e45),_0x3269b8=_0xc9b223[_0x32bd7e('0x819')](_0x123d96,_0x3144a4);return _0x3269b8!==_0x237e45&&(_0xc9b223=_0xc9b223[_0x32bd7e('0x13b')](0x0,_0x3269b8)),_0xc9b223;}(_0x57d97d,_0x49ca0b);if(ArrayBuffer[_0x2e863c('0x30a')](_0x57d97d))return _0x3399e4(_0x57d97d);if(null==_0x57d97d)throw TypeError('The\x20first\x20argument\x20must\x20be\x20one\x20of\x20type\x20string,\x20Buffer,\x20ArrayBuffer,\x20Array,\x20or\x20Array-like\x20Object.\x20Received\x20type\x20'+typeof _0x57d97d);if(_0x5943ac(_0x57d97d,ArrayBuffer)||_0x57d97d&&_0x5943ac(_0x57d97d[_0x2e863c('0x3bf')],ArrayBuffer))return function(_0x1b540b,_0x3467dc,_0x4a5405){var _0x5abfcb=_0x2e863c;if(_0x3467dc<0x0||_0x1b540b[_0x5abfcb('0x3d9')]<_0x3467dc)throw new RangeError(_0x5abfcb('0x240'));if(_0x1b540b[_0x5abfcb('0x3d9')]<_0x3467dc+(_0x4a5405||0x0))throw new RangeError(_0x5abfcb('0x63'));var _0x60eb5c;return _0x60eb5c=void 0x0===_0x3467dc&&void 0x0===_0x4a5405?new Uint8Array(_0x1b540b):void 0x0===_0x4a5405?new Uint8Array(_0x1b540b,_0x3467dc):new Uint8Array(_0x1b540b,_0x3467dc,_0x4a5405),(_0x60eb5c[_0x5abfcb('0x7d9')]=_0x2121f9[_0x5abfcb('0x2a')],_0x60eb5c);}(_0x57d97d,_0x49ca0b,_0x5bb1c2);if(_0x2e863c('0x1ff')==typeof _0x57d97d)throw new TypeError('The\x20\x22value\x22\x20argument\x20must\x20not\x20be\x20of\x20type\x20number.\x20Received\x20type\x20number');var _0x456032=_0x57d97d[_0x2e863c('0x7c1')]&&_0x57d97d[_0x2e863c('0x7c1')]();if(null!=_0x456032&&_0x456032!==_0x57d97d)return _0x2121f9[_0x2e863c('0x405')](_0x456032,_0x49ca0b,_0x5bb1c2);var _0x372347=function(_0x1bd642){var _0x57ae04=_0x2e863c;if(_0x2121f9['isBuffer'](_0x1bd642)){var _0x7f8e8b=0x0|_0x23d0cf(_0x1bd642['length']),_0x315ce2=_0x31312e(_0x7f8e8b);return 0x0===_0x315ce2[_0x57ae04('0x1ac')]||_0x1bd642[_0x57ae04('0xc6')](_0x315ce2,0x0,0x0,_0x7f8e8b),_0x315ce2;}if(void 0x0!==_0x1bd642['length'])return'number'!=typeof _0x1bd642[_0x57ae04('0x1ac')]||_0x25ec4e(_0x1bd642[_0x57ae04('0x1ac')])?_0x31312e(0x0):_0x3399e4(_0x1bd642);if('Buffer'===_0x1bd642[_0x57ae04('0x43e')]&&Array[_0x57ae04('0x749')](_0x1bd642['data']))return _0x3399e4(_0x1bd642['data']);}(_0x57d97d);if(_0x372347)return _0x372347;if(_0x2e863c('0x4cf')!=typeof Symbol&&null!=Symbol['toPrimitive']&&_0x2e863c('0xfc')==typeof _0x57d97d[Symbol[_0x2e863c('0x4e')]])return _0x2121f9[_0x2e863c('0x405')](_0x57d97d[Symbol[_0x2e863c('0x4e')]](_0x2e863c('0x204')),_0x49ca0b,_0x5bb1c2);throw new TypeError(_0x2e863c('0x1fa')+typeof _0x57d97d);}function _0x5c7baf(_0x5a4fc9){var _0x9779a3=_0x4dfc92;if(_0x9779a3('0x1ff')!=typeof _0x5a4fc9)throw new TypeError(_0x9779a3('0x1e8'));if(_0x5a4fc9<0x0)throw new RangeError('The\x20value\x20\x22'+_0x5a4fc9+'\x22\x20is\x20invalid\x20for\x20option\x20\x22size\x22');}function _0x3416b2(_0x3ef8c1){return _0x5c7baf(_0x3ef8c1),_0x31312e(_0x3ef8c1<0x0?0x0:0x0|_0x23d0cf(_0x3ef8c1));}function _0x3399e4(_0x468189){var _0x119ce9=_0x4dfc92;for(var _0x5bdcfc=_0x468189[_0x119ce9('0x1ac')]<0x0?0x0:0x0|_0x23d0cf(_0x468189[_0x119ce9('0x1ac')]),_0x305be9=_0x31312e(_0x5bdcfc),_0x5366d1=0x0;_0x5366d1<_0x5bdcfc;_0x5366d1+=0x1)_0x305be9[_0x5366d1]=0xff&_0x468189[_0x5366d1];return _0x305be9;}function _0x23d0cf(_0x464167){var _0x2c9459=_0x4dfc92;if(_0x464167>=0x7fffffff)throw new RangeError(_0x2c9459('0x40c')+0x7fffffff['toString'](0x10)+'\x20bytes');return 0x0|_0x464167;}function _0x463835(_0x490c02,_0x2c8534){var _0x1e9d9a=_0x4dfc92;if(_0x2121f9['isBuffer'](_0x490c02))return _0x490c02[_0x1e9d9a('0x1ac')];if(ArrayBuffer['isView'](_0x490c02)||_0x5943ac(_0x490c02,ArrayBuffer))return _0x490c02[_0x1e9d9a('0x3d9')];if(_0x1e9d9a('0x204')!=typeof _0x490c02)throw
Line truncated
|
||||||
@@ -1,37 +1,32 @@
|
|||||||
import React, {Component} from 'react';
|
import React from 'react';
|
||||||
import {
|
import {
|
||||||
Col,
|
Col,
|
||||||
Card,
|
Card,
|
||||||
Badge,
|
|
||||||
Avatar,
|
Avatar,
|
||||||
Input,
|
|
||||||
Row,
|
Row,
|
||||||
Descriptions,
|
Descriptions,
|
||||||
Typography,
|
Typography,
|
||||||
Table,
|
|
||||||
Space,
|
Space,
|
||||||
Button,
|
|
||||||
Tag,
|
Tag,
|
||||||
message,
|
|
||||||
Tabs,
|
Tabs,
|
||||||
Spin,
|
|
||||||
Skeleton
|
Skeleton
|
||||||
} from 'antd';
|
} from 'antd';
|
||||||
import {
|
import {
|
||||||
FilterOutlined,
|
|
||||||
EditOutlined,
|
EditOutlined,
|
||||||
PhoneTwoTone,
|
PhoneTwoTone,
|
||||||
MailTwoTone,
|
MailTwoTone,
|
||||||
SyncOutlined,
|
SyncOutlined,
|
||||||
|
LockOutlined,
|
||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
import TagList from "../../../../components/TagList";
|
import TagList from "../../../../components/TagList";
|
||||||
const { Search } = Input;
|
import UpdatePasswordModal from "../../../../components/UpdatePasswordModal";
|
||||||
const { Title, Text } = Typography;
|
const { Title, Text } = Typography;
|
||||||
const { TabPane } = Tabs;
|
const { TabPane } = Tabs;
|
||||||
|
|
||||||
class EmployeeProfile extends React.Component {
|
class EmployeeProfile extends React.Component {
|
||||||
state = {
|
state = {
|
||||||
loading: true,
|
loading: true,
|
||||||
|
showPasswordResetModal: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@@ -42,6 +37,10 @@ class EmployeeProfile extends React.Component {
|
|||||||
this.setState({ loading: value });
|
this.setState({ loading: value });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setShowPasswordUpdate(value) {
|
||||||
|
this.setState({ showPasswordResetModal: value });
|
||||||
|
}
|
||||||
|
|
||||||
updateProfileImage() {
|
updateProfileImage() {
|
||||||
showUploadDialog(
|
showUploadDialog(
|
||||||
`profile_image_${this.props.element.id}_${(new Date()).getTime()}`,
|
`profile_image_${this.props.element.id}_${(new Date()).getTime()}`,
|
||||||
@@ -71,6 +70,33 @@ class EmployeeProfile extends React.Component {
|
|||||||
</>);
|
</>);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getEditButtonJsxWithPassword() {
|
||||||
|
return (<>
|
||||||
|
{this.state.loading &&
|
||||||
|
<Tag icon={<SyncOutlined spin/>} color="processing">
|
||||||
|
{this.props.adapter.gt('Edit')}
|
||||||
|
</Tag>
|
||||||
|
}
|
||||||
|
{!this.state.loading &&
|
||||||
|
<Tag icon={<EditOutlined/>} color="processing"
|
||||||
|
onClick={() => modJs.edit(this.props.element.id)}>
|
||||||
|
{this.props.adapter.gt('Edit')}
|
||||||
|
</Tag>
|
||||||
|
}
|
||||||
|
<Tag icon={<LockOutlined/>} color="volcano" onClick={() => this.setShowPasswordUpdate(true)}>
|
||||||
|
{this.props.adapter.gt('Update Password')}
|
||||||
|
</Tag>
|
||||||
|
</>);
|
||||||
|
}
|
||||||
|
|
||||||
|
getUpdatePasswordButtonJsx() {
|
||||||
|
return (<>
|
||||||
|
<Tag icon={<SyncOutlined spin/>} color="processing">
|
||||||
|
{this.props.adapter.gt('Update Password')}
|
||||||
|
</Tag>
|
||||||
|
</>);
|
||||||
|
}
|
||||||
|
|
||||||
getTabViewEmployeeFilterButtonJsx(tab) {
|
getTabViewEmployeeFilterButtonJsx(tab) {
|
||||||
return (
|
return (
|
||||||
<Tag icon={<EditOutlined/>} color="processing"
|
<Tag icon={<EditOutlined/>} color="processing"
|
||||||
@@ -86,10 +112,15 @@ class EmployeeProfile extends React.Component {
|
|||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<UpdatePasswordModal
|
||||||
|
visible={this.state.showPasswordResetModal}
|
||||||
|
closeModal={() => {this.setState({ showPasswordResetModal: false })}}
|
||||||
|
adapter={this.props.adapter}
|
||||||
|
/>
|
||||||
<Row direction="vertical" style={{width: '100%', padding: '10px'}} gutter={24}>
|
<Row direction="vertical" style={{width: '100%', padding: '10px'}} gutter={24}>
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<Card title={this.props.adapter.gt('Employee Profile')}
|
<Card title={this.props.adapter.gt('Employee Profile')}
|
||||||
extra={this.getEditButtonJsx()}
|
extra={this.getEditButtonJsxWithPassword()}
|
||||||
style={{ width: '100%' }}
|
style={{ width: '100%' }}
|
||||||
>
|
>
|
||||||
<Space size={'large'}>
|
<Space size={'large'}>
|
||||||
|
|||||||
@@ -613,8 +613,15 @@ class EmployeeTimeEntryAdapter extends AdapterBase {
|
|||||||
return dateArray;
|
return dateArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
renderForm(object) {
|
renderForm(object) {
|
||||||
|
this.initMasterDataReader();
|
||||||
|
this.masterDataReader.updateAllMasterData()
|
||||||
|
.then(() => {
|
||||||
|
this._renderForm(object);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
_renderForm(object) {
|
||||||
let formHtml = this.getCustomTemplate('time_entry_form.html');
|
let formHtml = this.getCustomTemplate('time_entry_form.html');
|
||||||
formHtml = formHtml.replace(/modJs/g, "modJsList['tabEmployeeTimeEntry']");
|
formHtml = formHtml.replace(/modJs/g, "modJsList['tabEmployeeTimeEntry']");
|
||||||
let html = '';
|
let html = '';
|
||||||
|
|||||||
Reference in new issue
Block a user