Compare commits
31 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
37299ac1a8 | ||
|
|
f614e0ebf0 | ||
|
|
66ced28bad | ||
|
|
22a371eef9 | ||
|
|
143961cf3f | ||
|
|
aae74a8cc9 | ||
|
|
3c89cb277c | ||
|
|
48619a086c | ||
|
|
ace8020028 | ||
|
|
acf281371b | ||
|
|
39820b84e0 | ||
|
|
5656910eab | ||
|
|
0594d84ed1 | ||
|
|
fbd77cedf7 | ||
|
|
045e85f3ad | ||
|
|
f6d5202ad5 | ||
|
|
31bb455d6f | ||
|
|
301ea64832 | ||
|
|
6fd9ba20c8 | ||
|
|
9ffa8617e9 | ||
|
|
f25a3ffd75 | ||
|
|
712b2025f1 | ||
|
|
0b37e9b573 | ||
|
|
c1cd17d7b0 | ||
|
|
43533c6570 | ||
|
|
2041071d00 | ||
|
|
78faf64770 | ||
|
|
e2368e526b | ||
|
|
76b3aff37d | ||
|
|
078396d5d7 | ||
|
|
b99b6f6f77 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,3 +2,4 @@
|
||||
/.buildpath
|
||||
/.project
|
||||
/.idea
|
||||
build
|
||||
|
||||
77
build.xml
77
build.xml
@@ -8,14 +8,15 @@
|
||||
<property name="env.appname" value="icehrm"/>
|
||||
<property name="env.Version" value="dev"/>
|
||||
<property name="installpath" value="/var/www/apps.gamonoid.com/icehrm-open-core"/>
|
||||
<property name="installLocalpath" value="/Applications/XAMPP/xamppfiles/htdocs/icehrm-open-core"/>
|
||||
|
||||
|
||||
<target name="build"
|
||||
depends="prepare,lint,phpunit,copyapp,release,install"
|
||||
depends="prepare,lint,copyapp,release,install"
|
||||
description=""/>
|
||||
|
||||
<target name="buildlocal"
|
||||
depends="prepare,copyapp"
|
||||
|
||||
<target name="buildlocal"
|
||||
depends="prepare,copyapp,installLocal"
|
||||
description=""/>
|
||||
|
||||
<target name="clean"
|
||||
@@ -37,6 +38,7 @@
|
||||
depends="clean"
|
||||
description="Prepare for build">
|
||||
<mkdir dir="${basedir}/build/api"/>
|
||||
<mkdir dir="${basedir}/build/api"/>
|
||||
<mkdir dir="${basedir}/build/coverage"/>
|
||||
<mkdir dir="${basedir}/build/logs"/>
|
||||
<mkdir dir="${basedir}/build/pdepend"/>
|
||||
@@ -47,29 +49,6 @@
|
||||
<mkdir dir="${basedir}/build/release/data/${env.appname}_${env.Version}"/>
|
||||
<mkdir dir="${basedir}/src/lib"/>
|
||||
|
||||
<copy todir="${basedir}/src/lib" overwrite="true">
|
||||
<fileset dir="${basedir}/lib">
|
||||
<include name="**/*"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy todir="${basedir}/src" overwrite="true">
|
||||
<fileset dir="${basedir}/core-ext">
|
||||
<include name="**/*"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy todir="${basedir}/src">
|
||||
<fileset dir="${basedir}/ext">
|
||||
<include name="**/*"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy todir="${basedir}/src">
|
||||
<fileset dir="${basedir}/tp">
|
||||
<include name="**/*"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<property name="prepare.done" value="true"/>
|
||||
</target>
|
||||
@@ -204,7 +183,6 @@
|
||||
|
||||
|
||||
<target name="copyapp"
|
||||
depends=""
|
||||
description="Copy generated files to QA app">
|
||||
|
||||
<delete includeemptydirs="true">
|
||||
@@ -213,11 +191,29 @@
|
||||
</fileset>
|
||||
</delete>
|
||||
|
||||
<copy todir="${destination}">
|
||||
<copy todir="${destination}" overwrite="true">
|
||||
<fileset dir="${origin}">
|
||||
<include name="**/*"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy todir="${destination}/lib" overwrite="true">
|
||||
<fileset dir="${basedir}/lib">
|
||||
<include name="**/*"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy todir="${destination}" overwrite="true">
|
||||
<fileset dir="${basedir}/core-ext">
|
||||
<include name="**/*"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy todir="${destination}" overwrite="true">
|
||||
<fileset dir="${basedir}/ext">
|
||||
<include name="**/*"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
</target>
|
||||
|
||||
@@ -233,8 +229,8 @@
|
||||
|
||||
<mkdir dir="${installpath}"/>
|
||||
|
||||
<copy todir="${installpath}">
|
||||
<fileset dir="${origin}">
|
||||
<copy todir="${installpath}" overwrite="true">
|
||||
<fileset dir="${destination}">
|
||||
<include name="**/*"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
@@ -245,6 +241,25 @@
|
||||
</fileset>
|
||||
</delete>
|
||||
</target>
|
||||
|
||||
<target name="installLocal"
|
||||
depends="copyapp"
|
||||
description="">
|
||||
|
||||
<delete includeemptydirs="true" failonerror="false">
|
||||
<fileset dir="${installLocalpath}">
|
||||
<include name="**/*"/>
|
||||
</fileset>
|
||||
</delete>
|
||||
|
||||
<mkdir dir="${installLocalpath}"/>
|
||||
|
||||
<copy todir="${installLocalpath}">
|
||||
<fileset dir="${destination}">
|
||||
<include name="**/*"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="release"
|
||||
depends="copyapp"
|
||||
|
||||
@@ -5,4 +5,4 @@ define('CURRENT_PATH',dirname(__FILE__));
|
||||
define('CLIENT_APP_PATH',realpath(dirname(__FILE__)."/..")."/");
|
||||
define('APP_PATH',realpath(dirname(__FILE__)."/../..")."/");
|
||||
define('APP_NAME',"ICE Hrm");
|
||||
define('APP_ID',"icehrm");
|
||||
define('APP_ID',"icehrm");
|
||||
82
core-ext/classes/LDAPManager.php
Normal file
82
core-ext/classes/LDAPManager.php
Normal file
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
class LDAPManager {
|
||||
|
||||
private static $me = null;
|
||||
|
||||
private function __construct(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static function getInstance(){
|
||||
if(empty(self::$me)){
|
||||
self::$me = new LDAPManager();
|
||||
}
|
||||
|
||||
return self::$me;
|
||||
}
|
||||
|
||||
public function checkLDAPLogin($user, $password){
|
||||
$ldap_host = SettingsManager::getInstance()->getSetting("LDAP: Server");
|
||||
$ldap_port = SettingsManager::getInstance()->getSetting("LDAP: Port");
|
||||
$ldap_dn = SettingsManager::getInstance()->getSetting("LDAP: Root DN");
|
||||
|
||||
$managerDN = SettingsManager::getInstance()->getSetting("LDAP: Manager DN");
|
||||
$managerPassword = SettingsManager::getInstance()->getSetting("LDAP: Manager Password");
|
||||
|
||||
// connect to active directory
|
||||
if(empty($ldap_port)){
|
||||
$ldap_port = 389;
|
||||
}
|
||||
|
||||
$ldap = ldap_connect($ldap_host, intval($ldap_port));
|
||||
|
||||
if(!$ldap){
|
||||
return new IceResponse(IceResponse::ERROR,"Could not connect to LDAP Server");
|
||||
}
|
||||
|
||||
LogManager::getInstance()->debug("LDAP Connect Result:".print_r($ldap,true));
|
||||
|
||||
if(SettingsManager::getInstance()->getSetting("LDAP: Version 3") == "1"){
|
||||
ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3);
|
||||
}
|
||||
ldap_set_option($ldap, LDAP_OPT_REFERRALS, 0);
|
||||
|
||||
// verify user and password
|
||||
$bind = @ldap_bind($ldap, $managerDN, $managerPassword);
|
||||
|
||||
LogManager::getInstance()->debug("LDAP Manager Bind:".print_r($bind,true));
|
||||
|
||||
if($bind) {
|
||||
|
||||
$userFilterStr = SettingsManager::getInstance()->getSetting("LDAP: User Filter");
|
||||
|
||||
$filter = str_replace("{}", $user, $userFilterStr); //"(uid=" . $user . ")";
|
||||
$result = ldap_search($ldap, $ldap_dn, $filter);
|
||||
LogManager::getInstance()->debug("LDAP Search Result:".print_r($result,true));
|
||||
if(!$result){
|
||||
exit("Unable to search LDAP server");
|
||||
}
|
||||
$entries = ldap_get_entries($ldap, $result);
|
||||
LogManager::getInstance()->debug("LDAP Search Entries:".print_r($entries,true));
|
||||
|
||||
if(empty($entries) || !isset($entries[0]) || !isset($entries[0]['dn'])){
|
||||
return new IceResponse(IceResponse::ERROR,"Invalid user");
|
||||
}
|
||||
|
||||
$bind = @ldap_bind($ldap,$entries[0]['dn'], $password);
|
||||
ldap_unbind($ldap);
|
||||
|
||||
if($bind){
|
||||
return new IceResponse(IceResponse::SUCCESS, $entries[0]);
|
||||
}else{
|
||||
return new IceResponse(IceResponse::ERROR,"Invalid user");
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
return new IceResponse(IceResponse::ERROR,"Invalid manager user");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1 +1,3 @@
|
||||
<?php
|
||||
//Nothing here
|
||||
?>
|
||||
@@ -9,13 +9,13 @@ define('HOME_LINK_ADMIN', CLIENT_BASE_URL."?g=admin&n=dashboard&m=admin_Admin");
|
||||
define('HOME_LINK_OTHERS', CLIENT_BASE_URL."?g=modules&n=dashboard&m=module_Personal_Information");
|
||||
|
||||
//Version
|
||||
define('VERSION', '14.1.OS');
|
||||
define('CACHE_VALUE', '14.1.OS');
|
||||
define('VERSION_DATE', '26/12/2015');
|
||||
define('VERSION', '16.1.OS');
|
||||
define('CACHE_VALUE', '16.1.OS');
|
||||
define('VERSION_DATE', '02/05/2016');
|
||||
|
||||
if(!defined('CONTACT_EMAIL')){define('CONTACT_EMAIL','icehrm@gamonoid.com');}
|
||||
if(!defined('KEY_PREFIX')){define('KEY_PREFIX','IceHrm');}
|
||||
if(!defined('APP_SEC')){define('APP_SEC','dbcs234d2s111');}
|
||||
|
||||
define('UI_SHOW_SWITCH_PROFILE', true);
|
||||
define('CRON_LOG', '/var/log/nginx/icehrmcron.log');
|
||||
define('CRON_LOG', '/var/log/nginx/icehrmcron.log');
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
UIManager::getInstance()->setCurrentUser($user);
|
||||
UIManager::getInstance()->setProfiles($profileCurrent, $profileSwitched);
|
||||
UIManager::getInstance()->setHomeLink($homeLink);
|
||||
|
||||
UIManager::getInstance()->addQuickAccessMenuItem("View Employees","fa-users",CLIENT_BASE_URL."?g=admin&n=employees&m=admin_Employees",array("Admin","Manager"));
|
||||
UIManager::getInstance()->addQuickAccessMenuItem("Add a New Employee","fa-edit",CLIENT_BASE_URL."?g=admin&n=employees&m=admin_Employees&action=new",array("Admin"));
|
||||
UIManager::getInstance()->addQuickAccessMenuItem("Manage Client/Projects","fa-list-alt",CLIENT_BASE_URL."?g=admin&n=projects&m=admin_Admin",array("Admin","Manager"));
|
||||
UIManager::getInstance()->addQuickAccessMenuItem("Clocked In Employees","fa-clock-o",CLIENT_BASE_URL."?g=admin&n=attendance&m=admin_Employees#tabAttendanceStatus",array("Admin","Manager"));
|
||||
UIManager::getInstance()->addQuickAccessMenuItem("Additional Modules","fa-shopping-cart","http://icehrm.com/modules.php",array("Admin"));
|
||||
27
core-ext/doc/ldap-config.txt
Normal file
27
core-ext/doc/ldap-config.txt
Normal file
@@ -0,0 +1,27 @@
|
||||
Before using please install php5-ldap module
|
||||
sudo apt-get install php5-ldap
|
||||
|
||||
For using php ldap on windows please refer
|
||||
http://stackoverflow.com/questions/16864306/fatal-error-call-to-undefined-function-ldap-connect
|
||||
|
||||
|
||||
The user "admin" will always login with local db username and password (even LDAP is enabled)
|
||||
|
||||
Use following config to test LDAP connection with following test LDAP server
|
||||
http://www.forumsys.com/tutorials/integration-how-to/ldap/online-ldap-test-server/
|
||||
|
||||
Change configs as follows under System->Settings
|
||||
|
||||
LDAP: Enabled = Yes
|
||||
LDAP: Server = ldap.forumsys.com
|
||||
LDAP: Port = 389
|
||||
LDAP: Root DN = dc=example,dc=com
|
||||
LDAP: Manager DN = cn=read-only-admin,dc=example,dc=com
|
||||
LDAP: Manager Password = password
|
||||
LDAP: Version 3 = Yes
|
||||
LDAP: User Filter = uid={}
|
||||
|
||||
Then create a user with username "riemann" under System->Users
|
||||
|
||||
Logout and try login with riemann/password
|
||||
|
||||
2
core-ext/login.com.inc.php
Normal file
2
core-ext/login.com.inc.php
Normal file
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
//Nothing here
|
||||
@@ -1,72 +1,160 @@
|
||||
<?php
|
||||
define('CLIENT_PATH',dirname(__FILE__));
|
||||
include ("config.base.php");
|
||||
include ("include.common.php");
|
||||
include ("include.common.php");
|
||||
include("server.includes.inc.php");
|
||||
|
||||
error_log(print_r($_REQUEST,true));
|
||||
|
||||
if(empty($user)){
|
||||
if(!empty($_REQUEST['username']) && !empty($_REQUEST['password'])){
|
||||
$suser = null;
|
||||
$ssoUserLoaded = false;
|
||||
if(empty($suser)){
|
||||
$suser = new User();
|
||||
$suser->Load("(username = ? or email = ?) and password = ?",array($_REQUEST['username'],$_REQUEST['username'],md5($_REQUEST['password'])));
|
||||
}
|
||||
|
||||
if($suser->password == md5($_REQUEST['password']) || $ssoUserLoaded){
|
||||
$user = $suser;
|
||||
SessionUtils::saveSessionObject('user', $user);
|
||||
$suser->last_login = date("Y-m-d H:i:s");
|
||||
$suser->Save();
|
||||
|
||||
if(!$ssoUserLoaded && !empty(BaseService::getInstance()->auditManager)){
|
||||
BaseService::getInstance()->auditManager->user = $user;
|
||||
BaseService::getInstance()->audit(IceConstants::AUDIT_AUTHENTICATION, "User Login");
|
||||
}
|
||||
|
||||
if($user->user_level == "Admin"){
|
||||
header("Location:".HOME_LINK_ADMIN);
|
||||
}else{
|
||||
header("Location:".HOME_LINK_OTHERS);
|
||||
}
|
||||
}else{
|
||||
header("Location:".CLIENT_BASE_URL."login.php?f=1");
|
||||
}
|
||||
}
|
||||
|
||||
if(!isset($_REQUEST['f']) && isset($_COOKIE['icehrmLF']) && @$_REQUEST['login'] != 'no' && !isset($_REQUEST['username'])){
|
||||
$tempUser = new User();
|
||||
$tempUser->Load("login_hash = ?",array($_COOKIE['icehrmLF']));
|
||||
|
||||
if(!empty($tempUser->id) &&
|
||||
sha1($tempUser->email."_".$tempUser->password) == $_COOKIE['icehrmLF']){
|
||||
|
||||
$_REQUEST['username'] = $tempUser->username;
|
||||
$_REQUEST['password'] = $tempUser->password;
|
||||
$_REQUEST['hashedPwd'] = $tempUser->password;
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($_REQUEST['username']) && !empty($_REQUEST['password'])){
|
||||
|
||||
$suser = null;
|
||||
$ssoUserLoaded = false;
|
||||
|
||||
if($_REQUEST['username'] != "admin") {
|
||||
LogManager::getInstance()->debug("LDAP: Enabled :" . SettingsManager::getInstance()->getSetting("LDAP: Enabled"));
|
||||
if (SettingsManager::getInstance()->getSetting("LDAP: Enabled") == "1") {
|
||||
$ldapResp = LDAPManager::getInstance()->checkLDAPLogin($_REQUEST['username'], $_REQUEST['password']);
|
||||
LogManager::getInstance()->debug("LDAP Response :" . print_r($ldapResp, true));
|
||||
LogManager::getInstance()->debug("LDAP Response Status :" . $ldapResp->getStatus());
|
||||
if ($ldapResp->getStatus() == IceResponse::ERROR) {
|
||||
header("Location:" . CLIENT_BASE_URL . "login.php?f=1");
|
||||
exit();
|
||||
} else {
|
||||
$suser = new User();
|
||||
$suser->Load("username = ?", array($_REQUEST['username']));
|
||||
LogManager::getInstance()->debug("LDAP Response :[".$_REQUEST['username']."]" . print_r($suser, true));
|
||||
if (empty($suser)) {
|
||||
header("Location:" . CLIENT_BASE_URL . "login.php?f=1");
|
||||
exit();
|
||||
}
|
||||
|
||||
$ssoUserLoaded = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(!isset($_REQUEST['hashedPwd'])){
|
||||
$_REQUEST['hashedPwd'] = md5($_REQUEST['password']);
|
||||
}
|
||||
|
||||
include 'login.com.inc.php';
|
||||
|
||||
if(empty($suser)){
|
||||
$suser = new User();
|
||||
$suser->Load("(username = ? or email = ?) and password = ?",array($_REQUEST['username'],$_REQUEST['username'],$_REQUEST['hashedPwd']));
|
||||
}
|
||||
|
||||
if($suser->password == $_REQUEST['hashedPwd'] || $ssoUserLoaded){
|
||||
$user = $suser;
|
||||
SessionUtils::saveSessionObject('user', $user);
|
||||
$suser->last_login = date("Y-m-d H:i:s");
|
||||
$suser->Save();
|
||||
|
||||
if(!$ssoUserLoaded && !empty(BaseService::getInstance()->auditManager)){
|
||||
BaseService::getInstance()->auditManager->user = $user;
|
||||
BaseService::getInstance()->audit(IceConstants::AUDIT_AUTHENTICATION, "User Login");
|
||||
}
|
||||
|
||||
if(!$ssoUserLoaded && isset($_REQUEST['remember'])){
|
||||
//Add cookie
|
||||
$suser->login_hash = sha1($suser->email."_".$suser->password);
|
||||
$suser->Save();
|
||||
|
||||
setcookie('icehrmLF',$suser->login_hash);
|
||||
}
|
||||
|
||||
if(!isset($_REQUEST['remember'])){
|
||||
setcookie('icehrmLF');
|
||||
}
|
||||
|
||||
$redirectUrl = SessionUtils::getSessionObject('loginRedirect');
|
||||
if(!empty($redirectUrl)){
|
||||
header("Location:".$redirectUrl);
|
||||
}else{
|
||||
if($user->user_level == "Admin"){
|
||||
if(SessionUtils::getSessionObject('account_locked') == "1"){
|
||||
header("Location:".CLIENT_BASE_URL."?g=admin&n=billing&m=admin_System");
|
||||
}else{
|
||||
header("Location:".HOME_LINK_ADMIN);
|
||||
}
|
||||
|
||||
}else{
|
||||
if(empty($user->default_module)){
|
||||
header("Location:".HOME_LINK_OTHERS);
|
||||
}else{
|
||||
$defaultModule = new Module();
|
||||
$defaultModule->Load("id = ?",array($user->default_module));
|
||||
if($defaultModule->mod_group == "user"){
|
||||
$defaultModule->mod_group = "modules";
|
||||
}
|
||||
$homeLink = CLIENT_BASE_URL."?g=".$defaultModule->mod_group."&&n=".$defaultModule->name.
|
||||
"&m=".$defaultModule->mod_group."_".str_replace(" ","_",$defaultModule->menu);
|
||||
header("Location:".$homeLink);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}else{
|
||||
header("Location:".CLIENT_BASE_URL."login.php?f=1");
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if($user->user_level == "Admin"){
|
||||
header("Location:".HOME_LINK_ADMIN);
|
||||
}else{
|
||||
header("Location:".HOME_LINK_OTHERS);
|
||||
}
|
||||
|
||||
if($user->user_level == "Admin"){
|
||||
header("Location:".HOME_LINK_ADMIN);
|
||||
}else{
|
||||
if(empty($user->default_module)){
|
||||
header("Location:".HOME_LINK_OTHERS);
|
||||
}else{
|
||||
$defaultModule = new Module();
|
||||
$defaultModule->Load("id = ?",array($user->default_module));
|
||||
if($defaultModule->mod_group == "user"){
|
||||
$defaultModule->mod_group = "modules";
|
||||
}
|
||||
$homeLink = CLIENT_BASE_URL."?g=".$defaultModule->mod_group."&n=".$defaultModule->name.
|
||||
"&m=".$defaultModule->mod_group."_".str_replace(" ","_",$defaultModule->menu);
|
||||
header("Location:".$homeLink);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$tuser = SessionUtils::getSessionObject('user');
|
||||
//check user
|
||||
|
||||
$logoFileName = CLIENT_BASE_PATH."data/logo.png";
|
||||
$logoFileUrl = CLIENT_BASE_URL."data/logo.png";
|
||||
if(!file_exists($logoFileName)){
|
||||
$logoFileUrl = BASE_URL."images/logo.png";
|
||||
}
|
||||
$logoFileUrl = UIManager::getInstance()->getCompanyLogoUrl();
|
||||
|
||||
?><!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title><?=APP_NAME?> Login v<?=VERSION?> © http://icehrm.com</title>
|
||||
<title><?=APP_NAME?> Login</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="A Powerful But Simple Way to Manage Your Company and People. http://icehrm.com">
|
||||
<meta name="author" content="http://gamonoid.com">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<!-- Le styles -->
|
||||
<link href="<?=BASE_URL?>bootstrap/css/bootstrap.css" rel="stylesheet">
|
||||
|
||||
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.js"></script>
|
||||
|
||||
<script type="text/javascript" src="<?=BASE_URL?>js/jquery-1.8.1.js"></script>
|
||||
<script src="<?=BASE_URL?>bootstrap/js/bootstrap.js"></script>
|
||||
<script src="<?=BASE_URL?>js/jquery.placeholder.js"></script>
|
||||
<script src="<?=BASE_URL?>js/jquery.dataTables.js"></script>
|
||||
<script src="<?=BASE_URL?>js/bootstrap-datepicker.js"></script>
|
||||
<script src="<?=BASE_URL?>js/jquery.placeholder.js"></script>
|
||||
<script src="<?=BASE_URL?>js/jquery.dataTables.js"></script>
|
||||
<script src="<?=BASE_URL?>js/bootstrap-datepicker.js"></script>
|
||||
<link href="<?=BASE_URL?>bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
|
||||
<link href="<?=BASE_URL?>css/DT_bootstrap.css?v=0.4" rel="stylesheet">
|
||||
<link href="<?=BASE_URL?>css/datepicker.css" rel="stylesheet">
|
||||
@@ -74,7 +162,7 @@ if(!file_exists($logoFileName)){
|
||||
|
||||
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<script src="<?=BASE_URL?>js/html5.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
<style type="text/css">
|
||||
@@ -89,29 +177,29 @@ if(!file_exists($logoFileName)){
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
/* The white background content wrapper */
|
||||
.container > .content {
|
||||
min-height: 0px !important;
|
||||
background-color: #fff;
|
||||
padding: 20px;
|
||||
margin: 0 -20px;
|
||||
-webkit-border-radius:0px;
|
||||
-moz-border-radius:0px;
|
||||
border-radius: 0px;
|
||||
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.15);
|
||||
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.15);
|
||||
box-shadow: 0 1px 2px rgba(0,0,0,.15);
|
||||
}
|
||||
/* The white background content wrapper */
|
||||
.container > .content {
|
||||
min-height: 0px !important;
|
||||
background-color: #fff;
|
||||
padding: 20px;
|
||||
margin: 0 -20px;
|
||||
-webkit-border-radius:0px;
|
||||
-moz-border-radius:0px;
|
||||
border-radius: 0px;
|
||||
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.15);
|
||||
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.15);
|
||||
box-shadow: 0 1px 2px rgba(0,0,0,.15);
|
||||
}
|
||||
|
||||
.login-form {
|
||||
margin-left: 65px;
|
||||
}
|
||||
|
||||
legend {
|
||||
margin-right: -50px;
|
||||
font-weight: bold;
|
||||
color: #404040;
|
||||
}
|
||||
.login-form {
|
||||
margin-left: 65px;
|
||||
}
|
||||
|
||||
legend {
|
||||
margin-right: -50px;
|
||||
font-weight: bold;
|
||||
color: #404040;
|
||||
}
|
||||
|
||||
.add-on{
|
||||
-webkit-border-radius:0px;
|
||||
@@ -119,212 +207,203 @@ if(!file_exists($logoFileName)){
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
input{
|
||||
-webkit-border-radius:0px;
|
||||
-moz-border-radius:0px;
|
||||
border-radius: 0px;
|
||||
}
|
||||
input{
|
||||
-webkit-border-radius:0px;
|
||||
-moz-border-radius:0px;
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div itemscope itemtype="http://schema.org/WebApplication" style="display: none;">
|
||||
<span itemprop="name">IceHrm Pro</span> -
|
||||
<body>
|
||||
|
||||
REQUIRES <span itemprop="operatingSystem">Windows, OSX, Linux</span>
|
||||
<link itemprop="applicationCategory" href="http://icehrm.com"/>
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
RATING:
|
||||
<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
|
||||
<span itemprop="ratingValue">4.5</span> (
|
||||
<span itemprop="ratingCount">12</span> ratings )
|
||||
</div>
|
||||
ga('create', '<?=BaseService::getInstance()->getGAKey()?>', 'gamonoid.com');
|
||||
ga('send', 'pageview');
|
||||
|
||||
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
|
||||
Price: $<span itemprop="price">199.99</span>
|
||||
<meta itemprop="priceCurrency" content="USD" />
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||
</script>
|
||||
|
||||
ga('create', '<?=BaseService::getInstance()->getGAKey()?>', 'gamonoid.com');
|
||||
ga('send', 'pageview');
|
||||
<script type="text/javascript">
|
||||
var key = "";
|
||||
<?php if(isset($_REQUEST['key'])){?>
|
||||
key = '<?=$_REQUEST['key']?>';
|
||||
key = key.replace(/ /g,"+");
|
||||
<?php }?>
|
||||
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var key = "";
|
||||
<?php if(isset($_REQUEST['key'])){?>
|
||||
key = '<?=$_REQUEST['key']?>';
|
||||
key = key.replace(/ /g,"+");
|
||||
<?php }?>
|
||||
$(document).ready(function() {
|
||||
$(window).keydown(function(event){
|
||||
if(event.keyCode == 13) {
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
$(window).keydown(function(event){
|
||||
if(event.keyCode == 13) {
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
$("#password").keydown(function(event){
|
||||
if(event.keyCode == 13) {
|
||||
submitLogin();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#password").keydown(function(event){
|
||||
if(event.keyCode == 13) {
|
||||
submitLogin();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
function showForgotPassword(){
|
||||
$("#loginForm").hide();
|
||||
$("#requestPasswordChangeForm").show();
|
||||
}
|
||||
|
||||
function showForgotPassword(){
|
||||
$("#loginForm").hide();
|
||||
$("#requestPasswordChangeForm").show();
|
||||
}
|
||||
function requestPasswordChange(){
|
||||
$("#requestPasswordChangeFormAlert").hide();
|
||||
var id = $("#usernameChange").val();
|
||||
$.post("service.php", {'a':'rpc','id':id}, function(data) {
|
||||
if(data.status == "SUCCESS"){
|
||||
$("#requestPasswordChangeFormAlert").show();
|
||||
$("#requestPasswordChangeFormAlert").html(data.message);
|
||||
}else{
|
||||
$("#requestPasswordChangeFormAlert").show();
|
||||
$("#requestPasswordChangeFormAlert").html(data.message);
|
||||
}
|
||||
},"json");
|
||||
}
|
||||
|
||||
function requestPasswordChange(){
|
||||
$("#requestPasswordChangeFormAlert").hide();
|
||||
var id = $("#usernameChange").val();
|
||||
$.post("service.php", {'a':'rpc','id':id}, function(data) {
|
||||
if(data.status == "SUCCESS"){
|
||||
$("#requestPasswordChangeFormAlert").show();
|
||||
$("#requestPasswordChangeFormAlert").html(data.message);
|
||||
}else{
|
||||
$("#requestPasswordChangeFormAlert").show();
|
||||
$("#requestPasswordChangeFormAlert").html(data.message);
|
||||
}
|
||||
},"json");
|
||||
}
|
||||
function changePassword(){
|
||||
$("#newPasswordFormAlert").hide();
|
||||
var password = $("#password").val();
|
||||
|
||||
function changePassword(){
|
||||
$("#newPasswordFormAlert").hide();
|
||||
var password = $("#password").val();
|
||||
var passwordValidation = function (str) {
|
||||
var val = /^[a-zA-Z0-9]\w{6,}$/;
|
||||
return str != null && val.test(str);
|
||||
};
|
||||
|
||||
var passwordValidation = function (str) {
|
||||
var val = /^[a-zA-Z0-9]\w{6,}$/;
|
||||
return str != null && val.test(str);
|
||||
};
|
||||
|
||||
|
||||
if(!passwordValidation(password)){
|
||||
$("#newPasswordFormAlert").show();
|
||||
$("#newPasswordFormAlert").html("Password may contain only letters, numbers and should be longer than 6 characters");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$.post("service.php", {'a':'rsp','key':key,'pwd':password,"now":"1"}, function(data) {
|
||||
if(data.status == "SUCCESS"){
|
||||
top.location.href = "login.php?c=1";
|
||||
}else{
|
||||
$("#newPasswordFormAlert").show();
|
||||
$("#newPasswordFormAlert").html(data.message);
|
||||
}
|
||||
},"json");
|
||||
}
|
||||
if(!passwordValidation(password)){
|
||||
$("#newPasswordFormAlert").show();
|
||||
$("#newPasswordFormAlert").html("Password may contain only letters, numbers and should be longer than 6 characters");
|
||||
return;
|
||||
}
|
||||
|
||||
function submitLogin(){
|
||||
$("#loginForm").submit();
|
||||
}
|
||||
|
||||
</script>
|
||||
<div class="container">
|
||||
<?php if(defined('DEMO_MODE')){?>
|
||||
<div class="content" style="top: 30px;
|
||||
|
||||
$.post("service.php", {'a':'rsp','key':key,'pwd':password,"now":"1"}, function(data) {
|
||||
if(data.status == "SUCCESS"){
|
||||
top.location.href = "login.php?c=1";
|
||||
}else{
|
||||
$("#newPasswordFormAlert").show();
|
||||
$("#newPasswordFormAlert").html(data.message);
|
||||
}
|
||||
},"json");
|
||||
}
|
||||
|
||||
function submitLogin(){
|
||||
try{
|
||||
localStorage.clear();
|
||||
}catch(e){}
|
||||
$("#loginForm").submit();
|
||||
}
|
||||
|
||||
</script>
|
||||
<div class="container">
|
||||
<?php if(defined('DEMO_MODE')){?>
|
||||
<div class="content" style="top: 30px;
|
||||
position: absolute;
|
||||
left: 50px;
|
||||
width: 380px;
|
||||
height: 100px;">
|
||||
|
||||
<ul class="list-group" style="font-size:12px;">
|
||||
<li style="padding-bottom:3px;" class="list-group-item">Admin: (Username = admin/ Password = admin)</li>
|
||||
<li style="padding-bottom:3px;" class="list-group-item">Manager: (Username = manager/ Password = demouserpwd)</li>
|
||||
<li style="padding-bottom:3px;" class="list-group-item">User: (Username = user1/ Password = demouserpwd)</li>
|
||||
<li style="padding-bottom:3px;" class="list-group-item">User: (Username = user2/ Password = demouserpwd)</li>
|
||||
</ul>
|
||||
</div>
|
||||
<?php }?>
|
||||
<div class="content" style="margin-top:100px;">
|
||||
<div class="row">
|
||||
<div class="login-form">
|
||||
<h2><img src="<?=$logoFileUrl?>"/></h2>
|
||||
<?php if(!isset($_REQUEST['cp'])){?>
|
||||
<form id="loginForm" action="login.php" method="POST">
|
||||
<fieldset>
|
||||
<div class="clearfix">
|
||||
<div class="input-prepend">
|
||||
<span class="add-on"><i class="icon-user"></i></span>
|
||||
<input class="span2" type="text" id="username" name="username" placeholder="Username">
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix">
|
||||
<div class="input-prepend">
|
||||
<span class="add-on"><i class="icon-lock"></i></span>
|
||||
<input class="span2" type="password" id="password" name="password" placeholder="Password">
|
||||
</div>
|
||||
</div>
|
||||
<?php if(isset($_REQUEST['f'])){?>
|
||||
<div class="clearfix alert alert-error" style="font-size:11px;width:147px;margin-bottom: 5px;">
|
||||
Login failed
|
||||
<?php if(isset($_REQUEST['fm'])){
|
||||
echo $_REQUEST['fm'];
|
||||
}?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php if(isset($_REQUEST['c'])){?>
|
||||
<div class="clearfix alert alert-info" style="font-size:11px;width:147px;margin-bottom: 5px;">
|
||||
Password changed successfully
|
||||
</div>
|
||||
<?php } ?>
|
||||
<button class="btn" style="margin-top: 5px;" type="button" onclick="submitLogin();return false;">Sign in <span class="icon-arrow-right"></span></button>
|
||||
</fieldset>
|
||||
<div class="clearfix">
|
||||
<a href="" onclick="showForgotPassword();return false;" style="float:left;margin-top: 10px;">Forgot password</a>
|
||||
<a href="<?=TWITTER_URL?>" target="_blank" style="float:right;"><img src="<?=BASE_URL?>images/32x32-Circle-53-TW.png"/></a>
|
||||
<a href="<?=FB_URL?>" target="_blank" style="float:right;margin-right: 7px;"><img src="<?=BASE_URL?>images/32x32-Circle-54-FB.png"/></a>
|
||||
</div>
|
||||
|
||||
<ul class="list-group" style="font-size:12px;">
|
||||
<li style="padding-bottom:3px;" class="list-group-item">Admin: (Username = admin/ Password = admin)</li>
|
||||
<li style="padding-bottom:3px;" class="list-group-item">Manager: (Username = manager/ Password = demouserpwd)</li>
|
||||
<li style="padding-bottom:3px;" class="list-group-item">User: (Username = user1/ Password = demouserpwd)</li>
|
||||
<li style="padding-bottom:3px;" class="list-group-item">User: (Username = user2/ Password = demouserpwd)</li>
|
||||
</ul>
|
||||
</div>
|
||||
<?php }?>
|
||||
<div class="content" style="margin-top:100px;">
|
||||
<div class="row">
|
||||
<div class="login-form">
|
||||
<h2><img src="<?=$logoFileUrl?>"/></h2>
|
||||
<?php if(!isset($_REQUEST['cp'])){?>
|
||||
<form id="loginForm" action="login.php" method="POST">
|
||||
<fieldset>
|
||||
<div class="clearfix">
|
||||
<div class="input-prepend">
|
||||
<span class="add-on"><i class="icon-user"></i></span>
|
||||
<input class="span2" type="text" id="username" name="username" placeholder="Username">
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix">
|
||||
<div class="input-prepend">
|
||||
<span class="add-on"><i class="icon-lock"></i></span>
|
||||
<input class="span2" type="password" id="password" name="password" placeholder="Password">
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix">
|
||||
<div class="checkbox">
|
||||
<label><input id="remember" name="remember" type="checkbox" value="remember" checked>Remember me</label>
|
||||
</div>
|
||||
</div>
|
||||
<?php if(isset($_REQUEST['f'])){?>
|
||||
<div class="clearfix alert alert-error" style="font-size:11px;width:147px;margin-bottom: 5px;">
|
||||
Login failed
|
||||
<?php if(isset($_REQUEST['fm'])){
|
||||
echo $_REQUEST['fm'];
|
||||
}?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php if(isset($_REQUEST['c'])){?>
|
||||
<div class="clearfix alert alert-info" style="font-size:11px;width:147px;margin-bottom: 5px;">
|
||||
Password changed successfully
|
||||
</div>
|
||||
<?php } ?>
|
||||
<button class="btn" style="margin-top: 5px;" type="button" onclick="submitLogin();return false;">Sign in <span class="icon-arrow-right"></span></button>
|
||||
</fieldset>
|
||||
<div class="clearfix">
|
||||
<span style="font-size:9px;">© <a href="http://icehrm.com" target="_blank">IceHrm - v<?=VERSION?></a> Developed by <a href="http://gamonoid.com" target="_blank">Gamonoid (Pvt) Ltd.</a></span>
|
||||
<a href="" onclick="showForgotPassword();return false;" style="float:left;margin-top: 10px;">Forgot password</a>
|
||||
<!--
|
||||
<a href="<?=TWITTER_URL?>" target="_blank" style="float:right;"><img src="<?=BASE_URL?>images/32x32-Circle-53-TW.png"/></a>
|
||||
<a href="<?=FB_URL?>" target="_blank" style="float:right;margin-right: 7px;"><img src="<?=BASE_URL?>images/32x32-Circle-54-FB.png"/></a>
|
||||
-->
|
||||
</div>
|
||||
</form>
|
||||
<form id="requestPasswordChangeForm" style="display:none;" action="">
|
||||
<fieldset>
|
||||
<div class="clearfix">
|
||||
<div class="input-prepend">
|
||||
<span class="add-on"><i class="icon-user"></i></span>
|
||||
<input class="span2" type="text" id="usernameChange" name="usernameChange" placeholder="Username or Email">
|
||||
</div>
|
||||
</div>
|
||||
<div id="requestPasswordChangeFormAlert" class="clearfix alert alert-info" style="font-size:11px;width:147px;margin-bottom: 5px;display:none;">
|
||||
|
||||
</div>
|
||||
<button class="btn" style="margin-top: 5px;" type="button" onclick="requestPasswordChange();return false;">Request Password Change <span class="icon-arrow-right"></span></button>
|
||||
</fieldset>
|
||||
</form>
|
||||
<?php }else{?>
|
||||
<form id="newPasswordForm" action="">
|
||||
<fieldset>
|
||||
<div class="clearfix">
|
||||
<div class="input-prepend">
|
||||
<span class="add-on"><i class="icon-lock"></i></span>
|
||||
<input class="span2" type="password" id="password" name="password" placeholder="New Password">
|
||||
</div>
|
||||
</div>
|
||||
<div id="newPasswordFormAlert" class="clearfix alert alert-error" style="font-size:11px;width:147px;margin-bottom: 5px;display:none;">
|
||||
|
||||
</div>
|
||||
<button class="btn" style="margin-top: 5px;" type="button" onclick="changePassword();return false;">Change Password <span class="icon-arrow-right"></span></button>
|
||||
</fieldset>
|
||||
</form>
|
||||
<?php }?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- /container -->
|
||||
</form>
|
||||
<form id="requestPasswordChangeForm" style="display:none;" action="">
|
||||
<fieldset>
|
||||
<div class="clearfix">
|
||||
<div class="input-prepend">
|
||||
<span class="add-on"><i class="icon-user"></i></span>
|
||||
<input class="span2" type="text" id="usernameChange" name="usernameChange" placeholder="Username or Email">
|
||||
</div>
|
||||
</div>
|
||||
<div id="requestPasswordChangeFormAlert" class="clearfix alert alert-info" style="font-size:11px;width:147px;margin-bottom: 5px;display:none;">
|
||||
|
||||
</div>
|
||||
<button class="btn" style="margin-top: 5px;" type="button" onclick="requestPasswordChange();return false;">Request Password Change <span class="icon-arrow-right"></span></button>
|
||||
</fieldset>
|
||||
</form>
|
||||
<?php }else{?>
|
||||
<form id="newPasswordForm" action="">
|
||||
<fieldset>
|
||||
<div class="clearfix">
|
||||
<div class="input-prepend">
|
||||
<span class="add-on"><i class="icon-lock"></i></span>
|
||||
<input class="span2" type="password" id="password" name="password" placeholder="New Password">
|
||||
</div>
|
||||
</div>
|
||||
<div id="newPasswordFormAlert" class="clearfix alert alert-error" style="font-size:11px;width:147px;margin-bottom: 5px;display:none;">
|
||||
|
||||
</div>
|
||||
<button class="btn" style="margin-top: 5px;" type="button" onclick="changePassword();return false;">Change Password <span class="icon-arrow-right"></span></button>
|
||||
</fieldset>
|
||||
</form>
|
||||
<?php }?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- /container -->
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -5,9 +5,9 @@ class ICEHRM_Record extends ADOdb_Active_Record{
|
||||
return array("get","element","save","delete");
|
||||
}
|
||||
|
||||
public function getOtherAccess(){
|
||||
return array("get","element","save","delete");
|
||||
}
|
||||
public function getOtherAccess(){
|
||||
return array("get","element","save","delete");
|
||||
}
|
||||
|
||||
public function getManagerAccess(){
|
||||
return array("get","element");
|
||||
@@ -16,7 +16,7 @@ class ICEHRM_Record extends ADOdb_Active_Record{
|
||||
public function getUserAccess(){
|
||||
return array("get","element");
|
||||
}
|
||||
|
||||
|
||||
public function getEmployeeAccess(){
|
||||
return $this->getUserAccess();
|
||||
}
|
||||
@@ -57,16 +57,24 @@ class ICEHRM_Record extends ADOdb_Active_Record{
|
||||
|
||||
}
|
||||
|
||||
public function postProcessGetData($obj){
|
||||
return $obj;
|
||||
}
|
||||
public function postProcessGetData($obj){
|
||||
return $obj;
|
||||
}
|
||||
|
||||
public function getDefaultAccessLevel(){
|
||||
return array("get","element","save","delete");
|
||||
}
|
||||
public function postProcessGetElement($obj){
|
||||
return $obj;
|
||||
}
|
||||
|
||||
public function getVirtualFields(){
|
||||
return array(
|
||||
);
|
||||
}
|
||||
public function getDefaultAccessLevel(){
|
||||
return array("get","element","save","delete");
|
||||
}
|
||||
|
||||
public function getVirtualFields(){
|
||||
return array(
|
||||
);
|
||||
}
|
||||
|
||||
public function allowIndirectMapping(){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1,54 +1,54 @@
|
||||
<!-- Delete Modal -->
|
||||
<div class="modal fade" id="deleteModel" tabindex="-1" role="dialog" aria-labelledby="deleteModelLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-times"/></button>
|
||||
<h3 id="deleteModelLabel" style="font-size: 17px;"></h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p id="deleteModelBody"></p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn" onclick="modJs.cancelDelete();">Cancel</button>
|
||||
<button class="btn btn-primary" onclick="modJs.confirmDelete();">Delete</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-times"/></button>
|
||||
<h3 id="deleteModelLabel" style="font-size: 17px;"></h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p id="deleteModelBody"></p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn" onclick="modJs.cancelDelete();">Cancel</button>
|
||||
<button class="btn btn-primary" onclick="modJs.confirmDelete();">Delete</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Delete Modal -->
|
||||
|
||||
<!-- Message Modal -->
|
||||
<div class="modal fade" id="messageModel" tabindex="-1" role="dialog" aria-labelledby="messageModelLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-times"/></button>
|
||||
<h3 id="messageModelLabel" style="font-size: 17px;"></h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p id="messageModelBody"></p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn" onclick="modJs.closeMessage();">Ok</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-times"/></button>
|
||||
<h3 id="messageModelLabel" style="font-size: 17px;"></h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p id="messageModelBody"></p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn" onclick="modJs.closeMessage();">Ok</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Message Modal -->
|
||||
|
||||
<!-- Plain Message Modal -->
|
||||
<div class="modal fade" id="plainMessageModel" tabindex="-1" role="dialog" aria-labelledby="plainMessageModelLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header" style="border-bottom:none;/*background-color: #3c8dbc;*/">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" style="margin-top:-10px;"><li class="fa fa-times"/></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p id="plainMessageModelBody"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header" style="border-bottom:none;/*background-color: #3c8dbc;*/">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" style="margin-top:-10px;"><li class="fa fa-times"/></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p id="plainMessageModelBody"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Plain Message Modal -->
|
||||
|
||||
@@ -89,98 +89,98 @@
|
||||
|
||||
<!-- Upload Modal -->
|
||||
<div class="modal fade" id="uploadModel" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-times"/></button>
|
||||
<h3 id="uploadModelLabel" style="font-size: 17px;"></h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p id="uploadModelBody"></p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn" onclick="$('#uploadModel').modal('hide');">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-times"/></button>
|
||||
<h3 id="uploadModelLabel" style="font-size: 17px;"></h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p id="uploadModelBody"></p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn" onclick="$('#uploadModel').modal('hide');">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Upload Modal -->
|
||||
|
||||
<!-- Message Modal -->
|
||||
<div class="modal fade" id="verifyModel" tabindex="-1" role="dialog" aria-labelledby="verifyModelLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-times"/></button>
|
||||
<h3 id="verifyModelLabel" style="font-size: 17px;"></h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p id="verifyModelBody">
|
||||
<b>Step 1:</b><br/>
|
||||
Please get your Instance Key from here:<br/>
|
||||
<a target="_blank" href="http://icehrm.com/generateInstanceKey.php?id=<?=$baseService->getInstanceId()?>">
|
||||
http://icehrm.com/generateInstanceKey.php?id=<?=$baseService->getInstanceId()?>
|
||||
</a>
|
||||
|
||||
<br/><b>Step 2:</b><br/>
|
||||
Enter the key you generated in step 1 here and click "Verify"<br/>
|
||||
<form role="form">
|
||||
<div class="row">
|
||||
<label class="col-sm-12 control-label" for="verificationKey">Verification Key</label>
|
||||
<div class="controls col-sm-12">
|
||||
<input class="form-control" type="text" id="verificationKey" name="verificationKey" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
<br/><br/>
|
||||
<div class="control-group row">
|
||||
<div class="controls col-sm-12">
|
||||
<button onclick="try{verifyInstance($('#verificationKey').val());}catch(e){};return false;" class="saveBtn btn btn-primary pull-right"><i class="fa fa-save"></i> Verify</button>
|
||||
<button onclick="$('#verifyModel').modal('hide');return false;" class="cancelBtn btn pull-right" style="margin-right:5px;"><i class="fa fa-times-circle-o"></i> Cancel</button>
|
||||
</div>
|
||||
<div class="controls col-sm-3">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-times"/></button>
|
||||
<h3 id="verifyModelLabel" style="font-size: 17px;"></h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p id="verifyModelBody">
|
||||
<b>Step 1:</b><br/>
|
||||
Please get your Instance Key from here:<br/>
|
||||
<a target="_blank" href="http://icehrm.com/generateInstanceKey.php?id=<?=$baseService->getInstanceId()?>">
|
||||
http://icehrm.com/generateInstanceKey.php?id=<?=$baseService->getInstanceId()?>
|
||||
</a>
|
||||
|
||||
<br/><b>Step 2:</b><br/>
|
||||
Enter the key you generated in step 1 here and click "Verify"<br/>
|
||||
<form role="form">
|
||||
<div class="row">
|
||||
<label class="col-sm-12 control-label" for="verificationKey">Verification Key</label>
|
||||
<div class="controls col-sm-12">
|
||||
<input class="form-control" type="text" id="verificationKey" name="verificationKey" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
<br/><br/>
|
||||
<div class="control-group row">
|
||||
<div class="controls col-sm-12">
|
||||
<button onclick="try{verifyInstance($('#verificationKey').val());}catch(e){};return false;" class="saveBtn btn btn-primary pull-right"><i class="fa fa-save"></i> Verify</button>
|
||||
<button onclick="$('#verifyModel').modal('hide');return false;" class="cancelBtn btn pull-right" style="margin-right:5px;"><i class="fa fa-times-circle-o"></i> Cancel</button>
|
||||
</div>
|
||||
<div class="controls col-sm-3">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Message Modal -->
|
||||
|
||||
|
||||
<?php if($user->user_level == 'Admin'){?>
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="profileSwitchModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-times"/></button>
|
||||
<h3 id="myModalLabel">Switch Employee</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>Select the employee to Edit</p>
|
||||
<div style="border: solid 1px #EEE;">
|
||||
<select id="switch_emp" style="width:100%;">
|
||||
<!--
|
||||
<option value="-1">No Employee</option>
|
||||
-->
|
||||
<?php
|
||||
$employees = $baseService->get('Employee');
|
||||
foreach($employees as $empTemp){
|
||||
?>
|
||||
<option value="<?=$empTemp->id?>"><?=$empTemp->first_name." ".$empTemp->last_name?></option>
|
||||
<?php }?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
|
||||
<button class="btn btn-primary" onclick="modJs.setAdminProfile($('#switch_emp').val());return false;">Switch</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="profileSwitchModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-times"/></button>
|
||||
<h3 id="myModalLabel">Switch Employee</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>Select the employee to Edit</p>
|
||||
<div style="border: solid 1px #EEE;">
|
||||
<select id="switch_emp" style="width:100%;">
|
||||
<!--
|
||||
<option value="-1">No Employee</option>
|
||||
-->
|
||||
<?php
|
||||
$employees = $baseService->get('Employee');
|
||||
foreach($employees as $empTemp){
|
||||
?>
|
||||
<option value="<?=$empTemp->id?>"><?=$empTemp->first_name." ".$empTemp->last_name?></option>
|
||||
<?php }?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
|
||||
<button class="btn btn-primary" onclick="modJs.setAdminProfile($('#switch_emp').val());return false;">Switch</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Modal -->
|
||||
<?php }?>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Modal -->
|
||||
<?php }?>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,19 @@
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
|
||||
DELIMITER $$
|
||||
CREATE FUNCTION generate_fname () RETURNS varchar(255)
|
||||
BEGIN
|
||||
RETURN ELT(FLOOR(1 + (RAND() * (100-1))), "James","Mary","John","Patricia","Robert","Linda","Michael","Barbara","William","Elizabeth","David","Jennifer","Richard","Maria","Charles","Susan","Joseph","Margaret","Thomas","Dorothy","Christopher","Lisa","Daniel","Nancy","Paul","Karen","Mark","Betty","Donald","Helen","George","Sandra","Kenneth","Donna","Steven","Carol","Edward","Ruth","Brian","Sharon","Ronald","Michelle","Anthony","Laura","Kevin","Sarah","Jason","Kimberly","Matthew","Deborah","Gary","Jessica","Timothy","Shirley","Jose","Cynthia","Larry","Angela","Jeffrey","Melissa","Frank","Brenda","Scott","Amy","Eric","Anna","Stephen","Rebecca","Andrew","Virginia","Raymond","Kathleen","Gregory","Pamela","Joshua","Martha","Jerry","Debra","Dennis","Amanda","Walter","Stephanie","Patrick","Carolyn","Peter","Christine","Harold","Marie","Douglas","Janet","Henry","Catherine","Carl","Frances","Arthur","Ann","Ryan","Joyce","Roger","Diane");
|
||||
END$$
|
||||
|
||||
DELIMITER ;
|
||||
|
||||
DELIMITER $$
|
||||
CREATE FUNCTION generate_lname () RETURNS varchar(255)
|
||||
BEGIN
|
||||
RETURN ELT(FLOOR(1 + (RAND() * (100-1))), "Smith","Johnson","Williams","Jones","Brown","Davis","Miller","Wilson","Moore","Taylor","Anderson","Thomas","Jackson","White","Harris","Martin","Thompson","Garcia","Martinez","Robinson","Clark","Rodriguez","Lewis","Lee","Walker","Hall","Allen","Young","Hernandez","King","Wright","Lopez","Hill","Scott","Green","Adams","Baker","Gonzalez","Nelson","Carter","Mitchell","Perez","Roberts","Turner","Phillips","Campbell","Parker","Evans","Edwards","Collins","Stewart","Sanchez","Morris","Rogers","Reed","Cook","Morgan","Bell","Murphy","Bailey","Rivera","Cooper","Richardson","Cox","Howard","Ward","Torres","Peterson","Gray","Ramirez","James","Watson","Brooks","Kelly","Sanders","Price","Bennett","Wood","Barnes","Ross","Henderson","Coleman","Jenkins","Perry","Powell","Long","Patterson","Hughes","Flores","Washington","Butler","Simmons","Foster","Gonzales","Bryant","Alexander","Russell","Griffin","Diaz","Hayes");
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
||||
INSERT INTO `CompanyStructures` (`id`, `title`, `description`, `address`, `type`, `country`, `parent`) VALUES
|
||||
(4, 'Development Center', 'Development Center', 'PO Box 001002\nSample Road, Sample Town', 'Regional Office', 'SG', 1),
|
||||
@@ -10,11 +24,23 @@ INSERT INTO `CompanyStructures` (`id`, `title`, `description`, `address`, `type`
|
||||
(9, 'Administration & HR', 'Administration and Human Resource', '', 'Department', 'SG', 4);
|
||||
|
||||
|
||||
INSERT INTO `Employees` (`id`, `employee_id`, `first_name`, `middle_name`, `last_name`, `nationality`, `birthday`, `gender`, `marital_status`, `ssn_num`, `nic_num`, `other_id`, `driving_license`, `driving_license_exp_date`, `employment_status`, `job_title`, `pay_grade`, `work_station_id`, `address1`, `address2`, `city`, `country`, `province`, `postal_code`, `home_phone`, `mobile_phone`, `work_phone`, `work_email`, `private_email`, `joined_date`, `confirmation_date`, `supervisor`, `department`, `custom1`, `custom2`, `custom3`, `custom4`, `custom5`, `custom6`, `custom7`, `custom8`, `custom9`, `custom10`) VALUES
|
||||
(2, 'EMP002', 'Lala', 'Nadila ', 'Lamees', 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+manager@web-stalk.com', 'icehrm+manager@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 1, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
|
||||
(3, 'EMP003', 'Sofia', '', 'O''Sullivan', 4, '1975-08-28 18:30:00', 'Female', 'Married', '', '768-20-4394', '768-20-4394', '', NULL, 3, 10, 2, '', '2792 Trails End Road', 'Fort Lauderdale', 'Fort Lauderdale', 'US', 12, '33308', '954-388-3340', '954-388-3340', '954-388-3340', 'icehrm+user1@web-stalk.com', 'icehrm+user1@web-stalk.com', '2010-02-08 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
|
||||
(4, 'EMP004', 'Taylor', '', 'Holmes', 10, '1979-07-15 18:30:00', 'Male', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO `Employees` (`id`, `employee_id`, `first_name`, `middle_name`, `last_name`, `nationality`, `birthday`, `gender`, `marital_status`, `ssn_num`, `nic_num`, `other_id`, `driving_license`, `driving_license_exp_date`, `employment_status`, `job_title`, `pay_grade`, `work_station_id`, `address1`, `address2`, `city`, `country`, `province`, `postal_code`, `home_phone`, `mobile_phone`, `work_phone`, `work_email`, `private_email`, `joined_date`, `confirmation_date`, `supervisor`, `department`, `custom1`, `custom2`, `custom3`, `custom4`, `custom5`, `custom6`, `custom7`, `custom8`, `custom9`, `custom10`,`indirect_supervisors`) VALUES
|
||||
(2, 'EMP002', 'Lala', 'Nadila ', 'Lamees', 175, '1984-03-12 18:30:00', 'Female', 'Single', '', '4594567WE3', '4595567WE3', '349-066-YUO', '2012-03-01', 1, 8, 2, 'W001', 'Green War Rd, 00123', '', 'Istanbul', 'TR', NULL, '909066', '+960112345', '+960112345', '+960112345', 'icehrm+manager@web-stalk.com', 'icehrm+manager@web-stalk.com', '2011-03-07 18:30:00', '2012-02-14 18:30:00', 1, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,NULL),
|
||||
(3, 'EMP003', 'Sofia', '', 'O''Sullivan', 4, '1975-08-28 18:30:00', 'Female', 'Married', '', '768-20-4394', '768-20-4394', '', NULL, 3, 10, 2, '', '2792 Trails End Road', 'Fort Lauderdale', 'Fort Lauderdale', 'US', 12, '33308', '954-388-3340', '954-388-3340', '954-388-3340', 'icehrm+user1@web-stalk.com', 'icehrm+user1@web-stalk.com', '2010-02-08 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,'[\"1\"]'),
|
||||
(4, 'EMP004', 'Taylor', '', 'Holmes', 10, '1979-07-15 18:30:00', 'Male', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,NULL);
|
||||
|
||||
INSERT INTO `Employees` (`id`, `employee_id`, `first_name`, `middle_name`, `last_name`, `nationality`, `birthday`, `gender`, `marital_status`, `ssn_num`, `nic_num`, `other_id`, `driving_license`, `driving_license_exp_date`, `employment_status`, `job_title`, `pay_grade`, `work_station_id`, `address1`, `address2`, `city`, `country`, `province`, `postal_code`, `home_phone`, `mobile_phone`, `work_phone`, `work_email`, `private_email`, `joined_date`, `confirmation_date`, `supervisor`, `department`, `custom1`, `custom2`, `custom3`, `custom4`, `custom5`, `custom6`, `custom7`, `custom8`, `custom9`, `custom10`) VALUES
|
||||
(5, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Male', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
|
||||
(6, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Male', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
|
||||
(7, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Male', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
|
||||
(8, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Male', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
|
||||
(9, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Male', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
|
||||
(10, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
|
||||
(11, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
|
||||
(12, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
|
||||
(13, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
|
||||
(14, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
|
||||
(15, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
|
||||
|
||||
INSERT INTO `EmergencyContacts` (`id`, `employee`, `name`, `relationship`, `home_phone`, `work_phone`, `mobile_phone`) VALUES
|
||||
@@ -36,9 +62,6 @@ INSERT INTO `EmployeeDependents` (`id`, `employee`, `name`, `relationship`, `dob
|
||||
(2, 1, 'Mica Singroo', 'Other', '2000-06-13', '');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
INSERT INTO `EmployeeEducations` (`id`, `education_id`, `employee`, `institute`, `date_start`, `date_end`) VALUES
|
||||
(1, 1, 1, 'National University of Turky', '2004-02-03', '2006-06-13'),
|
||||
(2, 1, 2, 'MIT', '1995-02-21', '1999-10-12');
|
||||
@@ -56,12 +79,38 @@ INSERT INTO `EmployeeProjects` (`id`, `employee`, `project`, `date_start`, `date
|
||||
(5, 2, 3, '2013-02-24', '0000-00-00', 'Current', '');
|
||||
|
||||
|
||||
INSERT INTO `EmployeeSalary` (`employee`, `component`,`amount`, `details`) VALUES
|
||||
(1, 1,'50000.00', ''),
|
||||
(1, 2,'20000.00', ''),
|
||||
(1, 3,'30000.00', ''),
|
||||
(1, 4,'2000.00', ''),
|
||||
|
||||
INSERT INTO `EmployeeSalary` (`id`, `employee`, `component`, `pay_frequency`, `currency`, `amount`, `details`) VALUES
|
||||
(1, 1, 1, 'Monthly', 131, '2700.00', ''),
|
||||
(2, 2, 2, 'Monthly', 151, '12000.00', ''),
|
||||
(3, 2, 3, 'Monthly', 131, '5000.00', '');
|
||||
(2, 1,'90500.00', ''),
|
||||
(2, 2,'40000.00', ''),
|
||||
(2, 3,'50000.00', ''),
|
||||
|
||||
(3, 1,'131409.00', ''),
|
||||
(3, 2,'143471.00', ''),
|
||||
(3, 3,'50000.00', ''),
|
||||
(3, 4,'30000.00', ''),
|
||||
|
||||
(4, 5,'1432.00', ''),
|
||||
(4, 6,'2100.00', ''),
|
||||
|
||||
(5, 5,'1200.00', ''),
|
||||
(5, 6,'1500.00', ''),
|
||||
(5, 7,'2000.00', ''),
|
||||
|
||||
(5, 1,round(rand() * 100000 + rand() * 20000 - rand() * 20000, 2), ''),
|
||||
(6, 1,round(rand() * 100000 + rand() * 20000 - rand() * 20000, 2), ''),
|
||||
(7, 1,round(rand() * 100000 + rand() * 20000 - rand() * 20000, 2), ''),
|
||||
(8, 1,round(rand() * 100000 + rand() * 20000 - rand() * 20000, 2), ''),
|
||||
(9, 1,round(rand() * 100000 + rand() * 20000 - rand() * 20000, 2), ''),
|
||||
(10, 1,round(rand() * 100000 + rand() * 20000 - rand() * 20000, 2), ''),
|
||||
(11, 1,round(rand() * 100000 + rand() * 20000 - rand() * 20000, 2), ''),
|
||||
(12, 1,round(rand() * 100000 + rand() * 20000 - rand() * 20000, 2), ''),
|
||||
(13, 1,round(rand() * 100000 + rand() * 20000 - rand() * 20000, 2), ''),
|
||||
(14, 1,round(rand() * 100000 + rand() * 20000 - rand() * 20000, 2), '');
|
||||
|
||||
INSERT INTO `EmployeeSkills` (`id`, `skill_id`, `employee`, `details`) VALUES
|
||||
(1, 9, 1, 'Creating web sites'),
|
||||
@@ -69,11 +118,169 @@ INSERT INTO `EmployeeSkills` (`id`, `skill_id`, `employee`, `details`) VALUES
|
||||
|
||||
|
||||
|
||||
INSERT INTO `Users` (`id`, `username`, `email`, `password`, `employee`, `user_level`, `last_login`, `last_update`, `created`) VALUES
|
||||
(2, 'manager', 'icehrm+manager@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 2, 'Manager', '2013-01-03 02:47:37', '2013-01-03 02:47:37', '2013-01-03 02:47:37'),
|
||||
(3, 'user1', 'icehrm+user1@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 3, 'Employee', '2013-01-03 02:48:32', '2013-01-03 02:48:32', '2013-01-03 02:48:32'),
|
||||
(4, 'user2', 'icehrm+user2@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 4, 'Employee', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55');
|
||||
|
||||
INSERT INTO `LeaveRules` (`id`, `leave_type`, `job_title`, `employment_status`, `employee`, `supervisor_leave_assign`, `employee_can_apply`, `apply_beyond_current`, `leave_accrue`, `carried_forward`, `default_per_year`) VALUES
|
||||
(1, 1, 11, NULL, NULL, 'No', 'Yes', 'Yes', 'No', 'No', 25),
|
||||
(2, 2, NULL, NULL, 2, 'No', 'Yes', 'Yes', 'No', 'No', 10);
|
||||
|
||||
|
||||
|
||||
INSERT INTO `Users` (`id`, `username`, `email`, `password`, `employee`,`default_module`, `user_level`,`user_roles`, `last_login`, `last_update`, `created`) VALUES
|
||||
(2, 'manager', 'icehrm+manager@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 2,NULL, 'Manager','', '2013-01-03 02:47:37', '2013-01-03 02:47:37', '2013-01-03 02:47:37'),
|
||||
(3, 'user1', 'icehrm+user1@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 3,NULL, 'Employee','', '2013-01-03 02:48:32', '2013-01-03 02:48:32', '2013-01-03 02:48:32'),
|
||||
(4, 'user2', 'icehrm+user2@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 4,NULL, 'Employee','', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55'),
|
||||
(5, 'user3', 'icehrm+user3@web-stalk.com', '4048bb914a704a0728549a26b92d8550', NULL,NULL, 'Other','["1"]', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55');
|
||||
|
||||
INSERT INTO `Job` VALUES
|
||||
(1,'Software Engineer','More than 375,000 users world-wide rely on our software for their daily business as it makes creating graphical presentations so much easier, faster and more enjoyable. Among our customers are many renowned consulting companies and large international corporations.','More than 375,000 users world-wide rely on our software for their daily business as it makes creating graphical presentations so much easier, faster and more enjoyable. Among our customers are many renowned consulting companies and large international corporations.\n\nWe follow our own strategy and do not have to make compromises with regard to code quality and beauty, because think-cell is profitable and has no outside investors. We are flourishing without program managers, meetings, and marketing-driven deadlines. Our code quality is extraordinarily high because we only release software when it is ready. We are willing to do the leg work of developing sophisticated algorithms and refining our user interface, which makes working with think-cell’s software so satisfying.','Challenging C++ coding with high personal responsibility\nWork with a competent and creative team in a modern loft office in Berlin\nFamily-friendly working hours, no deadlines\nAbove-average salary (we offer our developers EUR 120,000 annually after one year of employment)\nFree supply of drinks, fruits, sweets and snacks\nFlat hierarchies and plenty of room for your ideas\nA full-time company nanny who is available for free when children are sick, or when you just feel like spending an evening out','[\"Health plan\",\"Paid vacations\"]',226,2,NULL,'JC001',1,NULL,7,14,9,151,'Yes',3500,5500,'job, engineer','Active','0000-00-00 00:00:00',NULL,'Text Only',1),
|
||||
(2,'QA Senior Test Automation Engineer','As a QA Senior Test Automation Engineer at Rocket you will help us launch the most successful startup companies around the world.','As a QA Senior Test Automation Engineer at Rocket you will help us launch the most successful startup companies around the world.','Responsibilities:\n\nAutomated testing of web and mobile applications\nDevelop automated scenarios/scripts using Cucumber (for web applications) and Calabash (for mobile applications)\nOptimize existing test cases to get more stability and efficiency\nRun automated functional tests as well as performance and load tests\nAnalyze automated test results and report bugs to responsible employees\nSupport the test automation team during the whole development process (starting from the analysis of requirements up to the integration of automated test cases into the CI system (Jenkins)\n\n\nRequirements:\n\nSeveral years of experience as a Test Automation Engineer ( 5+ years )\nExperience with automated solutions such as Cucumber/Calabash, Gherkin, Selenium or similar tools/frameworks\nExperience with Ruby, Python, PHP, JAVA or similar programming languages\nExperience with source code controls like SVN, GIT, CVS\nFamiliarity with Continuous Integration and Delivery\nExperience in Agile Methodologies like Scrum and Kanban or extreme programming\nFluency in speaking & writing English skills\nISTQB certification\n Technology stack we use:\n\nTools: GitHub, Jira, Confluence, Bamboo, Jenkins, Testlink\nScrum, Kanban\nCucumber, Calabash, Capybara, JMeter','[\"Life insurance\"]',80,3,NULL,'JC002',3,NULL,5,14,6,151,'Yes',4000,4500,'','Active','0000-00-00 00:00:00',NULL,'Text Only',1),
|
||||
(3,'Online Editor','Online Editors required for a reputed news agency','Online Editors required for a reputed news agency','','[]',129,NULL,NULL,'J0003',1,NULL,7,23,9,103,'No',0,0,'','Active','0001-01-01 00:00:00','attachment_BI5XQCYFxZO12W1447383181684','Image and Full Text',1);
|
||||
|
||||
INSERT INTO `Candidates` VALUES
|
||||
(1,'Jhon','Doe',4,NULL,'Male',NULL,NULL,NULL,'New York','US',NULL,NULL,'icehrm+jhon@web-stalk.com','+1 455565656',NULL,'Software Engineer','cv_rYwHphV7xD5dOe1444302569136',NULL,NULL,NULL,'','','','','','',NULL,NULL,NULL,NULL,NULL,NULL,'2015-10-08 16:59:20','2015-10-08 16:59:20',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'663fd20d1859344585f678a0f87b23522b8f9fce8c67c5290a609ce342b81442',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
|
||||
|
||||
INSERT INTO `Files` VALUES
|
||||
(6,'attachment_BI5XQCYFxZO12W1447383181684','attachment_BI5XQCYFxZO12W1447383181684.png',1,'Job');
|
||||
|
||||
|
||||
INSERT INTO `EmployeeDocuments` (`id`,`employee`, `document`, `date_added`, `valid_until`, `status`, `details`, `attachment`, `expire_notification_last`) VALUES
|
||||
(1, 1, 1, CURDATE(), DATE_ADD(CURDATE(), INTERVAL 30 DAY), 'Active', '', NULL, -1),
|
||||
(2, 1, 2, CURDATE(), DATE_ADD(CURDATE(), INTERVAL 7 DAY), 'Active', '', NULL, -1),
|
||||
(3, 1, 3, CURDATE(), DATE_ADD(CURDATE(), INTERVAL 1 DAY), 'Active', '', NULL, -1);
|
||||
|
||||
|
||||
|
||||
INSERT INTO `Attendance` (`employee`,`in_time`,`out_time`,`note`) VALUES
|
||||
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 30 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 30 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
|
||||
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 29 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 29 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
|
||||
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 28 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 28 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
|
||||
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 27 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 27 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
|
||||
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 26 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 26 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
|
||||
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 25 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 25 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
|
||||
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 24 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 24 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
|
||||
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 23 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 23 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
|
||||
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
|
||||
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 21 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 21 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
|
||||
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 20 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 20 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
|
||||
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 19 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 19 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
|
||||
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 18 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 18 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
|
||||
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 17 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 17 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
|
||||
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 16 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 16 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
|
||||
(1, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 15 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 15 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
|
||||
|
||||
|
||||
|
||||
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 30 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 30 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
|
||||
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 29 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 29 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
|
||||
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 28 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 28 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
|
||||
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 27 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 27 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
|
||||
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 26 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 26 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
|
||||
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 25 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 25 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
|
||||
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 24 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 24 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
|
||||
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 23 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 23 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
|
||||
(2, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
|
||||
|
||||
|
||||
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 30 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 30 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
|
||||
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 29 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 29 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
|
||||
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 28 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 28 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
|
||||
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 27 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 27 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
|
||||
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 26 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 26 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
|
||||
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 25 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 25 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
|
||||
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 24 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 24 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
|
||||
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 23 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 23 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
|
||||
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), '');
|
||||
|
||||
|
||||
INSERT INTO `Payroll` VALUES
|
||||
(1,'2016-03',4,1,1,'[\"5\",\"8\",\"9\",\"10\",\"6\",\"7\",\"4\",\"3\",\"2\",\"1\",\"11\",\"12\",\"13\",\"14\",\"15\",\"16\"]','2016-03-01','2016-03-31','Draft'),
|
||||
(2,'2016-03-Weekly',2,1,2,'[\"1\",\"2\",\"3\"]','2016-03-01','2016-03-31','Draft');
|
||||
|
||||
INSERT INTO `PayrollColumns` VALUES
|
||||
(5,'Basic Salary',NULL,'[\"1\"]','[]','[]','[]',5,'No','Yes','0.00',NULL,NULL),
|
||||
(6,'Fixed Allowance',NULL,'[\"2\"]','[]','[]','[]',6,'No','Yes','0.00',NULL,NULL),
|
||||
(7,'Gross Pay',NULL,'[]','[]','[\"5\",\"6\"]','[]',7,'No','Yes','0.00',NULL,NULL),
|
||||
(8,'EPF Employee Contribution',NULL,'[]','[\"1\"]','[]','[]',8,'No','Yes','0.00',NULL,NULL),
|
||||
(9,'EPF Employer Contribution',NULL,'[]','[\"2\"]','[]','[]',9,'No','Yes','0.00',NULL,NULL),
|
||||
(10,'ETF Employee Contribution',NULL,'[]','[\"3\"]','[]','[]',10,'No','Yes','0.00',NULL,NULL),
|
||||
(11,'Total EPF 20%',NULL,'[]','[]','[\"8\",\"9\"]','[]',11,'No','Yes','0.00',NULL,NULL),
|
||||
(12,'Total for PAYE',NULL,'[]','[]','[\"7\"]','[]',12,'No','Yes','0.00',NULL,NULL),
|
||||
(13,'PAYE Tax',NULL,'[]','[\"4\"]','[]','[]',13,'No','Yes','0.00',NULL,NULL),
|
||||
(14,'Stamp Duty',NULL,'[]','[\"5\"]','[]','[]',14,'No','Yes','0.00',NULL,NULL),
|
||||
(15,'Total Deductions',NULL,'[]','[]','[\"8\",\"13\",\"14\"]','[]',15,'No','Yes','0.00',NULL,NULL),
|
||||
(16,'Salary to Bank',NULL,'[]','[]','[\"7\"]','[\"15\"]',16,'No','Yes','0.00',NULL,NULL);
|
||||
|
||||
|
||||
INSERT INTO `DeductionGroup` VALUES
|
||||
(1,'Sri Lanka Payroll Calculation',''),
|
||||
(2,'Singapore Payroll Calculation','');
|
||||
|
||||
INSERT INTO `Deductions` VALUES
|
||||
(1,'EPF Employee Contribution','[]','[]',7,'[{\"lowerCondition\":\"No Lower Limit\",\"lowerLimit\":\"0\",\"upperCondition\":\"No Upper Limit\",\"upperLimit\":\"0\",\"amount\":\"X*0.08\",\"id\":\"rangeAmounts_1\"}]',1),
|
||||
(2,'EPF Employer Contribution','[]','[]',7,'[{\"lowerCondition\":\"No Lower Limit\",\"lowerLimit\":\"0\",\"upperCondition\":\"No Upper Limit\",\"upperLimit\":\"0\",\"amount\":\"X*0.12\",\"id\":\"rangeAmounts_1\"}]',1),
|
||||
(3,'ETF Employee Contribution','[]','[]',7,'[{\"lowerCondition\":\"No Lower Limit\",\"lowerLimit\":\"0\",\"upperCondition\":\"No Upper Limit\",\"upperLimit\":\"0\",\"amount\":\"X*0.03\",\"id\":\"rangeAmounts_1\"}]',1),
|
||||
(4,'PAYE Tax','[]','[]',12,'[{\"lowerCondition\":\"No Lower Limit\",\"lowerLimit\":\"0\",\"upperCondition\":\"lte\",\"upperLimit\":\"62500\",\"amount\":\"0\",\"id\":\"rangeAmounts_1\"},{\"lowerCondition\":\"gt\",\"lowerLimit\":\"62500\",\"upperCondition\":\"lte\",\"upperLimit\":\"104167\",\"amount\":\"X*0.04 - 2500\",\"id\":\"rangeAmounts_2\"},{\"lowerCondition\":\"gt\",\"lowerLimit\":\"104167\",\"upperCondition\":\"lte\",\"upperLimit\":\"145833\",\"amount\":\"X*0.08 - 6667\",\"id\":\"rangeAmounts_3\"},{\"lowerCondition\":\"gt\",\"lowerLimit\":\"145833\",\"upperCondition\":\"lte\",\"upperLimit\":\"187500\",\"amount\":\"X*0.12-12500\",\"id\":\"rangeAmounts_4\"},{\"lowerCondition\":\"gt\",\"lowerLimit\":\"187500\",\"upperCondition\":\"No Upper Limit\",\"upperLimit\":\"0\",\"amount\":\"X*0.16 - 20000\",\"id\":\"rangeAmounts_5\"}]',1),
|
||||
(5,'Stamp Duty','[]','[]',12,'[{\"lowerCondition\":\"No Lower Limit\",\"lowerLimit\":\"0\",\"upperCondition\":\"lte\",\"upperLimit\":\"25000\",\"amount\":\"0\",\"id\":\"rangeAmounts_1\"},{\"lowerCondition\":\"gt\",\"lowerLimit\":\"25000\",\"upperCondition\":\"No Upper Limit\",\"upperLimit\":\"0\",\"amount\":\"25\",\"id\":\"rangeAmounts_2\"}]',1);
|
||||
|
||||
INSERT INTO `PayrollEmployees` VALUES
|
||||
(1,1,4,151,'[]','[]',1),
|
||||
(2,2,4,151,'[]','[]',1),
|
||||
(3,3,4,151,'[]','[]',1),
|
||||
(4,4,2,151,'[]','[]',1),
|
||||
(5,5,2,151,'[]','[]',1),
|
||||
(6,6,4,151,'[]','[]',1),
|
||||
(7,7,4,151,'[]','[]',1),
|
||||
(8,8,4,151,'[]','[]',1),
|
||||
(9,9,4,151,'[]','[]',1),
|
||||
(10,10,4,151,'[]','[]',1);
|
||||
|
||||
INSERT INTO `EmployeeLeaves` VALUES
|
||||
(1,1,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 3 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 3 DAY))),'%Y-%m-%d'),'Test Reason 1','Pending',''),
|
||||
(2,1,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 4 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 4 DAY))),'%Y-%m-%d'),'Test Reason 2','Approved',''),
|
||||
(3,2,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 3 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 3 DAY))),'%Y-%m-%d'),'Test Reason 3','Approved',''),
|
||||
|
||||
(4,3,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 8 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 8 DAY))),'%Y-%m-%d'),'Test Reason 4','Pending',''),
|
||||
(5,3,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 9 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 9 DAY))),'%Y-%m-%d'),'Test Reason 4','Pending',''),
|
||||
(6,3,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 10 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 10 DAY))),'%Y-%m-%d'),'Test Reason 4','Pending',''),
|
||||
(7,3,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 11 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 11 DAY))),'%Y-%m-%d'),'Test Reason 4','Pending',''),
|
||||
(8,3,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 12 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 12 DAY))),'%Y-%m-%d'),'Test Reason 4','Pending',''),
|
||||
(9,3,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 13 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 13 DAY))),'%Y-%m-%d'),'Test Reason 4','Pending',''),
|
||||
(10,3,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 14 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 14 DAY))),'%Y-%m-%d'),'Test Reason 4','Pending',''),
|
||||
(11,3,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 15 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 15 DAY))),'%Y-%m-%d'),'Test Reason 4','Pending',''),
|
||||
(12,3,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 16 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 16 DAY))),'%Y-%m-%d'),'Test Reason 4','Pending',''),
|
||||
(13,3,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 17 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 17 DAY))),'%Y-%m-%d'),'Test Reason 4','Pending',''),
|
||||
(14,3,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 18 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 18 DAY))),'%Y-%m-%d'),'Test Reason 4','Pending',''),
|
||||
(15,3,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 19 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 19 DAY))),'%Y-%m-%d'),'Test Reason 4','Pending',''),
|
||||
(16,3,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 20 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 20 DAY))),'%Y-%m-%d'),'Test Reason 4','Pending',''),
|
||||
(17,3,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 21 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 21 DAY))),'%Y-%m-%d'),'Test Reason 4','Pending',''),
|
||||
(18,3,1,4,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))),'%Y-%m-%d'),FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))),'%Y-%m-%d'),'Test Reason 22','Pending','');
|
||||
|
||||
INSERT INTO `EmployeeLeaveDays` VALUES
|
||||
(1,1,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 3 DAY))),'%Y-%m-%d'),'Full Day'),
|
||||
(2,1,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 4 DAY))),'%Y-%m-%d'),'Half Day - Morning'),
|
||||
(3,2,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 3 DAY))),'%Y-%m-%d'),'Half Day - Morning'),
|
||||
|
||||
(4,3,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 8 DAY))),'%Y-%m-%d'),'3 Hours - Morning'),
|
||||
(5,3,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 9 DAY))),'%Y-%m-%d'),'Full Day'),
|
||||
(6,3,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 10 DAY))),'%Y-%m-%d'),'Full Day'),
|
||||
(7,3,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 11 DAY))),'%Y-%m-%d'),'Full Day'),
|
||||
(8,3,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 12 DAY))),'%Y-%m-%d'),'Full Day'),
|
||||
(9,3,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 13 DAY))),'%Y-%m-%d'),'Full Day'),
|
||||
(10,3,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 14 DAY))),'%Y-%m-%d'),'Full Day'),
|
||||
(11,3,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 15 DAY))),'%Y-%m-%d'),'Full Day'),
|
||||
(12,3,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 16 DAY))),'%Y-%m-%d'),'Full Day'),
|
||||
(13,3,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 17 DAY))),'%Y-%m-%d'),'Full Day'),
|
||||
(14,3,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 18 DAY))),'%Y-%m-%d'),'Full Day'),
|
||||
(15,3,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 19 DAY))),'%Y-%m-%d'),'Full Day'),
|
||||
(16,3,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 20 DAY))),'%Y-%m-%d'),'Full Day'),
|
||||
(17,3,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 21 DAY))),'%Y-%m-%d'),'Full Day'),
|
||||
(18,3,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))),'%Y-%m-%d'),'Full Day');
|
||||
|
||||
|
||||
|
||||
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
('Instance : ID', '0847429146712c108e23c435e8f93b4d', '',''),
|
||||
('Instance: Key', 'UQHEYBx9H1eNR66nhNCNCz1WCDDhkjtx1OuJbO3ZQMt+8tfSGvuOH/YEHntRajY=', '','');
|
||||
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
|
||||
@@ -82,11 +289,3 @@ INSERT INTO `Users` (`id`, `username`, `email`, `password`, `employee`, `user_le
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
586
core-ext/scripts/upgrade_v14.0.OS_to_v15.0.OS.sql
Normal file
586
core-ext/scripts/upgrade_v14.0.OS_to_v15.0.OS.sql
Normal file
@@ -0,0 +1,586 @@
|
||||
ALTER table `Reports` ADD COLUMN `report_group` varchar(500) NULL;
|
||||
|
||||
ALTER table `Employees` ADD COLUMN `indirect_supervisors` VARCHAR(250) default null after `supervisor`;
|
||||
|
||||
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
('Leave: Allow Indirect Admins to Approve', '0', 'Allow indirect admins to approve leave requests','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
|
||||
|
||||
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
('System: Default Country', '0', 'Set the default Country','[ "value", {"label":"Country","type":"select2","remote-source":["Country","code","name"]}]');
|
||||
|
||||
UPDATE Reports set report_group = 'Employee Information' where name = 'Employee Details Report';
|
||||
UPDATE Reports set report_group = 'Leave Management' where name = 'Employee Leaves Report';
|
||||
UPDATE Reports set report_group = 'Time Management' where name = 'Employee Time Entry Report';
|
||||
UPDATE Reports set report_group = 'Time Management' where name = 'Employee Attendance Report';
|
||||
UPDATE Reports set report_group = 'Time Management' where name = 'Employee Time Tracking Report';
|
||||
UPDATE Reports set report_group = 'Employee Information' where name = 'Active Employee Report';
|
||||
UPDATE Reports set report_group = 'Employee Information' where name = 'New Hires Employee Report';
|
||||
UPDATE Reports set report_group = 'Employee Information' where name = 'Terminated Employee Report';
|
||||
UPDATE Reports set report_group = 'Leave Management' where name = 'Employee Leave Entitlement';
|
||||
UPDATE Reports set report_group = 'Travel and Expense Management' where name = 'Travel Request Report';
|
||||
UPDATE Reports set report_group = 'Travel and Expense Management' where name = 'Expense Report';
|
||||
|
||||
INSERT INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
|
||||
('Employee Time Sheet Report', 'This report list all employee time sheets by employee and date range', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}],\r\n[ "status", {"label":"Status","allow-null":true,"null-label":"All Status","type":"select","source":[["Approved","Approved"],["Pending","Pending"],["Rejected","Rejected"]]}]\r\n]', 'EmployeeTimeSheetData', '["employee","date_start","date_end","status"]', 'Class','Time Management');
|
||||
|
||||
|
||||
|
||||
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
('Files: Upload Files to S3', '0', '','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
|
||||
('Files: Amazon S3 Key for File Upload', '', 'Please provide S3 Key for uploading files',''),
|
||||
('Files: Amazone S3 Secret for File Upload', '', 'Please provide S3 Secret for uploading files',''),
|
||||
('Files: S3 Bucket', '', 'Please provide S3 Bucket name for uploading files',''),
|
||||
('Files: S3 Web Url', '', 'Please provide Url to the s3 bucket','');
|
||||
|
||||
|
||||
create table `Crons` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) NOT NULL,
|
||||
`class` varchar(100) NOT NULL,
|
||||
`lastrun` DATETIME default '0000-00-00 00:00:00',
|
||||
`frequency` int(4) NOT NULL,
|
||||
`time` varchar(50) NOT NULL,
|
||||
`type` enum('Minutely','Hourly','Daily','Weekly','Monthly','Yearly') default 'Hourly',
|
||||
`status` enum('Enabled','Disabled') default 'Enabled',
|
||||
primary key (`id`),
|
||||
key `KEY_Crons_frequency` (`frequency`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
|
||||
INSERT INTO `Crons` (`name`,`class`, `lastrun`, `frequency`, `time`, `type`, `status`) VALUES
|
||||
('Email Sender Task', 'EmailSenderTask', NULL, 1, 1, 'Minutely', 'Enabled'),
|
||||
('Document Expire Alert', 'DocumentExpiryNotificationTask', NULL, 1, 1, 'Minutely', 'Enabled');
|
||||
|
||||
|
||||
|
||||
|
||||
create table `LeaveTypes` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) NOT NULL,
|
||||
`supervisor_leave_assign` enum('Yes','No') default 'Yes',
|
||||
`employee_can_apply` enum('Yes','No') default 'Yes',
|
||||
`apply_beyond_current` enum('Yes','No') default 'Yes',
|
||||
`leave_accrue` enum('No','Yes') default 'No',
|
||||
`carried_forward` enum('No','Yes') default 'No',
|
||||
`default_per_year` decimal(10,3) NOT NULL,
|
||||
`carried_forward_percentage` int(11) NULL default 0,
|
||||
`carried_forward_leave_availability` int(11) NULL default 365,
|
||||
`propotionate_on_joined_date` enum('No','Yes') default 'No',
|
||||
`send_notification_emails` enum('Yes','No') default 'Yes',
|
||||
`leave_group` bigint(20) NULL,
|
||||
`leave_color` varchar(10) NULL,
|
||||
`max_carried_forward_amount` int(11) NULL default 0,
|
||||
primary key (`id`),
|
||||
unique key (`name`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `LeaveRules` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`leave_type` bigint(20) NOT NULL,
|
||||
`job_title` bigint(20) NULL,
|
||||
`employment_status` bigint(20) NULL,
|
||||
`employee` bigint(20) NULL,
|
||||
`supervisor_leave_assign` enum('Yes','No') default 'Yes',
|
||||
`employee_can_apply` enum('Yes','No') default 'Yes',
|
||||
`apply_beyond_current` enum('Yes','No') default 'Yes',
|
||||
`leave_accrue` enum('No','Yes') default 'No',
|
||||
`carried_forward` enum('No','Yes') default 'No',
|
||||
`default_per_year` decimal(10,3) NOT NULL,
|
||||
`carried_forward_percentage` int(11) NULL default 0,
|
||||
`carried_forward_leave_availability` int(11) NULL default 365,
|
||||
`propotionate_on_joined_date` enum('No','Yes') default 'No',
|
||||
`leave_group` bigint(20) NULL,
|
||||
`max_carried_forward_amount` int(11) NULL default 0,
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
|
||||
create table `LeaveGroups` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) NOT NULL,
|
||||
`details` text default null,
|
||||
`created` timestamp NULL default '0000-00-00 00:00:00',
|
||||
`updated` timestamp NULL default '0000-00-00 00:00:00',
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `LeaveGroupEmployees` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`employee` bigint(20) NOT NULL,
|
||||
`leave_group` bigint(20) NOT NULL,
|
||||
`created` timestamp NULL default '0000-00-00 00:00:00',
|
||||
`updated` timestamp NULL default '0000-00-00 00:00:00',
|
||||
CONSTRAINT `Fk_LeaveGroupEmployees_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT `Fk_LeaveGroupEmployees_LeaveGroups` FOREIGN KEY (`leave_group`) REFERENCES `LeaveGroups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
primary key (`id`),
|
||||
unique key `LeaveGroupEmployees_employee` (`employee`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `LeavePeriods` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) NOT NULL,
|
||||
`date_start` date default '0000-00-00',
|
||||
`date_end` date default '0000-00-00',
|
||||
`status` enum('Active','Inactive') default 'Inactive',
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `WorkDays` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) NOT NULL,
|
||||
`status` enum('Full Day','Half Day','Non-working Day') default 'Full Day',
|
||||
`country` bigint(20) DEFAULT NULL,
|
||||
primary key (`id`),
|
||||
unique key `workdays_name_country` (`name`,`country`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `HoliDays` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) NOT NULL,
|
||||
`dateh` date default '0000-00-00',
|
||||
`status` enum('Full Day','Half Day') default 'Full Day',
|
||||
`country` bigint(20) DEFAULT NULL,
|
||||
primary key (`id`),
|
||||
unique key `holidays_dateh_country` (`dateh`,`country`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `EmployeeLeaves` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`employee` bigint(20) NOT NULL,
|
||||
`leave_type` bigint(20) NOT NULL,
|
||||
`leave_period` bigint(20) NOT NULL,
|
||||
`date_start` date default '0000-00-00',
|
||||
`date_end` date default '0000-00-00',
|
||||
`details` text default null,
|
||||
`status` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled') default 'Pending',
|
||||
`attachment` varchar(100) NULL,
|
||||
CONSTRAINT `Fk_EmployeeLeaves_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT `Fk_EmployeeLeaves_LeaveTypes` FOREIGN KEY (`leave_type`) REFERENCES `LeaveTypes` (`id`),
|
||||
CONSTRAINT `Fk_EmployeeLeaves_LeavePeriods` FOREIGN KEY (`leave_period`) REFERENCES `LeavePeriods` (`id`),
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `EmployeeLeaveLog` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`employee_leave` bigint(20) NOT NULL,
|
||||
`user_id` bigint(20) NULL,
|
||||
`data` varchar(500) NOT NULL,
|
||||
`status_from` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled') default 'Pending',
|
||||
`status_to` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled') default 'Pending',
|
||||
`created` timestamp default '0000-00-00 00:00:00',
|
||||
CONSTRAINT `Fk_EmployeeLeaveLog_EmployeeLeaves` FOREIGN KEY (`employee_leave`) REFERENCES `EmployeeLeaves` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT `Fk_EmployeeLeaveLog_Users` FOREIGN KEY (`user_id`) REFERENCES `Users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `EmployeeLeaveDays` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`employee_leave` bigint(20) NOT NULL,
|
||||
`leave_date` date default '0000-00-00',
|
||||
`leave_type` enum('Full Day','Half Day - Morning','Half Day - Afternoon','1 Hour - Morning','2 Hours - Morning','3 Hours - Morning','1 Hour - Afternoon','2 Hours - Afternoon','3 Hours - Afternoon') NOT NULL,
|
||||
CONSTRAINT `Fk_EmployeeLeaveDays_EmployeeLeaves` FOREIGN KEY (`employee_leave`) REFERENCES `EmployeeLeaves` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
|
||||
|
||||
create table `Documents` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) NOT NULL,
|
||||
`details` text default null,
|
||||
`expire_notification` enum('Yes','No') default 'Yes',
|
||||
`expire_notification_month` enum('Yes','No') default 'Yes',
|
||||
`expire_notification_week` enum('Yes','No') default 'Yes',
|
||||
`expire_notification_day` enum('Yes','No') default 'Yes',
|
||||
`sign` enum('Yes','No') default 'Yes',
|
||||
`sign_label` VARCHAR(500) default null,
|
||||
`created` DATETIME default '0000-00-00 00:00:00',
|
||||
`updated` DATETIME default '0000-00-00 00:00:00',
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
|
||||
create table `EmployeeDocuments` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`employee` bigint(20) NOT NULL,
|
||||
`document` bigint(20) NULL,
|
||||
`date_added` date NOT NULL,
|
||||
`valid_until` date NOT NULL,
|
||||
`status` enum('Active','Inactive','Draft') default 'Active',
|
||||
`details` text default null,
|
||||
`attachment` varchar(100) NULL,
|
||||
`signature` text default null,
|
||||
`expire_notification_last` int(4) NULL,
|
||||
CONSTRAINT `Fk_EmployeeDocuments_Documents` FOREIGN KEY (`document`) REFERENCES `Documents` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
|
||||
CONSTRAINT `Fk_EmployeeDocuments_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
primary key (`id`),
|
||||
KEY `KEY_EmployeeDocuments_valid_until` (`valid_until`),
|
||||
KEY `KEY_EmployeeDocuments_valid_until_status` (`valid_until`,`status`,`expire_notification_last`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
|
||||
create table `CompanyDocuments` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) NOT NULL,
|
||||
`details` text default null,
|
||||
`valid_until` date NOT NULL,
|
||||
`status` enum('Active','Inactive','Draft') default 'Active',
|
||||
`notify_employees` enum('Yes','No') default 'Yes',
|
||||
`attachment` varchar(100) NULL,
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
|
||||
create table `Courses` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`code` varchar(300) NOT NULL,
|
||||
`name` varchar(300) NOT NULL,
|
||||
`description` text default null,
|
||||
`coordinator` bigint(20) NULL,
|
||||
`trainer` varchar(300) NULL,
|
||||
`trainer_info` text default null,
|
||||
`paymentType` enum('Company Sponsored','Paid by Employee') default 'Company Sponsored',
|
||||
`currency` varchar(3) null,
|
||||
`cost` decimal(12,2) DEFAULT 0.00,
|
||||
`status` enum('Active','Inactive') default 'Active',
|
||||
`created` datetime default '0000-00-00 00:00:00',
|
||||
`updated` datetime default '0000-00-00 00:00:00',
|
||||
CONSTRAINT `Fk_Courses_Employees` FOREIGN KEY (`coordinator`) REFERENCES `Employees` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `TrainingSessions` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(300) NOT NULL,
|
||||
`course` bigint(20) NOT NULL,
|
||||
`description` text default null,
|
||||
`scheduled` datetime default '0000-00-00 00:00:00',
|
||||
`dueDate` datetime default '0000-00-00 00:00:00',
|
||||
`deliveryMethod` enum('Classroom','Self Study','Online') default 'Classroom',
|
||||
`deliveryLocation` varchar(500) NULL,
|
||||
`status` enum('Pending','Approved','Completed','Cancelled') default 'Pending',
|
||||
`attendanceType` enum('Sign Up','Assign') default 'Sign Up',
|
||||
`attachment` varchar(300) NULL,
|
||||
`created` datetime default '0000-00-00 00:00:00',
|
||||
`updated` datetime default '0000-00-00 00:00:00',
|
||||
`requireProof` enum('Yes','No') default 'Yes',
|
||||
CONSTRAINT `Fk_TrainingSessions_Courses` FOREIGN KEY (`course`) REFERENCES `Courses` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
|
||||
create table `EmployeeTrainingSessions` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`employee` bigint(20) NOT NULL,
|
||||
`trainingSession` bigint(20) NULL,
|
||||
`feedBack` varchar(1500) NULL,
|
||||
`status` enum('Scheduled','Attended','Not-Attended','Completed') default 'Scheduled',
|
||||
`proof` varchar(300) NULL,
|
||||
CONSTRAINT `Fk_EmployeeTrainingSessions_TrainingSessions` FOREIGN KEY (`trainingSession`) REFERENCES `TrainingSessions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT `Fk_EmployeeTrainingSessions_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
|
||||
|
||||
create table `EmployementType` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(250) not null default '',
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `Industry` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(250) not null default '',
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `ExperienceLevel` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(250) not null default '',
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `JobFunction` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(250) not null default '',
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `EducationLevel` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(250) not null default '',
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `Benifits` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(250) not null default '',
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `Tags` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(250) not null default '',
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `Job` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`title` varchar(200) NOT NULL,
|
||||
`shortDescription` text DEFAULT NULL,
|
||||
`description` text DEFAULT NULL,
|
||||
`requirements` text DEFAULT NULL,
|
||||
`benefits` text DEFAULT NULL,
|
||||
`country` bigint(20) DEFAULT NULL,
|
||||
`company` bigint(20) DEFAULT NULL,
|
||||
`department` VARCHAR(100) NULL,
|
||||
`code` VARCHAR(20) NULL,
|
||||
`employementType` bigint(20) DEFAULT NULL,
|
||||
`industry` bigint(20) DEFAULT NULL,
|
||||
`experienceLevel` bigint(20) DEFAULT NULL,
|
||||
`jobFunction` bigint(20) DEFAULT NULL,
|
||||
`educationLevel` bigint(20) DEFAULT NULL,
|
||||
`currency` bigint(20) DEFAULT NULL,
|
||||
`showSalary` enum('Yes','No') default NULL,
|
||||
`salaryMin` bigint(20) DEFAULT NULL,
|
||||
`salaryMax` bigint(20) DEFAULT NULL,
|
||||
`keywords` text DEFAULT NULL,
|
||||
`status` enum('Active','On hold','Closed') default NULL,
|
||||
`closingDate` DATETIME default '0000-00-00 00:00:00',
|
||||
`attachment` varchar(100) NULL,
|
||||
`display` varchar(200) NOT NULL,
|
||||
`postedBy` bigint(20) DEFAULT NULL,
|
||||
INDEX `Job_status` (`status`),
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
|
||||
create table `Candidates` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`first_name` varchar(100) default '' not null,
|
||||
`last_name` varchar(100) default '' not null,
|
||||
`nationality` bigint(20) default null,
|
||||
`birthday` DATETIME default '0000-00-00 00:00:00',
|
||||
`gender` enum('Male','Female') default NULL,
|
||||
`marital_status` enum('Married','Single','Divorced','Widowed','Other') default NULL,
|
||||
`address1` varchar(100) default '',
|
||||
`address2` varchar(100) default '',
|
||||
`city` varchar(150) default '',
|
||||
`country` char(2) default null,
|
||||
`province` bigint(20) default null,
|
||||
`postal_code` varchar(20) default null,
|
||||
`email` varchar(200) default null,
|
||||
`home_phone` varchar(50) default null,
|
||||
`mobile_phone` varchar(50) default null,
|
||||
`cv_title` varchar(200) default '' not null,
|
||||
`cv` varchar(150) NULL,
|
||||
`cvtext` text NULL,
|
||||
`industry` text DEFAULT NULL,
|
||||
`profileImage` varchar(150) NULL,
|
||||
`head_line` text DEFAULT NULL,
|
||||
`objective` text DEFAULT NULL,
|
||||
`work_history` text DEFAULT NULL,
|
||||
`education` text DEFAULT NULL,
|
||||
`skills` text DEFAULT NULL,
|
||||
`referees` text DEFAULT NULL,
|
||||
`linkedInUrl` varchar(500) DEFAULT NULL,
|
||||
`linkedInData` text DEFAULT NULL,
|
||||
`totalYearsOfExperience` int(11) default null,
|
||||
`totalMonthsOfExperience` int(11) default null,
|
||||
`htmlCVData` longtext DEFAULT NULL,
|
||||
`generatedCVFile` varchar(150) DEFAULT NULL,
|
||||
`created` DATETIME default '0000-00-00 00:00:00',
|
||||
`updated` DATETIME default '0000-00-00 00:00:00',
|
||||
`expectedSalary` int(11) default null,
|
||||
`preferedPositions` text default null,
|
||||
`preferedJobtype` varchar(60) default null,
|
||||
`preferedCountries` text default null,
|
||||
`tags` text default null,
|
||||
`notes` text default null,
|
||||
`calls` text default null,
|
||||
`age` int(11) default null,
|
||||
`hash` varchar(100) DEFAULT NULL,
|
||||
`linkedInProfileLink` varchar(250) DEFAULT NULL,
|
||||
`linkedInProfileId` varchar(50) DEFAULT NULL,
|
||||
`facebookProfileLink` varchar(250) DEFAULT NULL,
|
||||
`facebookProfileId` varchar(50) DEFAULT NULL,
|
||||
`twitterProfileLink` varchar(250) DEFAULT NULL,
|
||||
`twitterProfileId` varchar(50) DEFAULT NULL,
|
||||
`googleProfileLink` varchar(250) DEFAULT NULL,
|
||||
`googleProfileId` varchar(50) DEFAULT NULL,
|
||||
primary key (`id`)
|
||||
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
|
||||
create table `Applications` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`job` bigint(20) NOT NULL,
|
||||
`candidate` bigint(20) DEFAULT NULL,
|
||||
`created` DATETIME default '0000-00-00 00:00:00',
|
||||
`referredByEmail` varchar(200) DEFAULT NULL,
|
||||
`notes` text DEFAULT NULL,
|
||||
primary key (`id`),
|
||||
unique key (`job`,`candidate`),
|
||||
CONSTRAINT `Fk_Applications_Job` FOREIGN KEY (`job`) REFERENCES `Job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT `Fk_Applications_Candidates` FOREIGN KEY (`candidate`) REFERENCES `Candidates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `Interviews` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`job` bigint(20) NOT NULL,
|
||||
`candidate` bigint(20) DEFAULT NULL,
|
||||
`level` varchar(100) DEFAULT NULL,
|
||||
`created` DATETIME default '0000-00-00 00:00:00',
|
||||
`updated` DATETIME default '0000-00-00 00:00:00',
|
||||
`scheduled` DATETIME default '0000-00-00 00:00:00',
|
||||
`location` varchar(500) DEFAULT NULL,
|
||||
`mapId` bigint(20) NULL,
|
||||
`status` varchar(100) default null,
|
||||
`notes` text DEFAULT NULL,
|
||||
primary key (`id`),
|
||||
CONSTRAINT `Fk_Interviews_Job` FOREIGN KEY (`job`) REFERENCES `Job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT `Fk_Interviews_Candidates` FOREIGN KEY (`candidate`) REFERENCES `Candidates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
|
||||
create table `Calls` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`job` bigint(20) NOT NULL,
|
||||
`candidate` bigint(20) DEFAULT NULL,
|
||||
`phone` varchar(20) default null,
|
||||
`created` DATETIME default '0000-00-00 00:00:00',
|
||||
`updated` DATETIME default '0000-00-00 00:00:00',
|
||||
`status` varchar(100) default null,
|
||||
`notes` text DEFAULT NULL,
|
||||
primary key (`id`),
|
||||
CONSTRAINT `Fk_Calls_Job` FOREIGN KEY (`job`) REFERENCES `Job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT `Fk_Calls_Candidates` FOREIGN KEY (`candidate`) REFERENCES `Candidates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
|
||||
create table `LeaveStartingBalance` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`leave_type` bigint(20) NOT NULL,
|
||||
`employee` bigint(20) NULL,
|
||||
`leave_period` bigint(20) NOT NULL,
|
||||
`amount` decimal(10,3) NOT NULL,
|
||||
`note` text DEFAULT NULL,
|
||||
`created` datetime default '0000-00-00 00:00:00',
|
||||
`updated` datetime default '0000-00-00 00:00:00',
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
INSERT INTO `WorkDays` (`id`, `name`, `status`, `country`) VALUES
|
||||
(1, 'Monday', 'Full Day',NULL),
|
||||
(2, 'Tuesday', 'Full Day',NULL),
|
||||
(3, 'Wednesday', 'Full Day',NULL),
|
||||
(4, 'Thursday', 'Full Day',NULL),
|
||||
(5, 'Friday', 'Full Day',NULL),
|
||||
(6, 'Saturday', 'Non-working Day',NULL),
|
||||
(7, 'Sunday', 'Non-working Day',NULL);
|
||||
|
||||
|
||||
INSERT INTO `Documents` (`id`, `name`, `details`, `expire_notification`, `expire_notification_month`, `expire_notification_week`, `expire_notification_day`,`sign`,`created`, `updated`) VALUES
|
||||
(1, 'ID Copy', 'Your ID copy','Yes','Yes','Yes','Yes','No',NOW(), NOW()),
|
||||
(2, 'Degree Certificate', 'Degree Certificate','Yes','Yes','Yes','Yes','Yes',NOW(), NOW()),
|
||||
(3, 'Driving License', 'Driving License','Yes','Yes','Yes','Yes','Yes',NOW(), NOW());
|
||||
|
||||
INSERT INTO `HoliDays` (`id`, `name`, `dateh`, `status`) VALUES
|
||||
(1, 'New Year''s Day', '2015-01-01', 'Full Day'),
|
||||
(2, 'Christmas Day', '2015-12-25', 'Full Day');
|
||||
|
||||
INSERT INTO `LeavePeriods` (`id`, `name`, `date_start`, `date_end`, `status`) VALUES
|
||||
(3, 'Year 2015', '2015-01-01', '2015-12-31', 'Active'),
|
||||
(4, 'Year 2016', '2016-01-01', '2016-12-31', 'Active'),
|
||||
(5, 'Year 2017', '2017-01-01', '2017-12-31', 'Active');
|
||||
|
||||
INSERT INTO `LeaveTypes` (`id`, `name`, `supervisor_leave_assign`, `employee_can_apply`, `apply_beyond_current`, `leave_accrue`, `carried_forward`, `default_per_year`) VALUES
|
||||
(1, 'Annual leave', 'No', 'Yes', 'No', 'No', 'No', 14),
|
||||
(2, 'Casual leave', 'Yes', 'Yes', 'No', 'No', 'No', 7),
|
||||
(3, 'Medical leave', 'Yes', 'Yes', 'Yes', 'No', 'No', 7);
|
||||
|
||||
|
||||
INSERT INTO `Courses` (`id`,`code`, `name`, `description`, `coordinator`, `trainer`, `trainer_info`, `paymentType`, `currency`, `cost`, `status`, `created`, `updated`) VALUES
|
||||
(1,'C0001', 'Info Marketing', 'Learn how to Create and Outsource Info Marketing Products', 1, 'Tim Jhon', 'Tim Jhon has a background in business management and has been working with small business to establish their online presence','Company Sponsored','USD','55','Active',now(), now()),
|
||||
(2,'C0002', 'People Management', 'Learn how to Manage People', 1, 'Tim Jhon', 'Tim Jhon has a background in business management and has been working with small business to establish their online presence','Company Sponsored','USD','59','Active',now(), now());
|
||||
|
||||
INSERT INTO `EmployementType` (`name`) VALUES
|
||||
('Full-time'),
|
||||
('Part-time'),
|
||||
('Contract'),
|
||||
('Temporary'),
|
||||
('Other');
|
||||
|
||||
INSERT INTO `Benifits` (`name`) VALUES
|
||||
('Retirement plan'),
|
||||
('Health plan'),
|
||||
('Life insurance'),
|
||||
('Paid vacations');
|
||||
|
||||
|
||||
|
||||
INSERT INTO `ExperienceLevel` (`name`) VALUES
|
||||
('Not Applicable'),
|
||||
('Internship'),
|
||||
('Entry level'),
|
||||
('Associate'),
|
||||
('Mid-Senior level'),
|
||||
('Director'),
|
||||
('Executive');
|
||||
|
||||
INSERT INTO `JobFunction` (`name`) VALUES
|
||||
('Accounting/Auditing'),
|
||||
('Administrative'),
|
||||
('Advertising'),
|
||||
('Business Analyst'),
|
||||
('Financial Analyst'),
|
||||
('Data Analyst'),
|
||||
('Art/Creative'),
|
||||
('Business Development'),
|
||||
('Consulting'),
|
||||
('Customer Service'),
|
||||
('Distribution'),
|
||||
('Design'),
|
||||
('Education'),
|
||||
('Engineering'),
|
||||
('Finance'),
|
||||
('General Business'),
|
||||
('Health Care Provider'),
|
||||
('Human Resources'),
|
||||
('Information Technology'),
|
||||
('Legal'),
|
||||
('Management'),
|
||||
('Manufacturing'),
|
||||
('Marketing'),
|
||||
('Other'),
|
||||
('Public Relations'),
|
||||
('Purchasing'),
|
||||
('Product Management'),
|
||||
('Project Management'),
|
||||
('Production'),
|
||||
('Quality Assurance'),
|
||||
('Research'),
|
||||
('Sales'),
|
||||
('Science'),
|
||||
('Strategy/Planning'),
|
||||
('Supply Chain'),
|
||||
('Training'),
|
||||
('Writing/Editing');
|
||||
|
||||
|
||||
INSERT INTO `EducationLevel` (`name`) VALUES
|
||||
('Unspecified'),
|
||||
('High School or equivalent'),
|
||||
('Certification'),
|
||||
('Vocational'),
|
||||
('Associate Degree'),
|
||||
('Bachelor\'s Degree'),
|
||||
('Master\'s Degree'),
|
||||
('Doctorate'),
|
||||
('Professional'),
|
||||
('Some College Coursework Completed'),
|
||||
('Vocational - HS Diploma'),
|
||||
('Vocational - Degree'),
|
||||
('Some High School Coursework');
|
||||
70
core-ext/scripts/upgrade_v15.0.OS_to_v15.2.OS.sql
Normal file
70
core-ext/scripts/upgrade_v15.0.OS_to_v15.2.OS.sql
Normal file
@@ -0,0 +1,70 @@
|
||||
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
('System: Default Country', '0', 'Set the default Country','[ "value", {"label":"Country","type":"select2","remote-source":["Country","code","name"]}]');
|
||||
|
||||
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
('Attendance: Overtime Calculation Class', 'BasicOvertimeCalculator', 'Set the method used to calculate overtime','["value", {"label":"Value","type":"select","source":[["BasicOvertimeCalculator","BasicOvertimeCalculator"],["CaliforniaOvertimeCalculator","CaliforniaOvertimeCalculator"]]}]');
|
||||
|
||||
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
('Attendance: Overtime Start Hour', '8', 'Overtime calculation will start after an employee work this number of hours per day, 0 to indicate no overtime', ''),
|
||||
('Attendance: Double time Start Hour', '12', 'Double time calculation will start after an employee work this number of hours per day, 0 to indicate no double time', '');
|
||||
|
||||
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
('Attendance: Work Week Start Day', '0', 'Set the starting day of the work week','["value", {"label":"Value","type":"select","source":[["0","Sunday"],["1","Monday"],["2","Tuesday"],["3","Wednesday"],["4","Thursday"],["5","Friday"],["6","Saturday"]]}]');
|
||||
|
||||
|
||||
ALTER table `Reports` ADD COLUMN `report_group` varchar(500) NULL;
|
||||
|
||||
UPDATE Reports set report_group = 'Employee Information' where name = 'Employee Details Report';
|
||||
UPDATE Reports set report_group = 'Time Management' where name = 'Employee Time Entry Report';
|
||||
UPDATE Reports set report_group = 'Time Management' where name = 'Employee Attendance Report';
|
||||
UPDATE Reports set report_group = 'Time Management' where name = 'Employee Time Tracking Report';
|
||||
UPDATE Reports set report_group = 'Employee Information' where name = 'Active Employee Report';
|
||||
UPDATE Reports set report_group = 'Employee Information' where name = 'New Hires Employee Report';
|
||||
UPDATE Reports set report_group = 'Employee Information' where name = 'Terminated Employee Report';
|
||||
UPDATE Reports set report_group = 'Travel and Expense Management' where name = 'Travel Request Report';
|
||||
|
||||
|
||||
REPLACE INTO `Reports` (`id`, `name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
|
||||
(1, 'Employee Details Report', 'This report list all employee details and you can filter employees by department, employment status or job title', '[\r\n[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}],\r\n[ "employment_status", {"label":"Employment Status","type":"select2","remote-source":["EmploymentStatus","id","name"],"allow-null":true}],\r\n[ "job_title", {"label":"Job Title","type":"select2","remote-source":["JobTitle","id","name"],"allow-null":true}]\r\n]', 'Select id, employee_id as ''Employee ID'',\r\nconcat(`first_name`,'' '',`middle_name`,'' '', `last_name`) as ''Name'',\r\n(SELECT name from Nationality where id = nationality) as ''Nationality'',\r\nbirthday as ''Birthday'',\r\ngender as ''Gender'',\r\nmarital_status as ''Marital Status'',\r\nssn_num as ''SSN Number'',\r\nnic_num as ''NIC Number'',\r\nother_id as ''Other IDs'',\r\ndriving_license as ''Driving License Number'',\r\n(SELECT name from EmploymentStatus where id = employment_status) as ''Employment Status'',\r\n(SELECT name from JobTitles where id = job_title) as ''Job Title'',\r\n(SELECT name from PayGrades where id = pay_grade) as ''Pay Grade'',\r\nwork_station_id as ''Work Station ID'',\r\naddress1 as ''Address 1'',\r\naddress2 as ''Address 2'',\r\ncity as ''City'',\r\n(SELECT name from Country where code = country) as ''Country'',\r\n(SELECT name from Province where id = province) as ''Province'',\r\npostal_code as ''Postal Code'',\r\nhome_phone as ''Home Phone'',\r\nmobile_phone as ''Mobile Phone'',\r\nwork_phone as ''Work Phone'',\r\nwork_email as ''Work Email'',\r\nprivate_email as ''Private Email'',\r\njoined_date as ''Joined Date'',\r\nconfirmation_date as ''Confirmation Date'',\r\n(SELECT title from CompanyStructures where id = department) as ''Department'',\r\n(SELECT concat(`first_name`,'' '',`middle_name`,'' '', `last_name`,'' [Employee ID:'',`employee_id`,'']'') from Employees e1 where e1.id = e.supervisor) as ''Supervisor'' \r\nFROM Employees e _where_', '["department","employment_status","job_title"]', 'Query', 'Employee Information'),
|
||||
(3, 'Employee Time Entry Report', 'This report list all employee time entries by employee, date range and project', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "project", {"label":"Project","type":"select","allow-null":true,"remote-source":["Project","id","name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeTimesheetReport', '["employee","date_start","date_end","status"]', 'Class','Time Management'),
|
||||
(4, 'Employee Attendance Report', 'This report list all employee attendance entries by employee and date range', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeAttendanceReport', '["employee","date_start","date_end"]', 'Class','Time Management'),
|
||||
(5, 'Employee Time Tracking Report', 'This report list employee working hours and attendance details for each day for a given period ', '[\r\n[ "employee", {"label":"Employee","type":"select2","allow-null":false,"remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeTimeTrackReport', '["employee","date_start","date_end"]', 'Class','Time Management');
|
||||
|
||||
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
|
||||
('Active Employee Report', 'This report list employees who are currently active based on joined date and termination date ',
|
||||
'[\r\n[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}]\r\n]',
|
||||
'ActiveEmployeeReport',
|
||||
'["department"]', 'Class','Employee Information');
|
||||
|
||||
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`, `report_group`) VALUES
|
||||
('New Hires Employee Report', 'This report list employees who are joined between given two dates ',
|
||||
'[[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]',
|
||||
'NewHiresEmployeeReport',
|
||||
'["department","date_start","date_end"]', 'Class','Employee Information');
|
||||
|
||||
|
||||
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
|
||||
('Travel Request Report', 'This report list employees travel requests for a specified period',
|
||||
'[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}],\r\n[ "status", {"label":"Status","type":"select","source":[["NULL","All Statuses"],["Approved","Approved"],["Pending","Pending"],["Rejected","Rejected"],["Cancellation Requested","Cancellation Requested"],["Cancelled","Cancelled"]]}]\r\n]',
|
||||
'TravelRequestReport',
|
||||
'["employee","date_start","date_end","status"]', 'Class', 'Travel and Expense Management');
|
||||
|
||||
|
||||
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
|
||||
('Employee Time Sheet Report', 'This report list all employee time sheets by employee and date range', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}],\r\n[ "status", {"label":"Status","allow-null":true,"null-label":"All Status","type":"select","source":[["Approved","Approved"],["Pending","Pending"],["Rejected","Rejected"]]}]\r\n]', 'EmployeeTimeSheetData', '["employee","date_start","date_end","status"]', 'Class','Time Management');
|
||||
|
||||
|
||||
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
|
||||
('Overtime Report', 'This report list all employee attendance entries by employee with overtime calculations', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'OvertimeReport', '["employee","date_start","date_end"]', 'Class','Time Management');
|
||||
|
||||
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
|
||||
('Overtime Summary Report', 'This report list all employee attendance entries by employee with overtime calculation summary', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'OvertimeSummaryReport', '["employee","date_start","date_end"]', 'Class','Time Management');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Alter table `Employees` modify column `joined_date` date default '0000-00-00';
|
||||
Alter table `Employees` modify column `confirmation_date` date default '0000-00-00';
|
||||
Alter table `Employees` modify column `termination_date` date default '0000-00-00';
|
||||
Alter table `Employees` modify column `birthday` date default '0000-00-00';
|
||||
839
core-ext/scripts/upgrade_v15.2.OS_to_v16.0.OS.sql
Normal file
839
core-ext/scripts/upgrade_v15.2.OS_to_v16.0.OS.sql
Normal file
@@ -0,0 +1,839 @@
|
||||
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
|
||||
('Employee Details Report', 'This report list all employee details and you can filter employees by department, employment status or job title', '[\r\n[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}],\r\n[ "employment_status", {"label":"Employment Status","type":"select2","remote-source":["EmploymentStatus","id","name"],"allow-null":true}],\r\n[ "job_title", {"label":"Job Title","type":"select2","remote-source":["JobTitle","id","name"],"allow-null":true}]\r\n]', 'Select id, employee_id as ''Employee ID'',\r\nconcat(`first_name`,'' '',`middle_name`,'' '', `last_name`) as ''Name'',\r\n(SELECT name from Nationality where id = nationality) as ''Nationality'',\r\nbirthday as ''Birthday'',\r\ngender as ''Gender'',\r\nmarital_status as ''Marital Status'',\r\nssn_num as ''SSN Number'',\r\nnic_num as ''NIC Number'',\r\nother_id as ''Other IDs'',\r\ndriving_license as ''Driving License Number'',\r\n(SELECT name from EmploymentStatus where id = employment_status) as ''Employment Status'',\r\n(SELECT name from JobTitles where id = job_title) as ''Job Title'',\r\n(SELECT name from PayGrades where id = pay_grade) as ''Pay Grade'',\r\nwork_station_id as ''Work Station ID'',\r\naddress1 as ''Address 1'',\r\naddress2 as ''Address 2'',\r\ncity as ''City'',\r\n(SELECT name from Country where code = country) as ''Country'',\r\n(SELECT name from Province where id = province) as ''Province'',\r\npostal_code as ''Postal Code'',\r\nhome_phone as ''Home Phone'',\r\nmobile_phone as ''Mobile Phone'',\r\nwork_phone as ''Work Phone'',\r\nwork_email as ''Work Email'',\r\nprivate_email as ''Private Email'',\r\njoined_date as ''Joined Date'',\r\nconfirmation_date as ''Confirmation Date'',\r\n(SELECT title from CompanyStructures where id = department) as ''Department'',\r\n(SELECT concat(`first_name`,'' '',`middle_name`,'' '', `last_name`,'' [Employee ID:'',`employee_id`,'']'') from Employees e1 where e1.id = e.supervisor) as ''Supervisor'' \r\nFROM Employees e _where_', '["department","employment_status","job_title"]', 'Query', 'Employee Information'),
|
||||
('Employee Time Entry Report', 'This report list all employee time entries by employee, date range and project', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "project", {"label":"Project","type":"select","allow-null":true,"remote-source":["Project","id","name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeTimesheetReport', '["employee","date_start","date_end","status"]', 'Class','Time Management'),
|
||||
('Employee Attendance Report', 'This report list all employee attendance entries by employee and date range', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeAttendanceReport', '["employee","date_start","date_end"]', 'Class','Time Management'),
|
||||
('Employee Time Tracking Report', 'This report list employee working hours and attendance details for each day for a given period ', '[\r\n[ "employee", {"label":"Employee","type":"select2","allow-null":false,"remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeTimeTrackReport', '["employee","date_start","date_end"]', 'Class','Time Management');
|
||||
|
||||
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
|
||||
('Active Employee Report', 'This report list employees who are currently active based on joined date and termination date ',
|
||||
'[\r\n[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}]\r\n]',
|
||||
'ActiveEmployeeReport',
|
||||
'["department"]', 'Class','Employee Information');
|
||||
|
||||
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`, `report_group`) VALUES
|
||||
('New Hires Employee Report', 'This report list employees who are joined between given two dates ',
|
||||
'[[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]',
|
||||
'NewHiresEmployeeReport',
|
||||
'["department","date_start","date_end"]', 'Class','Employee Information');
|
||||
|
||||
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`, `report_group`) VALUES
|
||||
('Terminated Employee Report', 'This report list employees who are terminated between given two dates ',
|
||||
'[[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]',
|
||||
'TerminatedEmployeeReport',
|
||||
'["department","date_start","date_end"]', 'Class','Employee Information');
|
||||
|
||||
|
||||
|
||||
|
||||
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
|
||||
('Employee Time Sheet Report', 'This report list all employee time sheets by employee and date range', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}],\r\n[ "status", {"label":"Status","allow-null":true,"null-label":"All Status","type":"select","source":[["Approved","Approved"],["Pending","Pending"],["Rejected","Rejected"]]}]\r\n]', 'EmployeeTimeSheetData', '["employee","date_start","date_end","status"]', 'Class','Time Management');
|
||||
|
||||
|
||||
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
('LDAP: Enabled', '0', '','["value", {"label":"Value","type":"select","source":[["0","No"],["1","Yes"]]}]'),
|
||||
('LDAP: Server', '', 'LDAP Server IP or DNS',''),
|
||||
('LDAP: Port', '389', 'LDAP Server Port',''),
|
||||
('LDAP: Root DN', '', 'e.g: dc=mycompany,dc=net',''),
|
||||
('LDAP: Manager DN', '', 'e.g: cn=admin,dc=mycompany,dc=net',''),
|
||||
('LDAP: Manager Password', '', 'Password of the manager user',''),
|
||||
('LDAP: Version 3', '1', 'Are you using LDAP v3','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
|
||||
('LDAP: User Filter', '', 'e.g: uid={}, we will replace {} with actual username provided by the user at the time of login','');
|
||||
|
||||
|
||||
|
||||
|
||||
/* v15.0.PRO to v16.0.PRO */
|
||||
|
||||
ALTER TABLE `Users` ADD COLUMN `login_hash` varchar(64) default null;
|
||||
ALTER TABLE `Users` ADD INDEX login_hash_index (`login_hash`);
|
||||
|
||||
INSERT INTO `ImmigrationStatus` VALUES
|
||||
(1,'Citizen'),
|
||||
(2,'Permanent Resident'),
|
||||
(3,'Work Permit Holder'),
|
||||
(4,'Dependant Pass Holder');
|
||||
|
||||
INSERT INTO `Ethnicity` VALUES
|
||||
(1,'White American'),
|
||||
(2,'Black or African American'),
|
||||
(3,'Native American'),
|
||||
(4,'Alaska Native'),
|
||||
(5,'Asian American'),
|
||||
(6,'Native Hawaiian'),
|
||||
(7,'Pacific Islander');
|
||||
|
||||
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
('Attendance: Overtime Calculation Class', 'BasicOvertimeCalculator', 'Set the method used to calculate overtime','["value", {"label":"Value","type":"select","source":[["BasicOvertimeCalculator","BasicOvertimeCalculator"],["CaliforniaOvertimeCalculator","CaliforniaOvertimeCalculator"]]}]');
|
||||
|
||||
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
('Attendance: Work Week Start Day', '0', 'Set the starting day of the work week','["value", {"label":"Value","type":"select","source":[["0","Sunday"],["1","Monday"],["2","Tuesday"],["3","Wednesday"],["4","Thursday"],["5","Friday"],["6","Saturday"]]}]');
|
||||
|
||||
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
('System: Reset Module Names', '1', 'Select this to reset module names in Database','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
|
||||
|
||||
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
('Attendance: Overtime Start Hour', '8', 'Overtime calculation will start after an employee work this number of hours per day, 0 to indicate no overtime', ''),
|
||||
('Attendance: Double time Start Hour', '12', 'Double time calculation will start after an employee work this number of hours per day, 0 to indicate no double time', ''),
|
||||
('Api: REST Api Enabled', '1', '','["value", {"label":"Value","type":"select","source":[["0","No"],["1","Yes"]]}]'),
|
||||
('Api: REST Api Token', 'Click on edit icon', '','["value", {"label":"Value","type":"placeholder"}]');
|
||||
|
||||
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
('System: Allowed Countries', '0', 'Only these countries will be allowed in select boxes','["value", {"label":"Value","type":"select2multi","remote-source":["Country","id","name"]}]');
|
||||
|
||||
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
('System: Allowed Currencies', '0', 'Only these currencies will be allowed in select boxes','["value", {"label":"Value","type":"select2multi","remote-source":["CurrencyType","id","code+name"]}]');
|
||||
|
||||
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
('System: Allowed Nationality', '', 'Only these nationalities will be allowed in select boxes','["value", {"label":"Value","type":"select2multi","remote-source":["Nationality","id","name"]}]');
|
||||
|
||||
|
||||
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
|
||||
('Overtime Report', 'This report list all employee attendance entries by employee with overtime calculations', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'OvertimeReport', '["employee","date_start","date_end"]', 'Class','Time Management');
|
||||
|
||||
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
|
||||
('Overtime Summary Report', 'This report list all employee attendance entries by employee with overtime calculation summary', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'OvertimeSummaryReport', '["employee","date_start","date_end"]', 'Class','Time Management');
|
||||
|
||||
create table `EmployeeDataHistory` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`type` varchar(100) not null,
|
||||
`employee` bigint(20) NOT NULL,
|
||||
`field` varchar(100) not null,
|
||||
`old_value` varchar(500) default null,
|
||||
`new_value` varchar(500) default null,
|
||||
`description` varchar(800) default null,
|
||||
`user` bigint(20) NULL,
|
||||
`updated` timestamp default '0000-00-00 00:00:00',
|
||||
`created` timestamp default '0000-00-00 00:00:00',
|
||||
CONSTRAINT `Fk_EmployeeDataHistory_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT `Fk_EmployeeDataHistory_Users` FOREIGN KEY (`user`) REFERENCES `Users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
Alter table `Employees` modify column `joined_date` date default '0000-00-00';
|
||||
Alter table `Employees` modify column `confirmation_date` date default '0000-00-00';
|
||||
Alter table `Employees` modify column `termination_date` date default '0000-00-00';
|
||||
Alter table `Employees` modify column `birthday` date default '0000-00-00';
|
||||
|
||||
|
||||
REPLACE INTO `FieldNameMappings` (`type`, `name`, `textOrig`, `textMapped`, `display`) VALUES
|
||||
('Employee', 'indirect_supervisors', 'Indirect Supervisors', 'Indirect Supervisors', 'Form');
|
||||
|
||||
Update Crons set time = (FLOOR( 1 + RAND( ) *58 )), type = 'Hourly' where name = 'Document Expire Alert';
|
||||
|
||||
CREATE TABLE `PayFrequency` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(200) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB default charset=utf8;
|
||||
|
||||
INSERT INTO `PayFrequency` VALUES
|
||||
(1,'Bi Weekly'),
|
||||
(2,'Weekly'),
|
||||
(3,'Semi Monthly'),
|
||||
(4,'Monthly'),
|
||||
(5,'Yearly');
|
||||
|
||||
|
||||
CREATE TABLE `PayrollColumnTemplates` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(50) DEFAULT NULL,
|
||||
`columns` varchar(500) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB default charset=utf8;
|
||||
|
||||
create table `Payroll` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(200) NULL,
|
||||
`pay_period` bigint(20) NOT NULL,
|
||||
`department` bigint(20) NOT NULL,
|
||||
`column_template` bigint(20) NOT NULL,
|
||||
`columns` varchar(500) DEFAULT NULL,
|
||||
`date_start` DATE NULL default '0000-00-00',
|
||||
`date_end` DATE NULL default '0000-00-00',
|
||||
`status` enum('Draft','Completed','Processing') default 'Draft',
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
|
||||
CREATE TABLE `PayrollData` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`payroll` bigint(20) NOT NULL,
|
||||
`employee` bigint(20) NOT NULL,
|
||||
`payroll_item` int(11) NOT NULL,
|
||||
`amount` varchar(25) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `PayrollDataUniqueKey` (`payroll`,`employee`,`payroll_item`),
|
||||
CONSTRAINT `Fk_PayrollData_Payroll` FOREIGN KEY (`payroll`) REFERENCES `Payroll` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB default charset=utf8;
|
||||
|
||||
|
||||
CREATE TABLE `PayrollColumns` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(50) DEFAULT NULL,
|
||||
`calculation_hook` varchar(200) DEFAULT NULL,
|
||||
`salary_components` varchar(500) DEFAULT NULL,
|
||||
`deductions` varchar(500) DEFAULT NULL,
|
||||
`add_columns` varchar(500) DEFAULT NULL,
|
||||
`sub_columns` varchar(500) DEFAULT NULL,
|
||||
`colorder` int(11) DEFAULT NULL,
|
||||
`editable` enum('Yes','No') default 'Yes',
|
||||
`enabled` enum('Yes','No') default 'Yes',
|
||||
`default_value` varchar(25) DEFAULT NULL,
|
||||
`calculation_columns` varchar(500) DEFAULT NULL,
|
||||
`calculation_function` varchar(100) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB default charset=utf8;
|
||||
|
||||
|
||||
|
||||
|
||||
INSERT INTO `PayrollColumns` (`id`,`name`,`calculation_hook`,`salary_components`,`deductions`,`add_columns`,`sub_columns`,`editable`) VALUES
|
||||
(1,'Total Hours','AttendanceUtil_getTimeWorkedHours','','','','','No'),
|
||||
(2,'Regular Hours','AttendanceUtil_getRegularWorkedHours','','','','','No'),
|
||||
(3,'Overtime Hours','AttendanceUtil_getOverTimeWorkedHours','','','','','No'),
|
||||
(4,'Leave Hours','LeaveUtil_getLeaveHours','','','','','No');
|
||||
|
||||
create table `PayrollEmployees` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`employee` bigint(20) NOT NULL,
|
||||
`pay_frequency` int(11) default null,
|
||||
`currency` bigint(20) NULL,
|
||||
`deduction_exemptions` varchar(250) default null,
|
||||
`deduction_allowed` varchar(250) default null,
|
||||
CONSTRAINT `Fk_PayrollEmployee_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
primary key (`id`),
|
||||
unique key `PayrollEmployees_employee` (`employee`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `DeductionGroup` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) NOT NULL,
|
||||
`description` varchar(100) NOT NULL,
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
drop table `DeductionRules`;
|
||||
drop table `Deductions`;
|
||||
|
||||
create table `Deductions` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) NOT NULL,
|
||||
`componentType` varchar(250) NULL,
|
||||
`component` varchar(250) NULL,
|
||||
`payrollColumn` int(11) DEFAULT NULL,
|
||||
`rangeAmounts` text default null,
|
||||
`deduction_group` bigint(20) NULL,
|
||||
CONSTRAINT `Fk_Deductions_DeductionGroup` FOREIGN KEY (`deduction_group`) REFERENCES `DeductionGroup` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Update Reports set parameters = '[\r\n[ "department", {"label":"Department (Company)","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}],\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}],\r\n[ "status", {"label":"Leave Status","type":"select","source":[["NULL","All Statuses"],["Approved","Approved"],["Pending","Pending"],["Rejected","Rejected"],["Cancellation Requested","Cancellation Requested"],["Cancelled","Cancelled"]]}]\r\n]' where name = "Employee Leaves Report";
|
||||
|
||||
|
||||
Delete from `Settings` where name = 'System: Default Country';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
create table `LeaveTypes` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) NOT NULL,
|
||||
`supervisor_leave_assign` enum('Yes','No') default 'Yes',
|
||||
`employee_can_apply` enum('Yes','No') default 'Yes',
|
||||
`apply_beyond_current` enum('Yes','No') default 'Yes',
|
||||
`leave_accrue` enum('No','Yes') default 'No',
|
||||
`carried_forward` enum('No','Yes') default 'No',
|
||||
`default_per_year` decimal(10,3) NOT NULL,
|
||||
`carried_forward_percentage` int(11) NULL default 0,
|
||||
`carried_forward_leave_availability` int(11) NULL default 365,
|
||||
`propotionate_on_joined_date` enum('No','Yes') default 'No',
|
||||
`send_notification_emails` enum('Yes','No') default 'Yes',
|
||||
`leave_group` bigint(20) NULL,
|
||||
`leave_color` varchar(10) NULL,
|
||||
`max_carried_forward_amount` int(11) NULL default 0,
|
||||
primary key (`id`),
|
||||
unique key (`name`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `LeaveRules` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`leave_type` bigint(20) NOT NULL,
|
||||
`job_title` bigint(20) NULL,
|
||||
`employment_status` bigint(20) NULL,
|
||||
`employee` bigint(20) NULL,
|
||||
`supervisor_leave_assign` enum('Yes','No') default 'Yes',
|
||||
`employee_can_apply` enum('Yes','No') default 'Yes',
|
||||
`apply_beyond_current` enum('Yes','No') default 'Yes',
|
||||
`leave_accrue` enum('No','Yes') default 'No',
|
||||
`carried_forward` enum('No','Yes') default 'No',
|
||||
`default_per_year` decimal(10,3) NOT NULL,
|
||||
`carried_forward_percentage` int(11) NULL default 0,
|
||||
`carried_forward_leave_availability` int(11) NULL default 365,
|
||||
`propotionate_on_joined_date` enum('No','Yes') default 'No',
|
||||
`leave_group` bigint(20) NULL,
|
||||
`max_carried_forward_amount` int(11) NULL default 0,
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
|
||||
create table `LeaveGroups` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) NOT NULL,
|
||||
`details` text default null,
|
||||
`created` timestamp NULL default '0000-00-00 00:00:00',
|
||||
`updated` timestamp NULL default '0000-00-00 00:00:00',
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `LeaveGroupEmployees` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`employee` bigint(20) NOT NULL,
|
||||
`leave_group` bigint(20) NOT NULL,
|
||||
`created` timestamp NULL default '0000-00-00 00:00:00',
|
||||
`updated` timestamp NULL default '0000-00-00 00:00:00',
|
||||
CONSTRAINT `Fk_LeaveGroupEmployees_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT `Fk_LeaveGroupEmployees_LeaveGroups` FOREIGN KEY (`leave_group`) REFERENCES `LeaveGroups` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
primary key (`id`),
|
||||
unique key `LeaveGroupEmployees_employee` (`employee`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `LeavePeriods` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) NOT NULL,
|
||||
`date_start` date default '0000-00-00',
|
||||
`date_end` date default '0000-00-00',
|
||||
`status` enum('Active','Inactive') default 'Inactive',
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `WorkDays` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) NOT NULL,
|
||||
`status` enum('Full Day','Half Day','Non-working Day') default 'Full Day',
|
||||
`country` bigint(20) DEFAULT NULL,
|
||||
primary key (`id`),
|
||||
unique key `workdays_name_country` (`name`,`country`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `HoliDays` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) NOT NULL,
|
||||
`dateh` date default '0000-00-00',
|
||||
`status` enum('Full Day','Half Day') default 'Full Day',
|
||||
`country` bigint(20) DEFAULT NULL,
|
||||
primary key (`id`),
|
||||
unique key `holidays_dateh_country` (`dateh`,`country`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `EmployeeLeaves` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`employee` bigint(20) NOT NULL,
|
||||
`leave_type` bigint(20) NOT NULL,
|
||||
`leave_period` bigint(20) NOT NULL,
|
||||
`date_start` date default '0000-00-00',
|
||||
`date_end` date default '0000-00-00',
|
||||
`details` text default null,
|
||||
`status` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled') default 'Pending',
|
||||
`attachment` varchar(100) NULL,
|
||||
CONSTRAINT `Fk_EmployeeLeaves_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT `Fk_EmployeeLeaves_LeaveTypes` FOREIGN KEY (`leave_type`) REFERENCES `LeaveTypes` (`id`),
|
||||
CONSTRAINT `Fk_EmployeeLeaves_LeavePeriods` FOREIGN KEY (`leave_period`) REFERENCES `LeavePeriods` (`id`),
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `EmployeeLeaveLog` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`employee_leave` bigint(20) NOT NULL,
|
||||
`user_id` bigint(20) NULL,
|
||||
`data` varchar(500) NOT NULL,
|
||||
`status_from` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled') default 'Pending',
|
||||
`status_to` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled') default 'Pending',
|
||||
`created` timestamp default '0000-00-00 00:00:00',
|
||||
CONSTRAINT `Fk_EmployeeLeaveLog_EmployeeLeaves` FOREIGN KEY (`employee_leave`) REFERENCES `EmployeeLeaves` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT `Fk_EmployeeLeaveLog_Users` FOREIGN KEY (`user_id`) REFERENCES `Users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `EmployeeLeaveDays` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`employee_leave` bigint(20) NOT NULL,
|
||||
`leave_date` date default '0000-00-00',
|
||||
`leave_type` enum('Full Day','Half Day - Morning','Half Day - Afternoon','1 Hour - Morning','2 Hours - Morning','3 Hours - Morning','1 Hour - Afternoon','2 Hours - Afternoon','3 Hours - Afternoon') NOT NULL,
|
||||
CONSTRAINT `Fk_EmployeeLeaveDays_EmployeeLeaves` FOREIGN KEY (`employee_leave`) REFERENCES `EmployeeLeaves` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
|
||||
create table `Documents` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) NOT NULL,
|
||||
`details` text default null,
|
||||
`expire_notification` enum('Yes','No') default 'Yes',
|
||||
`expire_notification_month` enum('Yes','No') default 'Yes',
|
||||
`expire_notification_week` enum('Yes','No') default 'Yes',
|
||||
`expire_notification_day` enum('Yes','No') default 'Yes',
|
||||
`sign` enum('Yes','No') default 'Yes',
|
||||
`sign_label` VARCHAR(500) default null,
|
||||
`created` DATETIME default '0000-00-00 00:00:00',
|
||||
`updated` DATETIME default '0000-00-00 00:00:00',
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
|
||||
create table `EmployeeDocuments` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`employee` bigint(20) NOT NULL,
|
||||
`document` bigint(20) NULL,
|
||||
`date_added` date NOT NULL,
|
||||
`valid_until` date NOT NULL,
|
||||
`status` enum('Active','Inactive','Draft') default 'Active',
|
||||
`details` text default null,
|
||||
`attachment` varchar(100) NULL,
|
||||
`signature` text default null,
|
||||
`expire_notification_last` int(4) NULL,
|
||||
CONSTRAINT `Fk_EmployeeDocuments_Documents` FOREIGN KEY (`document`) REFERENCES `Documents` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
|
||||
CONSTRAINT `Fk_EmployeeDocuments_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
primary key (`id`),
|
||||
KEY `KEY_EmployeeDocuments_valid_until` (`valid_until`),
|
||||
KEY `KEY_EmployeeDocuments_valid_until_status` (`valid_until`,`status`,`expire_notification_last`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
|
||||
create table `CompanyDocuments` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(100) NOT NULL,
|
||||
`details` text default null,
|
||||
`valid_until` date NOT NULL,
|
||||
`status` enum('Active','Inactive','Draft') default 'Active',
|
||||
`notify_employees` enum('Yes','No') default 'Yes',
|
||||
`attachment` varchar(100) NULL,
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
|
||||
create table `Courses` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`code` varchar(300) NOT NULL,
|
||||
`name` varchar(300) NOT NULL,
|
||||
`description` text default null,
|
||||
`coordinator` bigint(20) NULL,
|
||||
`trainer` varchar(300) NULL,
|
||||
`trainer_info` text default null,
|
||||
`paymentType` enum('Company Sponsored','Paid by Employee') default 'Company Sponsored',
|
||||
`currency` varchar(3) null,
|
||||
`cost` decimal(12,2) DEFAULT 0.00,
|
||||
`status` enum('Active','Inactive') default 'Active',
|
||||
`created` datetime default '0000-00-00 00:00:00',
|
||||
`updated` datetime default '0000-00-00 00:00:00',
|
||||
CONSTRAINT `Fk_Courses_Employees` FOREIGN KEY (`coordinator`) REFERENCES `Employees` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `TrainingSessions` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(300) NOT NULL,
|
||||
`course` bigint(20) NOT NULL,
|
||||
`description` text default null,
|
||||
`scheduled` datetime default '0000-00-00 00:00:00',
|
||||
`dueDate` datetime default '0000-00-00 00:00:00',
|
||||
`deliveryMethod` enum('Classroom','Self Study','Online') default 'Classroom',
|
||||
`deliveryLocation` varchar(500) NULL,
|
||||
`status` enum('Pending','Approved','Completed','Cancelled') default 'Pending',
|
||||
`attendanceType` enum('Sign Up','Assign') default 'Sign Up',
|
||||
`attachment` varchar(300) NULL,
|
||||
`created` datetime default '0000-00-00 00:00:00',
|
||||
`updated` datetime default '0000-00-00 00:00:00',
|
||||
`requireProof` enum('Yes','No') default 'Yes',
|
||||
CONSTRAINT `Fk_TrainingSessions_Courses` FOREIGN KEY (`course`) REFERENCES `Courses` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
|
||||
create table `EmployeeTrainingSessions` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`employee` bigint(20) NOT NULL,
|
||||
`trainingSession` bigint(20) NULL,
|
||||
`feedBack` varchar(1500) NULL,
|
||||
`status` enum('Scheduled','Attended','Not-Attended','Completed') default 'Scheduled',
|
||||
`proof` varchar(300) NULL,
|
||||
CONSTRAINT `Fk_EmployeeTrainingSessions_TrainingSessions` FOREIGN KEY (`trainingSession`) REFERENCES `TrainingSessions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT `Fk_EmployeeTrainingSessions_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
|
||||
|
||||
create table `LeaveStartingBalance` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`leave_type` bigint(20) NOT NULL,
|
||||
`employee` bigint(20) NULL,
|
||||
`leave_period` bigint(20) NOT NULL,
|
||||
`amount` decimal(10,3) NOT NULL,
|
||||
`note` text DEFAULT NULL,
|
||||
`created` datetime default '0000-00-00 00:00:00',
|
||||
`updated` datetime default '0000-00-00 00:00:00',
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
|
||||
|
||||
/* Sync with Default Schema */
|
||||
|
||||
create table `EmployementType` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(250) not null default '',
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `Industry` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(250) not null default '',
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `ExperienceLevel` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(250) not null default '',
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `JobFunction` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(250) not null default '',
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `EducationLevel` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(250) not null default '',
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `Benifits` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(250) not null default '',
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `Tags` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(250) not null default '',
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `Job` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`title` varchar(200) NOT NULL,
|
||||
`shortDescription` text DEFAULT NULL,
|
||||
`description` text DEFAULT NULL,
|
||||
`requirements` text DEFAULT NULL,
|
||||
`benefits` text DEFAULT NULL,
|
||||
`country` bigint(20) DEFAULT NULL,
|
||||
`company` bigint(20) DEFAULT NULL,
|
||||
`department` VARCHAR(100) NULL,
|
||||
`code` VARCHAR(20) NULL,
|
||||
`employementType` bigint(20) DEFAULT NULL,
|
||||
`industry` bigint(20) DEFAULT NULL,
|
||||
`experienceLevel` bigint(20) DEFAULT NULL,
|
||||
`jobFunction` bigint(20) DEFAULT NULL,
|
||||
`educationLevel` bigint(20) DEFAULT NULL,
|
||||
`currency` bigint(20) DEFAULT NULL,
|
||||
`showSalary` enum('Yes','No') default NULL,
|
||||
`salaryMin` bigint(20) DEFAULT NULL,
|
||||
`salaryMax` bigint(20) DEFAULT NULL,
|
||||
`keywords` text DEFAULT NULL,
|
||||
`status` enum('Active','On hold','Closed') default NULL,
|
||||
`closingDate` DATETIME default '0000-00-00 00:00:00',
|
||||
`attachment` varchar(100) NULL,
|
||||
`display` varchar(200) NOT NULL,
|
||||
`postedBy` bigint(20) DEFAULT NULL,
|
||||
INDEX `Job_status` (`status`),
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
|
||||
create table `Candidates` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`first_name` varchar(100) default '' not null,
|
||||
`last_name` varchar(100) default '' not null,
|
||||
`nationality` bigint(20) default null,
|
||||
`birthday` DATETIME default '0000-00-00 00:00:00',
|
||||
`gender` enum('Male','Female') default NULL,
|
||||
`marital_status` enum('Married','Single','Divorced','Widowed','Other') default NULL,
|
||||
`address1` varchar(100) default '',
|
||||
`address2` varchar(100) default '',
|
||||
`city` varchar(150) default '',
|
||||
`country` char(2) default null,
|
||||
`province` bigint(20) default null,
|
||||
`postal_code` varchar(20) default null,
|
||||
`email` varchar(200) default null,
|
||||
`home_phone` varchar(50) default null,
|
||||
`mobile_phone` varchar(50) default null,
|
||||
`cv_title` varchar(200) default '' not null,
|
||||
`cv` varchar(150) NULL,
|
||||
`cvtext` text NULL,
|
||||
`industry` text DEFAULT NULL,
|
||||
`profileImage` varchar(150) NULL,
|
||||
`head_line` text DEFAULT NULL,
|
||||
`objective` text DEFAULT NULL,
|
||||
`work_history` text DEFAULT NULL,
|
||||
`education` text DEFAULT NULL,
|
||||
`skills` text DEFAULT NULL,
|
||||
`referees` text DEFAULT NULL,
|
||||
`linkedInUrl` varchar(500) DEFAULT NULL,
|
||||
`linkedInData` text DEFAULT NULL,
|
||||
`totalYearsOfExperience` int(11) default null,
|
||||
`totalMonthsOfExperience` int(11) default null,
|
||||
`htmlCVData` longtext DEFAULT NULL,
|
||||
`generatedCVFile` varchar(150) DEFAULT NULL,
|
||||
`created` DATETIME default '0000-00-00 00:00:00',
|
||||
`updated` DATETIME default '0000-00-00 00:00:00',
|
||||
`expectedSalary` int(11) default null,
|
||||
`preferedPositions` text default null,
|
||||
`preferedJobtype` varchar(60) default null,
|
||||
`preferedCountries` text default null,
|
||||
`tags` text default null,
|
||||
`notes` text default null,
|
||||
`calls` text default null,
|
||||
`age` int(11) default null,
|
||||
`hash` varchar(100) DEFAULT NULL,
|
||||
`linkedInProfileLink` varchar(250) DEFAULT NULL,
|
||||
`linkedInProfileId` varchar(50) DEFAULT NULL,
|
||||
`facebookProfileLink` varchar(250) DEFAULT NULL,
|
||||
`facebookProfileId` varchar(50) DEFAULT NULL,
|
||||
`twitterProfileLink` varchar(250) DEFAULT NULL,
|
||||
`twitterProfileId` varchar(50) DEFAULT NULL,
|
||||
`googleProfileLink` varchar(250) DEFAULT NULL,
|
||||
`googleProfileId` varchar(50) DEFAULT NULL,
|
||||
primary key (`id`)
|
||||
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
|
||||
create table `Applications` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`job` bigint(20) NOT NULL,
|
||||
`candidate` bigint(20) DEFAULT NULL,
|
||||
`created` DATETIME default '0000-00-00 00:00:00',
|
||||
`referredByEmail` varchar(200) DEFAULT NULL,
|
||||
`notes` text DEFAULT NULL,
|
||||
primary key (`id`),
|
||||
unique key (`job`,`candidate`),
|
||||
CONSTRAINT `Fk_Applications_Job` FOREIGN KEY (`job`) REFERENCES `Job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT `Fk_Applications_Candidates` FOREIGN KEY (`candidate`) REFERENCES `Candidates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `Interviews` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`job` bigint(20) NOT NULL,
|
||||
`candidate` bigint(20) DEFAULT NULL,
|
||||
`level` varchar(100) DEFAULT NULL,
|
||||
`created` DATETIME default '0000-00-00 00:00:00',
|
||||
`updated` DATETIME default '0000-00-00 00:00:00',
|
||||
`scheduled` DATETIME default '0000-00-00 00:00:00',
|
||||
`location` varchar(500) DEFAULT NULL,
|
||||
`mapId` bigint(20) NULL,
|
||||
`status` varchar(100) default null,
|
||||
`notes` text DEFAULT NULL,
|
||||
primary key (`id`),
|
||||
CONSTRAINT `Fk_Interviews_Job` FOREIGN KEY (`job`) REFERENCES `Job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT `Fk_Interviews_Candidates` FOREIGN KEY (`candidate`) REFERENCES `Candidates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
|
||||
create table `Calls` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`job` bigint(20) NOT NULL,
|
||||
`candidate` bigint(20) DEFAULT NULL,
|
||||
`phone` varchar(20) default null,
|
||||
`created` DATETIME default '0000-00-00 00:00:00',
|
||||
`updated` DATETIME default '0000-00-00 00:00:00',
|
||||
`status` varchar(100) default null,
|
||||
`notes` text DEFAULT NULL,
|
||||
primary key (`id`),
|
||||
CONSTRAINT `Fk_Calls_Job` FOREIGN KEY (`job`) REFERENCES `Job` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT `Fk_Calls_Candidates` FOREIGN KEY (`candidate`) REFERENCES `Candidates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Add Missing Master Data */
|
||||
|
||||
INSERT INTO `WorkDays` (`id`, `name`, `status`, `country`) VALUES
|
||||
(1, 'Monday', 'Full Day',NULL),
|
||||
(2, 'Tuesday', 'Full Day',NULL),
|
||||
(3, 'Wednesday', 'Full Day',NULL),
|
||||
(4, 'Thursday', 'Full Day',NULL),
|
||||
(5, 'Friday', 'Full Day',NULL),
|
||||
(6, 'Saturday', 'Non-working Day',NULL),
|
||||
(7, 'Sunday', 'Non-working Day',NULL);
|
||||
|
||||
|
||||
|
||||
|
||||
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
('System: Reset Module Names', '1', 'Select this to reset module names in Database','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
|
||||
('Leave: Share Calendar to Whole Company', '1', '','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
|
||||
('Leave: CC Emails', '', 'Every email sent though leave module will be CC to these comma seperated list of emails addresses',''),
|
||||
('Leave: BCC Emails', '', 'Every email sent though leave module will be BCC to these comma seperated list of emails addresses',''),
|
||||
('Api: REST Api Enabled', '1', '','["value", {"label":"Value","type":"select","source":[["0","No"],["1","Yes"]]}]'),
|
||||
('Api: REST Api Token', 'Click on edit icon', '','["value", {"label":"Value","type":"placeholder"}]');
|
||||
|
||||
|
||||
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
('LDAP: Enabled', '0', '','["value", {"label":"Value","type":"select","source":[["0","No"],["1","Yes"]]}]'),
|
||||
('LDAP: Server', '', 'LDAP Server IP or DNS',''),
|
||||
('LDAP: Port', '389', 'LDAP Server Port',''),
|
||||
('LDAP: Root DN', '', 'e.g: dc=mycompany,dc=net',''),
|
||||
('LDAP: Manager DN', '', 'e.g: cn=admin,dc=mycompany,dc=net',''),
|
||||
('LDAP: Manager Password', '', 'Password of the manager user',''),
|
||||
('LDAP: Version 3', '1', 'Are you using LDAP v3','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
|
||||
('LDAP: User Filter', '', 'e.g: uid={}, we will replace {} with actual username provided by the user at the time of login','');
|
||||
|
||||
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
('Leave: Allow Indirect Admins to Approve', '0', 'Allow indirect admins to approve leave requests','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
|
||||
|
||||
|
||||
REPLACE INTO `Documents` (`id`, `name`, `details`, `expire_notification`, `expire_notification_month`, `expire_notification_week`, `expire_notification_day`,`sign`,`created`, `updated`) VALUES
|
||||
(1, 'ID Copy', 'Your ID copy','Yes','Yes','Yes','Yes','No',NOW(), NOW()),
|
||||
(2, 'Degree Certificate', 'Degree Certificate','Yes','Yes','Yes','Yes','Yes',NOW(), NOW()),
|
||||
(3, 'Driving License', 'Driving License','Yes','Yes','Yes','Yes','Yes',NOW(), NOW());
|
||||
|
||||
REPLACE INTO `HoliDays` (`id`, `name`, `dateh`, `status`) VALUES
|
||||
(1, 'New Year''s Day', '2015-01-01', 'Full Day'),
|
||||
(2, 'Christmas Day', '2015-12-25', 'Full Day');
|
||||
|
||||
REPLACE INTO `LeavePeriods` (`id`, `name`, `date_start`, `date_end`, `status`) VALUES
|
||||
(3, 'Year 2015', '2015-01-01', '2015-12-31', 'Active'),
|
||||
(4, 'Year 2016', '2016-01-01', '2016-12-31', 'Active'),
|
||||
(5, 'Year 2017', '2017-01-01', '2017-12-31', 'Active');
|
||||
|
||||
REPLACE INTO `LeaveTypes` (`id`, `name`, `supervisor_leave_assign`, `employee_can_apply`, `apply_beyond_current`, `leave_accrue`, `carried_forward`, `default_per_year`) VALUES
|
||||
(1, 'Annual leave', 'No', 'Yes', 'No', 'No', 'No', 14),
|
||||
(2, 'Casual leave', 'Yes', 'Yes', 'No', 'No', 'No', 7),
|
||||
(3, 'Medical leave', 'Yes', 'Yes', 'Yes', 'No', 'No', 7);
|
||||
|
||||
REPLACE INTO `Courses` (`id`,`code`, `name`, `description`, `coordinator`, `trainer`, `trainer_info`, `paymentType`, `currency`, `cost`, `status`, `created`, `updated`) VALUES
|
||||
(1,'C0001', 'Info Marketing', 'Learn how to Create and Outsource Info Marketing Products', 1, 'Tim Jhon', 'Tim Jhon has a background in business management and has been working with small business to establish their online presence','Company Sponsored','USD','55','Active',now(), now()),
|
||||
(2,'C0002', 'People Management', 'Learn how to Manage People', 1, 'Tim Jhon', 'Tim Jhon has a background in business management and has been working with small business to establish their online presence','Company Sponsored','USD','59','Active',now(), now());
|
||||
|
||||
REPLACE INTO `EmployementType` (`name`) VALUES
|
||||
('Full-time'),
|
||||
('Part-time'),
|
||||
('Contract'),
|
||||
('Temporary'),
|
||||
('Other');
|
||||
|
||||
REPLACE INTO `Benifits` (`name`) VALUES
|
||||
('Retirement plan'),
|
||||
('Health plan'),
|
||||
('Life insurance'),
|
||||
('Paid vacations');
|
||||
|
||||
|
||||
|
||||
REPLACE INTO `ExperienceLevel` (`name`) VALUES
|
||||
('Not Applicable'),
|
||||
('Internship'),
|
||||
('Entry level'),
|
||||
('Associate'),
|
||||
('Mid-Senior level'),
|
||||
('Director'),
|
||||
('Executive');
|
||||
|
||||
REPLACE INTO `JobFunction` (`name`) VALUES
|
||||
('Accounting/Auditing'),
|
||||
('Administrative'),
|
||||
('Advertising'),
|
||||
('Business Analyst'),
|
||||
('Financial Analyst'),
|
||||
('Data Analyst'),
|
||||
('Art/Creative'),
|
||||
('Business Development'),
|
||||
('Consulting'),
|
||||
('Customer Service'),
|
||||
('Distribution'),
|
||||
('Design'),
|
||||
('Education'),
|
||||
('Engineering'),
|
||||
('Finance'),
|
||||
('General Business'),
|
||||
('Health Care Provider'),
|
||||
('Human Resources'),
|
||||
('Information Technology'),
|
||||
('Legal'),
|
||||
('Management'),
|
||||
('Manufacturing'),
|
||||
('Marketing'),
|
||||
('Other'),
|
||||
('Public Relations'),
|
||||
('Purchasing'),
|
||||
('Product Management'),
|
||||
('Project Management'),
|
||||
('Production'),
|
||||
('Quality Assurance'),
|
||||
('Research'),
|
||||
('Sales'),
|
||||
('Science'),
|
||||
('Strategy/Planning'),
|
||||
('Supply Chain'),
|
||||
('Training'),
|
||||
('Writing/Editing');
|
||||
|
||||
|
||||
REPLACE INTO `EducationLevel` (`name`) VALUES
|
||||
('Unspecified'),
|
||||
('High School or equivalent'),
|
||||
('Certification'),
|
||||
('Vocational'),
|
||||
('Associate Degree'),
|
||||
('Bachelor\'s Degree'),
|
||||
('Master\'s Degree'),
|
||||
('Doctorate'),
|
||||
('Professional'),
|
||||
('Some College Coursework Completed'),
|
||||
('Vocational - HS Diploma'),
|
||||
('Vocational - Degree'),
|
||||
('Some High School Coursework');
|
||||
|
||||
|
||||
REPLACE INTO `Crons` (`name`,`class`, `lastrun`, `frequency`, `time`, `type`, `status`) VALUES
|
||||
('Email Sender Task', 'EmailSenderTask', NULL, 1, 1, 'Minutely', 'Enabled'),
|
||||
('Document Expire Alert', 'DocumentExpiryNotificationTask', NULL, 1, (FLOOR( 1 + RAND( ) *58 )), 'Hourly', 'Enabled');
|
||||
|
||||
|
||||
REPLACE INTO `ExpensesPaymentMethods` (`name`) VALUES
|
||||
('Cash'),
|
||||
('Check'),
|
||||
('Credit Card'),
|
||||
('Debit Card');
|
||||
|
||||
|
||||
REPLACE INTO `ExpensesCategories` (`name`) VALUES
|
||||
('Auto - Gas'),
|
||||
('Auto - Insurance'),
|
||||
('Auto - Maintenance'),
|
||||
('Auto - Payment'),
|
||||
('Transportation'),
|
||||
('Bank Fees'),
|
||||
('Dining Out'),
|
||||
('Entertainment'),
|
||||
('Hotel / Motel'),
|
||||
('Insurance'),
|
||||
('Interest Charges'),
|
||||
('Loan Payment'),
|
||||
('Medical'),
|
||||
('Mileage'),
|
||||
('Rent'),
|
||||
('Rental Car'),
|
||||
('Utility');
|
||||
@@ -19,6 +19,50 @@ if (!class_exists('AttendanceAdminManager')) {
|
||||
$this->addModelClass('Attendance');
|
||||
}
|
||||
|
||||
public function getDashboardItemData(){
|
||||
$data = array();
|
||||
$attendance = new Attendance();
|
||||
$data['numberOfAttendanceLastWeek'] = $attendance->Count("in_time > '".date("Y-m-d H:i:s",strtotime("-1 week"))."'");
|
||||
if(empty($data['numberOfAttendanceLastWeek'])){
|
||||
$data['numberOfAttendanceLastWeek'] = 0;
|
||||
}
|
||||
return $data;
|
||||
|
||||
}
|
||||
|
||||
public function initQuickAccessMenu(){
|
||||
UIManager::getInstance()->addQuickAccessMenuItem("Clocked In Employees","fa-clock-o",CLIENT_BASE_URL."?g=admin&n=attendance&m=admin_Employees#tabAttendanceStatus",array("Admin","Manager"));
|
||||
}
|
||||
|
||||
public function initCalculationHooks(){
|
||||
$this->addCalculationHook('AttendanceUtil_getTimeWorkedHours','Total Hours from Attendance','AttendanceUtil','getTimeWorkedHours');
|
||||
$this->addCalculationHook('AttendanceUtil_getRegularWorkedHours','Total Regular Hours from Attendance','AttendanceUtil','getRegularWorkedHours');
|
||||
$this->addCalculationHook('AttendanceUtil_getOverTimeWorkedHours','Total Overtime Hours from Attendance','AttendanceUtil','getOverTimeWorkedHours');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (!class_exists('AttendanceDashboardManager')) {
|
||||
|
||||
class AttendanceDashboardManager extends AbstractModuleManager{
|
||||
|
||||
public function initializeUserClasses(){
|
||||
|
||||
}
|
||||
|
||||
public function initializeFieldMappings(){
|
||||
|
||||
}
|
||||
|
||||
public function initializeDatabaseErrorMappings(){
|
||||
|
||||
}
|
||||
|
||||
public function setupModuleClassDefinitions(){
|
||||
$this->addModelClass('Attendance');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,4 +217,265 @@ if (!class_exists('AttendanceStatus')) {
|
||||
return array("element","save","delete");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!class_exists('AttendanceUtil')) {
|
||||
class AttendanceUtil{
|
||||
public function getAttendanceSummary($employeeId, $startDate, $endDate){
|
||||
$startTime = $startDate." 00:00:00";
|
||||
$endTime = $endDate." 23:59:59";
|
||||
$attendance = new Attendance();
|
||||
$atts = $attendance->Find("employee = ? and in_time >= ? and out_time <= ?",array($employeeId, $startTime, $endTime));
|
||||
|
||||
$atCalClassName = SettingsManager::getInstance()->getSetting('Attendance: Overtime Calculation Class');
|
||||
|
||||
$atCal = new $atCalClassName();
|
||||
$atSum = $atCal->getDataSeconds($atts, $startDate, true);
|
||||
|
||||
return $atSum;
|
||||
}
|
||||
|
||||
public function getTimeWorkedHours($employeeId, $startDate, $endDate){
|
||||
$atSum = $this->getAttendanceSummary($employeeId, $startDate, $endDate);
|
||||
return round(($atSum['t']/60)/60,2);
|
||||
}
|
||||
|
||||
public function getRegularWorkedHours($employeeId, $startDate, $endDate){
|
||||
$atSum = $this->getAttendanceSummary($employeeId, $startDate, $endDate);
|
||||
return round(($atSum['r']/60)/60,2);
|
||||
}
|
||||
|
||||
public function getOverTimeWorkedHours($employeeId, $startDate, $endDate){
|
||||
$atSum = $this->getAttendanceSummary($employeeId, $startDate, $endDate);
|
||||
return round(($atSum['o']/60)/60,2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!class_exists('BasicOvertimeCalculator')) {
|
||||
|
||||
class BasicOvertimeCalculator{
|
||||
|
||||
public function createAttendanceSummary($atts){
|
||||
|
||||
$atTimeByDay = array();
|
||||
|
||||
foreach($atts as $atEntry){
|
||||
if($atEntry->out_time == "0000-00-00 00:00:00" || empty($atEntry->out_time)){
|
||||
continue;
|
||||
}
|
||||
|
||||
$atDate = date("Y-m-d",strtotime($atEntry->in_time));
|
||||
|
||||
if(!isset($atTimeByDay[$atDate])){
|
||||
$atTimeByDay[$atDate] = 0;
|
||||
}
|
||||
|
||||
$diff = strtotime($atEntry->out_time) - strtotime($atEntry->in_time);
|
||||
if($diff < 0){
|
||||
$diff = 0;
|
||||
}
|
||||
|
||||
$atTimeByDay[$atDate] += $diff;
|
||||
|
||||
}
|
||||
|
||||
return $atTimeByDay;
|
||||
}
|
||||
|
||||
public function calculateOvertime($atTimeByDay){
|
||||
$overtimeStarts = SettingsManager::getInstance()->getSetting('Attendance: Overtime Start Hour');
|
||||
$doubletimeStarts = SettingsManager::getInstance()->getSetting('Attendance: Double time Start Hour');
|
||||
|
||||
$overtimeStarts = (is_numeric($overtimeStarts))?floatval($overtimeStarts)*60*60:0;
|
||||
$doubletimeStarts = (is_numeric($doubletimeStarts))?floatval($doubletimeStarts)*60*60:0;
|
||||
|
||||
$atTimeByDayNew = array();
|
||||
foreach($atTimeByDay as $k=>$v){
|
||||
$atTimeByDayNewEntry = array("t"=>$v,"r"=>0,"o"=>0,"d"=>0);
|
||||
if($overtimeStarts > 0 && $v > $overtimeStarts){
|
||||
$atTimeByDayNewEntry["r"] = $overtimeStarts;
|
||||
if($doubletimeStarts > 0 && $doubletimeStarts > $overtimeStarts){
|
||||
//calculate double time
|
||||
if($v > $doubletimeStarts){
|
||||
$atTimeByDayNewEntry['d'] = $v - $doubletimeStarts;
|
||||
$atTimeByDayNewEntry['o'] = $doubletimeStarts - $overtimeStarts;
|
||||
}else{
|
||||
$atTimeByDayNewEntry['d'] = 0 ;
|
||||
$atTimeByDayNewEntry['o'] = $v - $overtimeStarts;
|
||||
}
|
||||
|
||||
}else{
|
||||
//ignore double time
|
||||
$atTimeByDayNewEntry['o'] = $v - $overtimeStarts;
|
||||
}
|
||||
}else{
|
||||
//ignore overtime
|
||||
$atTimeByDayNewEntry['r'] = $v;
|
||||
}
|
||||
|
||||
$atTimeByDayNew[$k] = $atTimeByDayNewEntry;
|
||||
}
|
||||
|
||||
return $atTimeByDayNew;
|
||||
}
|
||||
|
||||
protected function removeAdditionalDays($atSummary, $actualStartDate){
|
||||
$newAtSummary = array();
|
||||
foreach($atSummary as $k => $v){
|
||||
if(strtotime($k) >= strtotime($actualStartDate)){
|
||||
$newAtSummary[$k] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
return $newAtSummary;
|
||||
}
|
||||
|
||||
public function getData($atts, $actualStartDate, $aggregate = false){
|
||||
$atSummary = $this->createAttendanceSummary($atts);
|
||||
$overtime = $this->calculateOvertime($this->removeAdditionalDays($atSummary, $actualStartDate));
|
||||
if($aggregate){
|
||||
$overtime = $this->aggregateData($overtime);
|
||||
return $this->convertToHoursAggregated($overtime);
|
||||
}else{
|
||||
return $this->convertToHours($overtime);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function getDataSeconds($atts, $actualStartDate, $aggregate = false){
|
||||
$atSummary = $this->createAttendanceSummary($atts);
|
||||
$overtime = $this->calculateOvertime($this->removeAdditionalDays($atSummary, $actualStartDate));
|
||||
if($aggregate){
|
||||
$overtime = $this->aggregateData($overtime);
|
||||
return $overtime;
|
||||
}else{
|
||||
return $overtime;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function convertToHours($overtime){
|
||||
foreach($overtime as $k=>$v){
|
||||
$overtime[$k]['t'] = $this->convertToHoursAndMinutes($overtime[$k]['t']);
|
||||
$overtime[$k]['r'] = $this->convertToHoursAndMinutes($overtime[$k]['r']);
|
||||
$overtime[$k]['o'] = $this->convertToHoursAndMinutes($overtime[$k]['o']);
|
||||
$overtime[$k]['d'] = $this->convertToHoursAndMinutes($overtime[$k]['d']);
|
||||
}
|
||||
|
||||
return $overtime;
|
||||
}
|
||||
|
||||
public function convertToHoursAggregated($overtime){
|
||||
$overtime['t'] = $this->convertToHoursAndMinutes($overtime['t']);
|
||||
$overtime['r'] = $this->convertToHoursAndMinutes($overtime['r']);
|
||||
$overtime['o'] = $this->convertToHoursAndMinutes($overtime['o']);
|
||||
$overtime['d'] = $this->convertToHoursAndMinutes($overtime['d']);
|
||||
|
||||
return $overtime;
|
||||
}
|
||||
|
||||
protected function aggregateData($overtime){
|
||||
$ag = array("t"=>0,"r"=>0,"o"=>0,"d"=>0);
|
||||
foreach($overtime as $k=>$v){
|
||||
$ag['t'] += $v['t'];
|
||||
$ag['r'] += $v['r'];
|
||||
$ag['o'] += $v['o'];
|
||||
$ag['d'] += $v['d'];
|
||||
}
|
||||
|
||||
return $ag;
|
||||
}
|
||||
|
||||
public function convertToHoursAndMinutes($val){
|
||||
$sec = $val % 60;
|
||||
$minutesTot = ($val - $sec)/60;
|
||||
|
||||
$minutes = $minutesTot % 60;
|
||||
$hours = ($minutesTot - $minutes)/60;
|
||||
|
||||
if($hours < 10){
|
||||
$hours = "0".$hours;
|
||||
}
|
||||
if($minutes < 10){
|
||||
$minutes = "0".$minutes;
|
||||
}
|
||||
|
||||
return $hours.":".$minutes;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (!class_exists('CaliforniaOvertimeCalculator')) {
|
||||
|
||||
class CaliforniaOvertimeCalculator extends BasicOvertimeCalculator{
|
||||
|
||||
public function getData($atts, $actualStartDate, $aggregate = false){
|
||||
|
||||
if(count($atts) == 0){
|
||||
return array();
|
||||
}
|
||||
|
||||
$atSummary = $this->createAttendanceSummary($atts);
|
||||
$overtime = $this->calculateOvertime($atSummary);
|
||||
|
||||
$workWeekStartDate = SettingsManager::getInstance()->getSetting('Attendance: Work Week Start Day');
|
||||
|
||||
//TODO - just assume a work week from Sunday to Saturday
|
||||
|
||||
//Find first Sunday in array
|
||||
$firstDate = null;
|
||||
//Find double time days (7th work day of a week without a break)
|
||||
$doubleTimeDates = array();
|
||||
$prvDate = null;
|
||||
$consecutiveWorkDays = 1;
|
||||
foreach($overtime as $k=>$v){
|
||||
if($firstDate == null) {
|
||||
$dw = date("w", strtotime($k));
|
||||
if ($dw == $workWeekStartDate) {
|
||||
$firstDate = $k;
|
||||
}
|
||||
}
|
||||
|
||||
if($firstDate != null){
|
||||
if($prvDate != null && date('Y-m-d', strtotime('-1 day',strtotime($k))) == $prvDate){
|
||||
|
||||
$consecutiveWorkDays++;
|
||||
if($consecutiveWorkDays == 7){
|
||||
//This is a double time day
|
||||
$overtime[$k]['d'] = $overtime[$k]['d'] + $overtime[$k]['o'];
|
||||
$overtime[$k]['o'] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//Resetting $consecutiveWorkDays at the start of the work week
|
||||
if($prvDate != null && date( "w", strtotime($k)) == $workWeekStartDate){
|
||||
$consecutiveWorkDays = 1;
|
||||
$prvDate = null;
|
||||
}
|
||||
|
||||
$prvDate = $k;
|
||||
}
|
||||
}
|
||||
|
||||
$overtime = $this->removeAdditionalDays($overtime, $actualStartDate);
|
||||
if($aggregate){
|
||||
$overtime = $this->aggregateData($overtime);
|
||||
return $this->convertToHoursAggregated($overtime);
|
||||
}else{
|
||||
return $this->convertToHours($overtime);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
18
ext/admin/attendance/dashboard.html
Normal file
18
ext/admin/attendance/dashboard.html
Normal file
@@ -0,0 +1,18 @@
|
||||
<div class="col-lg-3 col-xs-12">
|
||||
<div class="small-box bg-yellow">
|
||||
<div class="inner">
|
||||
<h3>
|
||||
Attendance
|
||||
</h3>
|
||||
<p id="numberOfAttendanceLastWeek">
|
||||
#_numberOfAttendanceLastWeek_# Entries Last Week
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-clock"></i>
|
||||
</div>
|
||||
<a href="#_moduleLink_#" class="small-box-footer" id="attendanceLink">
|
||||
Monitor Attendance <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -4,6 +4,7 @@
|
||||
"order":"8",
|
||||
"icon":"fa-clock-o",
|
||||
"user_levels":["Admin","Manager"],
|
||||
"dashboardPosition":5,
|
||||
|
||||
"permissions":
|
||||
{}
|
||||
|
||||
@@ -20,6 +20,14 @@ if (!class_exists('Company_structureAdminManager')) {
|
||||
|
||||
$this->addModelClass('CompanyStructure');
|
||||
}
|
||||
|
||||
public function getDashboardItemData(){
|
||||
$data = array();
|
||||
$company = new CompanyStructure();
|
||||
$data['numberOfCompanyStuctures'] = $company->Count("1 = 1");
|
||||
return $data;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -48,6 +56,37 @@ if (!class_exists('CompanyStructure')) {
|
||||
|
||||
return new IceResponse(IceResponse::SUCCESS,"");
|
||||
}
|
||||
|
||||
public static function getAllChildCompanyStructures($companyStructureId){
|
||||
$structures = array();
|
||||
$companyStructure = new CompanyStructure();
|
||||
$companyStructure->Load("id = ?",array($companyStructureId));
|
||||
|
||||
if($companyStructure->id != $companyStructureId || empty($companyStructure->id)){
|
||||
return new IceResponse(IceResponse::ERROR, array());
|
||||
}
|
||||
|
||||
self::getChildCompanyStructures($companyStructure, $structures);
|
||||
|
||||
$structures[$companyStructure->id] = $companyStructure;
|
||||
|
||||
return new IceResponse(IceResponse::SUCCESS, array_values($structures));
|
||||
|
||||
}
|
||||
|
||||
private static function getChildCompanyStructures($companyStructure, &$structures){
|
||||
$child = new CompanyStructure();
|
||||
$children = $child->Find("parent = ?",array($companyStructure->id));
|
||||
if(!empty($children)){
|
||||
foreach($children as $c){
|
||||
if(isset($structures[$c->id])){
|
||||
continue;
|
||||
}
|
||||
$structures[$c->id] = $c;
|
||||
self::getChildCompanyStructures($c, $structures);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
17
ext/admin/company_structure/dashboard.html
Normal file
17
ext/admin/company_structure/dashboard.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<div class="col-lg-3 col-xs-12">
|
||||
|
||||
<div class="small-box bg-green">
|
||||
<div class="inner">
|
||||
<h3>Company</h3>
|
||||
<p id="numberOfCompanyStuctures">
|
||||
#_numberOfCompanyStuctures_# Departments
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-shuffle"></i>
|
||||
</div>
|
||||
<a href="#_moduleLink_#" class="small-box-footer" id="companyLink">
|
||||
Manage Company <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -41,8 +41,8 @@ CompanyStructureAdapter.method('getFormFields', function() {
|
||||
[ "description", {"label":"Details","type":"textarea","validation":""}],
|
||||
[ "address", {"label":"Address","type":"textarea","validation":"none"}],
|
||||
[ "type", {"label":"Type","type":"select","source":[["Company","Company"],["Head Office","Head Office"],["Regional Office","Regional Office"],["Department","Department"],["Unit","Unit"],["Sub Unit","Sub Unit"],["Other","Other"]]}],
|
||||
[ "country", {"label":"Country","type":"select","remote-source":["Country","code","name"]}],
|
||||
[ "timezone", {"label":"Time Zone","type":"select","allow-null":false,"remote-source":["Timezone","name","details"]}],
|
||||
[ "country", {"label":"Country","type":"select2","remote-source":["Country","code","name"]}],
|
||||
[ "timezone", {"label":"Time Zone","type":"select2","allow-null":false,"remote-source":["Timezone","name","details"]}],
|
||||
[ "parent", {"label":"Parent Structure","type":"select","allow-null":true,"remote-source":["CompanyStructure","id","title"]}]
|
||||
];
|
||||
});
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
{
|
||||
"label":"Company Structure",
|
||||
"menu":"Admin",
|
||||
"order":"2",
|
||||
"icon":"fa-building-o",
|
||||
"user_levels":["Admin","Manager"],
|
||||
"label":"Company Structure",
|
||||
"menu":"Admin",
|
||||
"order":"2",
|
||||
"icon":"fa-building-o",
|
||||
"user_levels":["Admin","Manager"],
|
||||
"dashboardPosition":2,
|
||||
|
||||
"permissions":
|
||||
{
|
||||
"Manager":{
|
||||
"Add Company Structure":"No",
|
||||
"Edit Company Structure":"No",
|
||||
"Delete Company Structure":"No"
|
||||
}
|
||||
}
|
||||
"permissions":
|
||||
{
|
||||
"Manager":{
|
||||
"Add Company Structure":"No",
|
||||
"Edit Company Structure":"No",
|
||||
"Delete Company Structure":"No"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -40,13 +40,26 @@ class DashboardActionManager extends SubActionManager{
|
||||
|
||||
$attendance = new Attendance();
|
||||
$data['numberOfAttendanceLastWeek'] = $attendance->Count("in_time > '".date("Y-m-d H:i:s",strtotime("-1 week"))."'");
|
||||
if(empty($data['numberOfAttendanceLastWeek'])){
|
||||
$data['numberOfAttendanceLastWeek'] = 0;
|
||||
}
|
||||
|
||||
$data['numberOfLeaves'] = 0;
|
||||
|
||||
$empLeave = new EmployeeLeave();
|
||||
$data['numberOfLeaves'] = $empLeave->Count("date_start > '".date("Y-m-d")."'");
|
||||
|
||||
$timeEntry = new EmployeeTimeEntry();
|
||||
$data['numberOfAttendanceLastWeek'] = $attendance->Count("in_time > '".date("Y-m-d H:i:s",strtotime("-1 week"))."'");
|
||||
|
||||
|
||||
$data['numberOfAttendanceLastWeek'] = $timeEntry->Count("in_time > '".date("Y-m-d H:i:s",strtotime("-1 week"))."'");
|
||||
|
||||
$candidate = new Candidate();
|
||||
$data['numberOfCandidates'] = $candidate->Count("1 = 1");
|
||||
|
||||
$job = new Job();
|
||||
$data['numberOfJobs'] = $job->Count("status = 'Active'");
|
||||
|
||||
$course = new Course();
|
||||
$data['numberOfCourses'] = $course->Count("1 = 1");
|
||||
|
||||
return new IceResponse(IceResponse::SUCCESS,$data);
|
||||
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ along with iCE Hrm. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
------------------------------------------------------------------
|
||||
|
||||
Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
|
||||
Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
|
||||
Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
|
||||
*/
|
||||
|
||||
@@ -25,192 +25,39 @@ $moduleName = 'dashboard';
|
||||
define('MODULE_PATH',dirname(__FILE__));
|
||||
include APP_BASE_PATH.'header.php';
|
||||
include APP_BASE_PATH.'modulejslibs.inc.php';
|
||||
|
||||
?><div class="span9">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-3 col-xs-12">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-aqua">
|
||||
<div class="inner">
|
||||
<h3>
|
||||
People
|
||||
</h3>
|
||||
<p id="numberOfEmployees">
|
||||
.. Employees
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-person-stalker"></i>
|
||||
</div>
|
||||
<a href="#" class="small-box-footer" id="employeeLink">
|
||||
Manage Employees <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div><!-- ./col -->
|
||||
<div class="col-lg-3 col-xs-12">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-green">
|
||||
<div class="inner">
|
||||
<h3 id="numberOfCompanyStuctures">..</h3>
|
||||
<p >
|
||||
Company Structures
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-shuffle"></i>
|
||||
</div>
|
||||
<a href="#" class="small-box-footer" id="companyLink">
|
||||
Manage Company <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div><!-- ./col -->
|
||||
<div class="col-lg-3 col-xs-12">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-yellow">
|
||||
<div class="inner">
|
||||
<h3>Users</h3>
|
||||
<p id="numberOfUsers">
|
||||
.. Users
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-person-add"></i>
|
||||
</div>
|
||||
<a href="#" class="small-box-footer" id="usersLink">
|
||||
Manage Users <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div><!-- ./col -->
|
||||
<div class="col-lg-3 col-xs-12">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-red">
|
||||
<div class="inner">
|
||||
<h3 id="numberOfProjects">..</h3>
|
||||
<p>
|
||||
Active Projects
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-pie-graph"></i>
|
||||
</div>
|
||||
<a href="#" class="small-box-footer" id="projectsLink">
|
||||
Update Clients/Projects <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div><!-- ./col -->
|
||||
<div class="row">
|
||||
<?php
|
||||
$moduleManagers = BaseService::getInstance()->getModuleManagers();
|
||||
$dashBoardList = array();
|
||||
foreach($moduleManagers as $moduleManagerObj){
|
||||
|
||||
<div class="col-lg-3 col-xs-12">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-yellow">
|
||||
<div class="inner">
|
||||
<h3>
|
||||
Attendance
|
||||
</h3>
|
||||
<p id="numberOfAttendanceLastWeek">
|
||||
.. Entries Last Week
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-clock"></i>
|
||||
</div>
|
||||
<a href="#" class="small-box-footer" id="attendanceLink">
|
||||
Monitor Attendance <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div><!-- ./col -->
|
||||
<div class="col-lg-3 col-xs-12">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-teal">
|
||||
<div class="inner">
|
||||
<h3>Reports</h3>
|
||||
<p>
|
||||
View / Download Reports
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-document-text"></i>
|
||||
</div>
|
||||
<a href="#" class="small-box-footer" id="reportsLink">
|
||||
Create a Report <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div><!-- ./col -->
|
||||
<div class="col-lg-3 col-xs-12">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-green">
|
||||
<div class="inner">
|
||||
<h3>Settings</h3>
|
||||
<p>
|
||||
Configure IceHrm
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-settings"></i>
|
||||
</div>
|
||||
<a href="#" class="small-box-footer" id="settingsLink">
|
||||
Update Settings <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div><!-- ./col -->
|
||||
<div class="col-lg-3 col-xs-12">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-red">
|
||||
<div class="inner">
|
||||
<h3>
|
||||
Travel
|
||||
</h3>
|
||||
<p id="numberOfTravel">
|
||||
Requests
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-plane"></i>
|
||||
</div>
|
||||
<a href="#" class="small-box-footer" id="travelLink">
|
||||
Manage Travel <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-xs-12">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-yellow">
|
||||
<div class="inner">
|
||||
<h3>
|
||||
Help
|
||||
</h3>
|
||||
<p>
|
||||
User Guide
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-help"></i>
|
||||
</div>
|
||||
<a href="http://blog.icehrm.com/docs/home/" target="_blank" class="small-box-footer" id="icehrmHelpLink">
|
||||
Documentation <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-xs-12">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-red">
|
||||
<div class="inner">
|
||||
<h3>
|
||||
Purchase
|
||||
</h3>
|
||||
<p>
|
||||
Additional Modules
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-ios-cart"></i>
|
||||
</div>
|
||||
<a href="http://icehrm.com/modules.php" target="_blank" class="small-box-footer">
|
||||
From Icehrm.com <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
//Check if this is not an admin module
|
||||
if($moduleManagerObj->getModuleType() != 'admin'){
|
||||
continue;
|
||||
}
|
||||
|
||||
$allowed = BaseService::getInstance()->isModuleAllowedForUser($moduleManagerObj);
|
||||
|
||||
if(!$allowed){
|
||||
continue;
|
||||
}
|
||||
|
||||
$item = $moduleManagerObj->getDashboardItem();
|
||||
if(!empty($item)) {
|
||||
$index = $moduleManagerObj->getDashboardItemIndex();
|
||||
$dashBoardList[$index] = $item;
|
||||
}
|
||||
}
|
||||
|
||||
ksort($dashBoardList);
|
||||
|
||||
foreach($dashBoardList as $k=>$v){
|
||||
echo $v;
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div id="iceannon">
|
||||
<div class="callout callout-danger lead" style="font-size: 14px;font-weight: bold;">
|
||||
<h4>Why not upgrade to IceHrm Pro Version</h4>
|
||||
@@ -227,40 +74,25 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<script>
|
||||
var modJsList = new Array();
|
||||
var modJsList = new Array();
|
||||
|
||||
modJsList['tabDashboard'] = new DashboardAdapter('Dashboard','Dashboard');
|
||||
modJsList['tabDashboard'] = new DashboardAdapter('Dashboard','Dashboard');
|
||||
|
||||
var modJs = modJsList['tabDashboard'];
|
||||
var modJs = modJsList['tabDashboard'];
|
||||
|
||||
$("#employeeLink").attr("href",modJs.getCustomUrl('?g=admin&n=employees&m=admin_Admin'));
|
||||
$("#companyLink").attr("href",modJs.getCustomUrl('?g=admin&n=company_structure&m=admin_Admin'));
|
||||
$("#usersLink").attr("href",modJs.getCustomUrl('?g=admin&n=users&m=admin_System'));
|
||||
$("#projectsLink").attr("href",modJs.getCustomUrl('?g=admin&n=projects&m=admin_Admin'));
|
||||
$("#attendanceLink").attr("href",modJs.getCustomUrl('?g=admin&n=attendance&m=admin_Admin'));
|
||||
$("#leaveLink").attr("href",modJs.getCustomUrl('?g=admin&n=leaves&m=admin_Admin'));
|
||||
$("#reportsLink").attr("href",modJs.getCustomUrl('?g=admin&n=reports&m=admin_Reports'));
|
||||
$("#settingsLink").attr("href",modJs.getCustomUrl('?g=admin&n=settings&m=admin_System'));
|
||||
$("#travelLink").attr("href",modJs.getCustomUrl('?g=admin&n=travel&m=admin_Employees'));
|
||||
|
||||
|
||||
modJs.getInitData();
|
||||
|
||||
$(document).ready(function(){
|
||||
try{
|
||||
$.ajax({
|
||||
url : "https://icehrm-public.s3.amazonaws.com/icehrmnews.html",
|
||||
success : function(result){
|
||||
$('#iceannon').html(result);
|
||||
}
|
||||
});
|
||||
}catch(e){}
|
||||
|
||||
});
|
||||
$(document).ready(function() {
|
||||
try {
|
||||
$.ajax({
|
||||
url: "https://icehrm-public.s3.amazonaws.com/icehrmnews.html",
|
||||
success: function (result) {
|
||||
$('#iceannon').html(result);
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
@@ -62,13 +62,16 @@ DashboardAdapter.method('getInitData', function() {
|
||||
DashboardAdapter.method('getInitDataSuccessCallBack', function(data) {
|
||||
|
||||
$("#numberOfEmployees").html(data['numberOfEmployees']+" Employees");
|
||||
$("#numberOfCompanyStuctures").html(data['numberOfCompanyStuctures']);
|
||||
$("#numberOfCompanyStuctures").html(data['numberOfCompanyStuctures']+" Departments");
|
||||
$("#numberOfUsers").html(data['numberOfUsers']+" Users");
|
||||
$("#numberOfProjects").html(data['numberOfProjects']);
|
||||
$("#numberOfProjects").html(data['numberOfProjects']+" Active Projects");
|
||||
$("#numberOfAttendanceLastWeek").html(data['numberOfAttendanceLastWeek']+" Entries Last Week");
|
||||
$("#numberOfLeaves").html(data['numberOfLeaves']);
|
||||
$("#numberOfLeaves").html(data['numberOfLeaves']+" Upcoming");
|
||||
$("#numberOfTimeEntries").html(data['numberOfTimeEntries']);
|
||||
|
||||
$("#numberOfCandidates").html(data['numberOfCandidates']+" Candidates");
|
||||
$("#numberOfJobs").html(data['numberOfJobs']+" Active");
|
||||
$("#numberOfCourses").html(data['numberOfCourses']+" Courses");
|
||||
|
||||
});
|
||||
|
||||
DashboardAdapter.method('getInitDataFailCallBack', function(callBackData) {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"menu":"Admin",
|
||||
"order":"1",
|
||||
"icon":"fa-desktop",
|
||||
"user_levels":["Admin"],
|
||||
"user_levels":["Admin","Other"],
|
||||
|
||||
"permissions":
|
||||
{
|
||||
|
||||
7
ext/admin/employees/README.txt
Normal file
7
ext/admin/employees/README.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
This module is licensed under IceHrm Commercial License, which can be found in LICENSE.txt.
|
||||
You are allowed to make any modification required to these module, but only allowed to use
|
||||
the module in one production server (even with modifications).
|
||||
|
||||
Installation
|
||||
------------
|
||||
Copy this module into <icehrm path>/admin/ directory
|
||||
164
ext/admin/employees/api/EmployeesActionManager.php
Normal file
164
ext/admin/employees/api/EmployeesActionManager.php
Normal file
@@ -0,0 +1,164 @@
|
||||
<?php
|
||||
class EmployeesActionManager extends SubActionManager{
|
||||
|
||||
public function terminateEmployee($req){
|
||||
$employee = new Employee();
|
||||
$employee->Load("id = ?",array($req->id));
|
||||
|
||||
if(empty($employee->id)){
|
||||
return new IceResponse(IceResponse::ERROR, "Employee Not Found");
|
||||
}
|
||||
|
||||
$employee->termination_date = date('Y-m-d H:i:s');
|
||||
$employee->status = 'Terminated';
|
||||
|
||||
$ok = $employee->Save();
|
||||
if(!$ok){
|
||||
return new IceResponse(IceResponse::ERROR, "Error occured while terminating employee");
|
||||
}
|
||||
|
||||
return new IceResponse(IceResponse::SUCCESS, $employee);
|
||||
|
||||
//$user = BaseService::getInstance()->getUserFromProfileId($employee->id);
|
||||
}
|
||||
|
||||
public function activateEmployee($req){
|
||||
$employee = new Employee();
|
||||
$employee->Load("id = ?",array($req->id));
|
||||
|
||||
if(empty($employee->id)){
|
||||
return new IceResponse(IceResponse::ERROR, "Employee Not Found");
|
||||
}
|
||||
|
||||
$employee->termination_date = NULL;
|
||||
$employee->status = 'Active';
|
||||
|
||||
$ok = $employee->Save();
|
||||
if(!$ok){
|
||||
return new IceResponse(IceResponse::ERROR, "Error occured while activating employee");
|
||||
}
|
||||
|
||||
return new IceResponse(IceResponse::SUCCESS, $employee);
|
||||
|
||||
//$user = BaseService::getInstance()->getUserFromProfileId($employee->id);
|
||||
}
|
||||
|
||||
public function deleteEmployee($req){
|
||||
|
||||
$employee = new Employee();
|
||||
$employee->Load("id = ?",array($req->id));
|
||||
|
||||
if(empty($employee->id)){
|
||||
return new IceResponse(IceResponse::ERROR, "Employee Not Found");
|
||||
}
|
||||
|
||||
$archived = new ArchivedEmployee();
|
||||
$archived->ref_id = $employee->id;
|
||||
$archived->employee_id = $employee->employee_id;
|
||||
$archived->first_name = $employee->first_name;
|
||||
$archived->last_name = $employee->last_name;
|
||||
$archived->gender = $employee->gender;
|
||||
$archived->ssn_num = $employee->ssn_num;
|
||||
$archived->nic_num = $employee->nic_num;
|
||||
$archived->other_id = $employee->other_id;
|
||||
$archived->work_email = $employee->work_email;
|
||||
$archived->joined_date = $employee->joined_date;
|
||||
$archived->confirmation_date = $employee->confirmation_date;
|
||||
$archived->supervisor = $employee->supervisor;
|
||||
$archived->department = $employee->department;
|
||||
$archived->termination_date = $employee->termination_date;
|
||||
$archived->notes = $employee->notes;
|
||||
|
||||
//$archived = BaseService::getInstance()->cleanUpAdoDB($archived);
|
||||
|
||||
$mapping = '{"nationality":["Nationality","id","name"],"employment_status":["EmploymentStatus","id","name"],"job_title":["JobTitle","id","name"],"pay_grade":["PayGrade","id","name"],"country":["Country","code","name"],"province":["Province","id","name"],"department":["CompanyStructure","id","title"],"supervisor":["Employee","id","first_name+last_name"]}';
|
||||
|
||||
$employeeEnriched = BaseService::getInstance()->getElement('Employee',$employee->id,$mapping,true);
|
||||
$employeeEnriched = BaseService::getInstance()->cleanUpAdoDB($employeeEnriched);
|
||||
|
||||
$data = new stdClass();
|
||||
$data->enrichedEmployee = $employeeEnriched;
|
||||
|
||||
$data->timesheets = $this->getEmployeeData($employee->id, new EmployeeTimeSheet());
|
||||
$data->timesheetEntries = $this->getEmployeeData($employee->id, new EmployeeTimeEntry());
|
||||
$data->attendance = $this->getEmployeeData($employee->id, new Attendance());
|
||||
$data->documents = $this->getEmployeeData($employee->id, new EmployeeDocument());
|
||||
if(class_exists('EmployeeTrainingSession')){
|
||||
$data->trainingSessions = $this->getEmployeeData($employee->id, new EmployeeTrainingSession());
|
||||
}
|
||||
$data->travelRecords = $this->getEmployeeData($employee->id, new EmployeeTravelRecord());
|
||||
$data->qualificationSkills = $this->getEmployeeData($employee->id, new EmployeeSkill());
|
||||
$data->qualificationEducation = $this->getEmployeeData($employee->id, new EmployeeEducation());
|
||||
$data->qualificationCertifications = $this->getEmployeeData($employee->id, new EmployeeCertification());
|
||||
$data->qualificationLanguages = $this->getEmployeeData($employee->id, new EmployeeLanguage());
|
||||
$data->salary = $this->getEmployeeData($employee->id, new EmployeeSalary());
|
||||
$data->dependants = $this->getEmployeeData($employee->id, new EmployeeDependent());
|
||||
$data->emergencyContacts = $this->getEmployeeData($employee->id, new EmergencyContact());
|
||||
$data->projects = $this->getEmployeeData($employee->id, new EmployeeProject());
|
||||
$data->leaves = $this->getEmployeeData($employee->id, new EmployeeLeave());
|
||||
$data->leaveDays = $this->getEmployeeData($employee->id, new EmployeeLeaveDay());
|
||||
|
||||
$archived->data = json_encode($data, JSON_PRETTY_PRINT);
|
||||
|
||||
$ok = $archived->Save();
|
||||
if(!$ok){
|
||||
return new IceResponse(IceResponse::ERROR, "Error occured while archiving employee");
|
||||
}
|
||||
|
||||
$ok = $employee->Delete();
|
||||
if(!$ok){
|
||||
return new IceResponse(IceResponse::ERROR, "Error occured while deleting employee");
|
||||
}
|
||||
|
||||
return new IceResponse(IceResponse::SUCCESS, $archived);
|
||||
}
|
||||
|
||||
public function downloadArchivedEmployee($req){
|
||||
|
||||
|
||||
if($this->baseService->currentUser->user_level != 'Admin'){
|
||||
echo "Error: Permission denied";
|
||||
exit();
|
||||
}
|
||||
|
||||
$employee = new ArchivedEmployee();
|
||||
$employee->Load("id = ?",array($req->id));
|
||||
|
||||
if(empty($employee->id)){
|
||||
return new IceResponse(IceResponse::ERROR, "Employee Not Found");
|
||||
}
|
||||
|
||||
$employee->data = json_decode($employee->data);
|
||||
$employee = $this->baseService->cleanUpAdoDB($employee);
|
||||
|
||||
$str = json_encode($employee, JSON_PRETTY_PRINT);
|
||||
|
||||
$filename = uniqid();
|
||||
$file = fopen("/tmp/".$filename,"w");
|
||||
fwrite($file,$str);
|
||||
fclose($file);
|
||||
|
||||
$downloadFileName = "employee_".$employee->id."_".str_replace(" ", "_", $employee->first_name)."_".str_replace(" ", "_", $employee->last_name).".txt";
|
||||
|
||||
header("Pragma: public"); // required
|
||||
header("Expires: 0");
|
||||
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
|
||||
header("Content-Description: File Transfer");
|
||||
header("Content-Type: image/jpg");
|
||||
header('Content-Disposition: attachment; filename="'.$downloadFileName.'"');
|
||||
header("Content-Transfer-Encoding: binary");
|
||||
header("Content-Length: ".filesize("/tmp/".$filename));
|
||||
readfile("/tmp/".$filename);
|
||||
exit();
|
||||
|
||||
}
|
||||
|
||||
private function getEmployeeData($id, $obj){
|
||||
$data = array();
|
||||
$objs = $obj->Find("employee = ?",array($id));
|
||||
foreach($objs as $entry){
|
||||
$data[] = BaseService::getInstance()->cleanUpAdoDB($entry);
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,18 @@ if (!class_exists('EmployeesAdminManager')) {
|
||||
|
||||
}
|
||||
|
||||
public function setupRestEndPoints(){
|
||||
\NoahBuscher\Macaw\Macaw::get(REST_API_PATH.'employee/(:any)', function($pathParams) {
|
||||
$empRestEndPoint = new EmployeeRestEndPoint();
|
||||
$empRestEndPoint->process('get',$pathParams);
|
||||
});
|
||||
|
||||
\NoahBuscher\Macaw\Macaw::get(REST_API_PATH.'employees', function() {
|
||||
$empRestEndPoint = new EmployeesRestEndPoint();
|
||||
$empRestEndPoint->process('get',NULL);
|
||||
});
|
||||
}
|
||||
|
||||
public function initializeDatabaseErrorMappings(){
|
||||
$this->addDatabaseErrorMapping('CONSTRAINT `Fk_User_Employee` FOREIGN KEY',"Can not delete Employee, please delete the User for this employee first.");
|
||||
$this->addDatabaseErrorMapping("Duplicate entry|for key 'employee'","A duplicate entry found");
|
||||
@@ -20,52 +32,308 @@ if (!class_exists('EmployeesAdminManager')) {
|
||||
$this->addModelClass('EmploymentStatus');
|
||||
}
|
||||
|
||||
public function getDashboardItemData(){
|
||||
$data = array();
|
||||
$emp = new Employee();
|
||||
$data['numberOfEmployees'] = $emp->Count("1 = 1");
|
||||
|
||||
return $data;
|
||||
|
||||
}
|
||||
|
||||
public function initQuickAccessMenu(){
|
||||
UIManager::getInstance()->addQuickAccessMenuItem("View Employees","fa-users",CLIENT_BASE_URL."?g=admin&n=employees&m=admin_Employees",array("Admin","Manager"));
|
||||
UIManager::getInstance()->addQuickAccessMenuItem("Add a New Employee","fa-edit",CLIENT_BASE_URL."?g=admin&n=employees&m=admin_Employees&action=new",array("Admin"));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (!class_exists('Employee')) {
|
||||
class Employee extends ICEHRM_Record {
|
||||
|
||||
|
||||
var $oldObj = null;
|
||||
var $oldObjOrig = null;
|
||||
var $historyUpdateList = array();
|
||||
var $historyFieldsToTrack = array(
|
||||
"employee_id"=>"employee_id",
|
||||
"first_name"=>"first_name",
|
||||
"middle_name"=>"middle_name",
|
||||
"last_name"=>"last_name",
|
||||
"nationality"=>"nationality_Name",
|
||||
"birthday"=>"birthday",
|
||||
"gender"=>"gender",
|
||||
"marital_status"=>"marital_status",
|
||||
"ssn_num"=>"ssn_num",
|
||||
"nic_num"=>"nic_num",
|
||||
"other_id"=>"other_id",
|
||||
"employment_status"=>"employment_status_Name",
|
||||
"job_title"=>"job_title_Name",
|
||||
"pay_grade"=>"pay_grade_Name",
|
||||
"work_station_id"=>"work_station_id",
|
||||
"address1"=>"address1",
|
||||
"address2"=>"address2",
|
||||
"city"=>"city_Name",
|
||||
"country"=>"country_Name",
|
||||
"province"=>"province_Name",
|
||||
"postal_code"=>"postal_code",
|
||||
"home_phone"=>"home_phone",
|
||||
"mobile_phone"=>"mobile_phone",
|
||||
"work_phone"=>"work_phone",
|
||||
"work_email"=>"work_email",
|
||||
"private_email"=>"private_email",
|
||||
"joined_date"=>"joined_date",
|
||||
"confirmation_date"=>"confirmation_date",
|
||||
"supervisor"=>"supervisor_Name",
|
||||
"indirect_supervisors"=>"indirect_supervisors",
|
||||
"department"=>"department_Name"
|
||||
);
|
||||
|
||||
public function getAdminAccess(){
|
||||
return array("get","element","save","delete");
|
||||
}
|
||||
|
||||
|
||||
public function getManagerAccess(){
|
||||
return array("get","element","save");
|
||||
}
|
||||
|
||||
|
||||
public function getUserAccess(){
|
||||
return array("get");
|
||||
}
|
||||
|
||||
|
||||
public function getUserOnlyMeAccess(){
|
||||
return array("element","save");
|
||||
}
|
||||
|
||||
|
||||
public function getUserOnlyMeAccessField(){
|
||||
return "id";
|
||||
}
|
||||
|
||||
|
||||
|
||||
private function initHistory($obj){
|
||||
|
||||
$oldObjOrig = new Employee();
|
||||
$oldObjOrig->Load("id = ?",array($obj->id));
|
||||
$this->oldObjOrig = $oldObjOrig;
|
||||
|
||||
$mapping = '{"nationality":["Nationality","id","name"],"employment_status":["EmploymentStatus","id","name"],"job_title":["JobTitle","id","name"],"pay_grade":["PayGrade","id","name"],"country":["Country","code","name"],"province":["Province","id","name"],"department":["CompanyStructure","id","title"],"supervisor":["Employee","id","first_name+last_name"]}';
|
||||
|
||||
$this->oldObj = BaseService::getInstance()->getElement('Employee',$obj->id,$mapping,true);
|
||||
|
||||
}
|
||||
|
||||
private function saveHistory($obj){
|
||||
|
||||
$oldObj = $this->oldObj;
|
||||
$oldObjOrig = $this->oldObjOrig;
|
||||
|
||||
$mapping = '{"nationality":["Nationality","id","name"],"employment_status":["EmploymentStatus","id","name"],"job_title":["JobTitle","id","name"],"pay_grade":["PayGrade","id","name"],"country":["Country","code","name"],"province":["Province","id","name"],"department":["CompanyStructure","id","title"],"supervisor":["Employee","id","first_name+last_name"]}';
|
||||
|
||||
$objEnriched = BaseService::getInstance()->getElement('Employee',$obj->id,$mapping,true);
|
||||
|
||||
foreach($this->historyFieldsToTrack as $k => $v){
|
||||
|
||||
if(empty($oldObjOrig->$k) && $obj->$k = '[]'){
|
||||
continue;
|
||||
}
|
||||
|
||||
if(empty($obj->$k) && $oldObjOrig->$k = '0000-00-00'){
|
||||
continue;
|
||||
}
|
||||
|
||||
if($oldObjOrig->$k != $obj->$k){
|
||||
|
||||
$enrichNewVal = '';
|
||||
$enrichOldVal = '';
|
||||
|
||||
if($k == 'indirect_supervisors'){
|
||||
if(!empty($obj->$k) && $obj->$k != '[]'){
|
||||
$newIndeirectSupervisorIds = json_decode($obj->$k);
|
||||
foreach($newIndeirectSupervisorIds as $id){
|
||||
$item = BaseService::getInstance()->getItemFromCache("Employee", $id);
|
||||
if($enrichNewVal != ""){
|
||||
$enrichNewVal .= ", ";
|
||||
}
|
||||
$enrichNewVal .= $item->first_name." ".$item->last_name;
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($oldObjOrig->$k) && $oldObjOrig->$k != '[]'){
|
||||
$oldIndeirectSupervisorIds = json_decode($oldObjOrig->$k);
|
||||
foreach($oldIndeirectSupervisorIds as $id){
|
||||
$item = BaseService::getInstance()->getItemFromCache("Employee", $id);
|
||||
if($enrichOldVal != ""){
|
||||
$enrichOldVal .= ", ";
|
||||
}
|
||||
$enrichOldVal .= $item->first_name." ".$item->last_name;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$enrichOldVal = $oldObj->$v;
|
||||
$enrichNewVal = $objEnriched->$v;
|
||||
}
|
||||
|
||||
$this->historyUpdateList[] = array($obj->id,$k,$enrichOldVal,$enrichNewVal);
|
||||
}
|
||||
}
|
||||
|
||||
while(count($this->historyUpdateList)){
|
||||
$ele = array_pop($this->historyUpdateList);
|
||||
BaseService::getInstance()->addHistoryItem("Employee","Employee",$ele[0],$ele[1],$ele[2],$ele[3]);
|
||||
}
|
||||
}
|
||||
|
||||
public function executePreSaveActions($obj){
|
||||
if(empty($obj->status)){
|
||||
$obj->status = 'Active';
|
||||
}
|
||||
return new IceResponse(IceResponse::SUCCESS,$obj);
|
||||
}
|
||||
|
||||
public function executePreUpdateActions($obj){
|
||||
$this->initHistory($obj);
|
||||
return new IceResponse(IceResponse::SUCCESS,$obj);
|
||||
}
|
||||
|
||||
public function executePostUpdateActions($obj){
|
||||
$this->saveHistory($obj);
|
||||
}
|
||||
|
||||
public function postProcessGetData($obj){
|
||||
$obj = FileService::getInstance()->updateSmallProfileImage($obj);
|
||||
return $obj;
|
||||
}
|
||||
|
||||
public function getVirtualFields(){
|
||||
return array(
|
||||
"image"
|
||||
);
|
||||
}
|
||||
|
||||
public function getActiveEmployees(){
|
||||
$employee = new Employee();
|
||||
$list = $employee->Find("status = ?",array('Active'));
|
||||
return $list;
|
||||
}
|
||||
|
||||
public function getActiveSubordinateEmployees(){
|
||||
|
||||
$employee = new Employee();
|
||||
if(BaseService::getInstance()->currentUser->user_level != 'Admin'){
|
||||
$cemp = BaseService::getInstance()->getCurrentProfileId();
|
||||
$list = $employee->Find("status = ? and supervisor = ?",array('Active', $cemp));
|
||||
}else{
|
||||
$list = $employee->Find("status = ?",array('Active'));
|
||||
}
|
||||
return $list;
|
||||
}
|
||||
|
||||
public static function cleanEmployeeData($obj){
|
||||
unset($obj->historyFieldsToTrack);
|
||||
unset($obj->historyUpdateList);
|
||||
unset($obj->oldObjOrig);
|
||||
unset($obj->oldObj);
|
||||
unset($obj->oldObj);
|
||||
return $obj;
|
||||
}
|
||||
|
||||
var $_table = 'Employees';
|
||||
}
|
||||
}
|
||||
|
||||
if (!class_exists('ArchivedEmployee')) {
|
||||
class ArchivedEmployee extends ICEHRM_Record {
|
||||
|
||||
public function getAdminAccess(){
|
||||
return array("get","element","save","delete");
|
||||
}
|
||||
|
||||
public function getManagerAccess(){
|
||||
return array("get","element","save");
|
||||
}
|
||||
|
||||
public function getUserAccess(){
|
||||
return array("get");
|
||||
}
|
||||
|
||||
public function getUserOnlyMeAccess(){
|
||||
return array("element","save");
|
||||
}
|
||||
|
||||
public function getUserOnlyMeAccessField(){
|
||||
return "id";
|
||||
}
|
||||
|
||||
var $_table = 'ArchivedEmployees';
|
||||
}
|
||||
}
|
||||
|
||||
if (!class_exists('EmploymentStatus')) {
|
||||
class EmploymentStatus extends ICEHRM_Record {
|
||||
|
||||
|
||||
var $_table = 'EmploymentStatus';
|
||||
|
||||
|
||||
public function getAdminAccess(){
|
||||
return array("get","element","save","delete");
|
||||
}
|
||||
|
||||
|
||||
public function getManagerAccess(){
|
||||
return array("get","element","save");
|
||||
}
|
||||
|
||||
|
||||
public function getUserAccess(){
|
||||
return array();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!class_exists('EmployeeRestEndPoint')) {
|
||||
class EmployeeRestEndPoint extends RestEndPoint{
|
||||
public function get($parameter){
|
||||
if(empty($parameter)){
|
||||
return new IceResponse(IceResponse::ERROR, "Employee ID not provided");
|
||||
}
|
||||
|
||||
$accessTokenValidation = $this->validateAccessToken();
|
||||
if($accessTokenValidation->getStatus() == IceResponse::ERROR){
|
||||
return $accessTokenValidation;
|
||||
}
|
||||
|
||||
$mapping = '{"nationality":["Nationality","id","name"],"ethnicity":["Ethnicity","id","name"],"immigration_status":["ImmigrationStatus","id","name"],"employment_status":["EmploymentStatus","id","name"],"job_title":["JobTitle","id","name"],"pay_grade":["PayGrade","id","name"],"country":["Country","code","name"],"province":["Province","id","name"],"department":["CompanyStructure","id","title"],"supervisor":["Employee","id","first_name+last_name"]}';
|
||||
$employeeResp = BaseService::getInstance()->getElement('Employee',$parameter,$mapping,true);
|
||||
if($employeeResp->getStatus() == IceResponse::SUCCESS){
|
||||
$emp = $employeeResp->getObject();
|
||||
$emp = Employee::cleanEmployeeData($emp);
|
||||
return new IceResponse(IceResponse::SUCCESS,$emp);
|
||||
}
|
||||
return $employeeResp;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (!class_exists('EmployeesRestEndPoint')) {
|
||||
class EmployeesRestEndPoint extends RestEndPoint{
|
||||
public function get($parameter){
|
||||
|
||||
$accessTokenValidation = $this->validateAccessToken();
|
||||
if($accessTokenValidation->getStatus() == IceResponse::ERROR){
|
||||
return $accessTokenValidation;
|
||||
}
|
||||
|
||||
$emp = new Employee();
|
||||
$emps = $emp->Find("1=1");
|
||||
$newEmps = array();
|
||||
foreach($emps as $emp){
|
||||
$newEmps[] = Employee::cleanEmployeeData($emp);
|
||||
}
|
||||
return new IceResponse(IceResponse::SUCCESS, $newEmps);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
248
ext/admin/employees/customTemplates/myDetails.html
Normal file
248
ext/admin/employees/customTemplates/myDetails.html
Normal file
@@ -0,0 +1,248 @@
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-2">
|
||||
<div class="row-fluid">
|
||||
<div class="col-xs-12" style="text-align: center;">
|
||||
<img id="profile_image__id_" src="" class="img-polaroid img-thumbnail" style="max-width: 140px;max-height: 140px;">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-10">
|
||||
<div class="row-fluid">
|
||||
<div class="col-md-12"><h2 id="name"></h2></div>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<div class="col-md-12">
|
||||
<p>
|
||||
<i class="fa fa-phone"></i> <span id="mobile_phone"></span>
|
||||
<i class="fa fa-envelope"></i> <span id="work_email"></span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<div class="col-xs-12" style="font-size:18px;border-bottom: 1px solid #DDD;margin-bottom: 10px;padding-bottom: 10px;">
|
||||
<button id="employeeProfileEditInfo" class="btn btn-small btn-success" onclick="modJs.edit(_id_);" style="margin-right:10px;"><i class="fa fa-edit"></i> Edit Info</button>
|
||||
<button id="employeeUploadProfileImage" onclick="showUploadDialog('profile_image__id_','Upload Profile Image','profile_image',_id_,'profile_image__id_','src','url','image');return false;" class="btn btn-small btn-primary" type="button" style="margin-right:10px;"><i class="fa fa-upload"></i> Upload Profile Image</button>
|
||||
<button id="employeeDeleteProfileImage" onclick="modJs.deleteProfileImage(_id_);return false;" class="btn btn-small btn-warning" type="button" style="margin-right:10px;"><i class="fa fa-times"></i> Delete Profile Image</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row-fluid" style="border-top: 1px;">
|
||||
<div class="col-xs-6 col-md-4" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;font-size:13px;">#_label_employee_id_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="employee_id"></label>
|
||||
</div>
|
||||
<div class="col-xs-6 col-md-4" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_nic_num_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="nic_num"></label>
|
||||
</div>
|
||||
<div class="col-xs-6 col-md-4" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_ssn_num_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="ssn_num"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<ul class="nav nav-tabs" id="subModTab" style="margin-bottom:0px;margin-left:5px;border-bottom: none;">
|
||||
<li class="active"><a id="tabBasic" href="#tabPageBasic">Basic Information</a></li>
|
||||
<li class=""><a id="tabQualifications" href="#tabPageQualifications">Qualifications</a></li>
|
||||
<li class=""><a id="tabDocuments" href="#tabPageDocuments">Documents</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="tabPageBasic" style="border:1px solid #DDD;">
|
||||
<div class="row" style="margin-left:10px;margin-top:20px;">
|
||||
<div class="panel panel-default" style="width:97.5%;">
|
||||
<div class="panel-heading"><h4>Personal Information</h4></div>
|
||||
<div class="panel-body">
|
||||
<div class="row-fluid">
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_driving_license_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="driving_license"></label>
|
||||
</div>
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_other_id_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="other_id"></label>
|
||||
</div>
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_birthday_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="birthday"></label>
|
||||
</div>
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_gender_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="gender"></label>
|
||||
</div>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="row-fluid">
|
||||
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_nationality_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="nationality_Name"></label>
|
||||
</div>
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_marital_status_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="marital_status"></label>
|
||||
</div>
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_joined_date_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="joined_date"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-left:10px;margin-top:20px;">
|
||||
<div class="panel panel-default" style="width:97.5%;">
|
||||
<div class="panel-heading"><h4>Contact Information</h4></div>
|
||||
<div class="panel-body">
|
||||
<div class="row-fluid">
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_address1_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="address1"></label>
|
||||
</div>
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_address2_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="address2"></label>
|
||||
</div>
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_city_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="city"></label>
|
||||
</div>
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_country_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="country_Name"></label>
|
||||
</div>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="row-fluid">
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_postal_code_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="postal_code"></label>
|
||||
</div>
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_home_phone_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="home_phone"></label>
|
||||
</div>
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_work_phone_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="work_phone"></label>
|
||||
</div>
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_private_email_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="private_email"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-left:10px;margin-top:20px;">
|
||||
<div class="panel panel-default" style="width:97.5%;">
|
||||
<div class="panel-heading"><h4>Job Details</h4></div>
|
||||
<div class="panel-body">
|
||||
<div class="row-fluid">
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_job_title_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="job_title_Name"></label>
|
||||
</div>
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_employment_status_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="employment_status_Name"></label>
|
||||
</div>
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_supervisor_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="supervisor_Name"></label>
|
||||
</div>
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">Direct Reports</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="subordinates"></label>
|
||||
</div>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="row-fluid">
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_department_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="department_Name"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="modal" id="adminUsersModel" tabindex="-1" role="dialog" aria-labelledby="messageModelLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-times"/></button>
|
||||
<h3 style="font-size: 17px;">Change User Password</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="adminUsersChangePwd">
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<span class="label label-warning" id="adminUsersChangePwd_error" style="display:none;"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" id="field_newpwd">
|
||||
<label class="control-label" for="newpwd">New Password</label>
|
||||
<div class="controls">
|
||||
<input class="" type="password" id="newpwd" name="newpwd" value="" class="form-control"/>
|
||||
<span class="help-inline" id="help_newpwd"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" id="field_conpwd">
|
||||
<label class="control-label" for="conpwd">Confirm Password</label>
|
||||
<div class="controls">
|
||||
<input class="" type="password" id="conpwd" name="conpwd" value="" class="form-control"/>
|
||||
<span class="help-inline" id="help_conpwd"></span>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-primary" onclick="modJs.changePasswordConfirm();">Change Password</button>
|
||||
<button class="btn" onclick="modJs.closeChangePassword();">Not Now</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- End tabPageBasic -->
|
||||
<div class="tab-pane" id="tabPageQualifications" style="border:1px solid #DDD;">
|
||||
<div class="row" style="margin-top:20px;">
|
||||
<div class="col-md-3">
|
||||
<div id="EmployeeSkillSubTab" class="" data-content="List" style="padding-left:5px;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div id="EmployeeEducationSubTab" class="" data-content="List" style="padding-left:5px;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div id="EmployeeCertificationSubTab" class="" data-content="List" style="padding-left:5px;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div id="EmployeeLanguageSubTab" class="" data-content="List" style="padding-left:5px;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- End tabPageQualifications -->
|
||||
</div>
|
||||
<div class="tab-pane" id="tabPageDocuments" style="border:1px solid #DDD;">
|
||||
<div class="row" style="margin-top:20px;">
|
||||
<div class="col-md-12">
|
||||
<div id="EmployeeDocumentSubTab" class="" data-content="List" style="padding-left:5px;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- End tabPageQualifications -->
|
||||
</div>
|
||||
</div><!-- End tab-content -->
|
||||
19
ext/admin/employees/dashboard.html
Normal file
19
ext/admin/employees/dashboard.html
Normal file
@@ -0,0 +1,19 @@
|
||||
<div class="col-lg-3 col-xs-12">
|
||||
|
||||
<div class="small-box bg-aqua">
|
||||
<div class="inner">
|
||||
<h3>
|
||||
People
|
||||
</h3>
|
||||
<p id="numberOfEmployees">
|
||||
#_numberOfEmployees_# Employees
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-person-stalker"></i>
|
||||
</div>
|
||||
<a href="#_moduleLink_#" class="small-box-footer" id="employeeLink">
|
||||
Manage Employees <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
108
ext/admin/employees/db_update.sql
Normal file
108
ext/admin/employees/db_update.sql
Normal file
@@ -0,0 +1,108 @@
|
||||
ALTER TABLE Employees ADD COLUMN `status` enum('Active','Terminated') default 'Active';
|
||||
|
||||
create table `ArchivedEmployees` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`ref_id` bigint(20) NOT NULL,
|
||||
`employee_id` varchar(50) default null,
|
||||
`first_name` varchar(100) default '' not null,
|
||||
`last_name` varchar(100) default '' not null,
|
||||
`gender` enum('Male','Female') default NULL,
|
||||
`ssn_num` varchar(100) default '',
|
||||
`nic_num` varchar(100) default '',
|
||||
`other_id` varchar(100) default '',
|
||||
`work_email` varchar(100) default null,
|
||||
`joined_date` DATETIME default '0000-00-00 00:00:00',
|
||||
`confirmation_date` DATETIME default '0000-00-00 00:00:00',
|
||||
`supervisor` bigint(20) default null,
|
||||
`department` bigint(20) default null,
|
||||
`termination_date` DATETIME default '0000-00-00 00:00:00',
|
||||
`notes` text default null,
|
||||
`data` longtext default null,
|
||||
primary key (`id`)
|
||||
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
|
||||
create table `FieldNameMappings` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`type` varchar(20) NOT NULL,
|
||||
`name` varchar(20) NOT NULL,
|
||||
`textOrig` varchar(200) default null,
|
||||
`textMapped` varchar(200) default null,
|
||||
`display` enum('Form','Table and Form','Hidden') default 'Form',
|
||||
`created` DATETIME default '0000-00-00 00:00:00',
|
||||
`updated` DATETIME default '0000-00-00 00:00:00',
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
INSERT INTO `FieldNameMappings` (`type`, `name`, `textOrig`, `textMapped`, `display`) VALUES
|
||||
('Employee', 'employee_id', 'Employee Number', 'Employee Number', 'Table and Form'),
|
||||
('Employee', 'first_name', 'First Name', 'First Name', 'Table and Form'),
|
||||
('Employee', 'middle_name', 'Middle Name', 'Middle Name', 'Form'),
|
||||
('Employee', 'last_name', 'Last Name', 'Last Name', 'Table and Form'),
|
||||
('Employee', 'nationality', 'Nationality', 'Nationality', 'Form'),
|
||||
('Employee', 'birthday', 'Date of Birth', 'Date of Birth', 'Form'),
|
||||
('Employee', 'gender', 'Gender', 'Gender', 'Form'),
|
||||
('Employee', 'marital_status', 'Marital Status', 'Marital Status', 'Form'),
|
||||
('Employee', 'ssn_num', 'SSN/NRIC', 'SSN/NRIC', 'Form'),
|
||||
('Employee', 'nic_num', 'NIC', 'NIC', 'Form'),
|
||||
('Employee', 'other_id', 'Other ID', 'Other ID', 'Form'),
|
||||
('Employee', 'driving_license', 'Driving License No', 'Driving License No', 'Form'),
|
||||
('Employee', 'employment_status', 'Employment Status', 'Employment Status', 'Form'),
|
||||
('Employee', 'job_title', 'Job Title', 'Job Title', 'Form'),
|
||||
('Employee', 'pay_grade', 'Pay Grade', 'Pay Grade', 'Form'),
|
||||
('Employee', 'work_station_id', 'Work Station Id', 'Work Station Id', 'Form'),
|
||||
('Employee', 'address1', 'Address Line 1', 'Address Line 1', 'Form'),
|
||||
('Employee', 'address2', 'Address Line 2', 'Address Line 2', 'Form'),
|
||||
('Employee', 'city', 'City', 'City', 'Form'),
|
||||
('Employee', 'country', 'Country', 'Country', 'Form'),
|
||||
('Employee', 'province', 'Province', 'Province', 'Form'),
|
||||
('Employee', 'postal_code', 'Postal/Zip Code', 'Postal/Zip Code', 'Form'),
|
||||
('Employee', 'home_phone', 'Home Phone', 'Home Phone', 'Form'),
|
||||
('Employee', 'mobile_phone', 'Mobile Phone', 'Mobile Phone', 'Table and Form'),
|
||||
('Employee', 'work_phone', 'Work Phone', 'Work Phone', 'Form'),
|
||||
('Employee', 'work_email', 'Work Email', 'Work Email', 'Form'),
|
||||
('Employee', 'private_email', 'Private Email', 'Private Email', 'Form'),
|
||||
('Employee', 'joined_date', 'Joined Date', 'Joined Date', 'Form'),
|
||||
('Employee', 'confirmation_date', 'Confirmation Date', 'Confirmation Date', 'Form'),
|
||||
('Employee', 'termination_date', 'Termination Date', 'Termination Date', 'Form'),
|
||||
('Employee', 'supervisor', 'Supervisor', 'Supervisor', 'Table and Form'),
|
||||
('Employee', 'department', 'Department', 'Department', 'Table and Form'),
|
||||
('Employee', 'notes', 'Notes', 'Notes', 'Form');
|
||||
|
||||
|
||||
create table `CustomFields` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`type` varchar(20) NOT NULL,
|
||||
`name` varchar(20) NOT NULL,
|
||||
`data` text default null,
|
||||
`display` enum('Form','Table and Form','Hidden') default 'Form',
|
||||
`created` DATETIME default '0000-00-00 00:00:00',
|
||||
`updated` DATETIME default '0000-00-00 00:00:00',
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
|
||||
INSERT INTO `CustomFields` (`type`, `name`, `data`,`display`) VALUES
|
||||
('Employee', 'custom1', '', 'Hidden'),
|
||||
('Employee', 'custom2', '', 'Hidden'),
|
||||
('Employee', 'custom3', '', 'Hidden'),
|
||||
('Employee', 'custom4', '', 'Hidden'),
|
||||
('Employee', 'custom5', '', 'Hidden'),
|
||||
('Employee', 'custom6', '', 'Hidden'),
|
||||
('Employee', 'custom7', '', 'Hidden'),
|
||||
('Employee', 'custom8', '', 'Hidden'),
|
||||
('Employee', 'custom9', '', 'Hidden'),
|
||||
('Employee', 'custom10', '', 'Hidden');
|
||||
|
||||
|
||||
Alter table `Employees` MODIFY COLUMN `middle_name` varchar(100) default null;
|
||||
Alter table `Employees` MODIFY COLUMN `last_name` varchar(100) default null;
|
||||
Alter table `Employees` MODIFY COLUMN `ssn_num` varchar(100) default NULL;
|
||||
Alter table `Employees` MODIFY COLUMN `nic_num` varchar(100) default NULL;
|
||||
Alter table `Employees` MODIFY COLUMN `other_id` varchar(100) default NULL;
|
||||
Alter table `Employees` MODIFY COLUMN `driving_license` varchar(100) default NULL;
|
||||
Alter table `Employees` MODIFY COLUMN `work_station_id` varchar(100) default NULL;
|
||||
Alter table `Employees` MODIFY COLUMN `address1` varchar(100) default NULL;
|
||||
Alter table `Employees` MODIFY COLUMN `address2` varchar(100) default NULL;
|
||||
Alter table `Employees` MODIFY COLUMN `city` varchar(150) default NULL;
|
||||
@@ -4,10 +4,41 @@ $moduleName = 'employees';
|
||||
define('MODULE_PATH',dirname(__FILE__));
|
||||
include APP_BASE_PATH.'header.php';
|
||||
include APP_BASE_PATH.'modulejslibs.inc.php';
|
||||
$fieldNameMap = BaseService::getInstance()->getFieldNameMappings("Employee");
|
||||
$customFields = BaseService::getInstance()->getCustomFields("Employee");
|
||||
?><div class="span9">
|
||||
|
||||
<ul class="nav nav-tabs" id="modTab" style="margin-bottom:0px;margin-left:5px;border-bottom: none;">
|
||||
<li class="active"><a id="tabEmployee" href="#tabPageEmployee">Employees</a></li>
|
||||
<?php if($user->user_level != "Admin"){
|
||||
?>
|
||||
<li class="active"><a id="tabEmployee" href="#tabPageEmployee">Employees (Direct Reports)</a></li>
|
||||
<?php }else{ ?>
|
||||
<li class="active"><a id="tabEmployee" href="#tabPageEmployee">Employees</a></li>
|
||||
<?php }?>
|
||||
|
||||
<?php if($user->user_level == "Admin"){
|
||||
?>
|
||||
<li><a id="tabEmployeeSkill" href="#tabPageEmployeeSkill">Skills</a></li>
|
||||
<li><a id="tabEmployeeEducation" href="#tabPageEmployeeEducation">Education</a></li>
|
||||
<li><a id="tabEmployeeCertification" href="#tabPageEmployeeCertification">Certifications</a></li>
|
||||
<li><a id="tabEmployeeLanguage" href="#tabPageEmployeeLanguage">Languages</a></li>
|
||||
<li><a id="tabEmployeeDependent" href="#tabPageEmployeeDependent">Dependents</a></li>
|
||||
<li><a id="tabEmergencyContact" href="#tabPageEmergencyContact">Emergency Contacts</a></li>
|
||||
<?php if (!class_exists('DocumentsAdminManager')) {?>
|
||||
<li><a id="tabEmployeeDocument" href="#tabPageEmployeeDocument">Documents</a></li>
|
||||
<?php } ?>
|
||||
<?php }?>
|
||||
<?php if($user->user_level == "Admin"){
|
||||
?>
|
||||
<li class="dropdown">
|
||||
<a href="#" id="terminatedEmployeeMenu" class="dropdown-toggle" data-toggle="dropdown" aria-controls="terminatedEmployeeMenu-contents">Suspended Employees <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" role="menu" aria-labelledby="terminatedEmployeeMenu" id="terminatedEmployeeMenu-contents">
|
||||
<li><a id="tabTerminatedEmployee" href="#tabPageTerminatedEmployee">Temporarily Suspended Employees</a></li>
|
||||
<li><a id="tabArchivedEmployee" href="#tabPageArchivedEmployee">Terminated Employee Data</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<?php }?>
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
@@ -19,16 +50,161 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane" id="tabPageEmployeeSkill">
|
||||
<div id="EmployeeSkill" class="reviewBlock" data-content="List" style="padding-left:5px;">
|
||||
|
||||
</div>
|
||||
<div id="EmployeeSkillForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane" id="tabPageEmployeeEducation">
|
||||
<div id="EmployeeEducation" class="reviewBlock" data-content="List" style="padding-left:5px;">
|
||||
|
||||
</div>
|
||||
<div id="EmployeeEducationForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane" id="tabPageEmployeeCertification">
|
||||
<div id="EmployeeCertification" class="reviewBlock" data-content="List" style="padding-left:5px;">
|
||||
|
||||
</div>
|
||||
<div id="EmployeeCertificationForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane" id="tabPageEmployeeLanguage">
|
||||
<div id="EmployeeLanguage" class="reviewBlock" data-content="List" style="padding-left:5px;">
|
||||
|
||||
</div>
|
||||
<div id="EmployeeLanguageForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane" id="tabPageEmployeeDependent">
|
||||
<div id="EmployeeDependent" class="reviewBlock" data-content="List" style="padding-left:5px;">
|
||||
|
||||
</div>
|
||||
<div id="EmployeeDependentForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane" id="tabPageEmergencyContact">
|
||||
<div id="EmergencyContact" class="reviewBlock" data-content="List" style="padding-left:5px;">
|
||||
|
||||
</div>
|
||||
<div id="EmergencyContactForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="tabPageArchivedEmployee">
|
||||
<div id="ArchivedEmployee" class="reviewBlock" data-content="List" style="padding-left:5px;">
|
||||
|
||||
</div>
|
||||
<div id="ArchivedEmployeeForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane" id="tabPageTerminatedEmployee">
|
||||
<div id="TerminatedEmployee" class="reviewBlock" data-content="List" style="padding-left:5px;">
|
||||
|
||||
</div>
|
||||
<div id="TerminatedEmployeeForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?php if (!class_exists('DocumentsAdminManager')) {?>
|
||||
<div class="tab-pane" id="tabPageEmployeeDocument">
|
||||
<div id="EmployeeDocument" class="reviewBlock" data-content="List" style="padding-left:5px;">
|
||||
|
||||
</div>
|
||||
<div id="EmployeeDocumentForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
var modJsList = new Array();
|
||||
modJsList['tabEmployee'] = new EmployeeAdapter('Employee');
|
||||
<?php if($user->user_level != "Admin"){
|
||||
?>
|
||||
modJsList['tabEmployee'] = new EmployeeAdapter('Employee','Employee',{"status":"Active", "supervisor":"__myid__"});
|
||||
modJsList['tabEmployee'].setShowAddNew(false);
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
modJsList['tabEmployee'] = new EmployeeAdapter('Employee','Employee',{"status":"Active"});
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
modJsList['tabEmployee'].setRemoteTable(true);
|
||||
modJsList['tabEmployee'].setFieldNameMap(<?=json_encode($fieldNameMap)?>);
|
||||
modJsList['tabEmployee'].setCustomFields(<?=json_encode($customFields)?>);
|
||||
|
||||
modJsList['tabEmployeeSkill'] = new EmployeeSkillAdapter('EmployeeSkill');
|
||||
modJsList['tabEmployeeSkill'].setRemoteTable(true);
|
||||
|
||||
modJsList['tabEmployeeEducation'] = new EmployeeEducationAdapter('EmployeeEducation');
|
||||
modJsList['tabEmployeeEducation'].setRemoteTable(true);
|
||||
|
||||
modJsList['tabEmployeeCertification'] = new EmployeeCertificationAdapter('EmployeeCertification');
|
||||
modJsList['tabEmployeeCertification'].setRemoteTable(true);
|
||||
|
||||
modJsList['tabEmployeeLanguage'] = new EmployeeLanguageAdapter('EmployeeLanguage');
|
||||
modJsList['tabEmployeeLanguage'].setRemoteTable(true);
|
||||
|
||||
modJsList['tabEmployeeDependent'] = new EmployeeDependentAdapter('EmployeeDependent');
|
||||
modJsList['tabEmployeeDependent'].setRemoteTable(true);
|
||||
|
||||
modJsList['tabEmergencyContact'] = new EmergencyContactAdapter('EmergencyContact');
|
||||
modJsList['tabEmergencyContact'].setRemoteTable(true);
|
||||
|
||||
modJsList['tabEmployeeImmigration'] = new EmployeeImmigrationAdapter('EmployeeImmigration');
|
||||
modJsList['tabEmployeeImmigration'].setRemoteTable(true);
|
||||
|
||||
modJsList['tabArchivedEmployee'] = new ArchivedEmployeeAdapter('ArchivedEmployee');
|
||||
modJsList['tabArchivedEmployee'].setRemoteTable(true);
|
||||
modJsList['tabArchivedEmployee'].setShowAddNew(false);
|
||||
|
||||
modJsList['tabTerminatedEmployee'] = new TerminatedEmployeeAdapter('Employee','TerminatedEmployee',{"status":"Terminated"});
|
||||
modJsList['tabTerminatedEmployee'].setRemoteTable(true);
|
||||
modJsList['tabTerminatedEmployee'].setShowAddNew(false);
|
||||
|
||||
<?php if (!class_exists('DocumentsAdminManager')) {?>
|
||||
modJsList['tabEmployeeDocument'] = new EmployeeDocumentAdapter('EmployeeDocument','EmployeeDocument');
|
||||
modJsList['tabTerminatedEmployee'].setRemoteTable(true);
|
||||
<?php } ?>
|
||||
|
||||
var modJs = modJsList['tabEmployee'];
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
|
||||
|
||||
<div class="modal" id="createUserModel" tabindex="-1" role="dialog" aria-labelledby="messageModelLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-times"/></button>
|
||||
<h3 style="font-size: 17px;">Employee Saved Successfully</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
Employee needs a User to login to IceHrm. Do you want to create a user for this employee now? <br/><br/>You can do this later through Users module if required.
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-primary" onclick="modJs.createUser();">Yes</button>
|
||||
<button class="btn" onclick="modJs.closeCreateUser();">No</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,12 @@
|
||||
{
|
||||
"label":"Employees",
|
||||
"menu":"Employees",
|
||||
"order":"1",
|
||||
"icon":"fa-users",
|
||||
"user_levels":["Admin"],
|
||||
"label":"Employees",
|
||||
"menu":"Employees",
|
||||
"order":"1",
|
||||
"icon":"fa-users",
|
||||
"user_levels":["Admin","Manager"],
|
||||
"dashboardPosition":1,
|
||||
|
||||
"permissions":
|
||||
{
|
||||
}
|
||||
"permissions":
|
||||
{
|
||||
}
|
||||
}
|
||||
57
ext/admin/fieldnames/api/FieldnamesAdminManager.php
Normal file
57
ext/admin/fieldnames/api/FieldnamesAdminManager.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
if (!class_exists('FieldnamesAdminManager')) {
|
||||
class FieldnamesAdminManager extends AbstractModuleManager{
|
||||
public function initializeUserClasses(){
|
||||
|
||||
}
|
||||
|
||||
public function initializeFieldMappings(){
|
||||
|
||||
}
|
||||
|
||||
public function initializeDatabaseErrorMappings(){
|
||||
|
||||
}
|
||||
|
||||
public function setupModuleClassDefinitions(){
|
||||
$this->addModelClass('FieldNameMapping');
|
||||
$this->addModelClass('CustomField');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!class_exists('FieldNameMapping')) {
|
||||
class FieldNameMapping extends ICEHRM_Record {
|
||||
var $_table = 'FieldNameMappings';
|
||||
|
||||
public function getAdminAccess(){
|
||||
return array("get","element","save","delete");
|
||||
}
|
||||
|
||||
public function getUserAccess(){
|
||||
return array();
|
||||
}
|
||||
|
||||
public function getAnonymousAccess(){
|
||||
return array("get","element");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!class_exists('CustomField')) {
|
||||
class CustomField extends ICEHRM_Record {
|
||||
var $_table = 'CustomFields';
|
||||
|
||||
public function getAdminAccess(){
|
||||
return array("get","element","save","delete");
|
||||
}
|
||||
|
||||
public function getUserAccess(){
|
||||
return array();
|
||||
}
|
||||
|
||||
public function getAnonymousAccess(){
|
||||
return array("get","element");
|
||||
}
|
||||
}
|
||||
}
|
||||
62
ext/admin/fieldnames/index.php
Normal file
62
ext/admin/fieldnames/index.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
/*
|
||||
This file is part of Ice Framework.
|
||||
|
||||
------------------------------------------------------------------
|
||||
|
||||
Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
|
||||
Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
|
||||
*/
|
||||
|
||||
$moduleName = 'fieldnames';
|
||||
define('MODULE_PATH',dirname(__FILE__));
|
||||
include APP_BASE_PATH.'header.php';
|
||||
include APP_BASE_PATH.'modulejslibs.inc.php';
|
||||
?><div class="span9">
|
||||
|
||||
<ul class="nav nav-tabs" id="modTab" style="margin-bottom:0px;margin-left:5px;border-bottom: none;">
|
||||
<li class="dropdown">
|
||||
<a href="#" id="settingsEmployeeMenu" class="dropdown-toggle" data-toggle="dropdown" aria-controls="settingsEmployeeMenu-contents">Employee Fields <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" role="menu" aria-labelledby="settingsEmployeeMenu" id="settingsEmployeeMenu-contents">
|
||||
<li><a id="tabEmployeeFieldName" href="#tabPageEmployeeFieldName">Employee Field Name Mapping</a></li>
|
||||
<li><a id="tabEmployeeCustomField" href="#tabPageEmployeeCustomField">Employee Custom Fields</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="tabPageEmployeeFieldName">
|
||||
<div id="EmployeeFieldName" class="reviewBlock" data-content="List" style="padding-left:5px;">
|
||||
|
||||
</div>
|
||||
<div id="EmployeeFieldNameForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane" id="tabPageEmployeeCustomField">
|
||||
<div id="EmployeeCustomField" class="reviewBlock" data-content="List" style="padding-left:5px;">
|
||||
|
||||
</div>
|
||||
<div id="EmployeeCustomFieldForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
var modJsList = new Array();
|
||||
|
||||
modJsList['tabEmployeeFieldName'] = new FieldNameAdapter('FieldNameMapping','EmployeeFieldName',{"type":"Employee"});
|
||||
modJsList['tabEmployeeFieldName'].setRemoteTable(true);
|
||||
modJsList['tabEmployeeFieldName'].setShowAddNew(false);
|
||||
|
||||
modJsList['tabEmployeeCustomField'] = new CustomFieldAdapter('CustomField','EmployeeCustomField',{"type":"Employee"});
|
||||
modJsList['tabEmployeeCustomField'].setRemoteTable(true);
|
||||
modJsList['tabEmployeeCustomField'].setShowAddNew(false);
|
||||
|
||||
|
||||
var modJs = modJsList['tabEmployeeFieldName'];
|
||||
|
||||
</script>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
86
ext/admin/fieldnames/lib.js
Normal file
86
ext/admin/fieldnames/lib.js
Normal file
@@ -0,0 +1,86 @@
|
||||
/**
|
||||
* Author: Thilina Hasantha
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* FieldNameAdapter
|
||||
*/
|
||||
|
||||
function FieldNameAdapter(endPoint,tab,filter,orderBy) {
|
||||
this.initAdapter(endPoint,tab,filter,orderBy);
|
||||
}
|
||||
|
||||
FieldNameAdapter.inherits(AdapterBase);
|
||||
|
||||
|
||||
|
||||
FieldNameAdapter.method('getDataMapping', function() {
|
||||
return [
|
||||
"id",
|
||||
"name",
|
||||
"textOrig",
|
||||
"textMapped",
|
||||
"display"
|
||||
];
|
||||
});
|
||||
|
||||
FieldNameAdapter.method('getHeaders', function() {
|
||||
return [
|
||||
{ "sTitle": "ID" ,"bVisible":false},
|
||||
{ "sTitle": "Name" },
|
||||
{ "sTitle": "Original Text"},
|
||||
{ "sTitle": "Mapped Text"},
|
||||
{ "sTitle": "Display Status"}
|
||||
];
|
||||
});
|
||||
|
||||
FieldNameAdapter.method('getFormFields', function() {
|
||||
return [
|
||||
[ "id", {"label":"ID","type":"hidden"}],
|
||||
[ "type", {"label":"Type","type":"placeholder","validation":""}],
|
||||
[ "name", {"label":"Name","type":"placeholder","validation":""}],
|
||||
[ "textOrig", {"label":"Original Text","type":"placeholder","validation":""}],
|
||||
[ "textMapped", {"label":"Mapped Text","type":"text","validation":""}],
|
||||
[ "display", {"label":"Display Status","type":"select","source":[["Form","Form"],["Table and Form","Table and Form"],["Hidden","Hidden"]]}]
|
||||
];
|
||||
});
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
|
||||
function CustomFieldAdapter(endPoint,tab,filter,orderBy) {
|
||||
this.initAdapter(endPoint,tab,filter,orderBy);
|
||||
}
|
||||
|
||||
CustomFieldAdapter.inherits(AdapterBase);
|
||||
|
||||
|
||||
|
||||
CustomFieldAdapter.method('getDataMapping', function() {
|
||||
return [
|
||||
"id",
|
||||
"name",
|
||||
"display"
|
||||
];
|
||||
});
|
||||
|
||||
CustomFieldAdapter.method('getHeaders', function() {
|
||||
return [
|
||||
{ "sTitle": "ID" ,"bVisible":false},
|
||||
{ "sTitle": "Name" },
|
||||
{ "sTitle": "Display Status"}
|
||||
];
|
||||
});
|
||||
|
||||
CustomFieldAdapter.method('getFormFields', function() {
|
||||
return [
|
||||
[ "id", {"label":"ID","type":"hidden"}],
|
||||
[ "type", {"label":"Type","type":"placeholder","validation":""}],
|
||||
[ "name", {"label":"Name","type":"placeholder","validation":""}],
|
||||
[ "data", {"label":"Data","type":"textarea","validation":""}],
|
||||
[ "display", {"label":"Display Status","type":"select","source":[["Form","Form"],["Table and Form","Table and Form"],["Hidden","Hidden"]]}]
|
||||
];
|
||||
});
|
||||
|
||||
11
ext/admin/fieldnames/meta.json
Normal file
11
ext/admin/fieldnames/meta.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"label":"Field Names Setup",
|
||||
"menu":"System",
|
||||
"order":"7",
|
||||
"icon":"fa-sort-alpha-asc",
|
||||
"user_levels":["Admin"],
|
||||
|
||||
"permissions":
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -3,5 +3,5 @@
|
||||
"Employees":"fa-users",
|
||||
"Reports":"fa-file-text",
|
||||
"System":"fa-cogs",
|
||||
"Salary Details":"fa-money"
|
||||
"Payroll":"fa-money"
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ if (!class_exists('MetadataAdminManager')) {
|
||||
$this->addModelClass('Nationality');
|
||||
$this->addModelClass('ImmigrationStatus');
|
||||
$this->addModelClass('Ethnicity');
|
||||
$this->addModelClass('CalculationHook');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -42,6 +43,20 @@ if (!class_exists('Country')) {
|
||||
public function getAnonymousAccess(){
|
||||
return array("get","element");
|
||||
}
|
||||
|
||||
function Find($whereOrderBy,$bindarr=false,$pkeysArr=false,$extra=array()){
|
||||
$allowedCountriesStr = SettingsManager::getInstance()->getSetting('System: Allowed Countries');
|
||||
$allowedCountries = array();
|
||||
if(!empty($allowedCountriesStr)){
|
||||
$allowedCountries = json_decode($allowedCountriesStr,true);
|
||||
}
|
||||
|
||||
if(!empty($allowedCountries)){
|
||||
return parent::Find("id in (".implode(",",$allowedCountries).")" , array());
|
||||
}
|
||||
|
||||
return parent::Find($whereOrderBy, $bindarr, $pkeysArr, $extra);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,6 +94,20 @@ if (!class_exists('CurrencyType')) {
|
||||
public function getAnonymousAccess(){
|
||||
return array("get","element");
|
||||
}
|
||||
|
||||
function Find($whereOrderBy,$bindarr=false,$pkeysArr=false,$extra=array()){
|
||||
$allowedCountriesStr = SettingsManager::getInstance()->getSetting('System: Allowed Currencies');
|
||||
$allowedCountries = array();
|
||||
if(!empty($allowedCountriesStr)){
|
||||
$allowedCountries = json_decode($allowedCountriesStr,true);
|
||||
}
|
||||
|
||||
if(!empty($allowedCountries)){
|
||||
return parent::Find("id in (".implode(",",$allowedCountries).")" , array());
|
||||
}
|
||||
|
||||
return parent::Find($whereOrderBy, $bindarr, $pkeysArr, $extra);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,6 +127,22 @@ if (!class_exists('Nationality')) {
|
||||
public function getAnonymousAccess(){
|
||||
return array("get","element");
|
||||
}
|
||||
|
||||
function Find($whereOrderBy,$bindarr=false,$pkeysArr=false,$extra=array()){
|
||||
$allowedCountriesStr = SettingsManager::getInstance()->getSetting('System: Allowed Nationality');
|
||||
$allowedCountries = array();
|
||||
if(!empty($allowedCountriesStr)){
|
||||
$allowedCountries = json_decode($allowedCountriesStr,true);
|
||||
}
|
||||
|
||||
if(!empty($allowedCountries)){
|
||||
return parent::Find("id in (".implode(",",$allowedCountries).")" , array());
|
||||
}
|
||||
|
||||
return parent::Find($whereOrderBy, $bindarr, $pkeysArr, $extra);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,6 +184,32 @@ if (!class_exists('Ethnicity')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!class_exists('CalculationHook')) {
|
||||
class CalculationHook extends ICEHRM_Record {
|
||||
var $_table = 'CalculationHooks';
|
||||
|
||||
public function getAdminAccess(){
|
||||
return array("get","element","save","delete");
|
||||
}
|
||||
|
||||
public function getUserAccess(){
|
||||
return array();
|
||||
}
|
||||
|
||||
public function getAnonymousAccess(){
|
||||
return array("get","element");
|
||||
}
|
||||
|
||||
function Find($whereOrderBy,$bindarr=false,$pkeysArr=false,$extra=array()){
|
||||
return BaseService::getInstance()->getCalculationHooks();
|
||||
}
|
||||
|
||||
function Load($where=null,$bindarr=false){
|
||||
return BaseService::getInstance()->getCalculationHook($bindarr[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@ $moduleBuilder->addModuleOrGroup(new ModuleTab('Country','Country','Countries','
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab('Province','Province','Provinces','ProvinceAdapter','',''));
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab('CurrencyType','CurrencyType','Currency Types','CurrencyTypeAdapter','',''));
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab('Nationality','Nationality','Nationality','NationalityAdapter','',''));
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab('Nationality','Nationality','Nationality','NationalityAdapter','',''));
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab('Ethnicity','Ethnicity','Ethnicity','EthnicityAdapter','',''));
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab('ImmigrationStatus','ImmigrationStatus','Immigration Status','ImmigrationStatusAdapter','',''));
|
||||
|
||||
|
||||
@@ -46,9 +46,9 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
|
||||
<script>
|
||||
var modJsList = new Array();
|
||||
|
||||
modJsList['moduleModule'] = new ModuleAdapter('Module','Module');
|
||||
modJsList['moduleModule'].setShowAddNew(false);
|
||||
var modJs = modJsList['moduleModule'];
|
||||
modJsList['tabModule'] = new ModuleAdapter('Module','Module');
|
||||
modJsList['tabModule'].setShowAddNew(false);
|
||||
var modJs = modJsList['tabModule'];
|
||||
|
||||
</script>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
@@ -46,7 +46,8 @@ ModuleAdapter.method('getFormFields', function() {
|
||||
[ "id", {"label":"ID","type":"hidden"}],
|
||||
[ "label", {"label":"Label","type":"text","validation":""}],
|
||||
[ "status", {"label":"Status","type":"select","source":[["Enabled","Enabled"],["Disabled","Disabled"]]}],
|
||||
[ "user_levels", {"label":"User Levels","type":"select2multi","source":[["Admin","Admin"],["Manager","Manager"],["Employee","Employee"],["Other","Other"]]}]
|
||||
[ "user_levels", {"label":"User Levels","type":"select2multi","source":[["Admin","Admin"],["Manager","Manager"],["Employee","Employee"],["Other","Other"]]}],
|
||||
[ "user_roles", {"label":"User Roles","type":"select2multi","remote-source":["UserRole","id","name"]}]
|
||||
];
|
||||
});
|
||||
|
||||
@@ -57,7 +58,7 @@ ModuleAdapter.method('getActionButtonsHtml', function(id,data) {
|
||||
var nonEditableFields = {};
|
||||
nonEditableFields["admin_Company Structure"] = 1;
|
||||
nonEditableFields["admin_Employees"] = 1;
|
||||
nonEditableFields["admin_Jobs"] = 1;
|
||||
nonEditableFields["admin_Job Details Setup"] = 1;
|
||||
nonEditableFields["admin_Leaves"] = 1;
|
||||
nonEditableFields["admin_Manage Modules"] = 1;
|
||||
nonEditableFields["admin_Projects"] = 1;
|
||||
@@ -65,9 +66,11 @@ ModuleAdapter.method('getActionButtonsHtml', function(id,data) {
|
||||
nonEditableFields["admin_Settings"] = 1;
|
||||
nonEditableFields["admin_Users"] = 1;
|
||||
nonEditableFields["admin_Upgrade"] = 1;
|
||||
|
||||
nonEditableFields["admin_Dashboard"] = 1;
|
||||
|
||||
nonEditableFields["user_Basic Information"] = 1;
|
||||
|
||||
nonEditableFields["user_Dashboard"] = 1;
|
||||
|
||||
if(nonEditableFields[data[3]+"_"+data[1]] == 1){
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"label":"Setup",
|
||||
"menu":"Salary Details",
|
||||
"order":"6",
|
||||
"icon":"fa-cogs",
|
||||
"user_levels":["Admin"],
|
||||
|
||||
"permissions":
|
||||
{
|
||||
}
|
||||
}
|
||||
19
ext/admin/permissions/dashboard.html
Normal file
19
ext/admin/permissions/dashboard.html
Normal file
@@ -0,0 +1,19 @@
|
||||
<div class="col-lg-3 col-xs-12">
|
||||
|
||||
<div class="small-box bg-aqua">
|
||||
<div class="inner">
|
||||
<h3>
|
||||
Permission
|
||||
</h3>
|
||||
<p>
|
||||
Management
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-locked"></i>
|
||||
</div>
|
||||
<a href="#_moduleLink_#" class="small-box-footer" id="permissionLink">
|
||||
Manage Permissions <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,11 +1,12 @@
|
||||
{
|
||||
"label":"Manage Permissions",
|
||||
"menu":"System",
|
||||
"order":"4",
|
||||
"icon":"fa-unlock",
|
||||
"user_levels":["Admin"],
|
||||
"label":"Manage Permissions",
|
||||
"menu":"System",
|
||||
"order":"4",
|
||||
"icon":"fa-unlock",
|
||||
"user_levels":["Admin"],
|
||||
"dashboardPosition":15,
|
||||
|
||||
"permissions":
|
||||
{
|
||||
}
|
||||
"permissions":
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,19 @@ if (!class_exists('ProjectsAdminManager')) {
|
||||
|
||||
}
|
||||
|
||||
public function getDashboardItemData(){
|
||||
$data = array();
|
||||
$project = new Project();
|
||||
$data['numberOfProjects'] = $project->Count("status = 'Active'");
|
||||
return $data;
|
||||
|
||||
}
|
||||
|
||||
public function initQuickAccessMenu(){
|
||||
UIManager::getInstance()->addQuickAccessMenuItem("Manage Client/Projects","fa-list-alt",CLIENT_BASE_URL."?g=admin&n=projects&m=admin_Admin",array("Admin","Manager"));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
17
ext/admin/projects/dashboard.html
Normal file
17
ext/admin/projects/dashboard.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<div class="col-lg-3 col-xs-12">
|
||||
|
||||
<div class="small-box bg-red">
|
||||
<div class="inner">
|
||||
<h3>Projects</h3>
|
||||
<p id="numberOfProjects">
|
||||
#_numberOfProjects_# Active Projects
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-pie-graph"></i>
|
||||
</div>
|
||||
<a href="#_moduleLink_#" class="small-box-footer" id="projectsLink">
|
||||
Update Clients/Projects <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,19 +1,20 @@
|
||||
{
|
||||
"label":"Projects/Client Setup",
|
||||
"menu":"Admin",
|
||||
"order":"5",
|
||||
"icon":"fa-list-alt",
|
||||
"user_levels":["Admin","Manager"],
|
||||
"label":"Projects/Client Setup",
|
||||
"menu":"Admin",
|
||||
"order":"51",
|
||||
"icon":"fa-list-alt",
|
||||
"user_levels":["Admin","Manager"],
|
||||
"dashboardPosition":4,
|
||||
|
||||
"permissions":
|
||||
{
|
||||
"Manager":{
|
||||
"Add Projects":"Yes",
|
||||
"Edit Projects":"Yes",
|
||||
"Delete Projects":"No",
|
||||
"Add Clients":"Yes",
|
||||
"Edit Clients":"Yes",
|
||||
"Delete Clients":"No"
|
||||
}
|
||||
}
|
||||
"permissions":
|
||||
{
|
||||
"Manager":{
|
||||
"Add Projects":"Yes",
|
||||
"Edit Projects":"Yes",
|
||||
"Delete Projects":"No",
|
||||
"Add Clients":"Yes",
|
||||
"Edit Clients":"Yes",
|
||||
"Delete Clients":"No"
|
||||
}
|
||||
}
|
||||
}
|
||||
17
ext/admin/reports/dashboard.html
Normal file
17
ext/admin/reports/dashboard.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<div class="col-lg-3 col-xs-12">
|
||||
|
||||
<div class="small-box bg-teal">
|
||||
<div class="inner">
|
||||
<h3>Reports</h3>
|
||||
<p>
|
||||
View / Download Reports
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-document-text"></i>
|
||||
</div>
|
||||
<a href="#_moduleLink_#" class="small-box-footer" id="reportsLink">
|
||||
Create a Report <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -19,14 +19,21 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
var modJsList = new Array();
|
||||
|
||||
modJsList['tabReport'] = new ReportAdapter('Report','Report');
|
||||
modJsList['tabReport'] = new ReportAdapter('Report','Report','','report_group');
|
||||
modJsList['tabReport'].setShowAddNew(false);
|
||||
modJsList['tabReport'].setRemoteTable(true);
|
||||
|
||||
/*
|
||||
modJsList['tabReport'] = new ReportGenAdapter('File','File','{"file_group":"Report"}','group');
|
||||
modJsList['tabReport'].setShowAddNew(false);
|
||||
*/
|
||||
|
||||
var modJs = modJsList['tabReport'];
|
||||
|
||||
|
||||
@@ -7,8 +7,9 @@
|
||||
* ReportAdapter
|
||||
*/
|
||||
|
||||
function ReportAdapter(endPoint) {
|
||||
this.initAdapter(endPoint);
|
||||
|
||||
function ReportAdapter(endPoint,tab,filter,orderBy) {
|
||||
this.initAdapter(endPoint,tab,filter,orderBy);
|
||||
this._formFileds = [
|
||||
[ "id", {"label":"ID","type":"hidden"}],
|
||||
[ "name", {"label":"Name","type":"label","validation":""}],
|
||||
@@ -162,3 +163,42 @@ ReportAdapter.method('fillForm', function(object) {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
function ReportGenAdapter(endPoint) {
|
||||
this.initAdapter(endPoint);
|
||||
}
|
||||
|
||||
ReportGenAdapter.inherits(AdapterBase);
|
||||
|
||||
|
||||
|
||||
ReportGenAdapter.method('getDataMapping', function() {
|
||||
return [
|
||||
"id",
|
||||
"name",
|
||||
];
|
||||
});
|
||||
|
||||
ReportGenAdapter.method('getHeaders', function() {
|
||||
return [
|
||||
{ "sTitle": "ID" ,"bVisible":false},
|
||||
{ "sTitle": "Name" }
|
||||
];
|
||||
});
|
||||
|
||||
ReportGenAdapter.method('getFormFields', function() {
|
||||
return [
|
||||
|
||||
];
|
||||
});
|
||||
|
||||
ReportGenAdapter.method('getActionButtonsHtml', function(id,data) {
|
||||
var html = '<div style="width:80px;"><img class="tableActionButton" src="_BASE_images/download.png" style="cursor:pointer;" rel="tooltip" title="Download" onclick="download(_name_);return false;"></img></div>';
|
||||
html = html.replace(/_id_/g,id);
|
||||
html = html.replace(/_name_/g,data[1]);
|
||||
html = html.replace(/_BASE_/g,this.baseUrl);
|
||||
return html;
|
||||
});
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"label":"Reports",
|
||||
"menu":"Reports",
|
||||
"order":"1",
|
||||
"icon":"fa-file-o",
|
||||
"user_levels":["Admin","Manager"],
|
||||
|
||||
"permissions":
|
||||
{
|
||||
}
|
||||
"label":"Reports",
|
||||
"menu":"Reports",
|
||||
"order":"1",
|
||||
"icon":"fa-file-o",
|
||||
"user_levels":["Admin","Manager"],
|
||||
"dashboardPosition":7,
|
||||
"permissions":
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
if(!class_exists('ReportBuilder')){
|
||||
include_once MODULE_PATH.'/reportClasses/ReportBuilder.php';
|
||||
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilder.php';
|
||||
}
|
||||
class ActiveEmployeeReport extends ReportBuilder{
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
if(!class_exists('ReportBuilder')){
|
||||
include_once MODULE_PATH.'/reportClasses/ReportBuilder.php';
|
||||
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilder.php';
|
||||
}
|
||||
class EmployeeAttendanceReport extends ReportBuilder{
|
||||
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
if(!interface_exists('ReportBuilderInterface')){
|
||||
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilderInterface.php';
|
||||
}
|
||||
|
||||
if(!class_exists('LeavesActionManager')){
|
||||
include_once APP_BASE_PATH.'modules/leaves/api/LeavesActionManager.php';
|
||||
}
|
||||
class EmployeeLeaveEntitlementReport implements ReportBuilderInterface{
|
||||
public function getData($report,$req){
|
||||
|
||||
$leaveActionManager = new LeavesActionManager();
|
||||
|
||||
$department = $req['department'];
|
||||
$employeeId = $req['employee'];
|
||||
|
||||
if(($employeeId == "NULL" || empty($employeeId)) && ($department == "NULL" || empty($department))){
|
||||
$emp = new Employee();
|
||||
$employees = $emp->Find("status = 'Active'",array());
|
||||
}else if($employeeId != "NULL" && !empty($employeeId)){
|
||||
$emp = new Employee();
|
||||
$employees = $emp->Find("id = ?",array($employeeId));
|
||||
}else{
|
||||
$emp = new Employee();
|
||||
$employees = $emp->Find("department = ? and status = 'Active'",array($department));
|
||||
}
|
||||
|
||||
|
||||
$reportData = array();
|
||||
$reportData[] = array("Employee ID","Employee","Leave Type","Pending","Approved","Rejected","Canceled","Available","To be Accrued","Carried Forward from Previous Years");
|
||||
|
||||
foreach($employees as $employee){
|
||||
$leaveEntitlements = $leaveActionManager->getEntitlementByEmployee($employee)->getObject();
|
||||
foreach($leaveEntitlements as $leaveEntitlement){
|
||||
$reportData[] = array(
|
||||
$employee->employee_id,
|
||||
$employee->first_name." ".$employee->last_name,
|
||||
$leaveEntitlement['name'],
|
||||
$leaveEntitlement['pendingLeaves'],
|
||||
$leaveEntitlement['approvedLeaves'],
|
||||
$leaveEntitlement['rejectedLeaves'],
|
||||
$leaveEntitlement['cancelRequestedLeaves'],
|
||||
$leaveEntitlement['availableLeaves'],
|
||||
$leaveEntitlement['tobeAccrued'],
|
||||
$leaveEntitlement['carriedForward']
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $reportData;
|
||||
}
|
||||
}
|
||||
86
ext/admin/reports/reportClasses/EmployeeLeavesReport.php
Normal file
86
ext/admin/reports/reportClasses/EmployeeLeavesReport.php
Normal file
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
if(!class_exists('ReportBuilder')){
|
||||
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilder.php';
|
||||
}
|
||||
class EmployeeLeavesReport extends ReportBuilder{
|
||||
|
||||
public function getMainQuery(){
|
||||
$query = "SELECT
|
||||
(SELECT concat(`first_name`,' ',`middle_name`,' ', `last_name`) from Employees where id = employee) as 'Employee',
|
||||
(SELECT name from LeaveTypes where id = leave_type) as 'Leave Type',
|
||||
(SELECT name from LeavePeriods where id = leave_period) as 'Leave Period',
|
||||
date_start as 'Start Date',
|
||||
date_end as 'End Date',
|
||||
details as 'Reason',
|
||||
status as 'Leave Status',
|
||||
(select count(*) from EmployeeLeaveDays d where d.employee_leave = lv.id and leave_type = 'Full Day') as 'Full Day Count',
|
||||
(select count(*) from EmployeeLeaveDays d where d.employee_leave = lv.id and leave_type = 'Half Day - Morning') as 'Half Day (Morning) Count',
|
||||
(select count(*) from EmployeeLeaveDays d where d.employee_leave = lv.id and leave_type = 'Half Day - Afternoon') as 'Half Day (Afternoon) Count'
|
||||
from EmployeeLeaves lv";
|
||||
|
||||
return $query;
|
||||
|
||||
}
|
||||
|
||||
public function getWhereQuery($request){
|
||||
|
||||
$employeeList = array();
|
||||
if(!empty($request['employee'])){
|
||||
$employeeList = json_decode($request['employee'],true);
|
||||
}
|
||||
|
||||
if(in_array("NULL", $employeeList) ){
|
||||
$employeeList = array();
|
||||
}
|
||||
|
||||
if($request['department'] != "NULL" && empty($employeeList)){
|
||||
$empTmp = new Employee();
|
||||
$empTemps = $empTmp->Find("department = ? and status = Active",array($request['department']));
|
||||
foreach($empTemps as $empTmp){
|
||||
$employeeList[] = $empTmp->id;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(!empty($employeeList) && ($request['status'] != "NULL" && !empty($request['status']))){
|
||||
$query = "where employee in (".implode(",", $employeeList).") and ((date_start >= ? and date_start <= ?) or (date_end >= ? and date_end <= ?)) and status = ?;";
|
||||
$params = array(
|
||||
$request['date_start'],
|
||||
$request['date_end'],
|
||||
$request['date_start'],
|
||||
$request['date_end'],
|
||||
$request['status']
|
||||
);
|
||||
}else if(!empty($employeeList)){
|
||||
$query = "where employee in (".implode(",", $employeeList).") and ((date_start >= ? and date_start <= ?) or (date_end >= ? and date_end <= ?));";
|
||||
$params = array(
|
||||
$request['date_start'],
|
||||
$request['date_end'],
|
||||
$request['date_start'],
|
||||
$request['date_end']
|
||||
);
|
||||
}else if(($request['status'] != "NULL" && !empty($request['status']))){
|
||||
$query = "where status = ? and ((date_start >= ? and date_start <= ?) or (date_end >= ? and date_end <= ?));";
|
||||
$params = array(
|
||||
$request['status'],
|
||||
$request['date_start'],
|
||||
$request['date_end'],
|
||||
$request['date_start'],
|
||||
$request['date_end']
|
||||
);
|
||||
}else{
|
||||
$query = "where ((date_start >= ? and date_start <= ?) or (date_end >= ? and date_end <= ?));";
|
||||
$params = array(
|
||||
$request['date_start'],
|
||||
$request['date_end'],
|
||||
$request['date_start'],
|
||||
$request['date_end']
|
||||
);
|
||||
}
|
||||
|
||||
LogManager::getInstance()->info("Query:".$query);
|
||||
LogManager::getInstance()->info("Params:".json_encode($params));
|
||||
|
||||
return array($query, $params);
|
||||
}
|
||||
}
|
||||
69
ext/admin/reports/reportClasses/EmployeeTimeSheetData.php
Normal file
69
ext/admin/reports/reportClasses/EmployeeTimeSheetData.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
if(!interface_exists('ReportBuilderInterface')){
|
||||
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilderInterface.php';
|
||||
}
|
||||
|
||||
class EmployeeTimeSheetData implements ReportBuilderInterface{
|
||||
public function getData($report,$request){
|
||||
|
||||
$employeeCache = array();
|
||||
|
||||
$employeeList = array();
|
||||
if(!empty($request['employee'])){
|
||||
$employeeList = json_decode($request['employee'],true);
|
||||
}
|
||||
|
||||
if(in_array("NULL", $employeeList) ){
|
||||
$employeeList = array();
|
||||
}
|
||||
|
||||
$employee_query = "";
|
||||
if(!empty($employeeList)){
|
||||
$employee_query = "employee in (".implode(",", $employeeList).") and ";
|
||||
}
|
||||
|
||||
|
||||
$timeSheet = new EmployeeTimeSheet();
|
||||
if($request['status'] != "NULL"){
|
||||
$timeSheets = $timeSheet->Find($employee_query."status = ? and date_start >= ? and date_end <= ?",
|
||||
array($request['status'],$request['date_start'],$request['date_end']));
|
||||
}else{
|
||||
$timeSheets = $timeSheet->Find($employee_query."date_start >= ? and date_end <= ?",
|
||||
array($request['date_start'],$request['date_end']));
|
||||
}
|
||||
|
||||
|
||||
if(!$timeSheets){
|
||||
LogManager::getInstance()->info($timeSheet->ErrorMsg());
|
||||
}
|
||||
|
||||
|
||||
|
||||
$reportData = array();
|
||||
$reportData[] = array("Employee ID","Employee","Name","Start","End","Total Time","Status");
|
||||
|
||||
foreach($timeSheets as $ts){
|
||||
$employee = $employeeCache[$ts->employee];
|
||||
if(empty($employee)){
|
||||
$employee = new Employee();
|
||||
$employee->Load("id = ?",array($ts->employee));
|
||||
if(empty($employee->id)){
|
||||
continue;
|
||||
}
|
||||
$employeeCache[$employee->id] = $employee;
|
||||
}
|
||||
$reportData[] = array(
|
||||
$employee->employee_id,
|
||||
$employee->first_name." ".$employee->last_name,
|
||||
date("F j, Y",strtotime($ts->date_start))." - ".date("F j, Y",strtotime($ts->date_end)),
|
||||
$ts->date_start,
|
||||
$ts->date_end,
|
||||
$ts->getTotalTime(),
|
||||
$ts->status
|
||||
);
|
||||
}
|
||||
|
||||
return $reportData;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
if(!interface_exists('ReportBuilderInterface')){
|
||||
include_once MODULE_PATH.'/reportClasses/ReportBuilderInterface.php';
|
||||
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilderInterface.php';
|
||||
}
|
||||
class EmployeeTimeTrackReport implements ReportBuilderInterface{
|
||||
public function getData($report,$req){
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
if(!class_exists('ReportBuilder')){
|
||||
include_once MODULE_PATH.'/reportClasses/ReportBuilder.php';
|
||||
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilder.php';
|
||||
}
|
||||
class EmployeeTimesheetReport extends ReportBuilder{
|
||||
|
||||
|
||||
68
ext/admin/reports/reportClasses/ExpenseReport.php
Normal file
68
ext/admin/reports/reportClasses/ExpenseReport.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
if(!class_exists('ReportBuilder')){
|
||||
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilder.php';
|
||||
}
|
||||
class ExpenseReport extends ReportBuilder{
|
||||
|
||||
public function getMainQuery(){
|
||||
$query = "SELECT
|
||||
(SELECT concat(`first_name`,' ',`middle_name`,' ', `last_name`) from Employees where id = employee) as 'Employee',
|
||||
expense_date as 'Date',
|
||||
(SELECT name from ExpensesPaymentMethods where id = payment_method) as 'Payment Method',
|
||||
transaction_no as 'Transaction Ref',
|
||||
payee as 'Payee',
|
||||
(SELECT name from ExpensesCategories where id = category) as 'Category',
|
||||
notes as 'Notes',
|
||||
concat(`amount`,' ',`currency`) as 'Amount',
|
||||
status as 'Status',
|
||||
created as 'Created',
|
||||
updated as 'Updated'
|
||||
from EmployeeExpenses";
|
||||
|
||||
return $query;
|
||||
|
||||
}
|
||||
|
||||
public function getWhereQuery($request){
|
||||
|
||||
$employeeList = array();
|
||||
if(!empty($request['employee'])){
|
||||
$employeeList = json_decode($request['employee'],true);
|
||||
}
|
||||
|
||||
if(in_array("NULL", $employeeList) ){
|
||||
$employeeList = array();
|
||||
}
|
||||
|
||||
|
||||
if(!empty($employeeList) && ($request['status'] != "NULL" && !empty($request['status']))){
|
||||
$query = "where employee in (".implode(",", $employeeList).") and date(expense_date) >= ? and date(expense_date) <= ? and status = ?;";
|
||||
$params = array(
|
||||
$request['date_start'],
|
||||
$request['date_end'],
|
||||
$request['status']
|
||||
);
|
||||
}else if(!empty($employeeList)){
|
||||
$query = "where employee in (".implode(",", $employeeList).") and date(expense_date) >= ? and date(expense_date) <= ?;";
|
||||
$params = array(
|
||||
$request['date_start'],
|
||||
$request['date_end']
|
||||
);
|
||||
}else if(($request['status'] != "NULL" && !empty($request['status']))){
|
||||
$query = "where status = ? and date(expense_date) >= ? and date(expense_date) <= ?;";
|
||||
$params = array(
|
||||
$request['status'],
|
||||
$request['date_start'],
|
||||
$request['date_end']
|
||||
);
|
||||
}else{
|
||||
$query = "where date(expense_date) >= ? and date(expense_date) <= ?;";
|
||||
$params = array(
|
||||
$request['date_start'],
|
||||
$request['date_end']
|
||||
);
|
||||
}
|
||||
|
||||
return array($query, $params);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
if(!class_exists('ActiveEmployeeReport')){
|
||||
include_once MODULE_PATH.'/reportClasses/ActiveEmployeeReport.php';
|
||||
include_once APP_BASE_PATH.'admin/reports/reportClasses/ActiveEmployeeReport.php';
|
||||
}
|
||||
class NewHiresEmployeeReport extends ActiveEmployeeReport{
|
||||
|
||||
|
||||
100
ext/admin/reports/reportClasses/OvertimeReport.php
Normal file
100
ext/admin/reports/reportClasses/OvertimeReport.php
Normal file
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
if(!interface_exists('ReportBuilderInterface')){
|
||||
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilderInterface.php';
|
||||
}
|
||||
|
||||
if(!class_exists('AttendanceAdminManager')){
|
||||
include_once APP_BASE_PATH.'admin/attendance/api/AttendanceAdminManager.php';
|
||||
}
|
||||
class OvertimeReport implements ReportBuilderInterface{
|
||||
public function getData($report,$request){
|
||||
|
||||
$employeeList = array();
|
||||
if(!empty($request['employee'])){
|
||||
$employeeList = json_decode($request['employee'],true);
|
||||
}
|
||||
|
||||
if(in_array("NULL", $employeeList) ){
|
||||
$employeeList = array();
|
||||
}
|
||||
|
||||
$sevenDateBefore = date('Y-m-d', strtotime('-7 days',strtotime($request['date_start'])));
|
||||
|
||||
if(!empty($employeeList)){
|
||||
$query = "employee in (".implode(",", $employeeList).") and in_time >= ? and out_time <= ? order by in_time;";
|
||||
$params = array(
|
||||
$sevenDateBefore." 00:00:00",
|
||||
$request['date_end']." 23:59:59",
|
||||
);
|
||||
}else{
|
||||
$query = "in_time >= ? and out_time <= ? order by in_time;";
|
||||
$params = array(
|
||||
$sevenDateBefore." 00:00:00",
|
||||
$request['date_end']." 23:59:59",
|
||||
);
|
||||
}
|
||||
|
||||
$at = new Attendance();
|
||||
$attendance = $at->Find($query, $params);
|
||||
|
||||
|
||||
//Group records by employee
|
||||
$employeeAttendance = array();
|
||||
foreach($attendance as $entry){
|
||||
if(!isset($employeeAttendance[$entry->employee])){
|
||||
$employeeAttendance[$entry->employee] = array();
|
||||
}
|
||||
|
||||
$employeeAttendance[$entry->employee][] = $entry;
|
||||
|
||||
}
|
||||
|
||||
$atCalClassName = SettingsManager::getInstance()->getSetting('Attendance: Overtime Calculation Class');
|
||||
|
||||
$atCal = new $atCalClassName();
|
||||
|
||||
$reportData = array();
|
||||
if(!$this->isAggregated()) {
|
||||
$reportData[] = array("Date", "Employee ID", "Employee", "Time in Office", "Regular Time", "Overtime", "Double Time");
|
||||
}else{
|
||||
$reportData[] = array("Employee ID", "Employee", "Time in Office", "Regular Time", "Overtime", "Double Time");
|
||||
}
|
||||
|
||||
foreach($employeeAttendance as $employeeId => $atData){
|
||||
|
||||
$employee = new Employee();
|
||||
$employee->Load("id = ?",array($employeeId));
|
||||
$atSum = $atCal->getData($atData, $request['date_start'], $this->isAggregated());
|
||||
if(!$this->isAggregated()){
|
||||
foreach($atSum as $date=>$counts){
|
||||
$reportData[] = array(
|
||||
$date,
|
||||
$employee->employee_id,
|
||||
$employee->first_name." ".$employee->last_name,
|
||||
$counts['t'],
|
||||
$counts['r'],
|
||||
$counts['o'],
|
||||
$counts['d']
|
||||
);
|
||||
}
|
||||
}else{
|
||||
$reportData[] = array(
|
||||
$employee->employee_id,
|
||||
$employee->first_name." ".$employee->last_name,
|
||||
$atSum['t'],
|
||||
$atSum['r'],
|
||||
$atSum['o'],
|
||||
$atSum['d']
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return $reportData;
|
||||
}
|
||||
|
||||
protected function isAggregated(){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
10
ext/admin/reports/reportClasses/OvertimeSummaryReport.php
Normal file
10
ext/admin/reports/reportClasses/OvertimeSummaryReport.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
if(!interface_exists('OvertimeReport')){
|
||||
include_once APP_BASE_PATH.'admin/reports/reportClasses/OvertimeReport.php';
|
||||
}
|
||||
|
||||
class OvertimeSummaryReport extends OvertimeReport{
|
||||
protected function isAggregated(){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
if(!interface_exists('ReportBuilderInterface')){
|
||||
include_once MODULE_PATH.'/reportClasses/ReportBuilderInterface.php';
|
||||
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilderInterface.php';
|
||||
}
|
||||
abstract class ReportBuilder implements ReportBuilderInterface{
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
if(!class_exists('ActiveEmployeeReport')){
|
||||
include_once MODULE_PATH.'/reportClasses/ActiveEmployeeReport.php';
|
||||
include_once APP_BASE_PATH.'admin/reports/reportClasses/ActiveEmployeeReport.php';
|
||||
}
|
||||
class TerminatedEmployeeReport extends ActiveEmployeeReport{
|
||||
|
||||
|
||||
69
ext/admin/reports/reportClasses/TravelRequestReport.php
Normal file
69
ext/admin/reports/reportClasses/TravelRequestReport.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
if(!class_exists('ReportBuilder')){
|
||||
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilder.php';
|
||||
}
|
||||
class TravelRequestReport extends ReportBuilder{
|
||||
|
||||
public function getMainQuery(){
|
||||
$query = "SELECT
|
||||
(SELECT concat(`first_name`,' ',`middle_name`,' ', `last_name`) from Employees where id = employee) as 'Employee',
|
||||
type as 'Type',
|
||||
purpose as 'Purpose',
|
||||
travel_from as 'Travel From',
|
||||
travel_to as 'Travel To',
|
||||
travel_date as 'Travel Date',
|
||||
return_date as 'Return Date',
|
||||
details as 'Other Details',
|
||||
concat(`funding`,' ',`currency`) as 'Funding',
|
||||
status as 'Status',
|
||||
created as 'Created',
|
||||
updated as 'Updated'
|
||||
from EmployeeTravelRecords";
|
||||
|
||||
return $query;
|
||||
|
||||
}
|
||||
|
||||
public function getWhereQuery($request){
|
||||
|
||||
$employeeList = array();
|
||||
if(!empty($request['employee'])){
|
||||
$employeeList = json_decode($request['employee'],true);
|
||||
}
|
||||
|
||||
if(in_array("NULL", $employeeList) ){
|
||||
$employeeList = array();
|
||||
}
|
||||
|
||||
|
||||
if(!empty($employeeList) && ($request['status'] != "NULL" && !empty($request['status']))){
|
||||
$query = "where employee in (".implode(",", $employeeList).") and date(travel_date) >= ? and date(return_date) <= ? and status = ?;";
|
||||
$params = array(
|
||||
$request['date_start'],
|
||||
$request['date_end'],
|
||||
$request['status']
|
||||
);
|
||||
}else if(!empty($employeeList)){
|
||||
$query = "where employee in (".implode(",", $employeeList).") and date(travel_date) >= ? and date(return_date) <= ?;";
|
||||
$params = array(
|
||||
$request['date_start'],
|
||||
$request['date_end']
|
||||
);
|
||||
}else if(($request['status'] != "NULL" && !empty($request['status']))){
|
||||
$query = "where status = ? and date(travel_date) >= ? and date(return_date) <= ?;";
|
||||
$params = array(
|
||||
$request['status'],
|
||||
$request['date_start'],
|
||||
$request['date_end']
|
||||
);
|
||||
}else{
|
||||
$query = "where date(travel_date) >= ? and date(return_date) <= ?;";
|
||||
$params = array(
|
||||
$request['date_start'],
|
||||
$request['date_end']
|
||||
);
|
||||
}
|
||||
|
||||
return array($query, $params);
|
||||
}
|
||||
}
|
||||
44
ext/admin/salary/LICENSE.txt
Normal file
44
ext/admin/salary/LICENSE.txt
Normal file
@@ -0,0 +1,44 @@
|
||||
ICEHRM END USER LICENSE AGREEMENT
|
||||
NOTICE TO ALL USERS: BY PURCHASING THE MODULE, YOU (EITHER AN INDIVIDUAL OR A SINGLE ENTITY) CONSENT TO BE BOUND BY AND BECOME A PARTY TO THIS AGREEMENT.
|
||||
|
||||
All references to "Software" herein shall be deemed to include the software license with which you will be provided by Gamonoid Media Pvt Ltd, as part of the Software.
|
||||
|
||||
1. LICENSE GRANT. Subject to the payment of the applicable licence fees, and subject to the terms and conditions of this Agreement, ICEHRM hereby grants to you a non-exclusive, non-transferable right to use one copy of the specified version of the Software and the accompanying documentation (the "Documentation") for the term of this Agreement solely for your own internal business purposes. You may install one copy of the Software for production use.
|
||||
.
|
||||
2. USE. The Software is licensed as a single product; it may not be used on more than one ICEHRM Server at a time. The Software is "in use" on a Server when its installed on a Server. You shall not, nor permit any third party to copy (other than as expressly permitted herein). You shall not rent, lease or lend the Software to any other person, nor transfer or sub-licence your licence rights to any other person.
|
||||
|
||||
3. TERM. This Agreement is effective until terminated as set forth herein. This Agreement will terminate automatically if you fail to comply with any of the conditions, limitations or other requirements described herein. Upon any termination of this Agreement, you must immediately destroy all copies of the Software and the Documentation. You may terminate this Agreement at any point by destroying all copies of the Software and the Documentation.
|
||||
|
||||
4. SUPPORT. Gamonoid Media Pvt Ltd will provide you support according to the support agreement subscribed by the company.
|
||||
|
||||
5. OWNERSHIP RIGHTS. The Software is protected by copyright laws. ICEHRM and Gamonoid Media Pvt Ltd own and retain all right, title and interest in and to the Software, including all copyrights, patents, trademarks and other intellectual property rights therein. Your possession, installation, or use of the Software does not transfer to you any title to the intellectual property in the Software, and you will not acquire any rights to the Software except as expressly set forth in this Agreement.
|
||||
|
||||
6. LIMITED WARRANTY. You may not rent, lease, loan or resell the Software. You may not permit third parties to benefit from the use or functionality of the Software via a timesharing, service bureau or other arrangement, except to the extent such use is specified in the applicable list price or product packaging for the Software. You may not transfer any of the rights granted to you under this Agreement. You may not modify, or create derivative works based upon, the Software in whole or in part. You may not copy the Software or Documentation except as expressly permitted in Section 1 above. You may not remove any proprietary notices or labels on the Software. All rights not expressly set forth hereunder are reserved by ICEHRM. ICEHRM reserves the right to periodically conduct audits upon advance written notice to verify compliance with the terms of this Agreement.
|
||||
|
||||
7. WARRANTY and DISCLAIMER.
|
||||
|
||||
(i) Gamonoid Media Pvt Ltd. warrants that for 30 days from first download or installation the Software will perform substantially in accordance with the functionality described in the Documentation (http://blog.icehrm.com) when operated properly and in the manner specified in the Documentation.
|
||||
|
||||
(ii) You accept all responsibility for the selection of this Software to meet your requirements.
|
||||
|
||||
(iii) Gamonoid Media Pvt Ltd. does not warrant that the Software and/or the Documentation will be suitable for such requirements nor that any use will be uninterrupted and error free.
|
||||
|
||||
(iv) The warranty in (i) shall not apply if you (a) make or cause to be made any modifications to this Software, (b) use the Software in a manner for which it was not intended or (c) use the Software other than as permitted under this Agreement.
|
||||
|
||||
(vii) The warranties and conditions stated in this Agreement are in lieu of all other conditions, warranties or other terms concerning the supply or purported supply of, failure to supply or delay in supplying the Software or the Documentation which might but for this paragraph (vii) have effect between the ICEHRM and you or would otherwise be implied into or incorporated into this Agreement or any collateral contract, whether by statute, common law or otherwise, all of which are hereby excluded (including, without limitation, the implied conditions, warranties or other terms as to satisfactory quality, fitness for purpose or as to the use of reasonable skill and care).
|
||||
|
||||
8. LIMITATION of LIABILITY. Gamonoid Media Pvt Ltd. shall have no liability (whether in contract, tort, restitution or otherwise) for any of the following losses or damage (whether such losses or damage were foreseen, foreseeable, known or otherwise):
|
||||
- Loss of revenue;
|
||||
- Loss of actual or anticipated profits (including for loss of profits on contracts);
|
||||
- Loss of the use of money;
|
||||
- Loss of anticipated savings;
|
||||
- Loss of business;
|
||||
- Loss of opportunity;
|
||||
- Loss of goodwill;
|
||||
- Loss of reputation;
|
||||
- Loss of, damage to or corruption of data;
|
||||
or
|
||||
Any indirect or consequential loss or damage howsoever caused (including, for the avoidance of doubt, where such loss or damage is of the type specified in paragraph (ii), (a) to (ii), (i).
|
||||
The ICEHRM liability (whether in contract, tort, restitution or otherwise) arising out of or in connection with the supply of the Software shall in no circumstances exceed a sum equal to the amount equally paid by you for the Software.
|
||||
The construction and interpretation of this Agreement shall be governed in accordance with the laws of Sri Lanka. The parties hereby submit to the jurisdiction of the courts of Sri Lanka save that ICEHRM as claimant shall be entitled to initiate proceedings in any court of competent jurisdiction.
|
||||
This Agreement contains the entire understanding of the parties with respect to the subject matter hereof and supersedes all and any prior understandings, undertakings and promises between you and ICEHRM, whether oral or in writing, which have been given or may be implied from anything written or said in negotiations between us or our representatives prior to this Agreement and all prior agreements between the parties relating to the matters aforesaid shall cease to have effect as from the Effective Date.
|
||||
7
ext/admin/salary/README.txt
Normal file
7
ext/admin/salary/README.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
This module is licensed under IceHrm Commercial License, which can be found in LICENSE.txt.
|
||||
You are allowed to make any modification required to these module, but only allowed to use
|
||||
the module in one production server (even with modifications).
|
||||
|
||||
Installation
|
||||
------------
|
||||
Copy this module into <icehrm path>/admin/ directory
|
||||
@@ -1,27 +1,26 @@
|
||||
<?php
|
||||
if (!class_exists('PayrollAdminManager')) {
|
||||
class PayrollAdminManager extends AbstractModuleManager{
|
||||
|
||||
public function initializeUserClasses(){
|
||||
|
||||
}
|
||||
|
||||
public function initializeFieldMappings(){
|
||||
|
||||
}
|
||||
|
||||
public function initializeDatabaseErrorMappings(){
|
||||
if (!class_exists('SalaryAdminManager')) {
|
||||
class SalaryAdminManager extends AbstractModuleManager{
|
||||
|
||||
}
|
||||
|
||||
public function setupModuleClassDefinitions(){
|
||||
public function initializeUserClasses(){
|
||||
|
||||
}
|
||||
|
||||
public function initializeFieldMappings(){
|
||||
|
||||
}
|
||||
|
||||
public function initializeDatabaseErrorMappings(){
|
||||
|
||||
}
|
||||
|
||||
public function setupModuleClassDefinitions(){
|
||||
$this->addModelClass('SalaryComponentType');
|
||||
$this->addModelClass('SalaryComponent');
|
||||
$this->addModelClass('Deduction');
|
||||
$this->addModelClass('PayrollEmployee');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!class_exists('SalaryComponentType')) {
|
||||
@@ -52,9 +51,10 @@ if (!class_exists('SalaryComponent')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!class_exists('Deduction')) {
|
||||
class Deduction extends ICEHRM_Record {
|
||||
var $_table = 'Deductions';
|
||||
|
||||
if (!class_exists('PayrollEmployee')) {
|
||||
class PayrollEmployee extends ICEHRM_Record {
|
||||
var $_table = 'PayrollEmployees';
|
||||
|
||||
public function getAdminAccess(){
|
||||
return array("get","element","save","delete");
|
||||
@@ -66,4 +66,3 @@ if (!class_exists('Deduction')) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
$moduleName = 'metadata';
|
||||
$moduleName = 'salary';
|
||||
define('MODULE_PATH',dirname(__FILE__));
|
||||
include APP_BASE_PATH.'header.php';
|
||||
include APP_BASE_PATH.'modulejslibs.inc.php';
|
||||
include APP_BASE_PATH.'mod-houlejslibs.inc.php';
|
||||
|
||||
$moduleBuilder = new ModuleBuilder();
|
||||
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab('SalaryComponentType','SalaryComponentType','Salary Component Types','SalaryComponentTypeAdapter','','',true));
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab('SalaryComponent','SalaryComponent','Salary Components','SalaryComponentAdapter','',''));
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab('EmployeeSalary','EmployeeSalary','Employee Salary','EmployeeSalaryAdapter','','',false,array("setRemoteTable"=>"true")));
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab('EmployeeSalary','EmployeeSalary','Employee Salary Components','EmployeeSalaryAdapter','','',false,array("setRemoteTable"=>"true")));
|
||||
|
||||
|
||||
echo UIManager::getInstance()->renderModule($moduleBuilder);
|
||||
@@ -2,7 +2,6 @@
|
||||
* Author: Thilina Hasantha
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* SalaryComponentTypeAdapter
|
||||
*/
|
||||
@@ -16,27 +15,27 @@ SalaryComponentTypeAdapter.inherits(AdapterBase);
|
||||
|
||||
|
||||
SalaryComponentTypeAdapter.method('getDataMapping', function() {
|
||||
return [
|
||||
"id",
|
||||
"code",
|
||||
"name"
|
||||
];
|
||||
return [
|
||||
"id",
|
||||
"code",
|
||||
"name"
|
||||
];
|
||||
});
|
||||
|
||||
SalaryComponentTypeAdapter.method('getHeaders', function() {
|
||||
return [
|
||||
{ "sTitle": "ID" ,"bVisible":false},
|
||||
{ "sTitle": "Code" },
|
||||
{ "sTitle": "Name"}
|
||||
];
|
||||
return [
|
||||
{ "sTitle": "ID" ,"bVisible":false},
|
||||
{ "sTitle": "Code" },
|
||||
{ "sTitle": "Name"}
|
||||
];
|
||||
});
|
||||
|
||||
SalaryComponentTypeAdapter.method('getFormFields', function() {
|
||||
return [
|
||||
[ "id", {"label":"ID","type":"hidden"}],
|
||||
[ "code", {"label":"Code","type":"text","validation":""}],
|
||||
[ "name", {"label":"Name","type":"text","validation":""}]
|
||||
];
|
||||
return [
|
||||
[ "id", {"label":"ID","type":"hidden"}],
|
||||
[ "code", {"label":"Code","type":"text","validation":""}],
|
||||
[ "name", {"label":"Name","type":"text","validation":""}]
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
@@ -53,30 +52,30 @@ SalaryComponentAdapter.inherits(AdapterBase);
|
||||
|
||||
|
||||
SalaryComponentAdapter.method('getDataMapping', function() {
|
||||
return [
|
||||
"id",
|
||||
"name",
|
||||
"componentType",
|
||||
"details"
|
||||
];
|
||||
return [
|
||||
"id",
|
||||
"name",
|
||||
"componentType",
|
||||
"details"
|
||||
];
|
||||
});
|
||||
|
||||
SalaryComponentAdapter.method('getHeaders', function() {
|
||||
return [
|
||||
{ "sTitle": "ID" ,"bVisible":false},
|
||||
{ "sTitle": "Name" },
|
||||
{ "sTitle": "Salary Component Type" },
|
||||
{ "sTitle": "Details"}
|
||||
];
|
||||
return [
|
||||
{ "sTitle": "ID" ,"bVisible":false},
|
||||
{ "sTitle": "Name" },
|
||||
{ "sTitle": "Salary Component Type" },
|
||||
{ "sTitle": "Details"}
|
||||
];
|
||||
});
|
||||
|
||||
SalaryComponentAdapter.method('getFormFields', function() {
|
||||
return [
|
||||
[ "id", {"label":"ID","type":"hidden"}],
|
||||
[ "name", {"label":"Name","type":"text","validation":""}],
|
||||
[ "componentType", {"label":"Salary Component Type","type":"select2","remote-source":["SalaryComponentType","id","name"]}],
|
||||
[ "details", {"label":"Details","type":"textarea","validation":"none"}]
|
||||
];
|
||||
return [
|
||||
[ "id", {"label":"ID","type":"hidden"}],
|
||||
[ "name", {"label":"Name","type":"text","validation":""}],
|
||||
[ "componentType", {"label":"Salary Component Type","type":"select2","remote-source":["SalaryComponentType","id","name"]}],
|
||||
[ "details", {"label":"Details","type":"textarea","validation":"none"}]
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
@@ -96,8 +95,7 @@ DeductionAdapter.method('getDataMapping', function() {
|
||||
return [
|
||||
"id",
|
||||
"name",
|
||||
"contributor",
|
||||
"type",
|
||||
"deduction_group"
|
||||
];
|
||||
});
|
||||
|
||||
@@ -105,32 +103,52 @@ DeductionAdapter.method('getHeaders', function() {
|
||||
return [
|
||||
{ "sTitle": "ID" ,"bVisible":false},
|
||||
{ "sTitle": "Name" },
|
||||
{ "sTitle": "Contributor"},
|
||||
{ "sTitle": "Deduction Type"}
|
||||
{ "sTitle": "Calculation Group"}
|
||||
];
|
||||
});
|
||||
|
||||
DeductionAdapter.method('getFormFields', function() {
|
||||
|
||||
var rangeAmounts = [ "rangeAmounts", {"label":"Deduction Amounts","type":"datagroup",
|
||||
var rangeAmounts = [ "rangeAmounts", {"label":"Calculation Process","type":"datagroup",
|
||||
"form":[
|
||||
[ "lowerCondition", {"label":"Lower Limit Condition","type":"select","source":[["No Lower Limit","No Lower Limit"],[">","Greater than"],[">=","Greater than or Equal"]]}],
|
||||
[ "lowerLimit", {"label":"Lower Limit","type":"text","validation":"none"}],
|
||||
[ "upperCondition", {"label":"Upper Limit Condition","type":"select","source":[["No Upper Limit","No Upper Limit"],["<","Less than"],["<=","Less than or Equal"]]}],
|
||||
[ "upperLimit", {"label":"Upper Limit","type":"text","validation":"none"}],
|
||||
[ "amount", {"label":"Value","type":"text","validation":"float"}]
|
||||
[ "lowerCondition", {"label":"Lower Limit Condition","type":"select","source":[["No Lower Limit","No Lower Limit"],["gt","Greater than"],["gte","Greater than or Equal"]]}],
|
||||
[ "lowerLimit", {"label":"Lower Limit","type":"text","validation":"float"}],
|
||||
[ "upperCondition", {"label":"Upper Limit Condition","type":"select","source":[["No Upper Limit","No Upper Limit"],["lt","Less than"],["lte","Less than or Equal"]]}],
|
||||
[ "upperLimit", {"label":"Upper Limit","type":"text","validation":"float"}],
|
||||
[ "amount", {"label":"Value","type":"text","validation":""}]
|
||||
],
|
||||
"html":'<div id="#_id_#" class="panel panel-default">#_delete_##_edit_#<div class="panel-body">#_renderFunction_#</div></div>',
|
||||
"validation":"none",
|
||||
"custom-validate-function":function (data){
|
||||
var res = {};
|
||||
res['valid'] = true;
|
||||
if(lowerCondition != 'No Lower Limit'){
|
||||
data.lowerLimit = 0;
|
||||
}
|
||||
if(upperCondition != 'No Upper Limit'){
|
||||
data.upperLimit = 0;
|
||||
}
|
||||
res['params'] = data;
|
||||
return res;
|
||||
},
|
||||
"render":function(item){
|
||||
var output = "";
|
||||
var getSymbol = function(text){
|
||||
var map = {};
|
||||
map['gt'] = '>';
|
||||
map['gte'] = '>=';
|
||||
map['lt'] = '<';
|
||||
map['lte'] = '<=';
|
||||
|
||||
return map[text];
|
||||
}
|
||||
if(item.lowerCondition != "No Lower Limit"){
|
||||
output += item.lowerLimit + " " + item.lowerCondition + " ";
|
||||
output += " and ";
|
||||
output += item.lowerLimit + " " + getSymbol(item.lowerCondition) + " ";
|
||||
}
|
||||
|
||||
if(item.upperCondition != "No Upper Limit"){
|
||||
output += item.upperCondition + " " + item.upperLimit + " ";
|
||||
output += " and ";
|
||||
output += getSymbol(item.upperCondition) + " " + item.upperLimit + " ";
|
||||
}
|
||||
if(output == ""){
|
||||
return "Deduction is "+item.amount + " for all ranges";
|
||||
@@ -148,17 +166,16 @@ DeductionAdapter.method('getFormFields', function() {
|
||||
return [
|
||||
[ "id", {"label":"ID","type":"hidden"}],
|
||||
[ "name", {"label":"Name","type":"text","validation":""}],
|
||||
[ "contributor", {"label":"Contributor","type":"select","source":[["Employee","Employee"],["Employer","Employer"]]}],
|
||||
[ "type", {"label":"Deduction Type","type":"select","source":[["Fixed","Fixed"],["Percentage","Percentage"]]}],
|
||||
[ "percentage_type", {"label":"Percentage Type","type":"select","source":[["On Component","On Component"],["On Component Type","On Component Type"]]}],
|
||||
[ "componentType", {"label":"Salary Component Type","type":"select2","allow-null":true,"null-label":"N/A","remote-source":["SalaryComponentType","id","name"]}],
|
||||
[ "component", {"label":"Salary Component","type":"select2","allow-null":true,"null-label":"N/A","remote-source":["SalaryComponent","id","name"]}],
|
||||
[ "componentType", {"label":"Salary Component Type","type":"select2multi","allow-null":true,"remote-source":["SalaryComponentType","id","name"]}],
|
||||
[ "component", {"label":"Salary Component","type":"select2multi","allow-null":true,"remote-source":["SalaryComponent","id","name"]}],
|
||||
[ "payrollColumn", {"label":"Payroll Report Column","type":"select2","allow-null":true,"remote-source":["PayrollColumn","id","name"]}],
|
||||
rangeAmounts,
|
||||
[ "country", {"label":"Country","type":"select2","remote-source":["Country","id","name"]}]
|
||||
[ "deduction_group", {"label":"Calculation Group","type":"select2","allow-null":true,"null-label":"None","remote-source":["DeductionGroup","id","name"]}]
|
||||
|
||||
];
|
||||
});
|
||||
|
||||
/*
|
||||
DeductionAdapter.method('doCustomValidation', function(params) {
|
||||
if(params.type == "Fixed"){
|
||||
return null;
|
||||
@@ -177,7 +194,8 @@ DeductionAdapter.method('doCustomValidation', function(params) {
|
||||
|
||||
return null;
|
||||
});
|
||||
|
||||
*/
|
||||
/*
|
||||
DeductionAdapter.method('postRenderForm', function(object, $tempDomObj) {
|
||||
|
||||
$tempDomObj.find("#field_componentType").hide();
|
||||
@@ -213,6 +231,10 @@ DeductionAdapter.method('postRenderForm', function(object, $tempDomObj) {
|
||||
}
|
||||
});
|
||||
});
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
@@ -232,8 +254,6 @@ EmployeeSalaryAdapter.method('getDataMapping', function() {
|
||||
"id",
|
||||
"employee",
|
||||
"component",
|
||||
"pay_frequency",
|
||||
"currency",
|
||||
"amount",
|
||||
"details"
|
||||
];
|
||||
@@ -244,8 +264,6 @@ EmployeeSalaryAdapter.method('getHeaders', function() {
|
||||
{ "sTitle": "ID" ,"bVisible":false},
|
||||
{ "sTitle": "Employee" },
|
||||
{ "sTitle": "Salary Component" },
|
||||
{ "sTitle": "Pay Frequency"},
|
||||
{ "sTitle": "Currency"},
|
||||
{ "sTitle": "Amount"},
|
||||
{ "sTitle": "Details"}
|
||||
];
|
||||
@@ -256,8 +274,6 @@ EmployeeSalaryAdapter.method('getFormFields', function() {
|
||||
[ "id", {"label":"ID","type":"hidden"}],
|
||||
[ "employee", {"label":"Employee","type":"select2","remote-source":["Employee","id","first_name+last_name"]}],
|
||||
[ "component", {"label":"Salary Component","type":"select2","remote-source":["SalaryComponent","id","name"]}],
|
||||
[ "pay_frequency", {"label":"Pay Frequency","type":"select","source":[["Hourly","Hourly"],["Daily","Daily"],["Bi Weekly","Bi Weekly"],["Weekly","Weekly"],["Semi Monthly","Semi Monthly"],["Monthly","Monthly"]]}],
|
||||
[ "currency", {"label":"Currency","type":"select2","remote-source":["CurrencyType","id","name"]}],
|
||||
[ "amount", {"label":"Amount","type":"text","validation":"float"}],
|
||||
[ "details", {"label":"Details","type":"textarea","validation":"none"}]
|
||||
];
|
||||
@@ -272,3 +288,43 @@ EmployeeSalaryAdapter.method('getFilters', function() {
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* DeductionGroupAdapter
|
||||
*/
|
||||
|
||||
function DeductionGroupAdapter(endPoint,tab,filter,orderBy) {
|
||||
this.initAdapter(endPoint,tab,filter,orderBy);
|
||||
}
|
||||
|
||||
DeductionGroupAdapter.inherits(AdapterBase);
|
||||
|
||||
|
||||
|
||||
DeductionGroupAdapter.method('getDataMapping', function() {
|
||||
return [
|
||||
"id",
|
||||
"name",
|
||||
"description"
|
||||
];
|
||||
});
|
||||
|
||||
DeductionGroupAdapter.method('getHeaders', function() {
|
||||
return [
|
||||
{ "sTitle": "ID" ,"bVisible":false},
|
||||
{ "sTitle": "Name" },
|
||||
{ "sTitle": "Details" }
|
||||
];
|
||||
});
|
||||
|
||||
DeductionGroupAdapter.method('getFormFields', function() {
|
||||
return [
|
||||
[ "id", {"label":"ID","type":"hidden"}],
|
||||
[ "name", {"label":"Name","type":"text","validation":""}],
|
||||
[ "description", {"label":"Details","type":"textarea","validation":"none"}]
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
11
ext/admin/salary/meta.json
Normal file
11
ext/admin/salary/meta.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"label":"Salary",
|
||||
"menu":"Payroll",
|
||||
"order":"1",
|
||||
"icon":"fa-money",
|
||||
"user_levels":["Admin"],
|
||||
|
||||
"permissions":
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -22,18 +22,21 @@ Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilin
|
||||
*/
|
||||
|
||||
class SettingsInitialize extends AbstractInitialize{
|
||||
|
||||
|
||||
public function init(){
|
||||
if(SettingsManager::getInstance()->getSetting("Api: REST Api Enabled") == "1"){
|
||||
$user = BaseService::getInstance()->getCurrentUser();
|
||||
if(empty($user)){
|
||||
return;
|
||||
}
|
||||
$dbUser = new User();
|
||||
$dbUser->Load("id = ?",array($user->id));
|
||||
$resp = RestApiManager::getInstance()->getAccessTokenForUser($dbUser);
|
||||
if($resp->getStatus() != IceResponse::SUCCESS){
|
||||
LogManager::getInstance()->error("Error occured while creating REST Api acces token for ".$user->username);
|
||||
LogManager::getInstance()->error("Error occurred while creating REST Api access token for ".$user->username);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
17
ext/admin/settings/dashboard.html
Normal file
17
ext/admin/settings/dashboard.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<div class="col-lg-3 col-xs-12">
|
||||
|
||||
<div class="small-box bg-green">
|
||||
<div class="inner">
|
||||
<h3>Settings</h3>
|
||||
<p>
|
||||
Configure IceHrm
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-settings"></i>
|
||||
</div>
|
||||
<a href="#_moduleLink_#" class="small-box-footer" id="settingsLink">
|
||||
Update Settings <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -25,31 +25,26 @@ $moduleName = 'settings';
|
||||
define('MODULE_PATH',dirname(__FILE__));
|
||||
include APP_BASE_PATH.'header.php';
|
||||
include APP_BASE_PATH.'modulejslibs.inc.php';
|
||||
?><div class="span9">
|
||||
|
||||
<ul class="nav nav-tabs" id="modTab" style="margin-bottom:0px;margin-left:5px;border-bottom: none;">
|
||||
<li class="active"><a id="tabSetting" href="#tabPageSetting">Settings</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="tabPageSetting">
|
||||
<div id="Setting" class="reviewBlock" data-content="List" style="padding-left:5px;">
|
||||
|
||||
</div>
|
||||
<div id="SettingForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
$moduleBuilder = new ModuleBuilder();
|
||||
|
||||
$options1 = array();
|
||||
$options1['setShowAddNew'] = 'false';
|
||||
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab('CompanySetting','Setting','Company','SettingAdapter','{"name":["Company:"]}','name',true,$options1));
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab('SystemSetting','Setting','System','SettingAdapter','{"name":["System:"]}','name',false,$options1));
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab('EmailSetting','Setting','Email','SettingAdapter','{"name":["Email:"]}','name',false,$options1));
|
||||
//$moduleBuilder->addModuleOrGroup(new ModuleTab('LeaveSetting','Setting','Leave / PTO','SettingAdapter','{"name":["Leave:"]}','name',false,$options1));
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab('LDAPSetting','Setting','LDAP','SettingAdapter','{"name":["LDAP:"]}','name',false,$options1));
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab('OtherSetting','Setting','Other','SettingAdapter','{"name":["Projects:","Attendance:","Recruitment:","Notifications:","Expense:","Travel:","Api:"]}','name',false,$options1));
|
||||
echo UIManager::getInstance()->renderModule($moduleBuilder);
|
||||
?>
|
||||
</div>
|
||||
<script>
|
||||
var modJsList = new Array();
|
||||
|
||||
modJsList['tabSetting'] = new SettingAdapter('Setting','Setting','','name');
|
||||
modJsList['tabSetting'].setShowAddNew(false);
|
||||
|
||||
var modJs = modJsList['tabSetting'];
|
||||
$(window).load(function() {
|
||||
modJs.loadRemoteDataForSettings();
|
||||
});
|
||||
|
||||
</script>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
@@ -55,13 +55,56 @@ SettingAdapter.method('getMetaFieldForRendering', function(fieldName) {
|
||||
return "";
|
||||
});
|
||||
|
||||
SettingAdapter.method('edit', function(id) {
|
||||
this.loadRemoteDataForSettings();
|
||||
this.uber('edit',id);
|
||||
});
|
||||
|
||||
|
||||
SettingAdapter.method('fillForm', function(object) {
|
||||
this.uber('fillForm',object);
|
||||
|
||||
var metaField = this.getMetaFieldForRendering('value');
|
||||
var metaVal = object[metaField];
|
||||
var formFields = null;
|
||||
|
||||
if(metaVal != "" && metaVal != undefined){
|
||||
var formFields = [
|
||||
[ "id", {"label":"ID","type":"hidden"}],
|
||||
JSON.parse(metaVal)
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
this.uber('fillForm',object, null, formFields);
|
||||
$("#helptext").html(object.description);
|
||||
});
|
||||
|
||||
|
||||
SettingAdapter.method('loadRemoteDataForSettings', function () {
|
||||
var fields = [];
|
||||
var field = null;
|
||||
fields.push(["country", {"label": "Country", "type": "select2multi", "remote-source": ["Country", "id", "name"]}]);
|
||||
fields.push(["currency", {"label": "Currency", "type": "select2multi", "remote-source": ["CurrencyType","id","code+name"]}]);
|
||||
fields.push(["nationality", {"label": "Nationality", "type": "select2multi", "remote-source": ["Nationality","id","name"]}]);
|
||||
|
||||
for(index in fields){
|
||||
field = fields[index];
|
||||
if (field[1]['remote-source'] != undefined && field[1]['remote-source'] != null) {
|
||||
var key = field[1]['remote-source'][0] + "_" + field[1]['remote-source'][1] + "_" + field[1]['remote-source'][2];
|
||||
this.fieldMasterDataKeys[key] = false;
|
||||
this.sourceMapping[field[0]] = field[1]['remote-source'];
|
||||
|
||||
var callBackData = {};
|
||||
callBackData['callBack'] = 'initFieldMasterDataResponse';
|
||||
callBackData['callBackData'] = [key];
|
||||
|
||||
this.getFieldValues(field[1]['remote-source'], callBackData);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
SettingAdapter.method('getHelpLink', function () {
|
||||
return 'http://blog.icehrm.com/docs/settings/';
|
||||
});
|
||||
});
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"label":"Settings",
|
||||
"menu":"System",
|
||||
"order":"1",
|
||||
"icon":"fa-cogs",
|
||||
"user_levels":["Admin"],
|
||||
|
||||
"permissions":
|
||||
{
|
||||
}
|
||||
"label":"Settings",
|
||||
"menu":"System",
|
||||
"order":"1",
|
||||
"icon":"fa-cogs",
|
||||
"user_levels":["Admin"],
|
||||
"dashboardPosition":8,
|
||||
"permissions":
|
||||
{
|
||||
}
|
||||
}
|
||||
19
ext/admin/travel/dashboard.html
Normal file
19
ext/admin/travel/dashboard.html
Normal file
@@ -0,0 +1,19 @@
|
||||
<div class="col-lg-3 col-xs-12">
|
||||
|
||||
<div class="small-box bg-red">
|
||||
<div class="inner">
|
||||
<h3>
|
||||
Travel
|
||||
</h3>
|
||||
<p id="numberOfTravel">
|
||||
Requests
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-plane"></i>
|
||||
</div>
|
||||
<a href="#_moduleLink_#" class="small-box-footer" id="travelLink">
|
||||
Manage Travel <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,11 +1,12 @@
|
||||
{
|
||||
"label":"Travel Administration",
|
||||
"menu":"Employees",
|
||||
"order":"6",
|
||||
"icon":"fa-plane",
|
||||
"user_levels":["Admin","Manager"],
|
||||
"label":"Travel Administration",
|
||||
"menu":"Employees",
|
||||
"order":"6",
|
||||
"icon":"fa-plane",
|
||||
"user_levels":["Admin","Manager"],
|
||||
"dashboardPosition":12,
|
||||
|
||||
"permissions":
|
||||
{
|
||||
}
|
||||
"permissions":
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -23,8 +23,16 @@ Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilin
|
||||
|
||||
class UsersActionManager extends SubActionManager{
|
||||
public function changePassword($req){
|
||||
if($this->user->user_level == 'Admin' || $this->user->id == $req->id){
|
||||
$user = $this->baseService->getElement('User',$req->id);
|
||||
if(defined('DEMO_MODE')){
|
||||
return new IceResponse(IceResponse::ERROR,"You are not allowed to change the password in demo mode");
|
||||
}
|
||||
|
||||
$user = new User();
|
||||
$user->Load("id = ?",array($req->id));
|
||||
LogManager::getInstance()->debug("Current User:".print_r($this->user,true));
|
||||
LogManager::getInstance()->debug("Edit User:".print_r($user,true));
|
||||
if($this->user->user_level == 'Admin' || $this->user->id == $user->id){
|
||||
|
||||
if(empty($user->id)){
|
||||
return new IceResponse(IceResponse::ERROR,"Please save the user first");
|
||||
}
|
||||
|
||||
@@ -19,6 +19,14 @@ if (!class_exists('UsersAdminManager')) {
|
||||
$this->addModelClass('User');
|
||||
}
|
||||
|
||||
public function getDashboardItemData(){
|
||||
$data = array();
|
||||
$user = new User();
|
||||
$data['numberOfUsers'] = $user->Count("1 = 1");
|
||||
return $data;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,11 +54,54 @@ if (!class_exists('User')) {
|
||||
if(count($users) > 0){
|
||||
return new IceResponse(IceResponse::ERROR,"A user with same authentication email already exist");
|
||||
}
|
||||
|
||||
//Check if you are trying to change user level
|
||||
$oldUser = new User();
|
||||
$oldUser->Load("id = ?",array($obj->id));
|
||||
if($oldUser->user_level != $obj->user_level && $oldUser->user_level == 'Admin'){
|
||||
$adminUsers = $userTemp->Find("user_level = ?",array("Admin"));
|
||||
if(count($adminUsers) == 1 && $adminUsers[0]->id == $obj->id){
|
||||
return new IceResponse(IceResponse::ERROR,"You are the only admin user for the application. You are not allowed to revoke your admin rights");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//Check if the user have rights to the default module
|
||||
if(!empty($obj->default_module)){
|
||||
$module = new Module();
|
||||
$module->Load("id = ?",array($obj->default_module));
|
||||
if($module->mod_group == "user"){
|
||||
$module->mod_group = "modules";
|
||||
}
|
||||
$moduleManager = BaseService::getInstance()->getModuleManager($module->mod_group, $module->name);
|
||||
if(!BaseService::getInstance()->isModuleAllowedForGivenUser($moduleManager, $obj)){
|
||||
return new IceResponse(IceResponse::ERROR,"This module can not be set as the default module for the user since the user do not have access to this module");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return new IceResponse(IceResponse::SUCCESS,"");
|
||||
}
|
||||
|
||||
|
||||
var $_table = 'Users';
|
||||
}
|
||||
}
|
||||
|
||||
if (!class_exists('UserRole')) {
|
||||
class UserRole extends ICEHRM_Record {
|
||||
public function getAdminAccess(){
|
||||
return array("get","element","save","delete");
|
||||
}
|
||||
|
||||
public function getUserAccess(){
|
||||
return array();
|
||||
}
|
||||
|
||||
var $_table = 'UserRoles';
|
||||
}
|
||||
}
|
||||
17
ext/admin/users/dashboard.html
Normal file
17
ext/admin/users/dashboard.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<div class="col-lg-3 col-xs-12">
|
||||
|
||||
<div class="small-box bg-yellow">
|
||||
<div class="inner">
|
||||
<h3>Users</h3>
|
||||
<p id="numberOfUsers">
|
||||
#_numberOfUsers_# Users
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-person-add"></i>
|
||||
</div>
|
||||
<a href="#_moduleLink_#" class="small-box-footer" id="usersLink">
|
||||
Manage Users <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -30,6 +30,7 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
|
||||
|
||||
<ul class="nav nav-tabs" id="modTab" style="margin-bottom:0px;margin-left:5px;border-bottom: none;">
|
||||
<li class="active"><a id="tabUser" href="#tabPageUser">Users</a></li>
|
||||
<li class=""><a id="tabUserRole" href="#tabPageUserRole">User Roles</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
@@ -41,6 +42,14 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane" id="tabPageUserRole">
|
||||
<div id="UserRole" class="reviewBlock" data-content="List" style="padding-left:5px;">
|
||||
|
||||
</div>
|
||||
<div id="UserRoleForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -50,7 +59,7 @@ modJsList['tabUser'] = new UserAdapter('User');
|
||||
<?php if(isset($_REQUEST['action']) && $_REQUEST['action'] == "new" && isset($_REQUEST['object'])){?>
|
||||
modJsList['tabUser'].newInitObject = JSON.parse(Base64.decode('<?=$_REQUEST['object']?>'));
|
||||
<?php }?>
|
||||
|
||||
modJsList['tabUserRole'] = new UserRoleAdapter('UserRole');
|
||||
var modJs = modJsList['tabUser'];
|
||||
|
||||
</script>
|
||||
|
||||
@@ -35,7 +35,9 @@ UserAdapter.method('getFormFields', function() {
|
||||
[ "username", {"label":"User Name","type":"text","validation":"username"}],
|
||||
[ "email", {"label":"Email","type":"text","validation":"email"}],
|
||||
[ "employee", {"label":"Employee","type":"select2","allow-null":true,"remote-source":["Employee","id","first_name+last_name"]}],
|
||||
[ "user_level", {"label":"User Level","type":"select","source":[["Admin","Admin"],["Manager","Manager"],["Employee","Employee"]]}]
|
||||
[ "user_level", {"label":"User Level","type":"select","source":[["Admin","Admin"],["Manager","Manager"],["Employee","Employee"],["Other","Other"]]}],
|
||||
[ "user_roles", {"label":"User Roles","type":"select2multi","remote-source":["UserRole","id","name"]}],
|
||||
[ "default_module", {"label":"Default Module","type":"select2","null-label":"No Default Module","allow-null":true,"remote-source":["Module","id","menu+label"]}]
|
||||
];
|
||||
});
|
||||
|
||||
@@ -62,8 +64,8 @@ UserAdapter.method('saveUserFailCallBack', function(callBackData,serverData) {
|
||||
|
||||
UserAdapter.method('doCustomValidation', function(params) {
|
||||
var msg = null;
|
||||
if(params['user_level'] != "Admin" && params['employee'] == "NULL"){
|
||||
msg = "For non Admin users, you have to assign an employee when adding or editing the user.<br/>";
|
||||
if((params['user_level'] != "Admin" && params['user_level'] != "Other") && params['employee'] == "NULL"){
|
||||
msg = "For this user type, you have to assign an employee when adding or editing the user.<br/>";
|
||||
msg += " You may create a new employee through 'Admin'->'Employees' menu";
|
||||
}
|
||||
return msg;
|
||||
@@ -154,9 +156,39 @@ UserAdapter.method('changePasswordFailCallBack', function(callBackData,serverDat
|
||||
this.showMessage("Error",callBackData);
|
||||
});
|
||||
|
||||
UserAdapter.method('getHelpLink', function () {
|
||||
return 'http://blog.icehrm.com/?page_id=132';
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* UserRoleAdapter
|
||||
*/
|
||||
|
||||
function UserRoleAdapter(endPoint,tab,filter,orderBy) {
|
||||
this.initAdapter(endPoint,tab,filter,orderBy);
|
||||
}
|
||||
|
||||
UserRoleAdapter.inherits(AdapterBase);
|
||||
|
||||
|
||||
|
||||
UserRoleAdapter.method('getDataMapping', function() {
|
||||
return [
|
||||
"id",
|
||||
"name"
|
||||
];
|
||||
});
|
||||
|
||||
UserRoleAdapter.method('getHeaders', function() {
|
||||
return [
|
||||
{ "sTitle": "ID" ,"bVisible":false},
|
||||
{ "sTitle": "Name"}
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
UserRoleAdapter.method('getFormFields', function() {
|
||||
return [
|
||||
[ "id", {"label":"ID","type":"hidden"}],
|
||||
[ "name", {"label":"Name","type":"text","validation":""}]
|
||||
];
|
||||
});
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
{
|
||||
"label":"Users",
|
||||
"menu":"System",
|
||||
"order":"2",
|
||||
"icon":"fa-user",
|
||||
"user_levels":["Admin"],
|
||||
"label":"Users",
|
||||
"menu":"System",
|
||||
"order":"2",
|
||||
"icon":"fa-user",
|
||||
"user_levels":["Admin"],
|
||||
"dashboardPosition":3,
|
||||
|
||||
"permissions":
|
||||
{
|
||||
}
|
||||
"permissions":
|
||||
{
|
||||
}
|
||||
}
|
||||
17
ext/modules/attendance/dashboard.html
Normal file
17
ext/modules/attendance/dashboard.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<div class="col-lg-3 col-xs-12">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-aqua">
|
||||
<div class="inner">
|
||||
<h3 id="lastPunchTime">
|
||||
Punch In
|
||||
</h3>
|
||||
<p>or punch out</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-ios7-alarm-outline"></i>
|
||||
</div>
|
||||
<a href="#_moduleLink_#" class="small-box-footer" id="atteandanceLink">
|
||||
Record Attendance <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -4,7 +4,7 @@
|
||||
"order":"2",
|
||||
"icon":"fa-clock-o",
|
||||
"user_levels":["Admin","Manager","Employee"],
|
||||
|
||||
"dashboardPosition":102,
|
||||
"permissions":
|
||||
{
|
||||
}
|
||||
|
||||
@@ -21,49 +21,82 @@ Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
|
||||
Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
|
||||
*/
|
||||
|
||||
include (APP_BASE_PATH."modules/leaves/api/LeavesActionManager.php");
|
||||
|
||||
class DashboardActionManager extends SubActionManager{
|
||||
|
||||
public function getPendingLeaves($req){
|
||||
|
||||
return new IceResponse(IceResponse::SUCCESS,0);
|
||||
|
||||
}
|
||||
|
||||
public function getLastTimeSheetHours($req){
|
||||
$timeSheet = new EmployeeTimeSheet();
|
||||
$timeSheet->Load("employee = ? order by date_end desc limit 1",array($this->getCurrentProfileId()));
|
||||
|
||||
if(empty($timeSheet->employee)){
|
||||
return new IceResponse(IceResponse::SUCCESS,"0:00");
|
||||
}
|
||||
|
||||
$timeSheetEntry = new EmployeeTimeEntry();
|
||||
$list = $timeSheetEntry->Find("timesheet = ?",array($timeSheet->id));
|
||||
|
||||
$seconds = 0;
|
||||
foreach($list as $entry){
|
||||
$seconds += (strtotime($entry->date_end) - strtotime($entry->date_start));
|
||||
}
|
||||
|
||||
$minutes = (int)($seconds/60);
|
||||
$rem = $minutes % 60;
|
||||
$hours = ($minutes - $rem)/60;
|
||||
if($rem < 10){
|
||||
$rem ="0".$rem;
|
||||
}
|
||||
return new IceResponse(IceResponse::SUCCESS,$hours.":".$rem);
|
||||
|
||||
}
|
||||
|
||||
public function getEmployeeActiveProjects($req){
|
||||
$project = new EmployeeProject();
|
||||
$projects = $project->Find("employee = ? and status =?",array($this->getCurrentProfileId(),'Current'));
|
||||
|
||||
|
||||
return new IceResponse(IceResponse::SUCCESS,count($projects));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function getPendingLeaves($req){
|
||||
|
||||
$lam = new LeavesActionManager();
|
||||
$leavePeriod = $lam->getCurrentLeavePeriod(date("Y-m-d H:i:s"), date("Y-m-d H:i:s"));
|
||||
|
||||
$leave = new EmployeeLeave();
|
||||
$pendingLeaves = $leave->Find("status = ? and employee = ?",array("Pending", $this->getCurrentProfileId()));
|
||||
|
||||
return new IceResponse(IceResponse::SUCCESS,count($pendingLeaves));
|
||||
|
||||
}
|
||||
|
||||
public function getInitData($req){
|
||||
$data = array();
|
||||
|
||||
$emp = new Employee();
|
||||
$data['numberOfEmployees'] = $emp->Count("status = 'Active' and supervisor = ?",array($this->getCurrentProfileId()));
|
||||
|
||||
$data['lastTimeSheetHours'] = $this->getLastTimeSheetHours($req)->getData();
|
||||
$data['activeProjects'] = $this->getEmployeeActiveProjects($req)->getData();
|
||||
$data['pendingLeaves'] = $this->getPendingLeaves($req)->getData();
|
||||
$candidate = new Candidate();
|
||||
$data['numberOfCandidates'] = $candidate->Count("1 = 1");
|
||||
|
||||
$job = new Job();
|
||||
$data['numberOfJobs'] = $job->Count("status = 'Active'");
|
||||
|
||||
|
||||
$attendance = new Attendance();
|
||||
$data['numberOfAttendanceLastWeek'] = $attendance->Count("in_time > '".date("Y-m-d H:i:s",strtotime("-1 week"))."'");
|
||||
|
||||
$course = new Course();
|
||||
$data['numberOfCourses'] = $course->Count("1 = 1");
|
||||
|
||||
return new IceResponse(IceResponse::SUCCESS,$data);
|
||||
|
||||
}
|
||||
|
||||
public function getLastTimeSheetHours($req){
|
||||
$timeSheet = new EmployeeTimeSheet();
|
||||
$timeSheet->Load("employee = ? order by date_end desc limit 1",array($this->getCurrentProfileId()));
|
||||
|
||||
if(empty($timeSheet->employee)){
|
||||
return new IceResponse(IceResponse::SUCCESS,"0:00");
|
||||
}
|
||||
|
||||
$timeSheetEntry = new EmployeeTimeEntry();
|
||||
$list = $timeSheetEntry->Find("timesheet = ?",array($timeSheet->id));
|
||||
|
||||
$seconds = 0;
|
||||
foreach($list as $entry){
|
||||
$seconds += (strtotime($entry->date_end) - strtotime($entry->date_start));
|
||||
}
|
||||
|
||||
$minutes = (int)($seconds/60);
|
||||
$rem = $minutes % 60;
|
||||
$hours = ($minutes - $rem)/60;
|
||||
if($rem < 10){
|
||||
$rem ="0".$rem;
|
||||
}
|
||||
return new IceResponse(IceResponse::SUCCESS,$hours.":".$rem);
|
||||
|
||||
}
|
||||
|
||||
public function getEmployeeActiveProjects($req){
|
||||
$project = new EmployeeProject();
|
||||
$projects = $project->Find("employee = ? and status =?",array($this->getCurrentProfileId(),'Current'));
|
||||
|
||||
|
||||
return new IceResponse(IceResponse::SUCCESS,count($projects));
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -26,166 +26,41 @@ define('MODULE_PATH',dirname(__FILE__));
|
||||
include APP_BASE_PATH.'header.php';
|
||||
include APP_BASE_PATH.'modulejslibs.inc.php';
|
||||
?><div class="span9">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-3 col-xs-12">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-aqua">
|
||||
<div class="inner">
|
||||
<h3 id="lastPunchTime">
|
||||
..
|
||||
</h3>
|
||||
<p id="punchTimeText">
|
||||
Waiting for Response..
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-ios7-alarm-outline"></i>
|
||||
</div>
|
||||
<a href="#" class="small-box-footer" id="atteandanceLink">
|
||||
Record Attendance <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div><!-- ./col -->
|
||||
<div class="col-lg-3 col-xs-12">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-yellow">
|
||||
<div class="inner">
|
||||
<h3 id="timeSheetHoursWorked">..</h3>
|
||||
<p>
|
||||
Hours worked Last Week
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-clock"></i>
|
||||
</div>
|
||||
<a href="#" class="small-box-footer" id="timesheetLink">
|
||||
Update Time Sheet <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div><!-- ./col -->
|
||||
<div class="col-lg-3 col-xs-12">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-red">
|
||||
<div class="inner">
|
||||
<h3 id="numberOfProjects">..</h3>
|
||||
<p>
|
||||
Active Projects
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-pie-graph"></i>
|
||||
</div>
|
||||
<a href="#" class="small-box-footer" id="projectsLink">
|
||||
More info <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div><!-- ./col -->
|
||||
|
||||
<div class="col-lg-3 col-xs-12">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-teal">
|
||||
<div class="inner">
|
||||
<h3>
|
||||
My Travel
|
||||
</h3>
|
||||
<p>
|
||||
Requests
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-plane"></i>
|
||||
</div>
|
||||
<a href="#" class="small-box-footer" id="travelLink">
|
||||
Travel Requests <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-3 col-xs-12">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-yellow">
|
||||
<div class="inner">
|
||||
<h3>
|
||||
Help
|
||||
</h3>
|
||||
<p>
|
||||
User Guide
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-help"></i>
|
||||
</div>
|
||||
<a href="http://blog.icehrm.com/docs/home/" target="_blank" class="small-box-footer" id="icehrmHelpLink">
|
||||
Documentation <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if($user->user_level == "Manager" || $user->user_level == "Admin"){?>
|
||||
|
||||
<div class="col-lg-3 col-xs-12">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-yellow">
|
||||
<div class="inner">
|
||||
<h3>
|
||||
Travel
|
||||
</h3>
|
||||
<p id="numberOfTravel">
|
||||
Management
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-plane"></i>
|
||||
</div>
|
||||
<a href="#" class="small-box-footer" id="traveAdminlLink">
|
||||
Manage Travel <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="col-lg-3 col-xs-12">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-red">
|
||||
<div class="inner">
|
||||
<h3>
|
||||
Attendance
|
||||
</h3>
|
||||
<p id="numberOfDocuments">
|
||||
Monitor
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-ios7-timer"></i>
|
||||
</div>
|
||||
<a href="#" class="small-box-footer" id="attendanceAdminLink">
|
||||
View Attendance <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div><!-- ./col -->
|
||||
|
||||
<div class="col-lg-3 col-xs-12">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-teal">
|
||||
<div class="inner">
|
||||
<h3>Reports</h3>
|
||||
<p>
|
||||
View / Download Reports
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-document-text"></i>
|
||||
</div>
|
||||
<a href="#" class="small-box-footer" id="reportsLink">
|
||||
Create a Report <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div><!-- ./col -->
|
||||
|
||||
|
||||
<?php }?>
|
||||
</div>
|
||||
<?php
|
||||
$moduleManagers = BaseService::getInstance()->getModuleManagers();
|
||||
$dashBoardList = array();
|
||||
foreach($moduleManagers as $moduleManagerObj){
|
||||
|
||||
$allowed = BaseService::getInstance()->isModuleAllowedForUser($moduleManagerObj);
|
||||
|
||||
if(!$allowed){
|
||||
continue;
|
||||
}
|
||||
|
||||
$item = $moduleManagerObj->getDashboardItem();
|
||||
if(!empty($item)) {
|
||||
$index = $moduleManagerObj->getDashboardItemIndex();
|
||||
$dashBoardList[$index] = $item;
|
||||
}
|
||||
}
|
||||
|
||||
ksort($dashBoardList);
|
||||
|
||||
foreach($dashBoardList as $k=>$v){
|
||||
echo $v;
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
@@ -194,22 +69,30 @@ var modJsList = new Array();
|
||||
modJsList['tabDashboard'] = new DashboardAdapter('Dashboard','Dashboard');
|
||||
|
||||
var modJs = modJsList['tabDashboard'];
|
||||
/*
|
||||
$("#employeeLink").attr("href",modJs.getCustomUrl('?g=admin&n=employees&m=admin_Admin'));
|
||||
$("#jobsLink").attr("href",modJs.getCustomUrl('?g=admin&n=jobpositions&m=admin_Recruitment'));
|
||||
$("#candidatesLink").attr("href",modJs.getCustomUrl('?g=admin&n=candidates&m=admin_Recruitment'));
|
||||
$("#projectAdminLink").attr("href",modJs.getCustomUrl('?g=admin&n=projects&m=admin_Admin'));
|
||||
$("#trainingLink").attr("href",modJs.getCustomUrl('?g=admin&n=training&m=admin_Admin'));
|
||||
$("#travelLink").attr("href",modJs.getCustomUrl('?g=admin&n=travel&m=admin_Employees'));
|
||||
$("#documentLink").attr("href",modJs.getCustomUrl('?g=admin&n=documents&m=admin_Employees'));
|
||||
$("#expenseLink").attr("href",modJs.getCustomUrl('?g=admin&n=expenses&m=admin_Employees'));
|
||||
|
||||
|
||||
|
||||
$("#myProfileLink").attr("href",modJs.getCustomUrl('?g=modules&n=employees&m=module_Personal_Information'));
|
||||
$("#atteandanceLink").attr("href",modJs.getCustomUrl('?g=modules&n=attendance&m=module_Time_Management'));
|
||||
$("#attendanceAdminLink").attr("href",modJs.getCustomUrl('?g=admin&n=attendance&m=admin_Admin'));
|
||||
$("#leavesLink").attr("href",modJs.getCustomUrl('?g=modules&n=leaves&m=module_Leaves'));
|
||||
$("#timesheetLink").attr("href",modJs.getCustomUrl('?g=modules&n=time_sheets&m=module_Time_Management'));
|
||||
$("#projectsLink").attr("href",modJs.getCustomUrl('?g=modules&n=projects&m=module_Time_Management'));
|
||||
$("#traveAdminlLink").attr("href",modJs.getCustomUrl('?g=admin&n=travel&m=admin_Employees'));
|
||||
$("#travelLink").attr("href",modJs.getCustomUrl('?g=modules&n=travel&m=module_Travel_Management'));
|
||||
$("#reportsLink").attr("href",modJs.getCustomUrl('?g=admin&n=reports&m=admin_Reports'));
|
||||
|
||||
|
||||
$("#projectsLink").attr("href",modJs.getCustomUrl('?g=modules&n=projects&m=module_Personal_Information'));
|
||||
$("#myDocumentsLink").attr("href",modJs.getCustomUrl('?g=modules&n=documents&m=module_Documents'));
|
||||
$("#mytravelLink").attr("href",modJs.getCustomUrl('?g=modules&n=travel&m=module_Travel_Management'));
|
||||
$("#myExpensesLink").attr("href",modJs.getCustomUrl('?g=modules&n=expenses&m=module_Finance'));
|
||||
|
||||
modJs.getPunch();
|
||||
modJs.getPendingLeaves();
|
||||
modJs.getLastTimeSheetHours();
|
||||
modJs.getEmployeeActiveProjects();
|
||||
modJs.getInitData();
|
||||
*/
|
||||
|
||||
</script>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
@@ -1,27 +1,27 @@
|
||||
/*
|
||||
This file is part of iCE Hrm.
|
||||
This file is part of iCE Hrm.
|
||||
|
||||
iCE Hrm is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
iCE Hrm is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
iCE Hrm is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
iCE Hrm is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with iCE Hrm. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with iCE Hrm. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
------------------------------------------------------------------
|
||||
------------------------------------------------------------------
|
||||
|
||||
Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
|
||||
Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
|
||||
Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
|
||||
Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
|
||||
*/
|
||||
|
||||
function DashboardAdapter(endPoint) {
|
||||
this.initAdapter(endPoint);
|
||||
this.initAdapter(endPoint);
|
||||
}
|
||||
|
||||
DashboardAdapter.inherits(AdapterBase);
|
||||
@@ -29,15 +29,15 @@ DashboardAdapter.inherits(AdapterBase);
|
||||
|
||||
|
||||
DashboardAdapter.method('getDataMapping', function() {
|
||||
return [];
|
||||
return [];
|
||||
});
|
||||
|
||||
DashboardAdapter.method('getHeaders', function() {
|
||||
return [];
|
||||
return [];
|
||||
});
|
||||
|
||||
DashboardAdapter.method('getFormFields', function() {
|
||||
return [];
|
||||
return [];
|
||||
});
|
||||
|
||||
|
||||
@@ -46,128 +46,85 @@ DashboardAdapter.method('get', function(callBackData) {
|
||||
|
||||
|
||||
DashboardAdapter.method('getPunch', function() {
|
||||
var that = this;
|
||||
var object = {};
|
||||
|
||||
object['date'] = this.getClientDate(new Date()).toISOString().slice(0, 19).replace('T', ' ');
|
||||
object['offset'] = this.getClientGMTOffset();
|
||||
var reqJson = JSON.stringify(object);
|
||||
var callBackData = [];
|
||||
callBackData['callBackData'] = [];
|
||||
callBackData['callBackSuccess'] = 'getPunchSuccessCallBack';
|
||||
callBackData['callBackFail'] = 'getPunchFailCallBack';
|
||||
|
||||
this.customAction('getPunch','modules=attendance',reqJson,callBackData);
|
||||
var that = this;
|
||||
var object = {};
|
||||
|
||||
object['date'] = this.getClientDate(new Date()).toISOString().slice(0, 19).replace('T', ' ');
|
||||
object['offset'] = this.getClientGMTOffset();
|
||||
var reqJson = JSON.stringify(object);
|
||||
var callBackData = [];
|
||||
callBackData['callBackData'] = [];
|
||||
callBackData['callBackSuccess'] = 'getPunchSuccessCallBack';
|
||||
callBackData['callBackFail'] = 'getPunchFailCallBack';
|
||||
|
||||
this.customAction('getPunch','modules=attendance',reqJson,callBackData);
|
||||
});
|
||||
|
||||
|
||||
|
||||
DashboardAdapter.method('getPunchSuccessCallBack', function(callBackData) {
|
||||
var punch = callBackData;
|
||||
if(punch == null){
|
||||
$("#lastPunchTime").html("Not");
|
||||
$("#punchTimeText").html("Punched In");
|
||||
}else{
|
||||
$("#lastPunchTime").html(Date.parse(punch.in_time).toString('h:mm tt'));
|
||||
$("#punchTimeText").html("Punched In");
|
||||
}
|
||||
var punch = callBackData;
|
||||
if(punch == null){
|
||||
$("#lastPunchTime").html("Not");
|
||||
$("#punchTimeText").html("Punched In");
|
||||
}else{
|
||||
$("#lastPunchTime").html(Date.parse(punch.in_time).toString('h:mm tt'));
|
||||
$("#punchTimeText").html("Punched In");
|
||||
}
|
||||
});
|
||||
|
||||
DashboardAdapter.method('getPunchFailCallBack', function(callBackData) {
|
||||
|
||||
|
||||
});
|
||||
|
||||
DashboardAdapter.method('getInitData', function() {
|
||||
var that = this;
|
||||
var object = {};
|
||||
var reqJson = JSON.stringify(object);
|
||||
var callBackData = [];
|
||||
callBackData['callBackData'] = [];
|
||||
callBackData['callBackSuccess'] = 'getInitDataSuccessCallBack';
|
||||
callBackData['callBackFail'] = 'getInitDataFailCallBack';
|
||||
|
||||
DashboardAdapter.method('getPendingLeaves', function() {
|
||||
var that = this;
|
||||
var object = {};
|
||||
|
||||
var reqJson = JSON.stringify(object);
|
||||
var callBackData = [];
|
||||
callBackData['callBackData'] = [];
|
||||
callBackData['callBackSuccess'] = 'getPendingLeavesSuccessCallBack';
|
||||
callBackData['callBackFail'] = 'getPendingLeavesFailCallBack';
|
||||
|
||||
this.customAction('getPendingLeaves','modules=dashboard',reqJson,callBackData);
|
||||
this.customAction('getInitData','modules=dashboard',reqJson,callBackData);
|
||||
});
|
||||
|
||||
|
||||
|
||||
DashboardAdapter.method('getPendingLeavesSuccessCallBack', function(callBackData) {
|
||||
var leaveCount = callBackData;
|
||||
$("#pendingLeaveCount").html(leaveCount);
|
||||
DashboardAdapter.method('getInitDataSuccessCallBack', function(data) {
|
||||
|
||||
$("#timeSheetHoursWorked").html(data['lastTimeSheetHours']);
|
||||
$("#numberOfProjects").html(data['activeProjects']);
|
||||
$("#pendingLeaveCount").html(data['pendingLeaves']);
|
||||
|
||||
$("#numberOfEmployees").html(data['numberOfEmployees']+" Subordinates");
|
||||
$("#numberOfCandidates").html(data['numberOfCandidates']+" Candidates");
|
||||
$("#numberOfJobs").html(data['numberOfJobs']+" Active");
|
||||
$("#numberOfCourses").html(data['numberOfCourses']+" Active");
|
||||
|
||||
});
|
||||
|
||||
DashboardAdapter.method('getPendingLeavesFailCallBack', function(callBackData) {
|
||||
|
||||
DashboardAdapter.method('getInitDataFailCallBack', function(callBackData) {
|
||||
|
||||
});
|
||||
|
||||
DashboardAdapter.method('getLastTimeSheetHours', function() {
|
||||
var that = this;
|
||||
var object = {};
|
||||
|
||||
var reqJson = JSON.stringify(object);
|
||||
var callBackData = [];
|
||||
callBackData['callBackData'] = [];
|
||||
callBackData['callBackSuccess'] = 'getLastTimeSheetHoursSuccessCallBack';
|
||||
callBackData['callBackFail'] = 'getLastTimeSheetHoursFailCallBack';
|
||||
|
||||
this.customAction('getLastTimeSheetHours','modules=dashboard',reqJson,callBackData);
|
||||
});
|
||||
|
||||
|
||||
|
||||
DashboardAdapter.method('getLastTimeSheetHoursSuccessCallBack', function(callBackData) {
|
||||
var hours = callBackData;
|
||||
$("#timeSheetHoursWorked").html(hours);
|
||||
});
|
||||
|
||||
DashboardAdapter.method('getLastTimeSheetHoursFailCallBack', function(callBackData) {
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
DashboardAdapter.method('getEmployeeActiveProjects', function() {
|
||||
var that = this;
|
||||
var object = {};
|
||||
|
||||
var reqJson = JSON.stringify(object);
|
||||
var callBackData = [];
|
||||
callBackData['callBackData'] = [];
|
||||
callBackData['callBackSuccess'] = 'getEmployeeActiveProjectsSuccessCallBack';
|
||||
callBackData['callBackFail'] = 'getEmployeeActiveProjectsFailCallBack';
|
||||
|
||||
this.customAction('getEmployeeActiveProjects','modules=dashboard',reqJson,callBackData);
|
||||
});
|
||||
|
||||
|
||||
|
||||
DashboardAdapter.method('getEmployeeActiveProjectsSuccessCallBack', function(callBackData) {
|
||||
var hours = callBackData;
|
||||
$("#numberOfProjects").html(hours);
|
||||
});
|
||||
|
||||
DashboardAdapter.method('getEmployeeActiveProjectsFailCallBack', function(callBackData) {
|
||||
|
||||
});
|
||||
|
||||
DashboardAdapter.method('getClientDate', function (date) {
|
||||
|
||||
var offset = this.getClientGMTOffset();
|
||||
var offset = this.getClientGMTOffset();
|
||||
var tzDate = date.addMinutes(offset*60);
|
||||
return tzDate;
|
||||
|
||||
});
|
||||
|
||||
DashboardAdapter.method('getClientGMTOffset', function () {
|
||||
|
||||
var rightNow = new Date();
|
||||
var jan1 = new Date(rightNow.getFullYear(), 0, 1, 0, 0, 0, 0);
|
||||
var temp = jan1.toGMTString();
|
||||
var jan2 = new Date(temp.substring(0, temp.lastIndexOf(" ")-1));
|
||||
var std_time_offset = (jan1 - jan2) / (1000 * 60 * 60);
|
||||
|
||||
return std_time_offset;
|
||||
|
||||
|
||||
var rightNow = new Date();
|
||||
var jan1 = new Date(rightNow.getFullYear(), 0, 1, 0, 0, 0, 0);
|
||||
var temp = jan1.toGMTString();
|
||||
var jan2 = new Date(temp.substring(0, temp.lastIndexOf(" ")-1));
|
||||
var std_time_offset = (jan1 - jan2) / (1000 * 60 * 60);
|
||||
|
||||
return std_time_offset;
|
||||
|
||||
});
|
||||
|
||||
@@ -23,8 +23,20 @@ Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilin
|
||||
|
||||
class EmployeesActionManager extends SubActionManager{
|
||||
public function get($req){
|
||||
$profileId = $this->getCurrentProfileId();
|
||||
$subordinate = new Employee();
|
||||
$subordinatesCount = $subordinate->Count("supervisor = ? and id = ?",array($profileId, $req->id));
|
||||
|
||||
|
||||
if($this->user->user_level == 'Admin' || $subordinatesCount > 0){
|
||||
$id = $req->id;
|
||||
}
|
||||
|
||||
$employee = $this->baseService->getElement('Employee',$this->getCurrentProfileId(),$req->map,true);
|
||||
if(empty($id)){
|
||||
$id = $profileId;
|
||||
}
|
||||
|
||||
$employee = $this->baseService->getElement('Employee',$id,$req->map,true);
|
||||
|
||||
$subordinate = new Employee();
|
||||
$subordinates = $subordinate->Find("supervisor = ?",array($employee->id));
|
||||
@@ -53,11 +65,19 @@ class EmployeesActionManager extends SubActionManager{
|
||||
}
|
||||
|
||||
public function deleteProfileImage($req){
|
||||
if($this->user->user_level == 'Admin' || $this->user->employee == $req->id){
|
||||
|
||||
$profileId = $this->getCurrentProfileId();
|
||||
$subordinate = new Employee();
|
||||
$subordinatesCount = $subordinate->Count("supervisor = ? and id = ?",array($profileId, $req->id));
|
||||
|
||||
|
||||
if($this->user->user_level == 'Admin' || $this->user->employee == $req->id || $subordinatesCount == 1){
|
||||
$fs = FileService::getInstance();
|
||||
$res = $fs->deleteProfileImage($req->id);
|
||||
return new IceResponse(IceResponse::SUCCESS,$res);
|
||||
}
|
||||
|
||||
return new IceResponse(IceResponse::ERROR,"Not allowed to delete profile image");
|
||||
}
|
||||
|
||||
public function changePassword($req){
|
||||
@@ -65,8 +85,9 @@ class EmployeesActionManager extends SubActionManager{
|
||||
if($this->getCurrentProfileId() != $this->user->employee || empty($this->user->employee)){
|
||||
return new IceResponse(IceResponse::ERROR,"You are not allowed to change passwords of other employees");
|
||||
}
|
||||
|
||||
$user = $this->baseService->getElement('User',$this->user->id);
|
||||
|
||||
$user = new User();
|
||||
$user->Load("id = ?",array($this->user->id));
|
||||
if(empty($user->id)){
|
||||
return new IceResponse(IceResponse::ERROR,"Error occured while changing password");
|
||||
}
|
||||
|
||||
@@ -1,59 +1,69 @@
|
||||
<div class="row-fluid">
|
||||
<div class="col-xs-12 col-md-3">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-2">
|
||||
<div class="row-fluid">
|
||||
<div class="col-xs-12" style="text-align: center;">
|
||||
<img id="profile_image__id_" src="" class="img-polaroid" style="max-width: 140px;max-height: 140px;">
|
||||
<img id="profile_image__id_" src="" class="img-polaroid img-thumbnail" style="max-width: 140px;max-height: 140px;">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-9">
|
||||
<div class="col-xs-12 col-md-10">
|
||||
<div class="row-fluid">
|
||||
<div class="col-md-12"><h2 id="name"></h2></div>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<div class="col-md-12">
|
||||
<p>
|
||||
<i class="fa fa-phone"></i> <span id="mobile_phone"></span>
|
||||
<i class="fa fa-envelope"></i> <span id="work_email"></span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<div class="col-xs-12" style="font-size:18px;border-bottom: 1px solid #DDD;margin-bottom: 10px;padding-bottom: 10px;">
|
||||
<span id="name"></span><br/>
|
||||
<button id="employeeProfileEditInfo" class="btn btn-inverse btn-xs" onclick="modJs.editEmployee();" style="margin-right:10px;">Edit Info</button>
|
||||
<button id="employeeUploadProfileImage" onclick="showUploadDialog('profile_image__id_','Upload Profile Image','profile_image',_id_,'profile_image__id_','src','url','image');return false;" class="btn btn-xs btn-inverse" type="button" style="margin-right:10px;">Upload Profile Image</button>
|
||||
<button id="employeeDeleteProfileImage" onclick="modJs.deleteProfileImage(_id_);return false;" class="btn btn-xs btn-inverse" type="button">Delete Profile Image</button>
|
||||
<button id="employeeUpdatePassword" onclick="modJs.changePassword();return false;" class="btn btn-xs btn-inverse" type="button">Change Password</button>
|
||||
<button id="employeeProfileEditInfo" class="btn btn-small btn-success" onclick="modJs.editEmployee();" style="margin-right:10px;"><i class="fa fa-edit"></i> Edit Info</button>
|
||||
<button id="employeeUploadProfileImage" onclick="showUploadDialog('profile_image__id_','Upload Profile Image','profile_image',_id_,'profile_image__id_','src','url','image');return false;" class="btn btn-small btn-primary" type="button" style="margin-right:10px;"><i class="fa fa-upload"></i> Upload Profile Image</button>
|
||||
<button id="employeeDeleteProfileImage" onclick="modJs.deleteProfileImage(_id_);return false;" class="btn btn-small btn-warning" type="button" style="margin-right:10px;"><i class="fa fa-times"></i> Delete Profile Image</button>
|
||||
<button id="employeeUpdatePassword" onclick="modJs.changePassword();return false;" class="btn btn-small btn-success" type="button" style="margin-right:10px;"><i class="fa fa-lock"></i> Change Password</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row-fluid" style="border-top: 1px;">
|
||||
<div class="col-xs-6 col-md-4" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;font-size:13px;">Employee Id</label>
|
||||
<label class="control-label col-xs-12" style="font-size:13px;font-size:13px;">#_label_employee_id_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="employee_id"></label>
|
||||
</div>
|
||||
<div class="col-xs-6 col-md-4" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">NIC Number</label>
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_nic_num_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="nic_num"></label>
|
||||
</div>
|
||||
<div class="col-xs-6 col-md-4" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">EPF/CPF No</label>
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_ssn_num_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="ssn_num"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row-fluid" style="margin-left:10px;">
|
||||
<div class="col-xs-12">
|
||||
<hr/>
|
||||
<span class="label label-inverse" style="font-size:16px;background: #405A6A;">Personal Information</span><br/><br/>
|
||||
<div class="row" style="margin-left:10px;">
|
||||
<div class="panel panel-default" style="width:97.5%;">
|
||||
<div class="panel-heading"><h4>Personal Information</h4></div>
|
||||
<div class="panel-body">
|
||||
<div class="row-fluid">
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">Driver's License Number</label>
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_driving_license_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="driving_license"></label>
|
||||
</div>
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">Other Id</label>
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_other_id_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="other_id"></label>
|
||||
</div>
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">Birth Day</label>
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_birthday_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="birthday"></label>
|
||||
</div>
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">Gender</label>
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_gender_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="gender"></label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -61,87 +71,78 @@
|
||||
<div class="row-fluid">
|
||||
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">Nationality</label>
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_nationality_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="nationality_Name"></label>
|
||||
</div>
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">Marital Status</label>
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_marital_status_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="marital_status"></label>
|
||||
</div>
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">Joined Date</label>
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_joined_date_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="joined_date"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row-fluid" style="margin-left:10px;margin-top:20px;">
|
||||
<div class="col-xs-12">
|
||||
<hr/>
|
||||
<span class="label label-inverse" style="font-size:16px;background: #405A6A;">Contact Information</span><br/><br/>
|
||||
<div class="row" style="margin-left:10px;margin-top:20px;">
|
||||
<div class="panel panel-default" style="width:97.5%;">
|
||||
<div class="panel-heading"><h4>Contact Information</h4></div>
|
||||
<div class="panel-body">
|
||||
<div class="row-fluid">
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">Address 1</label>
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_address1_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="address1"></label>
|
||||
</div>
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">Address 2</label>
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_address2_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="address2"></label>
|
||||
</div>
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">City</label>
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_city_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="city"></label>
|
||||
</div>
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">Country</label>
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_country_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="country_Name"></label>
|
||||
</div>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="row-fluid">
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">Postal Code</label>
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_postal_code_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="postal_code"></label>
|
||||
</div>
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">Home Phone</label>
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_home_phone_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="home_phone"></label>
|
||||
</div>
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">Mobile Phone</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="mobile_phone"></label>
|
||||
</div>
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">Work Phone</label>
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_work_phone_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="work_phone"></label>
|
||||
</div>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="row-fluid">
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">Work Email</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="work_email"></label>
|
||||
</div>
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">Private Email</label>
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_private_email_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="private_email"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row-fluid" style="margin-left:10px;margin-top:20px;">
|
||||
<div class="col-xs-12">
|
||||
<hr/>
|
||||
<span class="label label-inverse" style="font-size:16px;background: #405A6A;">Job Details</span><br/><br/>
|
||||
<div class="row" style="margin-left:10px;margin-top:20px;">
|
||||
<div class="panel panel-default" style="width:97.5%;">
|
||||
<div class="panel-heading"><h4>Job Details</h4></div>
|
||||
<div class="panel-body">
|
||||
<div class="row-fluid">
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">Job Title</label>
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_job_title_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="job_title_Name"></label>
|
||||
</div>
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">Employment Status</label>
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_employment_status_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="employment_status_Name"></label>
|
||||
</div>
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
@@ -149,17 +150,18 @@
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="supervisor_Name"></label>
|
||||
</div>
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">Subordinates</label>
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">Direct Reports</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="subordinates"></label>
|
||||
</div>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="row-fluid">
|
||||
<div class="col-xs-6 col-md-3" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">Department</label>
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_department_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="department_Name"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
17
ext/modules/employees/dashboard.html
Normal file
17
ext/modules/employees/dashboard.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<div class="col-lg-3 col-xs-12">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-red">
|
||||
<div class="inner">
|
||||
<h3>My Profile</h3>
|
||||
<p>
|
||||
Edit Details
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-ios7-person"></i>
|
||||
</div>
|
||||
<a href="#_moduleLink_#" class="small-box-footer" id="myProfileLink">
|
||||
Manage Profile <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user