Compare commits
56 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
27779782fc | ||
|
|
04bafeec81 | ||
|
|
cc1ac5a75e | ||
|
|
7528e5eabd | ||
|
|
ef72f8daa3 | ||
|
|
967c69b04e | ||
|
|
a2a23a2bb4 | ||
|
|
d022651a24 | ||
|
|
a619f76b3a | ||
|
|
9f0626c1f7 | ||
|
|
ec85cfa521 | ||
|
|
b15e432756 | ||
|
|
1b7bea571f | ||
|
|
1f60c4b217 | ||
|
|
ed739aa4e1 | ||
|
|
e6b4245334 | ||
|
|
4c171bfce3 | ||
|
|
3bb3f038bf | ||
|
|
4f6cdd98f8 | ||
|
|
81f7a97096 | ||
|
|
ab2a0293a6 | ||
|
|
283ef1e377 | ||
|
|
55f8ae364f | ||
|
|
564ce43c18 | ||
|
|
bd9e5acd65 | ||
|
|
a4a38a1869 | ||
|
|
e1aa2c1365 | ||
|
|
b1bfd2f39d | ||
|
|
4c3f27914b | ||
|
|
214ab89ce8 | ||
|
|
9348be0acd | ||
|
|
21c5d09bac | ||
|
|
13085bcecc | ||
|
|
9271156708 | ||
|
|
6ac1320f6a | ||
|
|
dcfc009938 | ||
|
|
b9ba064dbb | ||
|
|
f78f5592d3 | ||
|
|
d9f0d52eed | ||
|
|
fb8e970f7e | ||
|
|
e78331f5b3 | ||
|
|
9e415d589e | ||
|
|
b2f83c51e4 | ||
|
|
585036b209 | ||
|
|
91c6867e2f | ||
|
|
912ff56260 | ||
|
|
1bd4014cb9 | ||
|
|
d226a18912 | ||
|
|
1e9e6f31a2 | ||
|
|
698c5d3daa | ||
|
|
271a39b3d4 | ||
|
|
217664e636 | ||
|
|
6e4d32933b | ||
|
|
a10fbba14a | ||
|
|
9e243073df | ||
|
|
1757421d9f |
7
.gitignore
vendored
7
.gitignore
vendored
@@ -1,5 +1,8 @@
|
||||
/.settings
|
||||
/.buildpath
|
||||
/.project
|
||||
/.idea
|
||||
build
|
||||
/.idea/
|
||||
/build
|
||||
/deployment/clients/dev/data/
|
||||
/deployment/clients/test/data/
|
||||
/.vagrant
|
||||
|
||||
13
.travis.yml
Normal file
13
.travis.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
services:
|
||||
- mysql
|
||||
before_script:
|
||||
- echo "USE mysql;\nUPDATE user SET password=PASSWORD('dev') WHERE user='root';\nFLUSH PRIVILEGES;\n" | mysql -u root
|
||||
install:
|
||||
- ant buildlocal
|
||||
language: php
|
||||
php:
|
||||
- '5.5'
|
||||
- '5.6'
|
||||
- '7.0'
|
||||
- nightly
|
||||
#after_failure: "cat /tmp/icehrm.test.log"
|
||||
29
Vagrantfile
vendored
Normal file
29
Vagrantfile
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
Vagrant.configure(2) do |config|
|
||||
config.vm.box = "thilinah/jessie64_isotope"
|
||||
config.vm.box_version = "0.0.1"
|
||||
config.vm.network "private_network", ip: "192.168.40.40"
|
||||
config.vm.synced_folder ".", "/vagrant", type: "nfs"
|
||||
|
||||
config.vm.provider "virtualbox" do |vb|
|
||||
vb.memory = "1024"
|
||||
vb.cpus = "2"
|
||||
vb.name = "app.dev"
|
||||
end
|
||||
|
||||
|
||||
config.vm.provision "shell", inline: <<-SHELL
|
||||
sudo apt-get update
|
||||
SHELL
|
||||
|
||||
config.vm.hostname = "app.dev"
|
||||
|
||||
config.hostsupdater.aliases = [
|
||||
"app.dev",
|
||||
"app.app.dev",
|
||||
"clients.app.dev"
|
||||
]
|
||||
|
||||
end
|
||||
116
build.xml
116
build.xml
@@ -3,6 +3,7 @@
|
||||
<!-- By default, we assume all tools to be on the $PATH -->
|
||||
<property name="toolsdir" value=""/>
|
||||
<property name="destination" value="${basedir}/build/app"/>
|
||||
<property name="testdir" value="${basedir}/build/test"/>
|
||||
<property name="origin" value="${basedir}/src"/>
|
||||
<property environment="env"/>
|
||||
<property name="env.appname" value="icehrm"/>
|
||||
@@ -11,13 +12,21 @@
|
||||
<property name="installLocalpath" value="/Applications/XAMPP/xamppfiles/htdocs/icehrm-open-core"/>
|
||||
|
||||
|
||||
<target name="build"
|
||||
depends="prepare,lint,copyapp,release,install"
|
||||
description=""/>
|
||||
<target name="build"
|
||||
depends="prepare,lint,copyapp,phpunit,release,install"
|
||||
description=""/>
|
||||
|
||||
<target name="buildlocal"
|
||||
depends="prepare,copyapp,installLocal"
|
||||
description=""/>
|
||||
<target name="buildlocal"
|
||||
depends="prepare,copyapp"
|
||||
description=""/>
|
||||
|
||||
<target name="releaseapp"
|
||||
depends="prepare,lint,copyapp,phpunit,release"
|
||||
description=""/>
|
||||
|
||||
<target name="ice"
|
||||
depends="copyapp_quick"
|
||||
description=""/>
|
||||
|
||||
<target name="clean"
|
||||
unless="clean.done"
|
||||
@@ -53,21 +62,22 @@
|
||||
<property name="prepare.done" value="true"/>
|
||||
</target>
|
||||
|
||||
<target name="lint" description="Perform syntax check of sourcecode files">
|
||||
<apply executable="php" failonerror="true">
|
||||
<arg value="-l" />
|
||||
<target name="lint" description="Perform syntax check of sourcecode files">
|
||||
<apply executable="php" failonerror="true">
|
||||
<arg value="-l" />
|
||||
|
||||
<fileset dir="${basedir}/src">
|
||||
<include name="**/*.php" />
|
||||
<modified />
|
||||
</fileset>
|
||||
<fileset dir="${basedir}/src">
|
||||
<include name="**/*.php" />
|
||||
<exclude name="composer/**"/>
|
||||
<modified />
|
||||
</fileset>
|
||||
|
||||
<fileset dir="${basedir}/test">
|
||||
<include name="**/*.php" />
|
||||
<modified />
|
||||
</fileset>
|
||||
</apply>
|
||||
</target>
|
||||
<fileset dir="${basedir}/test">
|
||||
<include name="**/*.php" />
|
||||
<modified />
|
||||
</fileset>
|
||||
</apply>
|
||||
</target>
|
||||
|
||||
<target name="phploc"
|
||||
description="Measure project size using PHPLOC and print human readable output. Intended for usage on the command line.">
|
||||
@@ -179,23 +189,55 @@
|
||||
description="Generate project documentation using phpDox">
|
||||
<exec executable="${toolsdir}phpdox"/>
|
||||
</target>
|
||||
|
||||
|
||||
<target name="copyapp_quick"
|
||||
description="Copy generated files to QA app">
|
||||
|
||||
<copy todir="${destination}" overwrite="true">
|
||||
<fileset dir="${origin}">
|
||||
<include name="**/*"/>
|
||||
<exclude name="composer/**"/>
|
||||
<exclude name="themecss/**"/>
|
||||
<exclude name="themejs/**"/>
|
||||
<exclude name="robo/**"/>
|
||||
<exclude name="images/**"/>
|
||||
</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>
|
||||
|
||||
<copy todir="${testdir}" overwrite="true">
|
||||
<fileset dir="${basedir}/test">
|
||||
<include name="**/*"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
</target>
|
||||
|
||||
<target name="copyapp"
|
||||
description="Copy generated files to QA app">
|
||||
|
||||
<delete includeemptydirs="true">
|
||||
<fileset dir="${destination}">
|
||||
<include name="**/*"/>
|
||||
</fileset>
|
||||
</delete>
|
||||
|
||||
<copy todir="${destination}" overwrite="true">
|
||||
<fileset dir="${origin}">
|
||||
<include name="**/*"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
description="Copy generated files to QA app">
|
||||
|
||||
<delete includeemptydirs="true">
|
||||
<fileset dir="${destination}">
|
||||
<include name="**/*"/>
|
||||
</fileset>
|
||||
</delete>
|
||||
|
||||
<copy todir="${destination}" overwrite="true">
|
||||
<fileset dir="${origin}">
|
||||
<include name="**/*"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy todir="${destination}/lib" overwrite="true">
|
||||
<fileset dir="${basedir}/lib">
|
||||
@@ -214,7 +256,13 @@
|
||||
<include name="**/*"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
|
||||
<copy todir="${testdir}" overwrite="true">
|
||||
<fileset dir="${basedir}/test">
|
||||
<include name="**/*"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
</target>
|
||||
|
||||
<target name="install"
|
||||
|
||||
0
config/database.yml
Normal file
0
config/database.yml
Normal file
90
core-ext/admin/dashboard/index.php
Normal file
90
core-ext/admin/dashboard/index.php
Normal file
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
/*
|
||||
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 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/>.
|
||||
|
||||
------------------------------------------------------------------
|
||||
|
||||
Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
|
||||
Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
|
||||
*/
|
||||
|
||||
$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">
|
||||
<?php
|
||||
$moduleManagers = BaseService::getInstance()->getModuleManagers();
|
||||
$dashBoardList = array();
|
||||
foreach($moduleManagers as $moduleManagerObj){
|
||||
|
||||
//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 LanguageManager::translateTnrText($v);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
if(class_exists("ProVersion")) {
|
||||
$proVersion = new ProVersion();
|
||||
if (strtotime($proVersion->licenseExpire) < time()) {
|
||||
?>
|
||||
<div class="callout callout-danger lead" style="font-size: 14px;">
|
||||
<h4>Your IceHrm Pro License is Expired</h4>
|
||||
<p style="font-weight: bold;">
|
||||
Your IceHrm Pro license is expired. Even though you can continue to use the software you won't receive
|
||||
software upgrades or security patches. Please renew your license.
|
||||
<br/>
|
||||
<br/>
|
||||
<a href="https://icehrm.com/renew_icehrmpro.php" class="btn btn-success btm-xs"><i
|
||||
class="fa fa-checkout"></i> Renew License</a>
|
||||
</p>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<script>
|
||||
var modJsList = new Array();
|
||||
|
||||
modJsList['tabDashboard'] = new DashboardAdapter('Dashboard','Dashboard');
|
||||
|
||||
var modJs = modJsList['tabDashboard'];
|
||||
|
||||
</script>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
1
core-ext/app/data/icehrm.log
Normal file
1
core-ext/app/data/icehrm.log
Normal file
@@ -0,0 +1 @@
|
||||
init log
|
||||
@@ -5,13 +5,16 @@ if(!defined('APP_NAME')){define('APP_NAME','ICE Hrm');}
|
||||
if(!defined('FB_URL')){define('FB_URL', 'https://www.facebook.com/icehrm');};
|
||||
if(!defined('TWITTER_URL')){define('TWITTER_URL', 'https://twitter.com/icehrmapp');};
|
||||
|
||||
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");
|
||||
if(defined('CLIENT_BASE_URL')) {
|
||||
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', '16.1.OS');
|
||||
define('CACHE_VALUE', '16.1.OS');
|
||||
define('VERSION_DATE', '02/05/2016');
|
||||
define('VERSION', '19.0.OS');
|
||||
define('CACHE_VALUE', '19.0.OS');
|
||||
define('VERSION_NUMBER', '190');
|
||||
define('VERSION_DATE', '19/11/2016');
|
||||
|
||||
if(!defined('CONTACT_EMAIL')){define('CONTACT_EMAIL','icehrm@gamonoid.com');}
|
||||
if(!defined('KEY_PREFIX')){define('KEY_PREFIX','IceHrm');}
|
||||
@@ -19,3 +22,14 @@ if(!defined('APP_SEC')){define('APP_SEC','dbcs234d2s111');}
|
||||
|
||||
define('UI_SHOW_SWITCH_PROFILE', true);
|
||||
define('CRON_LOG', '/var/log/nginx/icehrmcron.log');
|
||||
|
||||
define('MEMCACHE_HOST', '127.0.0.1');
|
||||
define('MEMCACHE_PORT', '11211');
|
||||
|
||||
if(!defined('WK_HTML_PATH')){
|
||||
define('WK_HTML_PATH', '/usr/bin/wkhtmltopdf');
|
||||
}
|
||||
|
||||
define('ALL_CLIENT_BASE_PATH', '/vagrant/deployment/clients/');
|
||||
|
||||
define('CHECK_UPDATE_URL', 'https://icehrm.com/a.php?a=checkUpdate&');
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
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
|
||||
|
||||
10
core-ext/lang/de-ext.po
Normal file
10
core-ext/lang/de-ext.po
Normal file
@@ -0,0 +1,10 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Language: English\n"
|
||||
"Language-Team: IceHrm\n"
|
||||
"Last-Translator: Thilina Hasantha\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Project-Id-Version: 18.0\n"
|
||||
"Report-Msgid-Bugs-To: https://icehrm.com\n"
|
||||
10
core-ext/lang/en-ext.po
Normal file
10
core-ext/lang/en-ext.po
Normal file
@@ -0,0 +1,10 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Language: English\n"
|
||||
"Language-Team: IceHrm\n"
|
||||
"Last-Translator: Thilina Hasantha\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Project-Id-Version: 18.0\n"
|
||||
"Report-Msgid-Bugs-To: https://icehrm.com\n"
|
||||
@@ -1,2 +1,2 @@
|
||||
<?php
|
||||
//Nothing here
|
||||
//Nothing here
|
||||
@@ -1,409 +0,0 @@
|
||||
<?php
|
||||
define('CLIENT_PATH',dirname(__FILE__));
|
||||
include ("config.base.php");
|
||||
include ("include.common.php");
|
||||
include("server.includes.inc.php");
|
||||
|
||||
error_log(print_r($_REQUEST,true));
|
||||
|
||||
if(empty($user)){
|
||||
|
||||
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{
|
||||
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');
|
||||
$logoFileUrl = UIManager::getInstance()->getCompanyLogoUrl();
|
||||
|
||||
?><!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title><?=APP_NAME?> Login</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<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="<?=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>
|
||||
<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">
|
||||
<link href="<?=BASE_URL?>css/style.css?v=<?=$cssVersion?>" rel="stylesheet">
|
||||
|
||||
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="<?=BASE_URL?>js/html5.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
<style type="text/css">
|
||||
/* Override some defaults */
|
||||
html, body {
|
||||
background-color: #829AA8;
|
||||
}
|
||||
body {
|
||||
padding-top: 40px;
|
||||
}
|
||||
.container {
|
||||
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);
|
||||
}
|
||||
|
||||
.login-form {
|
||||
margin-left: 65px;
|
||||
}
|
||||
|
||||
legend {
|
||||
margin-right: -50px;
|
||||
font-weight: bold;
|
||||
color: #404040;
|
||||
}
|
||||
|
||||
.add-on{
|
||||
-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>
|
||||
|
||||
<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');
|
||||
|
||||
ga('create', '<?=BaseService::getInstance()->getGAKey()?>', 'gamonoid.com');
|
||||
ga('send', 'pageview');
|
||||
|
||||
</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;
|
||||
}
|
||||
});
|
||||
|
||||
$("#password").keydown(function(event){
|
||||
if(event.keyCode == 13) {
|
||||
submitLogin();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
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 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);
|
||||
};
|
||||
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
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>
|
||||
<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">
|
||||
<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 -->
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,13 +1,26 @@
|
||||
<?php
|
||||
class ICEHRM_Record extends ADOdb_Active_Record{
|
||||
|
||||
var $keysToIgnore = array(
|
||||
"_table",
|
||||
"_dbat",
|
||||
"_tableat",
|
||||
"_where",
|
||||
"_saved",
|
||||
"_lasterr",
|
||||
"_original",
|
||||
"foreignName",
|
||||
"a",
|
||||
"t"
|
||||
);
|
||||
|
||||
public function getAdminAccess(){
|
||||
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 +29,7 @@ class ICEHRM_Record extends ADOdb_Active_Record{
|
||||
public function getUserAccess(){
|
||||
return array("get","element");
|
||||
}
|
||||
|
||||
|
||||
public function getEmployeeAccess(){
|
||||
return $this->getUserAccess();
|
||||
}
|
||||
@@ -57,24 +70,69 @@ class ICEHRM_Record extends ADOdb_Active_Record{
|
||||
|
||||
}
|
||||
|
||||
public function postProcessGetData($obj){
|
||||
return $obj;
|
||||
}
|
||||
public function postProcessGetData($obj){
|
||||
return $obj;
|
||||
}
|
||||
|
||||
public function postProcessGetElement($obj){
|
||||
return $obj;
|
||||
}
|
||||
|
||||
public function getDefaultAccessLevel(){
|
||||
return array("get","element","save","delete");
|
||||
public function getDefaultAccessLevel(){
|
||||
return array("get","element","save","delete");
|
||||
}
|
||||
|
||||
public function getVirtualFields(){
|
||||
return array(
|
||||
);
|
||||
}
|
||||
|
||||
public function allowIndirectMapping(){
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getDisplayName() {
|
||||
return get_called_class();
|
||||
}
|
||||
|
||||
public function getVirtualFields(){
|
||||
return array(
|
||||
);
|
||||
public function getObjectKeys(){
|
||||
$keys = array();
|
||||
|
||||
foreach($this as $k=>$v){
|
||||
if(in_array($k,$this->keysToIgnore )){
|
||||
continue;
|
||||
}
|
||||
|
||||
if(is_array($v) || is_object($v)){
|
||||
continue;
|
||||
}
|
||||
|
||||
$keys[$k] = $k;
|
||||
}
|
||||
|
||||
return $keys;
|
||||
}
|
||||
|
||||
public function allowIndirectMapping(){
|
||||
return false;
|
||||
public function getCustomFields($obj){
|
||||
$keys = array();
|
||||
$objKeys = $this->getObjectKeys();
|
||||
foreach($obj as $k=>$v){
|
||||
if(isset($objKeys[$k])){
|
||||
continue;
|
||||
}
|
||||
|
||||
if(is_array($v) || is_object($v)){
|
||||
continue;
|
||||
}
|
||||
|
||||
if(in_array($k,$this->keysToIgnore )){
|
||||
continue;
|
||||
}
|
||||
|
||||
$keys[$k] = $k;
|
||||
}
|
||||
|
||||
return $keys;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,134 @@
|
||||
|
||||
<!-- 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="https://icehrm.com/generateInstanceKey.php?id=<?=$baseService->getInstanceId()?>">
|
||||
https://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>
|
||||
</div>
|
||||
<!-- Modal -->
|
||||
<?php }?>
|
||||
<!-- 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"><?=LanguageManager::tran('Switch Employee')?></h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p><?=LanguageManager::tran('Select The Employee to Switch Into')?></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"><?=LanguageManager::tran('Close')?></button>
|
||||
<button class="btn btn-primary" onclick="modJs.setAdminProfile($('#switch_emp').val());return false;"><?=LanguageManager::tran('Switch')?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Modal -->
|
||||
<?php }?>
|
||||
|
||||
|
||||
<?php if(isset($itemNameLower)){?>
|
||||
<div class="modal" id="<?=$itemNameLower?>StatusModel" 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 <?=$itemName?> Status</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="expenseStatusForm">
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="expense_status"><?=$itemName?> Status</label>
|
||||
<div class="controls">
|
||||
<select type="text" id="<?=$itemNameLower?>_status" class="form-control" name="<?=$itemNameLower?>_status" value="">
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="expense_status">Status Change Note</label>
|
||||
<div class="controls">
|
||||
<textarea id="<?=$itemNameLower?>_reason" class="form-control" name="<?=$itemNameLower?>_reason" maxlength="500"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-primary" onclick="modJs.changeStatus();">Change <?=$itemName?> Status</button>
|
||||
<button class="btn" onclick="modJs.closeDialog();">Not Now</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
61
core-ext/raml/api.raml
Normal file
61
core-ext/raml/api.raml
Normal file
@@ -0,0 +1,61 @@
|
||||
#%RAML 0.8
|
||||
---
|
||||
title: IceHrm
|
||||
baseUri: http://icehrm-hosted.gamonoid.com/api
|
||||
version: 1
|
||||
documentation:
|
||||
- title: Authentication
|
||||
content: !include documentation/authentication.md
|
||||
- title: Responses
|
||||
content: !include documentation/responses.md
|
||||
|
||||
/employee:
|
||||
displayName: Employee
|
||||
/list:
|
||||
get:
|
||||
is: [ paginated ]
|
||||
description: Get a list of employees
|
||||
responses:
|
||||
200:
|
||||
body:
|
||||
application/json:
|
||||
schema: !include schemas/employees.json
|
||||
example: !include examples/employees.json
|
||||
/{id}:
|
||||
get:
|
||||
description: Get an employee by id
|
||||
responses:
|
||||
200:
|
||||
body:
|
||||
application/json:
|
||||
schema: !include schemas/employee.json
|
||||
example: !include examples/employee.json
|
||||
404:
|
||||
description: Employee does not exist
|
||||
body:
|
||||
application/json:
|
||||
schema: !include schemas/error.json
|
||||
uriParameters:
|
||||
id:
|
||||
description: Employee id
|
||||
type: integer
|
||||
/candidate:
|
||||
displayName: Candidate
|
||||
/{id}:
|
||||
get:
|
||||
description: Get an employee by id
|
||||
responses:
|
||||
200:
|
||||
body:
|
||||
application/json:
|
||||
schema: !include schemas/candidate.json
|
||||
example: !include examples/candidate.json
|
||||
404:
|
||||
description: Candidate does not exist
|
||||
body:
|
||||
application/json:
|
||||
schema: !include schemas/error.json
|
||||
uriParameters:
|
||||
id:
|
||||
description: Candidate id
|
||||
type: integer
|
||||
1
core-ext/raml/documentation/authentication.md
Normal file
1
core-ext/raml/documentation/authentication.md
Normal file
@@ -0,0 +1 @@
|
||||
Admin users of icehrm can find the access token under System->Settings
|
||||
9
core-ext/raml/documentation/responses.md
Normal file
9
core-ext/raml/documentation/responses.md
Normal file
@@ -0,0 +1,9 @@
|
||||
| Code | Description |
|
||||
|------|--------------------|
|
||||
| 200 | Ok |
|
||||
| 201 | Created |
|
||||
| 400 | Bad request |
|
||||
| 401 | Not authorized |
|
||||
| 403 | Forbidden |
|
||||
| 404 | Resource not found |
|
||||
| 500 | Server error |
|
||||
53
core-ext/raml/examples/candidate.json
Normal file
53
core-ext/raml/examples/candidate.json
Normal file
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"id": "1",
|
||||
"first_name": "Jhon",
|
||||
"last_name": "Doe",
|
||||
"nationality": "4",
|
||||
"birthday": null,
|
||||
"gender": "Male",
|
||||
"marital_status": null,
|
||||
"address1": null,
|
||||
"address2": null,
|
||||
"city": "New York",
|
||||
"country": "US",
|
||||
"province": null,
|
||||
"postal_code": null,
|
||||
"email": "icehrm+jhon@web-stalk.com",
|
||||
"home_phone": "+1 455565656",
|
||||
"mobile_phone": null,
|
||||
"cv_title": "Software Engineer",
|
||||
"cv": "cv_rYwHphV7xD5dOe1444302569136",
|
||||
"cvtext": null,
|
||||
"industry": null,
|
||||
"profileImage": null,
|
||||
"head_line": "",
|
||||
"objective": "",
|
||||
"work_history": "",
|
||||
"education": "",
|
||||
"skills": "",
|
||||
"referees": "",
|
||||
"linkedInUrl": null,
|
||||
"linkedInData": null,
|
||||
"totalYearsOfExperience": null,
|
||||
"totalMonthsOfExperience": null,
|
||||
"generatedCVFile": null,
|
||||
"created": "2015-10-08 16:59:20",
|
||||
"updated": "2015-10-08 16:59:20",
|
||||
"expectedSalary": "0",
|
||||
"preferedPositions": null,
|
||||
"preferedJobtype": null,
|
||||
"preferedCountries": null,
|
||||
"tags": null,
|
||||
"notes": null,
|
||||
"calls": null,
|
||||
"age": null,
|
||||
"hash": "663fd20d1859344585f678a0f87b23522b8f9fce8c67c5290a609ce342b81442",
|
||||
"linkedInProfileLink": null,
|
||||
"linkedInProfileId": null,
|
||||
"facebookProfileLink": null,
|
||||
"facebookProfileId": null,
|
||||
"twitterProfileLink": null,
|
||||
"twitterProfileId": null,
|
||||
"googleProfileLink": null,
|
||||
"googleProfileId": null
|
||||
}
|
||||
75
core-ext/raml/examples/employee.json
Normal file
75
core-ext/raml/examples/employee.json
Normal file
@@ -0,0 +1,75 @@
|
||||
{
|
||||
"id": "2",
|
||||
"employee_id": "EMP002",
|
||||
"first_name": "Lala",
|
||||
"middle_name": "Nadila ",
|
||||
"last_name": "Lamees",
|
||||
"nationality": "175",
|
||||
"birthday": "1984-03-12",
|
||||
"gender": "Female",
|
||||
"marital_status": "Single",
|
||||
"ssn_num": "",
|
||||
"nic_num": "4594567WE3",
|
||||
"other_id": "4595567WE3",
|
||||
"driving_license": "349-066-YUO",
|
||||
"driving_license_exp_date": "2012-03-01",
|
||||
"employment_status": "1",
|
||||
"job_title": "8",
|
||||
"pay_grade": "2",
|
||||
"work_station_id": "W001",
|
||||
"address1": "Green War Rd, 00123",
|
||||
"address2": "",
|
||||
"city": "Istanbul",
|
||||
"country": "TR",
|
||||
"province": null,
|
||||
"postal_code": "909066",
|
||||
"home_phone": "+960112345",
|
||||
"mobile_phone": "+960112345",
|
||||
"work_phone": "+960112345",
|
||||
"work_email": "icehrm+manager@web-stalk.com",
|
||||
"private_email": "icehrm+manager@web-stalk.com",
|
||||
"joined_date": "2011-03-07",
|
||||
"confirmation_date": "2012-02-14",
|
||||
"supervisor": "1",
|
||||
"indirect_supervisors": "[3,4]",
|
||||
"department": "2",
|
||||
"custom1": null,
|
||||
"custom2": null,
|
||||
"custom3": null,
|
||||
"custom4": null,
|
||||
"custom5": null,
|
||||
"custom6": null,
|
||||
"custom7": null,
|
||||
"custom8": null,
|
||||
"custom9": null,
|
||||
"custom10": null,
|
||||
"termination_date": "0000-00-00",
|
||||
"notes": null,
|
||||
"status": "Active",
|
||||
"ethnicity": null,
|
||||
"immigration_status": null,
|
||||
"approver1": "5",
|
||||
"approver2": "6",
|
||||
"approver3": null,
|
||||
"nationality_Name_id": [],
|
||||
"nationality_Name": "Tajik",
|
||||
"ethnicity_Name_id": [],
|
||||
"ethnicity_Name": null,
|
||||
"immigration_status_Name_id": [],
|
||||
"immigration_status_Name": null,
|
||||
"employment_status_Name_id": [],
|
||||
"employment_status_Name": "Full Time Contract",
|
||||
"job_title_Name_id": [],
|
||||
"job_title_Name": "Pre-Sales Executive",
|
||||
"pay_grade_Name_id": [],
|
||||
"pay_grade_Name": "Executive",
|
||||
"country_Name_id": [],
|
||||
"country_Name": "Turkey",
|
||||
"province_Name_id": [],
|
||||
"province_Name": null,
|
||||
"department_Name_id": [],
|
||||
"department_Name": "Head Office",
|
||||
"supervisor_Name_id": [],
|
||||
"supervisor_Name": "IceHrm Employee",
|
||||
"image": "http:\/\/app.app.dev\/images\/user_female.png"
|
||||
}
|
||||
23
core-ext/raml/examples/employees.json
Normal file
23
core-ext/raml/examples/employees.json
Normal file
@@ -0,0 +1,23 @@
|
||||
[
|
||||
{
|
||||
"id": "1",
|
||||
"employee_id": "EMP001",
|
||||
"first_name": "IceHrm",
|
||||
"middle_name": "Sample",
|
||||
"last_name": "Employee"
|
||||
},
|
||||
{
|
||||
"id": "2",
|
||||
"employee_id": "EMP002",
|
||||
"first_name": "Lala",
|
||||
"middle_name": "Nadila ",
|
||||
"last_name": "Lamees"
|
||||
},
|
||||
{
|
||||
"id": "3",
|
||||
"employee_id": "EMP003",
|
||||
"first_name": "Sofia",
|
||||
"middle_name": "",
|
||||
"last_name": "O'Sullivan"
|
||||
}
|
||||
]
|
||||
27
core-ext/raml/schemas/candidate.json
Normal file
27
core-ext/raml/schemas/candidate.json
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"email": {
|
||||
"type": "string"
|
||||
},
|
||||
"first_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"last_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"cv_title": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"employee_id",
|
||||
"first_name",
|
||||
"last_name"
|
||||
]
|
||||
}
|
||||
27
core-ext/raml/schemas/employee.json
Normal file
27
core-ext/raml/schemas/employee.json
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"employee_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"first_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"middle_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"last_name": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"employee_id",
|
||||
"first_name",
|
||||
"last_name"
|
||||
]
|
||||
}
|
||||
30
core-ext/raml/schemas/employees.json
Normal file
30
core-ext/raml/schemas/employees.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"employee_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"first_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"middle_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"last_name": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"employee_id",
|
||||
"first_name",
|
||||
"last_name"
|
||||
]
|
||||
}
|
||||
}
|
||||
39
core-ext/raml/schemas/error.json
Normal file
39
core-ext/raml/schemas/error.json
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"error": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"messages": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"code": {
|
||||
"type": "string"
|
||||
},
|
||||
"message": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"code",
|
||||
"message"
|
||||
]
|
||||
}
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"messages",
|
||||
"description"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"error"
|
||||
]
|
||||
}
|
||||
@@ -791,46 +791,45 @@ INSERT INTO `WorkDays` (`id`, `name`, `status`, `country`) VALUES
|
||||
(7, 'Sunday', 'Non-working Day',NULL);
|
||||
|
||||
|
||||
INSERT 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`,`output`) 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','CSV'),
|
||||
('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','CSV'),
|
||||
('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','CSV');
|
||||
|
||||
INSERT INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
|
||||
|
||||
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
|
||||
('Employee Time Entry Report', 'View employee time entries by 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[ "client", {"label":"Select Client","type":"select","allow-null":true,"null-label":"Not Selected","remote-source":["Client","id","name"]}],\r\n[ "project", {"label":"Or Project","type":"select","allow-null":true,"null-label":"All Projects","remote-source":["Project","id","name","getAllProjects"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]',
|
||||
'EmployeeTimesheetReport', '["employee","client","project","date_start","date_end","status"]', 'Class','Time Management','CSV');
|
||||
|
||||
|
||||
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) 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');
|
||||
'["department"]', 'Class','Employee Information','CSV');
|
||||
|
||||
INSERT INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`, `report_group`) VALUES
|
||||
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`, `report_group`,`output`) 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');
|
||||
'["department","date_start","date_end"]', 'Class','Employee Information','CSV');
|
||||
|
||||
INSERT INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`, `report_group`) VALUES
|
||||
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`, `report_group`,`output`) 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');
|
||||
'["department","date_start","date_end"]', 'Class','Employee Information','CSV');
|
||||
|
||||
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
|
||||
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) 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');
|
||||
'["employee","date_start","date_end","status"]', 'Class', 'Travel and Expense Management','CSV');
|
||||
|
||||
|
||||
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 `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');
|
||||
|
||||
INSERT 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');
|
||||
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) 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','CSV');
|
||||
|
||||
|
||||
|
||||
@@ -871,7 +870,7 @@ REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
('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
|
||||
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
('Recruitment: Show Quick Apply', '1', 'Show quick apply button when candidates are applying for jobs. Quick apply allow candidates to apply with minimum amount of information','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
|
||||
('Recruitment: Show Apply', '1', 'Show apply button when candidates are applying for jobs','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
|
||||
|
||||
@@ -885,29 +884,35 @@ INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
('Attendance: Use Department Time Zone', '0', '','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
|
||||
|
||||
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"]]}]');
|
||||
('Travel: Allow Indirect Admins to Approve', '0', 'Allow indirect admins to approve travel requests','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
|
||||
|
||||
|
||||
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"]]}]');
|
||||
|
||||
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
('Attendance: Overtime Calculation Period', 'Daily', 'Set the period for overtime calculation. (Affects attendance sheets)','["value", {"label":"Value","type":"select","source":[["Daily","Daily"],["Weekly","Weekly"]]}]');
|
||||
|
||||
|
||||
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
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', '');
|
||||
|
||||
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
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"]]}]');
|
||||
|
||||
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
('System: Allowed Countries', '', 'Only these countries will be allowed in select boxes','["value", {"label":"Value","type":"select2multi","remote-source":["Country","id","name"]}]');
|
||||
|
||||
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
('System: Allowed Currencies', '', 'Only these currencies will be allowed in select boxes','["value", {"label":"Value","type":"select2multi","remote-source":["CurrencyType","id","code+name"]}]');
|
||||
|
||||
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
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 `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
('System: Language', 'en', 'Current Language','["value", {"label":"Value","type":"select2","allow-null":false,"remote-source":["SupportedLanguage","name","description"]}]');
|
||||
|
||||
|
||||
INSERT INTO `Certifications` (`id`, `name`, `description`) VALUES
|
||||
(1, 'Red Hat Certified Architect (RHCA)', 'Red Hat Certified Architect (RHCA)'),
|
||||
@@ -986,12 +991,204 @@ INSERT INTO `JobTitles` (`id`, `code`, `name`, `description`, `specification`) V
|
||||
|
||||
|
||||
INSERT INTO `Languages` (`id`, `name`, `description`) VALUES
|
||||
(1, 'English', 'English'),
|
||||
(2, 'French', 'French'),
|
||||
(3, 'German', 'German'),
|
||||
(4, 'Chinese', 'Chinese');
|
||||
(1, 'en', 'English'),
|
||||
(2, 'fr', 'French'),
|
||||
(3, 'de', 'German'),
|
||||
(4, 'zh', 'Chinese'),
|
||||
(5, 'aa', 'Afar'),
|
||||
(6, 'ab', 'Abkhaz'),
|
||||
(7, 'ae', 'Avestan'),
|
||||
(8, 'af', 'Afrikaans'),
|
||||
(9, 'ak', 'Akan'),
|
||||
(10, 'am', 'Amharic'),
|
||||
(11, 'an', 'Aragonese'),
|
||||
(12, 'ar', 'Arabic'),
|
||||
(13, 'as', 'Assamese'),
|
||||
(14, 'av', 'Avaric'),
|
||||
(15, 'ay', 'Aymara'),
|
||||
(16, 'az', 'Azerbaijani'),
|
||||
(17, 'ba', 'Bashkir'),
|
||||
(18, 'be', 'Belarusian'),
|
||||
(19, 'bg', 'Bulgarian'),
|
||||
(20, 'bh', 'Bihari'),
|
||||
(21, 'bi', 'Bislama'),
|
||||
(22, 'bm', 'Bambara'),
|
||||
(23, 'bn', 'Bengali'),
|
||||
(24, 'bo', 'Tibetan Standard, Tibetan, Central'),
|
||||
(25, 'br', 'Breton'),
|
||||
(26, 'bs', 'Bosnian'),
|
||||
(27, 'ca', 'Catalan; Valencian'),
|
||||
(28, 'ce', 'Chechen'),
|
||||
(29, 'ch', 'Chamorro'),
|
||||
(30, 'co', 'Corsican'),
|
||||
(31, 'cr', 'Cree'),
|
||||
(32, 'cs', 'Czech'),
|
||||
(33, 'cu', 'Old Church Slavonic, Church Slavic, Church Slavonic, Old Bulgarian, Old Slavonic'),
|
||||
(34, 'cv', 'Chuvash'),
|
||||
(35, 'cy', 'Welsh'),
|
||||
(36, 'da', 'Danish'),
|
||||
(37, 'dv', 'Divehi; Dhivehi; Maldivian;'),
|
||||
(38, 'dz', 'Dzongkha'),
|
||||
(39, 'ee', 'Ewe'),
|
||||
(40, 'el', 'Greek, Modern'),
|
||||
(41, 'eo', 'Esperanto'),
|
||||
(42, 'es', 'Spanish; Castilian'),
|
||||
(43, 'et', 'Estonian'),
|
||||
(44, 'eu', 'Basque'),
|
||||
(45, 'fa', 'Persian'),
|
||||
(46, 'ff', 'Fula; Fulah; Pulaar; Pular'),
|
||||
(47, 'fi', 'Finnish'),
|
||||
(48, 'fj', 'Fijian'),
|
||||
(49, 'fo', 'Faroese'),
|
||||
(50, 'fy', 'Western Frisian'),
|
||||
(51, 'ga', 'Irish'),
|
||||
(52, 'gd', 'Scottish Gaelic; Gaelic'),
|
||||
(53, 'gl', 'Galician'),
|
||||
(54, 'gn', 'GuaranÃ'),
|
||||
(55, 'gu', 'Gujarati'),
|
||||
(56, 'gv', 'Manx'),
|
||||
(57, 'ha', 'Hausa'),
|
||||
(58, 'he', 'Hebrew (modern)'),
|
||||
(59, 'hi', 'Hindi'),
|
||||
(60, 'ho', 'Hiri Motu'),
|
||||
(61, 'hr', 'Croatian'),
|
||||
(62, 'ht', 'Haitian; Haitian Creole'),
|
||||
(63, 'hu', 'Hungarian'),
|
||||
(64, 'hy', 'Armenian'),
|
||||
(65, 'hz', 'Herero'),
|
||||
(66, 'ia', 'Interlingua'),
|
||||
(67, 'id', 'Indonesian'),
|
||||
(68, 'ie', 'Interlingue'),
|
||||
(69, 'ig', 'Igbo'),
|
||||
(70, 'ii', 'Nuosu'),
|
||||
(71, 'ik', 'Inupiaq'),
|
||||
(72, 'io', 'Ido'),
|
||||
(73, 'is', 'Icelandic'),
|
||||
(74, 'it', 'Italian'),
|
||||
(75, 'iu', 'Inuktitut'),
|
||||
(76, 'ja', 'Japanese (ja)'),
|
||||
(77, 'jv', 'Javanese (jv)'),
|
||||
(78, 'ka', 'Georgian'),
|
||||
(79, 'kg', 'Kongo'),
|
||||
(80, 'ki', 'Kikuyu, Gikuyu'),
|
||||
(81, 'kj', 'Kwanyama, Kuanyama'),
|
||||
(82, 'kk', 'Kazakh'),
|
||||
(83, 'kl', 'Kalaallisut, Greenlandic'),
|
||||
(84, 'km', 'Khmer'),
|
||||
(85, 'kn', 'Kannada'),
|
||||
(86, 'ko', 'Korean'),
|
||||
(87, 'kr', 'Kanuri'),
|
||||
(88, 'ks', 'Kashmiri'),
|
||||
(89, 'ku', 'Kurdish'),
|
||||
(90, 'kv', 'Komi'),
|
||||
(91, 'kw', 'Cornish'),
|
||||
(92, 'ky', 'Kirghiz, Kyrgyz'),
|
||||
(93, 'la', 'Latin'),
|
||||
(94, 'lb', 'Luxembourgish, Letzeburgesch'),
|
||||
(95, 'lg', 'Luganda'),
|
||||
(96, 'li', 'Limburgish, Limburgan, Limburger'),
|
||||
(97, 'ln', 'Lingala'),
|
||||
(98, 'lo', 'Lao'),
|
||||
(99, 'lt', 'Lithuanian'),
|
||||
(100, 'lu', 'Luba-Katanga'),
|
||||
(101, 'lv', 'Latvian'),
|
||||
(102, 'mg', 'Malagasy'),
|
||||
(103, 'mh', 'Marshallese'),
|
||||
(104, 'mi', 'Maori'),
|
||||
(105, 'mk', 'Macedonian'),
|
||||
(106, 'ml', 'Malayalam'),
|
||||
(107, 'mn', 'Mongolian'),
|
||||
(108, 'mr', 'Marathi (Mara?hi)'),
|
||||
(109, 'ms', 'Malay'),
|
||||
(110, 'mt', 'Maltese'),
|
||||
(111, 'my', 'Burmese'),
|
||||
(112, 'na', 'Nauru'),
|
||||
(113, 'nb', 'Norwegian Bokmål'),
|
||||
(114, 'nd', 'North Ndebele'),
|
||||
(115, 'ne', 'Nepali'),
|
||||
(116, 'ng', 'Ndonga'),
|
||||
(117, 'nl', 'Dutch'),
|
||||
(118, 'nn', 'Norwegian Nynorsk'),
|
||||
(119, 'no', 'Norwegian'),
|
||||
(120, 'nr', 'South Ndebele'),
|
||||
(121, 'nv', 'Navajo, Navaho'),
|
||||
(122, 'ny', 'Chichewa; Chewa; Nyanja'),
|
||||
(123, 'oc', 'Occitan'),
|
||||
(124, 'oj', 'Ojibwe, Ojibwa'),
|
||||
(125, 'om', 'Oromo'),
|
||||
(126, 'or', 'Oriya'),
|
||||
(127, 'os', 'Ossetian, Ossetic'),
|
||||
(128, 'pa', 'Panjabi, Punjabi'),
|
||||
(129, 'pi', 'Pali'),
|
||||
(130, 'pl', 'Polish'),
|
||||
(131, 'ps', 'Pashto, Pushto'),
|
||||
(132, 'pt', 'Portuguese'),
|
||||
(133, 'qu', 'Quechua'),
|
||||
(134, 'rm', 'Romansh'),
|
||||
(135, 'rn', 'Kirundi'),
|
||||
(136, 'ro', 'Romanian, Moldavian, Moldovan'),
|
||||
(137, 'ru', 'Russian'),
|
||||
(138, 'rw', 'Kinyarwanda'),
|
||||
(139, 'sa', 'Sanskrit (Sa?sk?ta)'),
|
||||
(140, 'sc', 'Sardinian'),
|
||||
(141, 'sd', 'Sindhi'),
|
||||
(142, 'se', 'Northern Sami'),
|
||||
(143, 'sg', 'Sango'),
|
||||
(144, 'si', 'Sinhala, Sinhalese'),
|
||||
(145, 'sk', 'Slovak'),
|
||||
(146, 'sl', 'Slovene'),
|
||||
(147, 'sm', 'Samoan'),
|
||||
(148, 'sn', 'Shona'),
|
||||
(149, 'so', 'Somali'),
|
||||
(150, 'sq', 'Albanian'),
|
||||
(151, 'sr', 'Serbian'),
|
||||
(152, 'ss', 'Swati'),
|
||||
(153, 'st', 'Southern Sotho'),
|
||||
(154, 'su', 'Sundanese'),
|
||||
(155, 'sv', 'Swedish'),
|
||||
(156, 'sw', 'Swahili'),
|
||||
(157, 'ta', 'Tamil'),
|
||||
(158, 'te', 'Telugu'),
|
||||
(159, 'tg', 'Tajik'),
|
||||
(160, 'th', 'Thai'),
|
||||
(161, 'ti', 'Tigrinya'),
|
||||
(162, 'tk', 'Turkmen'),
|
||||
(163, 'tl', 'Tagalog'),
|
||||
(164, 'tn', 'Tswana'),
|
||||
(165, 'to', 'Tonga (Tonga Islands)'),
|
||||
(166, 'tr', 'Turkish'),
|
||||
(167, 'ts', 'Tsonga'),
|
||||
(168, 'tt', 'Tatar'),
|
||||
(169, 'tw', 'Twi'),
|
||||
(170, 'ty', 'Tahitian'),
|
||||
(171, 'ug', 'Uighur, Uyghur'),
|
||||
(172, 'uk', 'Ukrainian'),
|
||||
(173, 'ur', 'Urdu'),
|
||||
(174, 'uz', 'Uzbek'),
|
||||
(175, 've', 'Venda'),
|
||||
(176, 'vi', 'Vietnamese'),
|
||||
(177, 'vo', 'Volapük'),
|
||||
(178, 'wa', 'Walloon'),
|
||||
(179, 'wo', 'Wolof'),
|
||||
(180, 'xh', 'Xhosa'),
|
||||
(181, 'yi', 'Yiddish'),
|
||||
(182, 'yo', 'Yoruba'),
|
||||
(183, 'za', 'Zhuang, Chuang'),
|
||||
(184, 'zu', 'Zulu');
|
||||
|
||||
|
||||
INSERT INTO `SupportedLanguages` (`name`, `description`) VALUES
|
||||
('en', 'English'),
|
||||
('de', 'German'),
|
||||
('fr', 'French'),
|
||||
('pl', 'Polish'),
|
||||
('it', 'Italian'),
|
||||
('si', 'Sinhala'),
|
||||
('zh', 'Chinese'),
|
||||
('ja', 'Japanese'),
|
||||
('hi', 'Hindi'),
|
||||
('es', 'Spanish');
|
||||
|
||||
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'),
|
||||
@@ -1117,7 +1314,7 @@ INSERT INTO `UserRoles` VALUES
|
||||
|
||||
|
||||
INSERT INTO `Users` VALUES
|
||||
(1,'admin','icehrm+admin@web-stalk.com','21232f297a57a5a743894a0e4a801fc3',1,NULL,'Admin','',NULL,NULL,NULL,NULL);
|
||||
(1,'admin','icehrm+admin@web-stalk.com','21232f297a57a5a743894a0e4a801fc3',1,NULL,'Admin','',NULL,NULL,NULL,NULL,NULL);
|
||||
|
||||
|
||||
INSERT INTO `SalaryComponentType` (`id`,`code`, `name`) VALUES
|
||||
@@ -1252,14 +1449,133 @@ INSERT INTO `ExpensesCategories` (`name`) VALUES
|
||||
('Utility');
|
||||
|
||||
|
||||
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');
|
||||
INSERT INTO `PayrollColumns` (`id`,`name`,`calculation_hook`,`salary_components`,`deductions`,`add_columns`,`sub_columns`,`editable`,`enabled`,`default_value`,`calculation_columns`,`calculation_function`) VALUES
|
||||
(1,'Total Hours','AttendanceUtil_getTimeWorkedHours','','','','','No','Yes','0.00',NULL,NULL),
|
||||
(2,'Regular Hours','AttendanceUtil_getRegularWorkedHours','','','','','No','Yes','0.00',NULL,NULL),
|
||||
(3,'Overtime Hours','AttendanceUtil_getOverTimeWorkedHours','','','','','No','Yes','0.00',NULL,NULL),
|
||||
(4,'Leave Hours','LeaveUtil_getLeaveHours','','','','','No','Yes','0.00',NULL,NULL);
|
||||
|
||||
|
||||
INSERT INTO `PayrollColumnTemplates` (`name`,`columns`) VALUES
|
||||
('All Columns','[\"1\",\"2\",\"3\",\"4\"]'),
|
||||
('All Time Management Columns','[\"1\",\"2\",\"3\"]');
|
||||
('All Columns','[\"1\",\"2\",\"3\",\"4\"]'),
|
||||
('All Time Management Columns','[\"1\",\"2\",\"3\"]');
|
||||
|
||||
|
||||
|
||||
INSERT INTO `DataImport` (`name`, `dataType`, `details`, `columns`, `updated`, `created`) VALUES
|
||||
('Employee Data Import', 'EmployeeDataImporter', '', '[{"name":"employee_id","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"Yes","id":"columns_7"},{"name":"first_name","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_3"},{"name":"middle_name","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_5"},{"name":"last_name","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_6"},{"name":"address1","title":"Address1","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_8"},{"name":"address2","title":"Address2","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_9"},{"name":"home_phone","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_14"},{"name":"mobile_phone","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_15"},{"name":"work_email","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_16"},{"name":"gender","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_17"},{"name":"marital_status","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_18"},{"name":"birthday","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_20"},{"name":"nationality","title":"Nationality","type":"Reference","dependOn":"Nationality","dependOnField":"name","isKeyField":"Yes","idField":"No","id":"columns_22"},{"name":"ethnicity","title":"Ethnicity","type":"Normal","dependOn":"Ethnicity","dependOnField":"name","isKeyField":"Yes","idField":"No","id":"columns_23"},{"name":"EmergencyContact/name","title":"","type":"Attached","dependOn":"EmergencyContact","dependOnField":"name","isKeyField":"Yes","idField":"No","id":"columns_24"},{"name":"EmergencyContact/relationship","title":"","type":"Attached","dependOn":"EmergencyContact","dependOnField":"relationship","isKeyField":"No","idField":"No","id":"columns_25"},{"name":"EmergencyContact/home_phone","title":"","type":"Attached","dependOn":"EmergencyContact","dependOnField":"home_phone","isKeyField":"No","idField":"No","id":"columns_26"},{"name":"ssn_num","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_31"},{"name":"job_title","title":"","type":"Reference","dependOn":"JobTitle","dependOnField":"name","isKeyField":"Yes","idField":"No","id":"columns_32"},{"name":"employment_status","title":"","type":"Reference","dependOn":"EmploymentStatus","dependOnField":"name","isKeyField":"Yes","idField":"No","id":"columns_33"},{"name":"joined_date","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_36"},{"name":"department","title":"","type":"Reference","dependOn":"CompanyStructure","dependOnField":"title","isKeyField":"Yes","idField":"No","id":"columns_38"}]', '2016-06-02 18:56:32', '2016-06-02 18:56:32'),
|
||||
('Attendance Data Import', 'AttendanceDataImporter', '', '[{"name":"employee","title":"","type":"Reference","dependOn":"Employee","dependOnField":"employee_id","isKeyField":"Yes","idField":"No","id":"columns_1"},{"name":"in_time","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_2"},{"name":"out_time","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_3"},{"name":"note","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_4"}]', '2016-08-14 02:51:56', '2016-08-14 02:51:56');
|
||||
|
||||
|
||||
|
||||
|
||||
REPLACE INTO `UserReports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
|
||||
('Time Entry Report', 'View your time entries by date range and project',
|
||||
'[\r\n[ "client", {"label":"Select Client","type":"select","allow-null":true,"null-label":"Not Selected","remote-source":["Client","id","name"]}],\r\n[ "project", {"label":"Or Project","type":"select","allow-null":true,"null-label":"All Projects","remote-source":["Project","id","name","getAllProjects"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]',
|
||||
'EmployeeTimesheetReport', '["client","project","date_start","date_end","status"]', 'Class','Time Management','CSV');
|
||||
|
||||
REPLACE INTO `UserReports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
|
||||
('Attendance Report', 'View your attendance entries by date range', '[\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeAttendanceReport', '["date_start","date_end"]', 'Class','Time Management','CSV');
|
||||
|
||||
REPLACE INTO `UserReports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
|
||||
('Time Tracking Report', 'View your working hours and attendance details for each day for a given period ', '[\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeTimeTrackReport', '["date_start","date_end"]', 'Class','Time Management','CSV');
|
||||
|
||||
|
||||
REPLACE INTO `UserReports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
|
||||
('Travel Request Report', 'View travel requests for a specified period',
|
||||
'[\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',
|
||||
'["date_start","date_end","status"]', 'Class', 'Travel and Expense Management','CSV');
|
||||
|
||||
|
||||
REPLACE INTO `UserReports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
|
||||
('Time Sheet Report', 'This report list all employee time sheets by employee and date range',
|
||||
'[\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',
|
||||
'["date_start","date_end","status"]', 'Class','Time Management','CSV');
|
||||
|
||||
|
||||
REPLACE INTO `UserReports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
|
||||
('Client Project Time Report', 'View your time entries for projects under a given client',
|
||||
'[\r\n[ "client", {"label":"Select Client","type":"select","allow-null":false,"remote-source":["Client","id","name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]',
|
||||
'ClientProjectTimeReport', '["client","date_start","date_end","status"]', 'Class','Time Management','PDF');
|
||||
|
||||
REPLACE INTO `UserReports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
|
||||
('Download Payslips', 'Download your payslips',
|
||||
'[\r\n[ "payroll", {"label":"Select Payroll","type":"select","allow-null":false,"remote-source":["Payroll","id","name","getEmployeePayrolls"]}]]',
|
||||
'PayslipReport', '["payroll"]', 'Class','Finance','PDF');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
INSERT INTO `DeductionGroup` VALUES
|
||||
(1,'Sri Lanka Payroll Calculation','');
|
||||
|
||||
|
||||
INSERT INTO `PayslipTemplates` (`id`, `name`, `data`, `status`, `created`, `updated`) VALUES
|
||||
(1, 'Sri Lanka - Default Payslip', '[{"type":"Company Logo","payrollColumn":"NULL","label":"","text":"","fontSize":"Normal","fontStyle":"Normal","fontColor":"#000000","status":"Show","id":"data_1"},{"type":"Company Name","payrollColumn":"NULL","label":"","text":"","fontSize":"Normal","fontStyle":"Normal","fontColor":"","status":"Show","id":"data_2"},{"type":"Separators","payrollColumn":"NULL","label":"","text":"","fontSize":"Normal","fontStyle":"Normal","fontColor":"","status":"Show","id":"data_8"},{"type":"Payroll Column","payrollColumn":"5","label":"Basic Salary","text":"","status":"Show","id":"data_3"},{"type":"Payroll Column","payrollColumn":"6","label":"Fixed Allowance","text":"","status":"Show","id":"data_4"},{"type":"Payroll Column","payrollColumn":"7","label":"Gross Pay","text":"","status":"Show","id":"data_11"},{"type":"Separators","payrollColumn":"NULL","label":"","text":"","fontSize":"Normal","fontStyle":"Normal","fontColor":"","status":"Show","id":"data_9"},{"type":"Text","payrollColumn":"NULL","label":"","text":"Deductions","status":"Show","id":"data_13"},{"type":"Payroll Column","payrollColumn":"8","label":"EPF Employee Contribution","text":"","status":"Show","id":"data_6"},{"type":"Payroll Column","payrollColumn":"13","label":"PAYE Tax","text":"","status":"Show","id":"data_14"},{"type":"Payroll Column","payrollColumn":"14","label":"Stamp Duty","text":"","status":"Show","id":"data_15"},{"type":"Payroll Column","payrollColumn":"15","label":"Total Deductions","text":"","status":"Show","id":"data_16"},{"type":"Separators","payrollColumn":"NULL","label":"","text":"","status":"Show","id":"data_17"},{"type":"Text","payrollColumn":"NULL","label":"","text":"Employer Contributions","status":"Show","id":"data_18"},{"type":"Payroll Column","payrollColumn":"9","label":"EPF Employer Contribution","text":"","status":"Show","id":"data_19"},{"type":"Payroll Column","payrollColumn":"7","label":"ETF Employer Contribution","text":"","status":"Show","id":"data_20"},{"type":"Separators","payrollColumn":"7","label":"","text":"","status":"Show","id":"data_21"},{"type":"Text","payrollColumn":"7","label":"","text":"Totals","status":"Show","id":"data_22"},{"type":"Payroll Column","payrollColumn":"11","label":"Total EPF 20%","text":"","status":"Show","id":"data_23"},{"type":"Payroll Column","payrollColumn":"12","label":"Total for PAYE","text":"","status":"Show","id":"data_24"},{"type":"Payroll Column","payrollColumn":"16","label":"Net Salary","text":"","status":"Show","id":"data_25"}]', NULL, '2016-06-29 22:07:12', '2016-06-29 22:07:12');
|
||||
|
||||
INSERT INTO `Payroll` VALUES
|
||||
(1,'Sri Lanka Payroll Sample',4,1,NULL,'[\"5\",\"8\",\"9\",\"10\",\"6\",\"7\",\"11\",\"12\",\"13\",\"14\",\"15\",\"16\"]','2016-03-01','2016-03-31','Draft', 1);
|
||||
|
||||
INSERT INTO `PayrollColumns` VALUES
|
||||
(5,'LK - Basic Salary',NULL,'[\"1\"]','[]','[]','[]',5,'No','Yes','0.00',NULL,NULL),
|
||||
(6,'LK - Fixed Allowance',NULL,'[\"2\"]','[]','[]','[]',6,'No','Yes','0.00',NULL,NULL),
|
||||
(7,'LK - Gross Pay',NULL,'[]','[]','[\"5\",\"6\"]','[]',7,'No','Yes','0.00',NULL,NULL),
|
||||
(8,'LK - EPF Employee Contribution',NULL,'[]','[\"1\"]','[]','[]',8,'No','Yes','0.00',NULL,NULL),
|
||||
(9,'LK - EPF Employer Contribution',NULL,'[]','[\"2\"]','[]','[]',9,'No','Yes','0.00',NULL,NULL),
|
||||
(10,'LK - ETF Employer Contribution',NULL,'[]','[\"3\"]','[]','[]',10,'No','Yes','0.00',NULL,NULL),
|
||||
(11,'LK - Total EPF 20%',NULL,'[]','[]','[\"8\",\"9\"]','[]',11,'No','Yes','0.00',NULL,NULL),
|
||||
(12,'LK - Total for PAYE',NULL,'[]','[]','[\"7\"]','[]',12,'No','Yes','0.00',NULL,NULL),
|
||||
(13,'LK - PAYE Tax',NULL,'[]','[\"4\"]','[]','[]',13,'No','Yes','0.00',NULL,NULL),
|
||||
(14,'LK - Stamp Duty',NULL,'[]','[\"5\"]','[]','[]',14,'No','Yes','0.00',NULL,NULL),
|
||||
(15,'LK - Total Deductions',NULL,'[]','[]','[\"8\",\"13\",\"14\"]','[]',15,'No','Yes','0.00',NULL,NULL),
|
||||
(16,'LK - Salary to Bank',NULL,'[]','[]','[\"7\"]','[\"15\"]',16,'No','Yes','0.00',NULL,NULL);
|
||||
|
||||
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 Employer 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 `DeductionGroup` VALUES
|
||||
(2,'Ghana Payroll Calculation','');
|
||||
|
||||
INSERT INTO `PayslipTemplates` VALUES
|
||||
(2,'Ghana Default','[{\"type\":\"Company Name\",\"payrollColumn\":\"NULL\",\"label\":\"\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_1\"},{\"type\":\"Separators\",\"payrollColumn\":\"NULL\",\"label\":\"\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_3\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"105\",\"label\":\"\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_4\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"106\",\"label\":\"\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_5\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"107\",\"label\":\"\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_6\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"112\",\"label\":\"Total\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_7\"},{\"type\":\"Separators\",\"payrollColumn\":\"NULL\",\"label\":\"\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_8\"},{\"type\":\"Text\",\"payrollColumn\":\"NULL\",\"label\":\"\",\"text\":\"Deductions \",\"status\":\"Show\",\"id\":\"data_9\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"109\",\"label\":\"SSNIT (5.5%)\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_10\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"113\",\"label\":\"Tax (1st Level 5%)\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_11\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"114\",\"label\":\"Tax (2nd Level 10%)\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_12\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"115\",\"label\":\"Tax (3rd Level 17.5%)\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_13\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"120\",\"label\":\"Tax (4th Level 25%)\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_14\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"121\",\"label\":\"Overtime Allow. Tax (5%)\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_15\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"122\",\"label\":\"Total (PAYE Tax)\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_16\"},{\"type\":\"Separators\",\"payrollColumn\":\"NULL\",\"label\":\"\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_17\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"123\",\"label\":\"Sub Total\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_18\"},{\"type\":\"Separators\",\"payrollColumn\":\"NULL\",\"label\":\"\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_19\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"125\",\"label\":\"Netto Monthly Salary\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_20\"}]',NULL,'2016-08-30 21:53:13','2016-08-30 21:53:13');
|
||||
|
||||
|
||||
INSERT INTO `Payroll` VALUES
|
||||
(6,'Ghana Payroll Sample',4,1,NULL,'[\"123\",\"125\",\"106\",\"124\",\"113\",\"114\",\"115\",\"121\",\"107\",\"120\",\"109\",\"105\",\"112\",\"108\",\"122\"]','2016-08-01','2016-08-31','Draft',2);
|
||||
|
||||
|
||||
INSERT INTO `PayrollColumns` VALUES
|
||||
(105,'GH - Salary (Basic)',NULL,'[\"1\"]','[]','[]','[]',1,'No','Yes','0.00','',''),
|
||||
(106,'GH - Housing Allowance',NULL,'[]','[\"101\"]','[]','[]',2,'No','Yes','0.00','',''),
|
||||
(107,'GH - Overtime Allowance',NULL,'[]','[\"102\"]','[]','[]',3,'No','Yes','0.00','',''),
|
||||
(108,'GH - Total',NULL,'[]','[]','[\"106\",\"107\",\"105\"]','[]',4,'No','Yes','0.00','',''),
|
||||
(109,'GH - SSNIT',NULL,'[]','[\"103\"]','[]','[]',5,'No','Yes','0.00','',''),
|
||||
(112,'GH - Taxable Income',NULL,'[]','[]','[\"106\",\"105\"]','[\"109\"]',7,'No','Yes','0.00','',''),
|
||||
(113,'GH - Next 108 GHC',NULL,'[]','[\"106\"]','[]','[]',9,'No','Yes','0.00','',''),
|
||||
(114,'GH - Next 151 GHC',NULL,'[]','[\"107\"]','[]','[]',10,'No','Yes','0.00','',''),
|
||||
(115,'GH - Next 2765 GHC',NULL,'[]','[\"108\"]','[]','[]',11,'No','Yes','0.00','',''),
|
||||
(120,'GH - Remaining after 3240 GHC',NULL,'[]','[\"111\"]','[]','[]',12,'No','Yes','0.00','',''),
|
||||
(121,'GH - Overtime Allow. Tax',NULL,'[]','[]','[]','[]',13,'No','Yes','0.00','[{\"name\":\"O\",\"column\":\"107\",\"id\":\"calculation_columns_1\"}]','O*0.05'),
|
||||
(122,'GH - Total (PAYE Tax)',NULL,'[]','[]','[\"113\",\"114\",\"115\",\"120\",\"121\"]','[]',14,'No','Yes','0.00','',''),
|
||||
(123,'GH - Deductions - Sub Total',NULL,'[]','[]','[\"109\",\"122\"]','[]',15,'No','Yes','0.00','',''),
|
||||
(125,'GH - Final Total',NULL,'[]','[]','[\"108\"]','[\"123\"]',16,'No','Yes','0.00','','');
|
||||
|
||||
|
||||
INSERT INTO `Deductions` VALUES
|
||||
(101,'Housing Allowance (10%)','[]','[\"1\"]',NULL,'[{\"lowerCondition\":\"No Lower Limit\",\"lowerLimit\":0,\"upperCondition\":\"No Upper Limit\",\"upperLimit\":0,\"amount\":\"X*0.1\",\"id\":\"rangeAmounts_1\"}]',2),
|
||||
(102,'Overtime Allowance (10%)','[]','[\"1\"]',NULL,'[{\"lowerCondition\":\"No Lower Limit\",\"lowerLimit\":0,\"upperCondition\":\"No Upper Limit\",\"upperLimit\":0,\"amount\":\"X*0.1\",\"id\":\"rangeAmounts_1\"}]',2),
|
||||
(103,'SSNIT','[]','[\"1\"]',NULL,'[{\"lowerCondition\":\"No Lower Limit\",\"lowerLimit\":0,\"upperCondition\":\"No Upper Limit\",\"upperLimit\":0,\"amount\":\"X*0.055\",\"id\":\"rangeAmounts_1\"}]',2),
|
||||
(104,'Tax - Ghana','[]','[]',NULL,'',2),
|
||||
(106,'Next 108 GHC','[]','[]',112,'[{\"lowerCondition\":\"gte\",\"lowerLimit\":\"216\",\"upperCondition\":\"lt\",\"upperLimit\":\"324\",\"amount\":\"X*0.05\",\"id\":\"rangeAmounts_1\"},{\"lowerCondition\":\"gte\",\"lowerLimit\":\"324\",\"upperCondition\":\"No Upper Limit\",\"upperLimit\":0,\"amount\":\"5.4\",\"id\":\"rangeAmounts_2\"}]',2),
|
||||
(107,'Next 151 GHC','[]','[]',112,'[{\"lowerCondition\":\"gte\",\"lowerLimit\":\"324\",\"upperCondition\":\"lt\",\"upperLimit\":\"475\",\"amount\":\"(X-324) * 0.1\",\"id\":\"rangeAmounts_1\"},{\"lowerCondition\":\"gte\",\"lowerLimit\":\"259\",\"upperCondition\":\"No Upper Limit\",\"upperLimit\":0,\"amount\":\"15.10\",\"id\":\"rangeAmounts_2\"}]',2),
|
||||
(108,'Next 2765 GHC','[]','[]',112,'[{\"lowerCondition\":\"gte\",\"lowerLimit\":\"475\",\"upperCondition\":\"lt\",\"upperLimit\":\"3240\",\"amount\":\"(X - 475) * 0.175\",\"id\":\"rangeAmounts_1\"},{\"lowerCondition\":\"gte\",\"lowerLimit\":\"3240\",\"upperCondition\":\"No Upper Limit\",\"upperLimit\":0,\"amount\":\"483.88\",\"id\":\"rangeAmounts_2\"}]',2),
|
||||
(111,'Remaining after 3240 GHC','[]','[]',112,'[{\"lowerCondition\":\"gte\",\"lowerLimit\":\"3240\",\"upperCondition\":\"No Upper Limit\",\"upperLimit\":0,\"amount\":\"(X-3240)*0.25\",\"id\":\"rangeAmounts_1\"}]',2);
|
||||
|
||||
|
||||
@@ -40,9 +40,32 @@ INSERT INTO `Employees` (`id`, `employee_id`, `first_name`, `middle_name`, `last
|
||||
(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);
|
||||
(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),
|
||||
(16, 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),
|
||||
(17, 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),
|
||||
(18, 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),
|
||||
(19, 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),
|
||||
(20, 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),
|
||||
(21, 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),
|
||||
(22, 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),
|
||||
(23, 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),
|
||||
(24, 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),
|
||||
(25, 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),
|
||||
(26, 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),
|
||||
(27, 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),
|
||||
(28, 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),
|
||||
(29, 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),
|
||||
(30, 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),
|
||||
(31, 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),
|
||||
(32, 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),
|
||||
(33, 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),
|
||||
(34, 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);
|
||||
|
||||
|
||||
UPDATE `Employees` set supervisor = 2, indirect_supervisors = '[3,4]', approver1 = 5, approver2 = 6, approver3 = 7 where id = 1;
|
||||
UPDATE `Employees` set supervisor = 1, indirect_supervisors = '[3,4]', approver1 = 5, approver2 = 6 where id = 2;
|
||||
UPDATE `Employees` set supervisor = 2, indirect_supervisors = '[1,4]', approver1 = 5 where id = 3;
|
||||
|
||||
INSERT INTO `EmergencyContacts` (`id`, `employee`, `name`, `relationship`, `home_phone`, `work_phone`, `mobile_phone`) VALUES
|
||||
(1, 1, 'Emma Owns', 'Mother', '+874463422', '+874463422', '+874463422'),
|
||||
(2, 2, 'Casey Watson', 'Sister', '231-453-876', '231-453-876', '231-453-876');
|
||||
@@ -129,7 +152,13 @@ INSERT INTO `Users` (`id`, `username`, `email`, `password`, `employee`,`default_
|
||||
(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');
|
||||
(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'),
|
||||
(6, 'user4', 'icehrm+user4@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 5,NULL, 'Manager','', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55'),
|
||||
(7, 'user5', 'icehrm+user5@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 6,NULL, 'Employee','', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55'),
|
||||
(8, 'user6', 'icehrm+user6@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 7,NULL, 'Employee','', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55'),
|
||||
(9, 'user7', 'icehrm+user7@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 8,NULL, 'Employee','', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55'),
|
||||
(10, 'user8', 'icehrm+user8@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 9,NULL, 'Employee','', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55'),
|
||||
(11, 'user9', 'icehrm+user9@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 10,NULL, 'Employee','', '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),
|
||||
@@ -140,7 +169,7 @@ 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');
|
||||
(6,'attachment_BI5XQCYFxZO12W1447383181684','attachment_BI5XQCYFxZO12W1447383181684.png',1,'Job',2000,'2MB');
|
||||
|
||||
|
||||
INSERT INTO `EmployeeDocuments` (`id`,`employee`, `document`, `date_added`, `valid_until`, `status`, `details`, `attachment`, `expire_notification_last`) VALUES
|
||||
@@ -192,35 +221,7 @@ INSERT INTO `Attendance` (`employee`,`in_time`,`out_time`,`note`) VALUES
|
||||
(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),
|
||||
@@ -276,12 +277,11 @@ INSERT INTO `EmployeeLeaveDays` VALUES
|
||||
(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 */;
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
482
core-ext/scripts/upgrade_v16.0.OS_v18.0.OS.sql
Normal file
482
core-ext/scripts/upgrade_v16.0.OS_v18.0.OS.sql
Normal file
File diff suppressed because one or more lines are too long
194
core-ext/scripts/upgrade_v18.0.OS_v19.0.OS.sql
Normal file
194
core-ext/scripts/upgrade_v18.0.OS_v19.0.OS.sql
Normal file
@@ -0,0 +1,194 @@
|
||||
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) 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','CSV');
|
||||
|
||||
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) 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','CSV');
|
||||
|
||||
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
|
||||
('Overtime Request Report',
|
||||
'This report list employee overtime requests by employee, date range, overtime category and project',
|
||||
'[[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],[ "date_start", {"label":"Start Date","type":"date"}],[ "date_end", {"label":"End Date","type":"date"}],[ "category", {"label":"Category","type":"select2","allow-null":true,"remote-source":["OvertimeCategory","id","name"]}],[ "project", {"label":"Project","type":"select2","allow-null":true,"remote-source":["Project","id","name"]}],[ "status", {"label":"Status","type":"select","source":[["NULL","All Statuses"],["Approved","Approved"],["Pending","Pending"],["Rejected","Rejected"],["Cancellation Requested","Cancellation Requested"],["Cancelled","Cancelled"],["Processing","Processing"]]}]]', 'OvertimeRequestReport', '["employee","date_start","date_end","category","project"]', 'Class','Time Management','CSV');
|
||||
|
||||
|
||||
|
||||
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
('Overtime: Allow Indirect Admins to Approve', '0', 'Allow indirect admins to approve overtime requests','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
|
||||
|
||||
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
('Travel: Enable Multi Level Approvals', '0', 'Allow multi level approvals in travel module','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
|
||||
|
||||
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
('Overtime: Enable Multi Level Approvals', '0', 'Allow multi level approvals in overtime module','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
|
||||
|
||||
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
('System: Company Structure Managers Enabled', '0', 'Allow Managers to View Employees in Their Company Structure, if They are Assigned as a Head of the Company Structure',
|
||||
'["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
|
||||
|
||||
|
||||
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||
('System: Child Company Structure Managers Enabled', '0', 'Allow Managers to View Employees in Their Company Structure and all Child Company Structures, if They are Assigned as a Head of the Company Structure',
|
||||
'["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
|
||||
|
||||
|
||||
|
||||
delete from PayrollColumns;
|
||||
|
||||
|
||||
INSERT INTO `PayrollColumns` (`id`,`name`,`calculation_hook`,`salary_components`,`deductions`,`add_columns`,`sub_columns`,`editable`,`enabled`,`default_value`,`calculation_columns`,`calculation_function`) VALUES
|
||||
(1,'Total Hours','AttendanceUtil_getTimeWorkedHours','','','','','No','Yes','0.00',NULL,NULL),
|
||||
(2,'Regular Hours','AttendanceUtil_getRegularWorkedHours','','','','','No','Yes','0.00',NULL,NULL),
|
||||
(3,'Overtime Hours','AttendanceUtil_getOverTimeWorkedHours','','','','','No','Yes','0.00',NULL,NULL),
|
||||
(4,'Leave Hours','LeaveUtil_getLeaveHours','','','','','No','Yes','0.00',NULL,NULL);
|
||||
|
||||
|
||||
delete from DataImport where name = 'Sage50 Import - Employee Data';
|
||||
|
||||
INSERT INTO `DataImport` (`name`, `dataType`, `details`, `columns`, `updated`, `created`) VALUES
|
||||
('Employee Data Import', 'EmployeeDataImporter', '', '[{"name":"employee_id","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"Yes","id":"columns_7"},{"name":"first_name","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_3"},{"name":"middle_name","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_5"},{"name":"last_name","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_6"},{"name":"address1","title":"Address1","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_8"},{"name":"address2","title":"Address2","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_9"},{"name":"home_phone","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_14"},{"name":"mobile_phone","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_15"},{"name":"work_email","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_16"},{"name":"gender","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_17"},{"name":"marital_status","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_18"},{"name":"birthday","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_20"},{"name":"nationality","title":"Nationality","type":"Reference","dependOn":"Nationality","dependOnField":"name","isKeyField":"Yes","idField":"No","id":"columns_22"},{"name":"ethnicity","title":"Ethnicity","type":"Normal","dependOn":"Ethnicity","dependOnField":"name","isKeyField":"Yes","idField":"No","id":"columns_23"},{"name":"EmergencyContact/name","title":"","type":"Attached","dependOn":"EmergencyContact","dependOnField":"name","isKeyField":"Yes","idField":"No","id":"columns_24"},{"name":"EmergencyContact/relationship","title":"","type":"Attached","dependOn":"EmergencyContact","dependOnField":"relationship","isKeyField":"No","idField":"No","id":"columns_25"},{"name":"EmergencyContact/home_phone","title":"","type":"Attached","dependOn":"EmergencyContact","dependOnField":"home_phone","isKeyField":"No","idField":"No","id":"columns_26"},{"name":"ssn_num","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_31"},{"name":"job_title","title":"","type":"Reference","dependOn":"JobTitle","dependOnField":"name","isKeyField":"Yes","idField":"No","id":"columns_32"},{"name":"employment_status","title":"","type":"Reference","dependOn":"EmploymentStatus","dependOnField":"name","isKeyField":"Yes","idField":"No","id":"columns_33"},{"name":"joined_date","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_36"},{"name":"department","title":"","type":"Reference","dependOn":"CompanyStructure","dependOnField":"title","isKeyField":"Yes","idField":"No","id":"columns_38"}]', '2016-06-02 18:56:32', '2016-06-02 18:56:32'),
|
||||
('Attendance Data Import', 'AttendanceDataImporter', '', '[{"name":"employee","title":"","type":"Reference","dependOn":"Employee","dependOnField":"employee_id","isKeyField":"Yes","idField":"No","id":"columns_1"},{"name":"in_time","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_2"},{"name":"out_time","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_3"},{"name":"note","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_4"}]', '2016-08-14 02:51:56', '2016-08-14 02:51:56');
|
||||
|
||||
|
||||
|
||||
REPLACE INTO `UserReports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
|
||||
('Overtime Report', 'This report list all employee attendance entries by employee with overtime calculations', '[\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','CSV');
|
||||
|
||||
REPLACE INTO `UserReports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
|
||||
('Overtime Summary Report', 'This report list all employee attendance entries by employee with overtime calculation summary', '[\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'OvertimeSummaryReport', '["date_start","date_end"]', 'Class','Time Management','CSV');
|
||||
|
||||
REPLACE INTO `UserReports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
|
||||
('Client Project Time Report', 'View your time entries for projects under a given client',
|
||||
'[\r\n[ "client", {"label":"Select Client","type":"select","allow-null":false,"remote-source":["Client","id","name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]',
|
||||
'ClientProjectTimeReport', '["client","date_start","date_end","status"]', 'Class','Time Management','PDF');
|
||||
|
||||
REPLACE INTO `UserReports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
|
||||
('Download Payslips', 'Download your payslips',
|
||||
'[\r\n[ "payroll", {"label":"Select Payroll","type":"select","allow-null":false,"remote-source":["Payroll","id","name","getEmployeePayrolls"]}]]',
|
||||
'PayslipReport', '["payroll"]', 'Class','Finance','PDF');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
INSERT INTO `DeductionGroup` VALUES
|
||||
(1,'Sri Lanka Payroll Calculation','');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
INSERT INTO `PayslipTemplates` (`id`, `name`, `data`, `status`, `created`, `updated`) VALUES
|
||||
(1, 'Sri Lanka - Default Payslip', '[{"type":"Company Logo","payrollColumn":"NULL","label":"","text":"","fontSize":"Normal","fontStyle":"Normal","fontColor":"#000000","status":"Show","id":"data_1"},{"type":"Company Name","payrollColumn":"NULL","label":"","text":"","fontSize":"Normal","fontStyle":"Normal","fontColor":"","status":"Show","id":"data_2"},{"type":"Separators","payrollColumn":"NULL","label":"","text":"","fontSize":"Normal","fontStyle":"Normal","fontColor":"","status":"Show","id":"data_8"},{"type":"Payroll Column","payrollColumn":"5","label":"Basic Salary","text":"","status":"Show","id":"data_3"},{"type":"Payroll Column","payrollColumn":"6","label":"Fixed Allowance","text":"","status":"Show","id":"data_4"},{"type":"Payroll Column","payrollColumn":"7","label":"Gross Pay","text":"","status":"Show","id":"data_11"},{"type":"Separators","payrollColumn":"NULL","label":"","text":"","fontSize":"Normal","fontStyle":"Normal","fontColor":"","status":"Show","id":"data_9"},{"type":"Text","payrollColumn":"NULL","label":"","text":"Deductions","status":"Show","id":"data_13"},{"type":"Payroll Column","payrollColumn":"8","label":"EPF Employee Contribution","text":"","status":"Show","id":"data_6"},{"type":"Payroll Column","payrollColumn":"13","label":"PAYE Tax","text":"","status":"Show","id":"data_14"},{"type":"Payroll Column","payrollColumn":"14","label":"Stamp Duty","text":"","status":"Show","id":"data_15"},{"type":"Payroll Column","payrollColumn":"15","label":"Total Deductions","text":"","status":"Show","id":"data_16"},{"type":"Separators","payrollColumn":"NULL","label":"","text":"","status":"Show","id":"data_17"},{"type":"Text","payrollColumn":"NULL","label":"","text":"Employer Contributions","status":"Show","id":"data_18"},{"type":"Payroll Column","payrollColumn":"9","label":"EPF Employer Contribution","text":"","status":"Show","id":"data_19"},{"type":"Payroll Column","payrollColumn":"7","label":"ETF Employer Contribution","text":"","status":"Show","id":"data_20"},{"type":"Separators","payrollColumn":"7","label":"","text":"","status":"Show","id":"data_21"},{"type":"Text","payrollColumn":"7","label":"","text":"Totals","status":"Show","id":"data_22"},{"type":"Payroll Column","payrollColumn":"11","label":"Total EPF 20%","text":"","status":"Show","id":"data_23"},{"type":"Payroll Column","payrollColumn":"12","label":"Total for PAYE","text":"","status":"Show","id":"data_24"},{"type":"Payroll Column","payrollColumn":"16","label":"Net Salary","text":"","status":"Show","id":"data_25"}]', NULL, '2016-06-29 22:07:12', '2016-06-29 22:07:12');
|
||||
|
||||
INSERT INTO `Payroll` VALUES
|
||||
(1,'Sri Lanka Payroll Sample',4,1,NULL,'[\"5\",\"8\",\"9\",\"10\",\"6\",\"7\",\"11\",\"12\",\"13\",\"14\",\"15\",\"16\"]','2016-03-01','2016-03-31','Draft', 1);
|
||||
|
||||
INSERT INTO `PayrollColumns` VALUES
|
||||
(5,'LK - Basic Salary',NULL,'[\"1\"]','[]','[]','[]',5,'No','Yes','0.00',NULL,NULL),
|
||||
(6,'LK - Fixed Allowance',NULL,'[\"2\"]','[]','[]','[]',6,'No','Yes','0.00',NULL,NULL),
|
||||
(7,'LK - Gross Pay',NULL,'[]','[]','[\"5\",\"6\"]','[]',7,'No','Yes','0.00',NULL,NULL),
|
||||
(8,'LK - EPF Employee Contribution',NULL,'[]','[\"1\"]','[]','[]',8,'No','Yes','0.00',NULL,NULL),
|
||||
(9,'LK - EPF Employer Contribution',NULL,'[]','[\"2\"]','[]','[]',9,'No','Yes','0.00',NULL,NULL),
|
||||
(10,'LK - ETF Employer Contribution',NULL,'[]','[\"3\"]','[]','[]',10,'No','Yes','0.00',NULL,NULL),
|
||||
(11,'LK - Total EPF 20%',NULL,'[]','[]','[\"8\",\"9\"]','[]',11,'No','Yes','0.00',NULL,NULL),
|
||||
(12,'LK - Total for PAYE',NULL,'[]','[]','[\"7\"]','[]',12,'No','Yes','0.00',NULL,NULL),
|
||||
(13,'LK - PAYE Tax',NULL,'[]','[\"4\"]','[]','[]',13,'No','Yes','0.00',NULL,NULL),
|
||||
(14,'LK - Stamp Duty',NULL,'[]','[\"5\"]','[]','[]',14,'No','Yes','0.00',NULL,NULL),
|
||||
(15,'LK - Total Deductions',NULL,'[]','[]','[\"8\",\"13\",\"14\"]','[]',15,'No','Yes','0.00',NULL,NULL),
|
||||
(16,'LK - Salary to Bank',NULL,'[]','[]','[\"7\"]','[\"15\"]',16,'No','Yes','0.00',NULL,NULL);
|
||||
|
||||
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 Employer 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 `DeductionGroup` VALUES
|
||||
(2,'Ghana Payroll Calculation','');
|
||||
|
||||
INSERT INTO `PayslipTemplates` VALUES
|
||||
(2,'Ghana Default','[{\"type\":\"Company Name\",\"payrollColumn\":\"NULL\",\"label\":\"\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_1\"},{\"type\":\"Separators\",\"payrollColumn\":\"NULL\",\"label\":\"\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_3\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"105\",\"label\":\"\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_4\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"106\",\"label\":\"\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_5\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"107\",\"label\":\"\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_6\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"112\",\"label\":\"Total\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_7\"},{\"type\":\"Separators\",\"payrollColumn\":\"NULL\",\"label\":\"\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_8\"},{\"type\":\"Text\",\"payrollColumn\":\"NULL\",\"label\":\"\",\"text\":\"Deductions \",\"status\":\"Show\",\"id\":\"data_9\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"109\",\"label\":\"SSNIT (5.5%)\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_10\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"113\",\"label\":\"Tax (1st Level 5%)\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_11\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"114\",\"label\":\"Tax (2nd Level 10%)\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_12\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"115\",\"label\":\"Tax (3rd Level 17.5%)\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_13\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"120\",\"label\":\"Tax (4th Level 25%)\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_14\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"121\",\"label\":\"Overtime Allow. Tax (5%)\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_15\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"122\",\"label\":\"Total (PAYE Tax)\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_16\"},{\"type\":\"Separators\",\"payrollColumn\":\"NULL\",\"label\":\"\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_17\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"123\",\"label\":\"Sub Total\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_18\"},{\"type\":\"Separators\",\"payrollColumn\":\"NULL\",\"label\":\"\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_19\"},{\"type\":\"Payroll Column\",\"payrollColumn\":\"125\",\"label\":\"Netto Monthly Salary\",\"text\":\"\",\"status\":\"Show\",\"id\":\"data_20\"}]',NULL,'2016-08-30 21:53:13','2016-08-30 21:53:13');
|
||||
|
||||
|
||||
INSERT INTO `Payroll` VALUES
|
||||
(6,'Ghana Payroll Sample',4,1,NULL,'[\"123\",\"125\",\"106\",\"124\",\"113\",\"114\",\"115\",\"121\",\"107\",\"120\",\"109\",\"105\",\"112\",\"108\",\"122\"]','2016-08-01','2016-08-31','Draft',2);
|
||||
|
||||
|
||||
INSERT INTO `PayrollColumns` VALUES
|
||||
(105,'GH - Salary (Basic)',NULL,'[\"1\"]','[]','[]','[]',1,'No','Yes','0.00','',''),
|
||||
(106,'GH - Housing Allowance',NULL,'[]','[\"101\"]','[]','[]',2,'No','Yes','0.00','',''),
|
||||
(107,'GH - Overtime Allowance',NULL,'[]','[\"102\"]','[]','[]',3,'No','Yes','0.00','',''),
|
||||
(108,'GH - Total',NULL,'[]','[]','[\"106\",\"107\",\"105\"]','[]',4,'No','Yes','0.00','',''),
|
||||
(109,'GH - SSNIT',NULL,'[]','[\"103\"]','[]','[]',5,'No','Yes','0.00','',''),
|
||||
(112,'GH - Taxable Income',NULL,'[]','[]','[\"106\",\"105\"]','[\"109\"]',7,'No','Yes','0.00','',''),
|
||||
(113,'GH - Next 108 GHC',NULL,'[]','[\"106\"]','[]','[]',9,'No','Yes','0.00','',''),
|
||||
(114,'GH - Next 151 GHC',NULL,'[]','[\"107\"]','[]','[]',10,'No','Yes','0.00','',''),
|
||||
(115,'GH - Next 2765 GHC',NULL,'[]','[\"108\"]','[]','[]',11,'No','Yes','0.00','',''),
|
||||
(120,'GH - Remaining after 3240 GHC',NULL,'[]','[\"111\"]','[]','[]',12,'No','Yes','0.00','',''),
|
||||
(121,'GH - Overtime Allow. Tax',NULL,'[]','[]','[]','[]',13,'No','Yes','0.00','[{\"name\":\"O\",\"column\":\"107\",\"id\":\"calculation_columns_1\"}]','O*0.05'),
|
||||
(122,'GH - Total (PAYE Tax)',NULL,'[]','[]','[\"113\",\"114\",\"115\",\"120\",\"121\"]','[]',14,'No','Yes','0.00','',''),
|
||||
(123,'GH - Deductions - Sub Total',NULL,'[]','[]','[\"109\",\"122\"]','[]',15,'No','Yes','0.00','',''),
|
||||
(125,'GH - Final Total',NULL,'[]','[]','[\"108\"]','[\"123\"]',16,'No','Yes','0.00','','');
|
||||
|
||||
|
||||
INSERT INTO `Deductions` VALUES
|
||||
(101,'Housing Allowance (10%)','[]','[\"1\"]',NULL,'[{\"lowerCondition\":\"No Lower Limit\",\"lowerLimit\":0,\"upperCondition\":\"No Upper Limit\",\"upperLimit\":0,\"amount\":\"X*0.1\",\"id\":\"rangeAmounts_1\"}]',2),
|
||||
(102,'Overtime Allowance (10%)','[]','[\"1\"]',NULL,'[{\"lowerCondition\":\"No Lower Limit\",\"lowerLimit\":0,\"upperCondition\":\"No Upper Limit\",\"upperLimit\":0,\"amount\":\"X*0.1\",\"id\":\"rangeAmounts_1\"}]',2),
|
||||
(103,'SSNIT','[]','[\"1\"]',NULL,'[{\"lowerCondition\":\"No Lower Limit\",\"lowerLimit\":0,\"upperCondition\":\"No Upper Limit\",\"upperLimit\":0,\"amount\":\"X*0.055\",\"id\":\"rangeAmounts_1\"}]',2),
|
||||
(104,'Tax - Ghana','[]','[]',NULL,'',2),
|
||||
(106,'Next 108 GHC','[]','[]',112,'[{\"lowerCondition\":\"gte\",\"lowerLimit\":\"216\",\"upperCondition\":\"lt\",\"upperLimit\":\"324\",\"amount\":\"X*0.05\",\"id\":\"rangeAmounts_1\"},{\"lowerCondition\":\"gte\",\"lowerLimit\":\"324\",\"upperCondition\":\"No Upper Limit\",\"upperLimit\":0,\"amount\":\"5.4\",\"id\":\"rangeAmounts_2\"}]',2),
|
||||
(107,'Next 151 GHC','[]','[]',112,'[{\"lowerCondition\":\"gte\",\"lowerLimit\":\"324\",\"upperCondition\":\"lt\",\"upperLimit\":\"475\",\"amount\":\"(X-324) * 0.1\",\"id\":\"rangeAmounts_1\"},{\"lowerCondition\":\"gte\",\"lowerLimit\":\"259\",\"upperCondition\":\"No Upper Limit\",\"upperLimit\":0,\"amount\":\"15.10\",\"id\":\"rangeAmounts_2\"}]',2),
|
||||
(108,'Next 2765 GHC','[]','[]',112,'[{\"lowerCondition\":\"gte\",\"lowerLimit\":\"475\",\"upperCondition\":\"lt\",\"upperLimit\":\"3240\",\"amount\":\"(X - 475) * 0.175\",\"id\":\"rangeAmounts_1\"},{\"lowerCondition\":\"gte\",\"lowerLimit\":\"3240\",\"upperCondition\":\"No Upper Limit\",\"upperLimit\":0,\"amount\":\"483.88\",\"id\":\"rangeAmounts_2\"}]',2),
|
||||
(111,'Remaining after 3240 GHC','[]','[]',112,'[{\"lowerCondition\":\"gte\",\"lowerLimit\":\"3240\",\"upperCondition\":\"No Upper Limit\",\"upperLimit\":0,\"amount\":\"(X-3240)*0.25\",\"id\":\"rangeAmounts_1\"}]',2);
|
||||
|
||||
|
||||
|
||||
|
||||
ALTER table `Files` add column `size` bigint(20) NULL;
|
||||
|
||||
ALTER table `Files` add column `size_text` varchar(20) NULL;
|
||||
|
||||
ALTER table `CompanyDocuments` add column `share_departments` varchar(100) NULL;
|
||||
ALTER table `CompanyDocuments` add column `share_employees` varchar(100) NULL;
|
||||
ALTER table `CompanyDocuments` add column `share_userlevel` varchar(100) NULL;
|
||||
ALTER table `CompanyDocuments` modify column `share_userlevel` varchar(100) NULL;
|
||||
|
||||
ALTER table `Notifications` add column `employee` bigint(20) NULL;
|
||||
|
||||
create table `Forms` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(50) NOT NULL,
|
||||
`description` varchar(500) NULL,
|
||||
`items` text 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 `EmployeeForms` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`employee` bigint(20) NOT NULL,
|
||||
`form` bigint(20) NOT NULL,
|
||||
`status` enum('Pending','Completed') default 'Pending',
|
||||
`created` timestamp NULL default '0000-00-00 00:00:00',
|
||||
`updated` timestamp NULL default '0000-00-00 00:00:00',
|
||||
CONSTRAINT `Fk_EmployeeForms_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT `Fk_EmployeeForms_Forms` FOREIGN KEY (`form`) REFERENCES `Forms` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
primary key (`id`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
create table `Migrations` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`file` varchar(50) NOT NULL,
|
||||
`version` int(11) NOT NULL,
|
||||
`created` DATETIME default '0000-00-00 00:00:00',
|
||||
`updated` DATETIME default '0000-00-00 00:00:00',
|
||||
`status` enum('Pending','Up','Down','UpError','DownError') default 'Pending',
|
||||
`last_error` varchar(500) NULL,
|
||||
primary key (`id`),
|
||||
unique key `KEY_Migrations_file` (`file`),
|
||||
index `KEY_Migrations_status` (`status`),
|
||||
index `KEY_Migrations_version` (`version`)
|
||||
) engine=innodb default charset=utf8;
|
||||
|
||||
18
deployment/clients/dev/config.php
Normal file
18
deployment/clients/dev/config.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
ini_set('error_log', 'data/icehrm.log');
|
||||
|
||||
define('CLIENT_NAME', 'icehrmpro');
|
||||
define('APP_BASE_PATH', '/vagrant/build/app/');
|
||||
define('CLIENT_BASE_PATH', '/vagrant/deployment/clients/dev/');
|
||||
define('BASE_URL','http://app.app.dev/');
|
||||
define('CLIENT_BASE_URL','http://clients.app.dev/dev/');
|
||||
|
||||
define('APP_DB', 'dev');
|
||||
define('APP_USERNAME', 'dev');
|
||||
define('APP_PASSWORD', 'dev');
|
||||
define('APP_HOST', 'localhost');
|
||||
define('APP_CON_STR', 'mysqli://'.APP_USERNAME.':'.APP_PASSWORD.'@'.APP_HOST.'/'.APP_DB);
|
||||
|
||||
//file upload
|
||||
define('FILE_TYPES', 'jpg,png,jpeg');
|
||||
define('MAX_FILE_SIZE_KB', 10 * 1024);
|
||||
7
deployment/clients/dev/cron.php
Normal file
7
deployment/clients/dev/cron.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
if(php_sapi_name() != 'cli'){
|
||||
exit();
|
||||
}
|
||||
|
||||
include ('config.php');
|
||||
include (APP_BASE_PATH.'crons/cron.php');
|
||||
3
deployment/clients/dev/data.php
Normal file
3
deployment/clients/dev/data.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
include ('config.php');
|
||||
include (APP_BASE_PATH.'data.php');
|
||||
1
deployment/clients/dev/data/sample
Executable file
1
deployment/clients/dev/data/sample
Executable file
@@ -0,0 +1 @@
|
||||
Test File
|
||||
18
deployment/clients/dev/entry.php
Normal file
18
deployment/clients/dev/entry.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
include ('config.php');
|
||||
if(!isset($_REQUEST['g']) || !isset($_REQUEST['n'])){
|
||||
header("Location:".CLIENT_BASE_URL."login.php");
|
||||
exit();
|
||||
}
|
||||
$group = $_REQUEST['g'];
|
||||
$name= $_REQUEST['n'];
|
||||
|
||||
$groups = array('admin','modules');
|
||||
|
||||
if($group == 'admin' || $group == 'modules'){
|
||||
$name = str_replace("..","",$name);
|
||||
$name = str_replace("/","",$name);
|
||||
include APP_BASE_PATH.'/'.$group.'/'.$name.'/entry.php';
|
||||
}else{
|
||||
exit();
|
||||
}
|
||||
3
deployment/clients/dev/fileupload.php
Normal file
3
deployment/clients/dev/fileupload.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
include ('config.php');
|
||||
include (APP_BASE_PATH.'fileupload.php');
|
||||
3
deployment/clients/dev/fileupload_page.php
Normal file
3
deployment/clients/dev/fileupload_page.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
include ('config.php');
|
||||
include (APP_BASE_PATH.'fileupload_page.php');
|
||||
3
deployment/clients/dev/header.php
Normal file
3
deployment/clients/dev/header.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
include (APP_BASE_PATH.'header.php');
|
||||
22
deployment/clients/dev/index.php
Normal file
22
deployment/clients/dev/index.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
if(!file_exists('config.php')){
|
||||
header("Location:install/");
|
||||
exit();
|
||||
}
|
||||
include ('config.php');
|
||||
if(!isset($_REQUEST['g']) || !isset($_REQUEST['n'])){
|
||||
header("Location:".CLIENT_BASE_URL."login.php");
|
||||
exit();
|
||||
}
|
||||
$group = $_REQUEST['g'];
|
||||
$name= $_REQUEST['n'];
|
||||
|
||||
$groups = array('admin','modules');
|
||||
|
||||
if($group == 'admin' || $group == 'modules'){
|
||||
$name = str_replace("..","",$name);
|
||||
$name = str_replace("/","",$name);
|
||||
include APP_BASE_PATH.'/'.$group.'/'.$name.'/index.php';
|
||||
}else{
|
||||
exit();
|
||||
}
|
||||
3
deployment/clients/dev/login.php
Normal file
3
deployment/clients/dev/login.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
include ('config.php');
|
||||
include (APP_BASE_PATH.'login.php');
|
||||
3
deployment/clients/dev/logout.php
Normal file
3
deployment/clients/dev/logout.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
include ('config.php');
|
||||
include (APP_BASE_PATH.'logout.php');
|
||||
3
deployment/clients/dev/rest.php
Normal file
3
deployment/clients/dev/rest.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
include ('config.php');
|
||||
include (APP_BASE_PATH.'rest.php');
|
||||
3
deployment/clients/dev/service.php
Normal file
3
deployment/clients/dev/service.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
include ('config.php');
|
||||
include (APP_BASE_PATH.'service.php');
|
||||
18
deployment/clients/dev/update.php
Normal file
18
deployment/clients/dev/update.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
include ('config.php');
|
||||
if(!isset($_REQUEST['g']) || !isset($_REQUEST['n'])){
|
||||
header("Location:".CLIENT_BASE_URL."login.php");
|
||||
exit();
|
||||
}
|
||||
$group = $_REQUEST['g'];
|
||||
$name= $_REQUEST['n'];
|
||||
|
||||
$groups = array('admin','modules');
|
||||
|
||||
if($group == 'admin' || $group == 'modules'){
|
||||
$name = str_replace("..","",$name);
|
||||
$name = str_replace("/","",$name);
|
||||
include APP_BASE_PATH.'/'.$group.'/'.$name.'/update.php';
|
||||
}else{
|
||||
exit();
|
||||
}
|
||||
18
deployment/clients/test/config.php
Normal file
18
deployment/clients/test/config.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
ini_set('error_log', 'data/icehrm.log');
|
||||
|
||||
define('CLIENT_NAME', 'icehrmpro');
|
||||
define('APP_BASE_PATH', '/vagrant/build/app/');
|
||||
define('CLIENT_BASE_PATH', '/vagrant/deployment/clients/test/');
|
||||
define('BASE_URL','http://app.app.dev/');
|
||||
define('CLIENT_BASE_URL','http://clients.app.dev/test/');
|
||||
|
||||
define('APP_DB', 'testing');
|
||||
define('APP_USERNAME', 'testing');
|
||||
define('APP_PASSWORD', 'testing');
|
||||
define('APP_HOST', 'localhost');
|
||||
define('APP_CON_STR', 'mysqli://'.APP_USERNAME.':'.APP_PASSWORD.'@'.APP_HOST.'/'.APP_DB);
|
||||
|
||||
//file upload
|
||||
define('FILE_TYPES', 'jpg,png,jpeg');
|
||||
define('MAX_FILE_SIZE_KB', 10 * 1024);
|
||||
7
deployment/clients/test/cron.php
Normal file
7
deployment/clients/test/cron.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
if(php_sapi_name() != 'cli'){
|
||||
exit();
|
||||
}
|
||||
|
||||
include ('config.php');
|
||||
include (APP_BASE_PATH.'crons/cron.php');
|
||||
3
deployment/clients/test/data.php
Normal file
3
deployment/clients/test/data.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
include ('config.php');
|
||||
include (APP_BASE_PATH.'data.php');
|
||||
1
deployment/clients/test/data/sample
Executable file
1
deployment/clients/test/data/sample
Executable file
@@ -0,0 +1 @@
|
||||
Test File
|
||||
18
deployment/clients/test/entry.php
Normal file
18
deployment/clients/test/entry.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
include ('config.php');
|
||||
if(!isset($_REQUEST['g']) || !isset($_REQUEST['n'])){
|
||||
header("Location:".CLIENT_BASE_URL."login.php");
|
||||
exit();
|
||||
}
|
||||
$group = $_REQUEST['g'];
|
||||
$name= $_REQUEST['n'];
|
||||
|
||||
$groups = array('admin','modules');
|
||||
|
||||
if($group == 'admin' || $group == 'modules'){
|
||||
$name = str_replace("..","",$name);
|
||||
$name = str_replace("/","",$name);
|
||||
include APP_BASE_PATH.'/'.$group.'/'.$name.'/entry.php';
|
||||
}else{
|
||||
exit();
|
||||
}
|
||||
3
deployment/clients/test/fileupload.php
Normal file
3
deployment/clients/test/fileupload.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
include ('config.php');
|
||||
include (APP_BASE_PATH.'fileupload.php');
|
||||
3
deployment/clients/test/fileupload_page.php
Normal file
3
deployment/clients/test/fileupload_page.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
include ('config.php');
|
||||
include (APP_BASE_PATH.'fileupload_page.php');
|
||||
3
deployment/clients/test/header.php
Normal file
3
deployment/clients/test/header.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
include (APP_BASE_PATH.'header.php');
|
||||
22
deployment/clients/test/index.php
Normal file
22
deployment/clients/test/index.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
if(!file_exists('config.php')){
|
||||
header("Location:install/");
|
||||
exit();
|
||||
}
|
||||
include ('config.php');
|
||||
if(!isset($_REQUEST['g']) || !isset($_REQUEST['n'])){
|
||||
header("Location:".CLIENT_BASE_URL."login.php");
|
||||
exit();
|
||||
}
|
||||
$group = $_REQUEST['g'];
|
||||
$name= $_REQUEST['n'];
|
||||
|
||||
$groups = array('admin','modules');
|
||||
|
||||
if($group == 'admin' || $group == 'modules'){
|
||||
$name = str_replace("..","",$name);
|
||||
$name = str_replace("/","",$name);
|
||||
include APP_BASE_PATH.'/'.$group.'/'.$name.'/index.php';
|
||||
}else{
|
||||
exit();
|
||||
}
|
||||
3
deployment/clients/test/login.php
Normal file
3
deployment/clients/test/login.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
include ('config.php');
|
||||
include (APP_BASE_PATH.'login.php');
|
||||
3
deployment/clients/test/logout.php
Normal file
3
deployment/clients/test/logout.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
include ('config.php');
|
||||
include (APP_BASE_PATH.'logout.php');
|
||||
3
deployment/clients/test/rest.php
Normal file
3
deployment/clients/test/rest.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
include ('config.php');
|
||||
include (APP_BASE_PATH.'rest.php');
|
||||
3
deployment/clients/test/service.php
Normal file
3
deployment/clients/test/service.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
include ('config.php');
|
||||
include (APP_BASE_PATH.'service.php');
|
||||
18
deployment/clients/test/update.php
Normal file
18
deployment/clients/test/update.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
include ('config.php');
|
||||
if(!isset($_REQUEST['g']) || !isset($_REQUEST['n'])){
|
||||
header("Location:".CLIENT_BASE_URL."login.php");
|
||||
exit();
|
||||
}
|
||||
$group = $_REQUEST['g'];
|
||||
$name= $_REQUEST['n'];
|
||||
|
||||
$groups = array('admin','modules');
|
||||
|
||||
if($group == 'admin' || $group == 'modules'){
|
||||
$name = str_replace("..","",$name);
|
||||
$name = str_replace("/","",$name);
|
||||
include APP_BASE_PATH.'/'.$group.'/'.$name.'/update.php';
|
||||
}else{
|
||||
exit();
|
||||
}
|
||||
2
docker/docker.md
Normal file
2
docker/docker.md
Normal file
@@ -0,0 +1,2 @@
|
||||
https://hub.docker.com/r/thilinah/icehrm/
|
||||
docker run -i -t -p 192.168.99.100:80:80 thilinah/icehrm /bin/start.sh
|
||||
30
docker/start.sh
Normal file
30
docker/start.sh
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
service nginx start
|
||||
service php5-fpm start
|
||||
service mysql start
|
||||
|
||||
if [ -d "/usr/share/nginx/www/" ]; then
|
||||
echo 'Already Installed'
|
||||
else
|
||||
echo 'Installing IceHrm'
|
||||
cd /usr/share/nginx
|
||||
curl -s https://api.github.com/repos/gamonoid/icehrm/releases/latest | jq -r ".assets[] | select(.name) | .browser_download_url" | grep '.zip' | xargs wget
|
||||
ls | grep 'zip' | xargs unzip
|
||||
mv `ls -d */ | grep icehrm | head -1` www/
|
||||
rm *.zip
|
||||
|
||||
echo 'Your MySQL root password : icehrmpwd'
|
||||
|
||||
echo "Following will be needed during installation"
|
||||
echo "--------------------------------------------"
|
||||
echo 'IceHrm Database : icehrmdb'
|
||||
echo 'IceHrm User : icehrmuser'
|
||||
echo 'IceHrm User Password : icehrmuserpwd'
|
||||
echo 'IceHrm Database host : localhost'
|
||||
|
||||
echo 'Please visit your docker installation url to begin installation.'
|
||||
|
||||
fi
|
||||
|
||||
|
||||
/bin/bash
|
||||
@@ -41,7 +41,7 @@ class AttendanceActionManager extends SubActionManager{
|
||||
|
||||
//check if dates are differnet
|
||||
if(!empty($outDate) && $inDate != $outDate){
|
||||
return new IceResponse(IceResponse::ERROR,"Attendance entry should be within a single day");
|
||||
return new IceResponse(IceResponse::ERROR,LanguageManager::tran("Attendance entry should be within a single day"));
|
||||
}
|
||||
|
||||
//compare dates
|
||||
|
||||
@@ -38,6 +38,8 @@ if (!class_exists('AttendanceAdminManager')) {
|
||||
$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');
|
||||
$this->addCalculationHook('AttendanceUtil_getWeeklyRegularWorkedHours','Total Weekly Regular Hours from Attendance','AttendanceUtil','getWeeklyBasedRegularHours');
|
||||
$this->addCalculationHook('AttendanceUtil_getWeeklyOverTimeWorkedHours','Total Weekly Overtime Hours from Attendance','AttendanceUtil','getWeeklyBasedOvertimeHours');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -249,6 +251,80 @@ if (!class_exists('AttendanceUtil')) {
|
||||
$atSum = $this->getAttendanceSummary($employeeId, $startDate, $endDate);
|
||||
return round(($atSum['o']/60)/60,2);
|
||||
}
|
||||
|
||||
public function getWeeklyBasedRegularHours($employeeId, $startDate, $endDate){
|
||||
$atSum = $this->getWeeklyBasedOvertimeSummary($employeeId, $startDate, $endDate);
|
||||
return round(($atSum['r']/60)/60,2);
|
||||
}
|
||||
|
||||
public function getWeeklyBasedOvertimeHours($employeeId, $startDate, $endDate){
|
||||
$atSum = $this->getWeeklyBasedOvertimeSummary($employeeId, $startDate, $endDate);
|
||||
return round(($atSum['o']/60)/60,2);
|
||||
}
|
||||
|
||||
public function getWeeklyBasedOvertimeSummary($employeeId, $startDate, $endDate){
|
||||
|
||||
$attendance = new Attendance();
|
||||
$atTimeByWeek = array();
|
||||
|
||||
//Find weeks starting from sunday and ending from saturday in day period
|
||||
|
||||
$weeks = $this->getWeeklyDays($startDate,$endDate);
|
||||
foreach($weeks as $k=>$week){
|
||||
$startTime = $week[0]." 00:00:00";
|
||||
$endTime = $week[count($week) - 1]." 23:59:59";
|
||||
$atts = $attendance->Find("employee = ? and in_time >= ? and out_time <= ?",array($employeeId, $startTime, $endTime));
|
||||
foreach($atts as $atEntry){
|
||||
if($atEntry->out_time == "0000-00-00 00:00:00" || empty($atEntry->out_time)){
|
||||
continue;
|
||||
}
|
||||
if(!isset($atTimeByWeek[$k])){
|
||||
$atTimeByWeek[$k] = 0;
|
||||
}
|
||||
|
||||
$diff = strtotime($atEntry->out_time) - strtotime($atEntry->in_time);
|
||||
if($diff < 0){
|
||||
$diff = 0;
|
||||
}
|
||||
|
||||
$atTimeByWeek[$k] += $diff;
|
||||
}
|
||||
}
|
||||
|
||||
$overtimeStarts = SettingsManager::getInstance()->getSetting('Attendance: Overtime Start Hour');
|
||||
$overtimeStarts = (is_numeric($overtimeStarts))?floatval($overtimeStarts)*60*60*5:0;
|
||||
$regTime = 0;
|
||||
$overTime = 0;
|
||||
foreach($atTimeByWeek as $value){
|
||||
if($value > $overtimeStarts){
|
||||
$regTime += $overtimeStarts;
|
||||
$overTime = $value - $overtimeStarts;
|
||||
}else{
|
||||
$regTime += $value;
|
||||
}
|
||||
}
|
||||
|
||||
return array('r'=>$regTime,'o'=>$overTime);
|
||||
|
||||
}
|
||||
|
||||
private function getWeeklyDays($startDate,$endDate){
|
||||
$start = new DateTime($startDate);
|
||||
$end = new DateTime($endDate.' 23:59');
|
||||
$interval = new DateInterval('P1D');
|
||||
$dateRange = new DatePeriod($start, $interval, $end);
|
||||
|
||||
$weekNumber = 1;
|
||||
$weeks = array();
|
||||
foreach ($dateRange as $date) {
|
||||
$weeks[$weekNumber][] = $date->format('Y-m-d');
|
||||
if ($date->format('w') == 6) {
|
||||
$weekNumber++;
|
||||
}
|
||||
}
|
||||
|
||||
return $weeks;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
<div class="small-box bg-yellow">
|
||||
<div class="inner">
|
||||
<h3>
|
||||
Attendance
|
||||
<t>Attendance</t>
|
||||
</h3>
|
||||
<p id="numberOfAttendanceLastWeek">
|
||||
#_numberOfAttendanceLastWeek_# Entries Last Week
|
||||
#_numberOfAttendanceLastWeek_# <t>Entries Last Week</t>
|
||||
</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>
|
||||
<t>Monitor Attendance</t> <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -28,11 +28,8 @@ 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="tabAttendance" href="#tabPageAttendance">Monitor Attendance</a></li>
|
||||
<li class=""><a id="tabAttendanceStatus" href="#tabPageAttendanceStatus">Current Clocked In Status</a></li>
|
||||
<!--
|
||||
<li class=""><a id="tabAttendanceData" href="#tabPageAttendanceData">Attendance Data Update</a></li>
|
||||
-->
|
||||
<li class="active"><a id="tabAttendance" href="#tabPageAttendance"><?=LanguageManager::tran('Monitor Attendance')?></a></li>
|
||||
<li class=""><a id="tabAttendanceStatus" href="#tabPageAttendanceStatus"><?=LanguageManager::tran('Current Clocked In Status')?></a></li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
@@ -52,20 +49,6 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!--
|
||||
<div class="tab-pane" id="tabPageAttendanceData">
|
||||
<div class="control-group" id="field__id_">
|
||||
<div class="controls">
|
||||
<textarea class="input-xxlarge" placeholder="Insert CSV data to submit" type="textarea" width="96%" rows="100" id="attendanceData" name="attendanceData"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<button onclick="return false;" class="btn">Update Attendance Data</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -87,6 +87,20 @@ if (!class_exists('CompanyStructure')) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function isHeadOfCompanyStructure($companyStructureId, $profileId){
|
||||
$companyStructure = new CompanyStructure();
|
||||
$companyStructure->Load("id = ?",array($companyStructureId));
|
||||
|
||||
if(isset($companyStructure->heads) && !empty($companyStructure->heads)){
|
||||
$heads = json_decode($companyStructure->heads);
|
||||
if(is_array($heads) && !empty($heads) && in_array($profileId, $heads)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,4 +122,4 @@ if (!class_exists('Timezone')) {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
|
||||
<div class="small-box bg-green">
|
||||
<div class="inner">
|
||||
<h3>Company</h3>
|
||||
<h3><t>Company</t></h3>
|
||||
<p id="numberOfCompanyStuctures">
|
||||
#_numberOfCompanyStuctures_# Departments
|
||||
#_numberOfCompanyStuctures_# <t>Departments</t>
|
||||
</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>
|
||||
<t>Manage</t> <t>Company</t> <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -54,8 +54,8 @@ path.link {
|
||||
<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="tabCompanyStructure" href="#tabPageCompanyStructure">Company Structure</a></li>
|
||||
<li><a id="tabCompanyGraph" href="#tabPageCompanyGraph">Company Graph</a></li>
|
||||
<li class="active"><a id="tabCompanyStructure" href="#tabPageCompanyStructure"><?=LanguageManager::tran('Company Structure')?></a></li>
|
||||
<li><a id="tabCompanyGraph" href="#tabPageCompanyGraph"><?=LanguageManager::tran('Company Graph')?></a></li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
|
||||
@@ -43,7 +43,8 @@ CompanyStructureAdapter.method('getFormFields', function() {
|
||||
[ "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":"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"]}]
|
||||
[ "parent", {"label":"Parent Structure","type":"select","allow-null":true,"remote-source":["CompanyStructure","id","title"]}],
|
||||
[ "heads", {"label":"Heads","type":"select2multi","allow-null":true,"remote-source":["Employee","id","first_name+last_name"]}]
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
@@ -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,74 +25,68 @@ $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">
|
||||
<?php
|
||||
$moduleManagers = BaseService::getInstance()->getModuleManagers();
|
||||
$dashBoardList = array();
|
||||
foreach($moduleManagers as $moduleManagerObj){
|
||||
<div class="row">
|
||||
<?php
|
||||
$moduleManagers = BaseService::getInstance()->getModuleManagers();
|
||||
$dashBoardList = array();
|
||||
foreach($moduleManagers as $moduleManagerObj){
|
||||
|
||||
//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;
|
||||
}
|
||||
//Check if this is not an admin module
|
||||
if($moduleManagerObj->getModuleType() != 'admin'){
|
||||
continue;
|
||||
}
|
||||
|
||||
ksort($dashBoardList);
|
||||
$allowed = BaseService::getInstance()->isModuleAllowedForUser($moduleManagerObj);
|
||||
|
||||
foreach($dashBoardList as $k=>$v){
|
||||
echo $v;
|
||||
if(!$allowed){
|
||||
continue;
|
||||
}
|
||||
?>
|
||||
</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>
|
||||
<p>
|
||||
IceHrm Pro is the feature rich upgrade to IceHrm open source version. It comes with improved modules for
|
||||
employee management, leave management and number of other features over open source version.
|
||||
Hit this <a href="http://icehrm.com/#compare" class="btn btn-primary btn-xs target="_blank">link</a> to do a full one to one comparison.
|
||||
|
||||
Also you can learn more about IceHrm Pro <a href="http://blog.icehrm.com/docs/icehrm-pro/" class="btn btn-primary btn-xs" target="_blank">here</a>
|
||||
<br/>
|
||||
<br/>
|
||||
<a href="http://icehrm.com/modules.php" class="btn btn-success btm-xs" target="_blank"><i class="fa fa-checkout"></i> Buy IceHrm Pro</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
$item = $moduleManagerObj->getDashboardItem();
|
||||
if(!empty($item)) {
|
||||
$index = $moduleManagerObj->getDashboardItemIndex();
|
||||
$dashBoardList[$index] = $item;
|
||||
}
|
||||
}
|
||||
|
||||
ksort($dashBoardList);
|
||||
|
||||
foreach($dashBoardList as $k=>$v){
|
||||
echo LanguageManager::translateTnrText($v);
|
||||
}
|
||||
?>
|
||||
</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'];
|
||||
|
||||
$(document).ready(function() {
|
||||
try {
|
||||
$.ajax({
|
||||
url: "https://icehrm-public.s3.amazonaws.com/icehrmnews.html",
|
||||
success: function (result) {
|
||||
$('#iceannon').html(result);
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
}
|
||||
/*
|
||||
$("#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'));
|
||||
$("#jobsLink").attr("href",modJs.getCustomUrl('?g=admin&n=jobpositions&m=admin_Recruitment'));
|
||||
$("#candidatesLink").attr("href",modJs.getCustomUrl('?g=admin&n=candidates&m=admin_Recruitment'));
|
||||
$("#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'));
|
||||
$("#permissionLink").attr("href",modJs.getCustomUrl('?g=admin&n=permissions&m=admin_System'));
|
||||
$("#upgradeLink").attr("href",modJs.getCustomUrl('?g=admin&n=billing&m=admin_System'));
|
||||
|
||||
modJs.getInitData();
|
||||
*/
|
||||
|
||||
});
|
||||
</script>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
@@ -35,7 +35,7 @@ class EmployeesActionManager extends SubActionManager{
|
||||
|
||||
$ok = $employee->Save();
|
||||
if(!$ok){
|
||||
return new IceResponse(IceResponse::ERROR, "Error occured while activating employee");
|
||||
return new IceResponse(IceResponse::ERROR, "Error occurred while activating employee");
|
||||
}
|
||||
|
||||
return new IceResponse(IceResponse::SUCCESS, $employee);
|
||||
@@ -102,12 +102,13 @@ class EmployeesActionManager extends SubActionManager{
|
||||
|
||||
$ok = $archived->Save();
|
||||
if(!$ok){
|
||||
return new IceResponse(IceResponse::ERROR, "Error occured while archiving employee");
|
||||
return new IceResponse(IceResponse::ERROR, "Error occurred while archiving employee");
|
||||
}
|
||||
|
||||
|
||||
$ok = $employee->Delete();
|
||||
if(!$ok){
|
||||
return new IceResponse(IceResponse::ERROR, "Error occured while deleting employee");
|
||||
return new IceResponse(IceResponse::ERROR, "Error occurred while deleting employee");
|
||||
}
|
||||
|
||||
return new IceResponse(IceResponse::SUCCESS, $archived);
|
||||
@@ -161,4 +162,4 @@ class EmployeesActionManager extends SubActionManager{
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,10 +16,6 @@ if (!class_exists('EmployeesAdminManager')) {
|
||||
$empRestEndPoint->process('get',$pathParams);
|
||||
});
|
||||
|
||||
\NoahBuscher\Macaw\Macaw::get(REST_API_PATH.'employees', function() {
|
||||
$empRestEndPoint = new EmployeesRestEndPoint();
|
||||
$empRestEndPoint->process('get',NULL);
|
||||
});
|
||||
}
|
||||
|
||||
public function initializeDatabaseErrorMappings(){
|
||||
@@ -30,6 +26,7 @@ if (!class_exists('EmployeesAdminManager')) {
|
||||
public function setupModuleClassDefinitions(){
|
||||
$this->addModelClass('Employee');
|
||||
$this->addModelClass('EmploymentStatus');
|
||||
$this->addModelClass('EmployeeApproval');
|
||||
}
|
||||
|
||||
public function getDashboardItemData(){
|
||||
@@ -230,11 +227,11 @@ if (!class_exists('Employee')) {
|
||||
}
|
||||
|
||||
public static function cleanEmployeeData($obj){
|
||||
unset($obj->keysToIgnore);
|
||||
unset($obj->historyFieldsToTrack);
|
||||
unset($obj->historyUpdateList);
|
||||
unset($obj->oldObjOrig);
|
||||
unset($obj->oldObj);
|
||||
unset($obj->oldObj);
|
||||
return $obj;
|
||||
}
|
||||
|
||||
@@ -288,52 +285,62 @@ if (!class_exists('EmploymentStatus')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!class_exists('EmployeeApproval')) {
|
||||
class EmployeeApproval extends ICEHRM_Record {
|
||||
|
||||
var $_table = 'EmployeeApprovals';
|
||||
|
||||
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;
|
||||
if($parameter === 'list'){
|
||||
$emp = new Employee();
|
||||
$emps = $emp->Find("1=1");
|
||||
$newEmps = array();
|
||||
foreach($emps as $emp){
|
||||
$employee = new stdClass();
|
||||
$employee->id = $emp->id;
|
||||
$employee->employee_id = $emp->employee_id;
|
||||
$employee->first_name = $emp->first_name;
|
||||
$employee->middle_name = $emp->middle_name;
|
||||
$employee->last_name = $emp->last_name;
|
||||
$newEmps[] = $employee;
|
||||
|
||||
}
|
||||
return new IceResponse(IceResponse::SUCCESS, $newEmps);
|
||||
}else{
|
||||
$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"]}';
|
||||
$emp = BaseService::getInstance()->getElement('Employee',$parameter,$mapping,true);
|
||||
if(!empty($emp)){
|
||||
$emp = Employee::cleanEmployeeData($emp);
|
||||
return new IceResponse(IceResponse::SUCCESS,$emp);
|
||||
}
|
||||
return new IceResponse(IceResponse::ERROR, "Employee not found" ,404);
|
||||
}
|
||||
|
||||
$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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,30 +4,30 @@
|
||||
<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-xs-12 col-md-10">
|
||||
<div class="row-fluid">
|
||||
<div class="col-md-12"><h2 id="name"></h2></div>
|
||||
</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>
|
||||
<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;">
|
||||
<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>
|
||||
|
||||
<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>
|
||||
@@ -40,24 +40,24 @@
|
||||
<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>
|
||||
</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="tabFamily" href="#tabPageFamily">Family</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="tab-pane sub-tab active" id="tabPageBasic">
|
||||
<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="panel-body" id="cont_personal_information">
|
||||
<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>
|
||||
@@ -74,10 +74,7 @@
|
||||
<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>
|
||||
@@ -90,16 +87,14 @@
|
||||
<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>
|
||||
|
||||
|
||||
<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="panel-heading"><h4>Contact Information</h4></div>
|
||||
<div class="panel-body" id="cont_contact_information">
|
||||
<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>
|
||||
@@ -116,9 +111,6 @@
|
||||
<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>
|
||||
@@ -135,16 +127,14 @@
|
||||
<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>
|
||||
|
||||
|
||||
<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="panel-heading"><h4>Job Details</h4></div>
|
||||
<div class="panel-body" id="cont_job_details">
|
||||
<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>
|
||||
@@ -161,82 +151,97 @@
|
||||
<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>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="customFieldsCont">
|
||||
|
||||
</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 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 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="tab-pane sub-tab" id="tabPageQualifications">
|
||||
<div class="row" style="margin-top:20px;">
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-3 sub-column">
|
||||
<div id="EmployeeSkillSubTab" class="" data-content="List" style="padding-left:5px;">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-3 sub-column">
|
||||
<div id="EmployeeEducationSubTab" class="" data-content="List" style="padding-left:5px;">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-3 sub-column">
|
||||
<div id="EmployeeCertificationSubTab" class="" data-content="List" style="padding-left:5px;">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-3 sub-column">
|
||||
<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="tab-pane sub-tab" id="tabPageFamily">
|
||||
<div class="row" style="margin-top:20px;">
|
||||
<div class="col-md-6 sub-column">
|
||||
<div id="EmployeeEmergencyContactSubTab" class="" data-content="List" style="padding-left:5px;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 sub-column">
|
||||
<div id="EmployeeDependentSubTab" class="" data-content="List" style="padding-left:5px;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane sub-tab" id="tabPageDocuments">
|
||||
<div class="row" style="margin-top:20px;">
|
||||
<div class="col-md-12">
|
||||
<div id="EmployeeDocumentSubTab" class="" data-content="List" style="padding-left:5px;">
|
||||
|
||||
@@ -3,17 +3,17 @@
|
||||
<div class="small-box bg-aqua">
|
||||
<div class="inner">
|
||||
<h3>
|
||||
People
|
||||
<t>People</t>
|
||||
</h3>
|
||||
<p id="numberOfEmployees">
|
||||
#_numberOfEmployees_# Employees
|
||||
#_numberOfEmployees_# <t>Employees</t>
|
||||
</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>
|
||||
<t>Manage</t> <t>Employees</t> <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -11,30 +11,30 @@ $customFields = BaseService::getInstance()->getCustomFields("Employee");
|
||||
<ul class="nav nav-tabs" id="modTab" style="margin-bottom:0px;margin-left:5px;border-bottom: none;">
|
||||
<?php if($user->user_level != "Admin"){
|
||||
?>
|
||||
<li class="active"><a id="tabEmployee" href="#tabPageEmployee">Employees (Direct Reports)</a></li>
|
||||
<li class="active"><a id="tabEmployee" href="#tabPageEmployee"><?=LanguageManager::tran('Employees (Direct Reports)')?></a></li>
|
||||
<?php }else{ ?>
|
||||
<li class="active"><a id="tabEmployee" href="#tabPageEmployee">Employees</a></li>
|
||||
<li class="active"><a id="tabEmployee" href="#tabPageEmployee"><?=LanguageManager::tran('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>
|
||||
<li><a id="tabEmployeeSkill" href="#tabPageEmployeeSkill"><?=LanguageManager::tran('Skills')?></a></li>
|
||||
<li><a id="tabEmployeeEducation" href="#tabPageEmployeeEducation"><?=LanguageManager::tran('Education')?></a></li>
|
||||
<li><a id="tabEmployeeCertification" href="#tabPageEmployeeCertification"><?=LanguageManager::tran('Certifications')?></a></li>
|
||||
<li><a id="tabEmployeeLanguage" href="#tabPageEmployeeLanguage"><?=LanguageManager::tran('Languages')?></a></li>
|
||||
<li><a id="tabEmployeeDependent" href="#tabPageEmployeeDependent"><?=LanguageManager::tran('Dependents')?></a></li>
|
||||
<li><a id="tabEmergencyContact" href="#tabPageEmergencyContact"><?=LanguageManager::tran('Emergency Contacts')?></a></li>
|
||||
<?php if (class_exists('DocumentsAdminManager')) {?>
|
||||
<li><a id="tabEmployeeDocument" href="#tabPageEmployeeDocument"><?=LanguageManager::tran('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>
|
||||
<a href="#" id="terminatedEmployeeMenu" class="dropdown-toggle" data-toggle="dropdown" aria-controls="terminatedEmployeeMenu-contents"><?=LanguageManager::tran('Deactivated 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>
|
||||
<li><a id="tabTerminatedEmployee" href="#tabPageTerminatedEmployee"><?=LanguageManager::tran('Temporarily Deactivated Employees')?></a></li>
|
||||
<li><a id="tabArchivedEmployee" href="#tabPageArchivedEmployee"><?=LanguageManager::tran('Terminated Employee Data')?></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<?php }?>
|
||||
@@ -115,7 +115,7 @@ $customFields = BaseService::getInstance()->getCustomFields("Employee");
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?php if (!class_exists('DocumentsAdminManager')) {?>
|
||||
<?php if (class_exists('DocumentsAdminManager')) {?>
|
||||
<div class="tab-pane" id="tabPageEmployeeDocument">
|
||||
<div id="EmployeeDocument" class="reviewBlock" data-content="List" style="padding-left:5px;">
|
||||
|
||||
@@ -133,7 +133,7 @@ $customFields = BaseService::getInstance()->getCustomFields("Employee");
|
||||
var modJsList = new Array();
|
||||
<?php if($user->user_level != "Admin"){
|
||||
?>
|
||||
modJsList['tabEmployee'] = new EmployeeAdapter('Employee','Employee',{"status":"Active", "supervisor":"__myid__"});
|
||||
modJsList['tabEmployee'] = new EmployeeAdapter('Employee','Employee',{"status":"Active"});
|
||||
modJsList['tabEmployee'].setShowAddNew(false);
|
||||
<?php
|
||||
}else{
|
||||
@@ -176,7 +176,7 @@ modJsList['tabTerminatedEmployee'] = new TerminatedEmployeeAdapter('Employee','T
|
||||
modJsList['tabTerminatedEmployee'].setRemoteTable(true);
|
||||
modJsList['tabTerminatedEmployee'].setShowAddNew(false);
|
||||
|
||||
<?php if (!class_exists('DocumentsAdminManager')) {?>
|
||||
<?php if (class_exists('DocumentsAdminManager')) {?>
|
||||
modJsList['tabEmployeeDocument'] = new EmployeeDocumentAdapter('EmployeeDocument','EmployeeDocument');
|
||||
modJsList['tabTerminatedEmployee'].setRemoteTable(true);
|
||||
<?php } ?>
|
||||
@@ -193,10 +193,10 @@ var modJs = modJsList['tabEmployee'];
|
||||
<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>
|
||||
<h3 style="font-size: 17px;"><?=LanguageManager::tran('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.
|
||||
<?=LanguageManager::tran('Employee needs a User to login to IceHrm. Do you want to create a user for this employee now?')?> <br/><br/><?=LanguageManager::tran('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>
|
||||
@@ -207,4 +207,4 @@ var modJs = modJsList['tabEmployee'];
|
||||
</div>
|
||||
|
||||
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
|
||||
@@ -36,7 +36,7 @@ EmployeeAdapter.method('setFieldNameMap', function(fields) {
|
||||
if(field.display == "Hidden"){
|
||||
this.hiddenFields[field.name] = field;
|
||||
}else{
|
||||
if(field.display == "Table and Form"){
|
||||
if(field.display == "Table and Form" || field.display == "Form"){
|
||||
this.tableFields[field.name] = field;
|
||||
}else{
|
||||
this.formOnlyFields[field.name] = field;
|
||||
@@ -197,6 +197,9 @@ EmployeeAdapter.method('getFormFields', function() {
|
||||
[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"]}],
|
||||
[ "supervisor", {"label":"Direct Supervisor","type":"select2","allow-null":true,"remote-source":["Employee","id","first_name+last_name"]}],
|
||||
[ "indirect_supervisors", {"label":"Indirect Supervisors","type":"select2multi","allow-null":true,"remote-source":["Employee","id","first_name+last_name"]}],
|
||||
[ "approver1", {"label":"First Level Approver","type":"select2","allow-null":true,"remote-source":["Employee","id","first_name+last_name"]}],
|
||||
[ "approver2", {"label":"Second Level Approver","type":"select2","allow-null":true,"remote-source":["Employee","id","first_name+last_name"]}],
|
||||
[ "approver3", {"label":"Third Level Approver","type":"select2","allow-null":true,"remote-source":["Employee","id","first_name+last_name"]}],
|
||||
[ "notes", {"label":"Notes","type":"datagroup",
|
||||
"form":[
|
||||
[ "note", {"label":"Note","type":"textarea","validation":""}]
|
||||
@@ -413,7 +416,7 @@ EmployeeAdapter.method('renderEmployee', function(data) {
|
||||
}
|
||||
}
|
||||
|
||||
html = html.replace(/#_.+_#/i,"");
|
||||
html = html.replace(/#_.+_#/gi,"");
|
||||
html = html.replace(/_id_/g,data.id);
|
||||
|
||||
$("#"+this.getTableName()).html(html);
|
||||
@@ -447,6 +450,43 @@ EmployeeAdapter.method('renderEmployee', function(data) {
|
||||
|
||||
$("#"+this.getTableName()+" #profile_image_"+data.id).attr('src',data.image);
|
||||
|
||||
|
||||
var sectionTemplate = '<div class="row" style="margin-left:10px;margin-top:20px;"><div class="panel panel-default" style="width:97.5%;"><div class="panel-heading"><h4>#_section.name_#</h4></div> <div class="panel-body" id="cont_#_section_#"> </div></div></div>';
|
||||
var sectionId = '';
|
||||
var sectionHtml = '';
|
||||
//Add custom fields
|
||||
if(data.customFields != undefined && data.customFields != null && Object.keys(data.customFields).length > 0) {
|
||||
|
||||
|
||||
var ct = '<div class="col-xs-6 col-md-3" style="font-size:16px;"><label class="control-label col-xs-12" style="font-size:13px;">#_label_#</label><label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;">#_value_#</label></div>';
|
||||
var customFieldHtml;
|
||||
for (index in data.customFields) {
|
||||
|
||||
if(!data.customFields[index][1]){
|
||||
data.customFields[index][1] = 'Other Details';
|
||||
}
|
||||
|
||||
sectionId = data.customFields[index][1].toLocaleLowerCase();
|
||||
sectionId = sectionId.replace(' ','_');
|
||||
|
||||
if($("#cont_"+sectionId).length <= 0){
|
||||
//Add section
|
||||
sectionHtml = sectionTemplate;
|
||||
sectionHtml = sectionHtml.replace('#_section_#', sectionId);
|
||||
sectionHtml = sectionHtml.replace('#_section.name_#', data.customFields[index][1]);
|
||||
$("#customFieldsCont").append($(sectionHtml));
|
||||
}
|
||||
|
||||
customFieldHtml = ct;
|
||||
customFieldHtml = customFieldHtml.replace('#_label_#', index);
|
||||
customFieldHtml = customFieldHtml.replace('#_value_#', data.customFields[index][0]);
|
||||
$("#cont_"+sectionId).append($(customFieldHtml));
|
||||
}
|
||||
}else{
|
||||
$("#customFieldsCont").remove();
|
||||
}
|
||||
|
||||
|
||||
this.cancel();
|
||||
|
||||
if(!this.isModuleInstalled("admin","documents")) {
|
||||
@@ -469,6 +509,12 @@ EmployeeAdapter.method('renderEmployee', function(data) {
|
||||
modJs.subModJsList['tabEmployeeLanguageSubTab'] = new EmployeeSubLanguageAdapter('EmployeeLanguage','EmployeeLanguageSubTab',{"employee":data.id});
|
||||
modJs.subModJsList['tabEmployeeLanguageSubTab'].parent = this;
|
||||
|
||||
modJs.subModJsList['tabEmployeeDependentSubTab'] = new EmployeeSubDependentAdapter('EmployeeDependent','EmployeeDependentSubTab',{"employee":data.id});
|
||||
modJs.subModJsList['tabEmployeeDependentSubTab'].parent = this;
|
||||
|
||||
modJs.subModJsList['tabEmployeeEmergencyContactSubTab'] = new EmployeeSubEmergencyContactAdapter('EmergencyContact','EmployeeEmergencyContactSubTab',{"employee":data.id});
|
||||
modJs.subModJsList['tabEmployeeEmergencyContactSubTab'].parent = this;
|
||||
|
||||
if(this.isModuleInstalled("admin","documents")) {
|
||||
modJs.subModJsList['tabEmployeeDocumentSubTab'] = new EmployeeSubDocumentAdapter('EmployeeDocument', 'EmployeeDocumentSubTab', {"employee": data.id});
|
||||
modJs.subModJsList['tabEmployeeDocumentSubTab'].parent = this;
|
||||
@@ -510,6 +556,16 @@ EmployeeAdapter.method('renderEmployee', function(data) {
|
||||
modJs.subModJsList['tabEmployeeLanguageSubTab'].setShowCancel(false);
|
||||
modJs.subModJsList['tabEmployeeLanguageSubTab'].get([]);
|
||||
|
||||
modJs.subModJsList['tabEmployeeDependentSubTab'].setShowFormOnPopup(true);
|
||||
modJs.subModJsList['tabEmployeeDependentSubTab'].setShowAddNew(false);
|
||||
modJs.subModJsList['tabEmployeeDependentSubTab'].setShowCancel(false);
|
||||
modJs.subModJsList['tabEmployeeDependentSubTab'].get([]);
|
||||
|
||||
modJs.subModJsList['tabEmployeeEmergencyContactSubTab'].setShowFormOnPopup(true);
|
||||
modJs.subModJsList['tabEmployeeEmergencyContactSubTab'].setShowAddNew(false);
|
||||
modJs.subModJsList['tabEmployeeEmergencyContactSubTab'].setShowCancel(false);
|
||||
modJs.subModJsList['tabEmployeeEmergencyContactSubTab'].get([]);
|
||||
|
||||
if(this.isModuleInstalled("admin","documents")) {
|
||||
modJs.subModJsList['tabEmployeeDocumentSubTab'].setShowFormOnPopup(true);
|
||||
modJs.subModJsList['tabEmployeeDocumentSubTab'].setShowAddNew(false);
|
||||
@@ -1335,7 +1391,7 @@ EmployeeSubSkillsAdapter.method('getSubHeaderTitle', function() {
|
||||
});
|
||||
|
||||
EmployeeSubSkillsAdapter.method('getSubItemHtml', function(item, itemDelete, itemEdit) {
|
||||
var itemHtml = $('<a href="#" class="list-group-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'+item[2]+itemDelete+itemEdit+'</h5><p class="list-group-item-text">'+nl2br(item[3])+'</p></a>');
|
||||
var itemHtml = $('<div class="list-group-item sub-tab-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'+item[2]+itemDelete+itemEdit+'</h5><p class="list-group-item-text">'+nl2br(item[3])+'</p></div>');
|
||||
return itemHtml;
|
||||
});
|
||||
|
||||
@@ -1414,8 +1470,8 @@ EmployeeSubEducationAdapter.method('getSubItemHtml', function(item, itemDelete,
|
||||
try{
|
||||
end = Date.parse(item[5]).toString('MMM d, yyyy');
|
||||
}catch(e){}
|
||||
//var itemHtml = $('<a href="#" class="list-group-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'+item[2]+itemDelete+itemEdit+'</h5><p class="list-group-item-text">'+nl2br(item[3])+'</p></a>');
|
||||
var itemHtml = $('<a href="#" class="list-group-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'+item[2]+itemDelete+itemEdit+'</h5><p class="list-group-item-text"><i class="fa fa-calendar"></i> Start: <b>'+start+'</b></p><p class="list-group-item-text">'+'<i class="fa fa-calendar"></i> Completed: <b>'+end+'</b></p><p class="list-group-item-text">'+'<i class="fa fa-building-o"></i> Institute: <b>'+item[3]+'</b></p></a>');
|
||||
//var itemHtml = $('<div class="list-group-item sub-tab-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'+item[2]+itemDelete+itemEdit+'</h5><p class="list-group-item-text">'+nl2br(item[3])+'</p></div>');
|
||||
var itemHtml = $('<div class="list-group-item sub-tab-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'+item[2]+itemDelete+itemEdit+'</h5><p class="list-group-item-text"><i class="fa fa-calendar"></i> Start: <b>'+start+'</b></p><p class="list-group-item-text">'+'<i class="fa fa-calendar"></i> Completed: <b>'+end+'</b></p><p class="list-group-item-text">'+'<i class="fa fa-building-o"></i> Institute: <b>'+item[3]+'</b></p></div>');
|
||||
return itemHtml;
|
||||
});
|
||||
|
||||
@@ -1492,7 +1548,7 @@ EmployeeSubCertificationAdapter.method('getSubItemHtml', function(item, itemDele
|
||||
try{
|
||||
end = Date.parse(item[5]).toString('MMM d, yyyy');
|
||||
}catch(e){}
|
||||
var itemHtml = $('<a href="#" class="list-group-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'+item[2]+itemDelete+itemEdit+'</h5><p class="list-group-item-text"><i class="fa fa-calendar"></i> Granted On: <b>'+start+'</b></p><p class="list-group-item-text">'+'<i class="fa fa-calendar"></i> Valid Thru: <b>'+end+'</b></p><p class="list-group-item-text">'+'<i class="fa fa-building-o"></i> Institute: <b>'+item[3]+'</b></p></a>');
|
||||
var itemHtml = $('<div class="list-group-item sub-tab-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'+item[2]+itemDelete+itemEdit+'</h5><p class="list-group-item-text"><i class="fa fa-calendar"></i> Granted On: <b>'+start+'</b></p><p class="list-group-item-text">'+'<i class="fa fa-calendar"></i> Valid Thru: <b>'+end+'</b></p><p class="list-group-item-text">'+'<i class="fa fa-building-o"></i> Institute: <b>'+item[3]+'</b></p></div>');
|
||||
return itemHtml;
|
||||
});
|
||||
|
||||
@@ -1570,7 +1626,7 @@ EmployeeSubLanguageAdapter.method('getSubHeaderTitle', function() {
|
||||
});
|
||||
|
||||
EmployeeSubLanguageAdapter.method('getSubItemHtml', function(item, itemDelete, itemEdit) {
|
||||
var itemHtml = $('<a href="#" class="list-group-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'+item[2]+itemDelete+itemEdit+'</h5><p class="list-group-item-text"><i class="fa fa-asterisk"></i> Reading: <b>'+item[3]+'</b></p><p class="list-group-item-text">'+'<i class="fa fa-asterisk"></i> Speaking: <b>'+ item[4] +'</b></p><p class="list-group-item-text">'+'<i class="fa fa-asterisk"></i> Writing: <b>'+item[5]+'</b></p><p class="list-group-item-text">'+'<i class="fa fa-asterisk"></i> Understanding: <b>'+item[6]+'</b></p></a>');
|
||||
var itemHtml = $('<div class="list-group-item sub-tab-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'+item[2]+itemDelete+itemEdit+'</h5><p class="list-group-item-text"><i class="fa fa-asterisk"></i> Reading: <b>'+item[3]+'</b></p><p class="list-group-item-text">'+'<i class="fa fa-asterisk"></i> Speaking: <b>'+ item[4] +'</b></p><p class="list-group-item-text">'+'<i class="fa fa-asterisk"></i> Writing: <b>'+item[5]+'</b></p><p class="list-group-item-text">'+'<i class="fa fa-asterisk"></i> Understanding: <b>'+item[6]+'</b></p></div>');
|
||||
return itemHtml;
|
||||
});
|
||||
|
||||
@@ -1582,6 +1638,154 @@ EmployeeSubLanguageAdapter.method('isSubProfileTable', function() {
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* @class EmployeeSubDependentAdapter
|
||||
* @param endPoint
|
||||
* @param tab
|
||||
* @param filter
|
||||
* @param orderBy
|
||||
* @returns
|
||||
*/
|
||||
|
||||
function EmployeeSubDependentAdapter(endPoint,tab,filter,orderBy) {
|
||||
this.initAdapter(endPoint,tab,filter,orderBy);
|
||||
}
|
||||
|
||||
EmployeeSubDependentAdapter.inherits(SubAdapterBase);
|
||||
|
||||
|
||||
|
||||
EmployeeSubDependentAdapter.method('getDataMapping', function() {
|
||||
return [
|
||||
"id",
|
||||
"employee",
|
||||
"name",
|
||||
"relationship",
|
||||
"dob",
|
||||
"id_number"
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
EmployeeSubDependentAdapter.method('getHeaders', function() {
|
||||
return [
|
||||
{ "sTitle": "ID" ,"bVisible":false},
|
||||
{ "sTitle": "Employee" },
|
||||
{ "sTitle": "Name" },
|
||||
{ "sTitle": "Relationship"},
|
||||
{ "sTitle": "Date of Birth"},
|
||||
{ "sTitle": "Id Number"}
|
||||
];
|
||||
});
|
||||
|
||||
EmployeeSubDependentAdapter.method('getFormFields', function() {
|
||||
return [
|
||||
[ "id", {"label":"ID","type":"hidden"}],
|
||||
[ "employee", {"label":"Employee","type":"hidden"}],
|
||||
[ "name", {"label":"Name","type":"text","validation":""}],
|
||||
[ "relationship", {"label":"Relationship","type":"select","source":[["Child","Child"],["Spouse","Spouse"],["Parent","Parent"],["Other","Other"]]}],
|
||||
[ "dob", {"label":"Date of Birth","type":"date","validation":""}],
|
||||
[ "id_number", {"label":"Id Number","type":"text","validation":"none"}]
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
EmployeeSubDependentAdapter.method('forceInjectValuesBeforeSave', function(params) {
|
||||
params['employee'] = this.parent.currentId;
|
||||
return params;
|
||||
});
|
||||
|
||||
EmployeeSubDependentAdapter.method('getSubHeaderTitle', function() {
|
||||
var addBtn = '<button class="btn btn-small btn-success" onclick="modJs.subModJsList[\'tab'+this.tab+'\'].renderForm();" style="margin-right:10px;"><i class="fa fa-plus"></i></button>';
|
||||
return addBtn + "Dependents";
|
||||
});
|
||||
|
||||
EmployeeSubDependentAdapter.method('getSubItemHtml', function(item, itemDelete, itemEdit) {
|
||||
|
||||
|
||||
var itemHtml = $('<div class="list-group-item sub-tab-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'+item[2]+itemDelete+itemEdit+'</h5><p class="list-group-item-text"><i class="fa fa-users"></i> Relationship: <b>'+item[3]+'</b></p><p class="list-group-item-text">'+'<i class="fa fa-user"></i> Name: <b>'+item[2]+'</b></p></div>');
|
||||
return itemHtml;
|
||||
});
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @class EmployeeSubEmergencyContactAdapter
|
||||
* @param endPoint
|
||||
* @param tab
|
||||
* @param filter
|
||||
* @param orderBy
|
||||
* @returns
|
||||
*/
|
||||
|
||||
function EmployeeSubEmergencyContactAdapter(endPoint,tab,filter,orderBy) {
|
||||
this.initAdapter(endPoint,tab,filter,orderBy);
|
||||
}
|
||||
|
||||
EmployeeSubEmergencyContactAdapter.inherits(SubAdapterBase);
|
||||
|
||||
|
||||
|
||||
EmployeeSubEmergencyContactAdapter.method('getDataMapping', function() {
|
||||
return [
|
||||
"id",
|
||||
"employee",
|
||||
"name",
|
||||
"relationship",
|
||||
"home_phone",
|
||||
"work_phone",
|
||||
"mobile_phone"
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
EmployeeSubEmergencyContactAdapter.method('getHeaders', function() {
|
||||
return [
|
||||
{ "sTitle": "ID" ,"bVisible":false},
|
||||
{ "sTitle": "Employee" },
|
||||
{ "sTitle": "Name" },
|
||||
{ "sTitle": "Relationship"},
|
||||
{ "sTitle": "Home Phone"},
|
||||
{ "sTitle": "Work Phone"},
|
||||
{ "sTitle": "Mobile Phone"}
|
||||
];
|
||||
});
|
||||
|
||||
EmployeeSubEmergencyContactAdapter.method('getFormFields', function() {
|
||||
return [
|
||||
[ "id", {"label":"ID","type":"hidden"}],
|
||||
[ "employee", {"label":"Employee","type":"hidden"}],
|
||||
[ "name", {"label":"Name","type":"text","validation":""}],
|
||||
[ "relationship", {"label":"Relationship","type":"text","validation":"none"}],
|
||||
[ "home_phone", {"label":"Home Phone","type":"text","validation":"none"}],
|
||||
[ "work_phone", {"label":"Work Phone","type":"text","validation":"none"}],
|
||||
[ "mobile_phone", {"label":"Mobile Phone","type":"text","validation":"none"}]
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
EmployeeSubEmergencyContactAdapter.method('forceInjectValuesBeforeSave', function(params) {
|
||||
params['employee'] = this.parent.currentId;
|
||||
return params;
|
||||
});
|
||||
|
||||
EmployeeSubEmergencyContactAdapter.method('getSubHeaderTitle', function() {
|
||||
var addBtn = '<button class="btn btn-small btn-success" onclick="modJs.subModJsList[\'tab'+this.tab+'\'].renderForm();" style="margin-right:10px;"><i class="fa fa-plus"></i></button>';
|
||||
return addBtn + "Emergency Contacts";
|
||||
});
|
||||
|
||||
EmployeeSubEmergencyContactAdapter.method('getSubItemHtml', function(item, itemDelete, itemEdit) {
|
||||
|
||||
|
||||
var itemHtml = $('<div class="list-group-item sub-tab-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'+item[2]+itemDelete+itemEdit+'</h5><p class="list-group-item-text"><i class="fa fa-users"></i> Relationship: <b>'+item[3]+'</b></p><p class="list-group-item-text">'+'<i class="fa fa-user"></i> Name: <b>'+item[2]+'</b></p><p class="list-group-item-text"><i class="fa fa-phone"></i> Home Phone: <b>'+item[4]+'</b></p><p class="list-group-item-text"><i class="fa fa-phone"></i> Mobile Phone: <b>'+item[6]+'</b></p></div>');
|
||||
return itemHtml;
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @class EmployeeSubDocumentAdapter
|
||||
@@ -1655,10 +1859,15 @@ EmployeeSubDocumentAdapter.method('getSubItemHtml', function(item, itemDelete, i
|
||||
try{
|
||||
expire = Date.parse(item[5]).toString('MMM d, yyyy');
|
||||
}catch(e){}
|
||||
var itemHtml = $('<a href="#" class="list-group-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'+item[2]+itemDelete+itemEdit+'</h5><p class="list-group-item-text">'+nl2br(item[3])+'</p><p class="list-group-item-text">'+'<i class="fa fa-calendar"></i> Expire On: <b>'+expire+'</b></p></a>');
|
||||
|
||||
var downloadButton = '<button id="#_id_#_download" onclick="download(\''+item[7]+'\');return false;" type="button" style="position: absolute;bottom: 5px;right: 70px;font-size: 13px;" tooltip="Download"><li class="fa fa-cloud-download"></li></button>';
|
||||
|
||||
var itemHtml = $('<div class="list-group-item sub-tab-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'+item[2]+downloadButton+itemDelete+itemEdit+'</h5><p class="list-group-item-text">'+nl2br(item[3])+'</p><p class="list-group-item-text">'+'<i class="fa fa-calendar"></i> Expire On: <b>'+expire+'</b></p></div>');
|
||||
return itemHtml;
|
||||
});
|
||||
|
||||
|
||||
|
||||
EmployeeSubDocumentAdapter.method('isSubProfileTable', function() {
|
||||
if(this.user.user_level == "Admin"){
|
||||
return false;
|
||||
|
||||
@@ -53,5 +53,30 @@ if (!class_exists('CustomField')) {
|
||||
public function getAnonymousAccess(){
|
||||
return array("get","element");
|
||||
}
|
||||
|
||||
public function validateSave($obj){
|
||||
$type = $obj->type;
|
||||
$baseObject = new $type();
|
||||
$fields = $baseObject->getObjectKeys();
|
||||
if(isset($fields[$obj->name])){
|
||||
return new IceResponse(IceResponse::ERROR,"Column name already exists by default");
|
||||
}
|
||||
|
||||
$cf = new CustomField();
|
||||
if(empty($obj->id)){
|
||||
$cf->Load("type = ? and name = ?",array($obj->type, $obj->name));
|
||||
if($cf->name == $obj->name){
|
||||
return new IceResponse(IceResponse::ERROR,"Another custom field with same name has already been added");
|
||||
}
|
||||
}else{
|
||||
$cf->Load("type = ? and name = ? and id <> ?",array($obj->type, $obj->name, $obj->id));
|
||||
if($cf->name == $obj->name){
|
||||
return new IceResponse(IceResponse::ERROR,"Another custom field with same name has already been added");
|
||||
}
|
||||
}
|
||||
|
||||
return new IceResponse(IceResponse::SUCCESS,"");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -15,13 +15,8 @@ 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>
|
||||
<li class="active"><a id="tabEmployeeFieldName" href="#tabPageEmployeeFieldName"><?=LanguageManager::tran('Employee Field Names')?></a></li>
|
||||
<li><a id="tabEmployeeCustomField" href="#tabPageEmployeeCustomField"><?=LanguageManager::tran('Employee Custom Fields')?></a></li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
@@ -51,9 +46,9 @@ modJsList['tabEmployeeFieldName'] = new FieldNameAdapter('FieldNameMapping','Emp
|
||||
modJsList['tabEmployeeFieldName'].setRemoteTable(true);
|
||||
modJsList['tabEmployeeFieldName'].setShowAddNew(false);
|
||||
|
||||
modJsList['tabEmployeeCustomField'] = new CustomFieldAdapter('CustomField','EmployeeCustomField',{"type":"Employee"});
|
||||
modJsList['tabEmployeeCustomField'] = new CustomFieldAdapter('CustomField','EmployeeCustomField',{"type":"Employee"},"display_order desc");
|
||||
modJsList['tabEmployeeCustomField'].setRemoteTable(true);
|
||||
modJsList['tabEmployeeCustomField'].setShowAddNew(false);
|
||||
modJsList['tabEmployeeCustomField'].setTableType("Employee");
|
||||
|
||||
|
||||
var modJs = modJsList['tabEmployeeFieldName'];
|
||||
|
||||
@@ -52,6 +52,7 @@ FieldNameAdapter.method('getFormFields', function() {
|
||||
|
||||
function CustomFieldAdapter(endPoint,tab,filter,orderBy) {
|
||||
this.initAdapter(endPoint,tab,filter,orderBy);
|
||||
this.tableType = "";
|
||||
}
|
||||
|
||||
CustomFieldAdapter.inherits(AdapterBase);
|
||||
@@ -62,7 +63,8 @@ CustomFieldAdapter.method('getDataMapping', function() {
|
||||
return [
|
||||
"id",
|
||||
"name",
|
||||
"display"
|
||||
"display",
|
||||
"display_order"
|
||||
];
|
||||
});
|
||||
|
||||
@@ -70,17 +72,74 @@ CustomFieldAdapter.method('getHeaders', function() {
|
||||
return [
|
||||
{ "sTitle": "ID" ,"bVisible":false},
|
||||
{ "sTitle": "Name" },
|
||||
{ "sTitle": "Display Status"}
|
||||
{ "sTitle": "Display Status"},
|
||||
{ "sTitle": "Priority"}
|
||||
];
|
||||
});
|
||||
|
||||
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"]]}]
|
||||
//[ "type", {"label":"Type","type":"placeholder","validation":""}],
|
||||
[ "name", {"label":"Name","type":"text","validation":""}],
|
||||
[ "display", {"label":"Display Status","type":"select","source":[["Form","Show"],["Hidden","Hidden"]]}],
|
||||
[ "field_type", {"label":"Field Type","type":"select","source":[["text","Text Field"],["textarea","Text Area"],["select","Select"],["select2","Select2"],["select2multi","Multi Select"],["fileupload","File Upload"],["date","Date"],["datetime","Date Time"],["time","Time"]]}],
|
||||
[ "field_label", {"label":"Field Label","type":"text","validation":""}],
|
||||
[ "field_validation", {"label":"Validation","type":"select","validation":"none","sort":"none","source":[["","Required"],["none","None"],["number","Number"],["numberOrEmpty","Number or Empty"],["float","Decimal"],["email","Email"],["emailOrEmpty","Email or Empty"]]}],
|
||||
[ "field_options", {"label":"Field Options","type":"datagroup",
|
||||
"form":[
|
||||
[ "label", {"label":"Label","type":"text","validation":""}],
|
||||
[ "value", {"label":"Value","type":"text","validation":"none"}]
|
||||
],
|
||||
"html":'<div id="#_id_#" class="panel panel-default"><div class="panel-body">#_delete_##_edit_#<span style="color:#999;font-size:13px;font-weight:bold">#_label_#</span>:#_value_#</div></div>',
|
||||
"validation":"none"
|
||||
}],
|
||||
[ "display_order", {"label":"Priority","type":"text","validation":"number"}],
|
||||
[ "display_section", {"label":"Display Section","type":"text","validation":""}]
|
||||
];
|
||||
});
|
||||
|
||||
CustomFieldAdapter.method('setTableType', function(type) {
|
||||
this.tableType = type;
|
||||
});
|
||||
|
||||
CustomFieldAdapter.method('doCustomValidation', function(params) {
|
||||
var validateName= function (str) {
|
||||
var name = /^[a-z][a-z0-9\._]+$/;
|
||||
return str != null && name.test(str);
|
||||
};
|
||||
|
||||
if(!validateName(params.name)){
|
||||
return "Invalid name for custom field";
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
});
|
||||
|
||||
CustomFieldAdapter.method('forceInjectValuesBeforeSave', function(params) {
|
||||
|
||||
|
||||
//Build data field
|
||||
var data = [params.name], options = [], optionsData;
|
||||
data.push({});
|
||||
data[1]['label'] = params.field_label;
|
||||
data[1]['type'] = params.field_type;
|
||||
data[1]['validation'] = params.field_validation;
|
||||
if(["select","select2","select2multi"].indexOf(params.field_type) >= 0){
|
||||
optionsData = JSON.parse(params.field_options);
|
||||
for(index in optionsData){
|
||||
options.push([optionsData[index].value, optionsData[index].label]);
|
||||
}
|
||||
data[1]['source'] = options;
|
||||
}
|
||||
if(params.field_validation == null || params.field_validation == undefined){
|
||||
params.field_validation = "";
|
||||
}
|
||||
params.data = JSON.stringify(data);
|
||||
params.type = this.tableType;
|
||||
return params;
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ 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)
|
||||
*/
|
||||
|
||||
$moduleName = 'jobs';
|
||||
define('MODULE_PATH',dirname(__FILE__));
|
||||
include APP_BASE_PATH.'header.php';
|
||||
@@ -28,9 +27,9 @@ 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="tabJobTitles" href="#tabPageJobTitles">Job Titles</a></li>
|
||||
<li><a id="tabPayGrades" href="#tabPagePayGrades">Pay Grades</a></li>
|
||||
<li><a id="tabEmploymentStatus" href="#tabPageEmploymentStatus">Employment Status</a></li>
|
||||
<li class="active"><a id="tabJobTitles" href="#tabPageJobTitles"><?=LanguageManager::tran('Job Titles')?></a></li>
|
||||
<li><a id="tabPayGrades" href="#tabPagePayGrades"><?=LanguageManager::tran('Pay Grades')?></a></li>
|
||||
<li><a id="tabEmploymentStatus" href="#tabPageEmploymentStatus"><?=LanguageManager::tran('Employment Status')?></a></li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
|
||||
@@ -28,8 +28,8 @@ 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="tabCompanyLoan" href="#tabPageCompanyLoan">Loan Types</a></li>
|
||||
<li><a id="tabEmployeeCompanyLoan" href="#tabPageEmployeeCompanyLoan">Employee Loans</a></li>
|
||||
<li class="active"><a id="tabCompanyLoan" href="#tabPageCompanyLoan"><?=LanguageManager::tran('Loan Types')?></a></li>
|
||||
<li><a id="tabEmployeeCompanyLoan" href="#tabPageEmployeeCompanyLoan"><?=LanguageManager::tran('Employee Loans')?></a></li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
{
|
||||
"Admin":"fa-cubes",
|
||||
"Employees":"fa-users",
|
||||
"Reports":"fa-file-text",
|
||||
"Admin Reports":"fa-file-text",
|
||||
"System":"fa-cogs",
|
||||
"Insights":"fa-bar-chart-o",
|
||||
"Payroll":"fa-money"
|
||||
}
|
||||
|
||||
@@ -52,7 +52,12 @@ if (!class_exists('Country')) {
|
||||
}
|
||||
|
||||
if(!empty($allowedCountries)){
|
||||
return parent::Find("id in (".implode(",",$allowedCountries).")" , array());
|
||||
$res = parent::Find("id in (".implode(",",$allowedCountries).")" , array());
|
||||
if(empty($res)){
|
||||
SettingsManager::getInstance()->setSetting('System: Allowed Countries','');
|
||||
}else{
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
||||
return parent::Find($whereOrderBy, $bindarr, $pkeysArr, $extra);
|
||||
@@ -103,7 +108,12 @@ if (!class_exists('CurrencyType')) {
|
||||
}
|
||||
|
||||
if(!empty($allowedCountries)){
|
||||
return parent::Find("id in (".implode(",",$allowedCountries).")" , array());
|
||||
$res = parent::Find("id in (".implode(",",$allowedCountries).")" , array());
|
||||
if(empty($res)){
|
||||
SettingsManager::getInstance()->setSetting('System: Allowed Currencies','');
|
||||
}else{
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
||||
return parent::Find($whereOrderBy, $bindarr, $pkeysArr, $extra);
|
||||
@@ -136,7 +146,12 @@ if (!class_exists('Nationality')) {
|
||||
}
|
||||
|
||||
if(!empty($allowedCountries)){
|
||||
return parent::Find("id in (".implode(",",$allowedCountries).")" , array());
|
||||
$res = parent::Find("id in (".implode(",",$allowedCountries).")" , array());
|
||||
if(empty($res)){
|
||||
SettingsManager::getInstance()->setSetting('System: Allowed Currencies','');
|
||||
}else{
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
||||
return parent::Find($whereOrderBy, $bindarr, $pkeysArr, $extra);
|
||||
@@ -210,6 +225,42 @@ if (!class_exists('CalculationHook')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!class_exists('CustomFieldValue')) {
|
||||
class CustomFieldValue extends ICEHRM_Record {
|
||||
var $_table = 'CustomFieldValues';
|
||||
|
||||
public function getAdminAccess(){
|
||||
return array("get","element","save","delete");
|
||||
}
|
||||
|
||||
public function getUserAccess(){
|
||||
return array("get","element","save","delete");
|
||||
}
|
||||
|
||||
public function getAnonymousAccess(){
|
||||
return array();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!class_exists('SupportedLanguage')) {
|
||||
class SupportedLanguage extends ICEHRM_Record {
|
||||
var $_table = 'SupportedLanguages';
|
||||
|
||||
public function getAdminAccess(){
|
||||
return array("get","element","save","delete");
|
||||
}
|
||||
|
||||
public function getUserAccess(){
|
||||
return array();
|
||||
}
|
||||
|
||||
public function getAnonymousAccess(){
|
||||
return array("get","element");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ 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="tabModule" href="#tabPageModule">Modules</a></li>
|
||||
<li class="active"><a id="tabModule" href="#tabPageModule"><?=LanguageManager::tran('Modules')?></a></li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
@@ -51,4 +51,4 @@ modJsList['tabModule'].setShowAddNew(false);
|
||||
var modJs = modJsList['tabModule'];
|
||||
|
||||
</script>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
|
||||
27
ext/admin/overtime/api/OvertimeActionManager.php
Normal file
27
ext/admin/overtime/api/OvertimeActionManager.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
class OvertimeActionManager extends ApproveAdminActionManager{
|
||||
|
||||
public function getModelClass(){
|
||||
return "EmployeeOvertime";
|
||||
}
|
||||
|
||||
public function getItemName(){
|
||||
return "Overtime Request";
|
||||
}
|
||||
|
||||
public function getModuleName(){
|
||||
return "Overtime Management";
|
||||
}
|
||||
|
||||
public function getModuleTabUrl(){
|
||||
return "g=modules&n=overtime&m=module_Time_Management#tabEmployeeOvertime";
|
||||
}
|
||||
|
||||
public function getModuleSubordinateTabUrl(){
|
||||
return "g=modules&n=overtime&m=module_Time_Management#tabSubordinateEmployeeOvertime";
|
||||
}
|
||||
|
||||
public function getModuleApprovalTabUrl(){
|
||||
return "g=modules&n=overtime&m=module_Time_Management#tabEmployeeOvertimeApproval";
|
||||
}
|
||||
}
|
||||
123
ext/admin/overtime/api/OvertimeAdminManager.php
Normal file
123
ext/admin/overtime/api/OvertimeAdminManager.php
Normal file
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
if (!class_exists('OvertimeAdminManager')) {
|
||||
|
||||
class OvertimeAdminManager extends AbstractModuleManager{
|
||||
|
||||
public function initializeUserClasses(){
|
||||
if(defined('MODULE_TYPE') && MODULE_TYPE != 'admin'){
|
||||
$this->addUserClass("EmployeeOvertime");
|
||||
}
|
||||
}
|
||||
|
||||
public function initializeFieldMappings(){
|
||||
|
||||
}
|
||||
|
||||
public function initializeDatabaseErrorMappings(){
|
||||
|
||||
}
|
||||
|
||||
public function setupModuleClassDefinitions(){
|
||||
|
||||
$this->addModelClass('OvertimeCategory');
|
||||
$this->addModelClass('EmployeeOvertime');
|
||||
$this->addModelClass('EmployeeOvertimeApproval');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!class_exists('OvertimeCategory')) {
|
||||
class OvertimeCategory extends ICEHRM_Record {
|
||||
var $_table = 'OvertimeCategories';
|
||||
|
||||
public function getAdminAccess(){
|
||||
return array("get","element","save","delete");
|
||||
}
|
||||
|
||||
public function getManagerAccess(){
|
||||
return array("get","element","save","delete");
|
||||
}
|
||||
|
||||
public function getUserAccess(){
|
||||
return array("get");
|
||||
}
|
||||
|
||||
public function getUserOnlyMeAccess(){
|
||||
return array("get","element");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!class_exists('EmployeeOvertime')) {
|
||||
class EmployeeOvertime extends ApproveModel
|
||||
{
|
||||
var $_table = 'EmployeeOvertime';
|
||||
|
||||
var $notificationModuleName = "Overtime Management";
|
||||
var $notificationUnitName = "OvertimeRequest";
|
||||
var $notificationUnitPrefix = "An";
|
||||
var $notificationUnitAdminUrl = "g=modules&n=overtime&m=module_Time_Management#tabSubordinateEmployeeOvertime";
|
||||
var $preApproveSettingName = "Attendance: Pre-Approve Overtime Request";
|
||||
|
||||
public function isMultiLevelApprovalsEnabled(){
|
||||
return (SettingsManager::getInstance()->getSetting('Overtime: Enable Multi Level Approvals') == '1');
|
||||
}
|
||||
|
||||
public function getAdminAccess()
|
||||
{
|
||||
return array("get", "element", "save", "delete");
|
||||
}
|
||||
|
||||
public function getManagerAccess()
|
||||
{
|
||||
return array("get", "element", "save", "delete");
|
||||
}
|
||||
|
||||
public function getUserAccess()
|
||||
{
|
||||
return array("get");
|
||||
}
|
||||
|
||||
public function getUserOnlyMeAccess()
|
||||
{
|
||||
return array("element", "save", "delete");
|
||||
}
|
||||
|
||||
public function fieldsNeedToBeApproved()
|
||||
{
|
||||
return array(
|
||||
"start_time",
|
||||
"end_time"
|
||||
);
|
||||
}
|
||||
|
||||
public function getType(){
|
||||
return 'EmployeeOvertime';
|
||||
}
|
||||
|
||||
public function allowIndirectMapping(){
|
||||
if(SettingsManager::getInstance()->getSetting('Overtime: Allow Indirect Admins to Approve') == '1'){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!class_exists('EmployeeOvertimeApproval')) {
|
||||
|
||||
class EmployeeOvertimeApproval extends EmployeeOvertime
|
||||
{
|
||||
|
||||
public function Find($whereOrderBy,$bindarr=false,$pkeysArr=false,$extra=array()){
|
||||
return $this->findApprovals(new EmployeeOvertime(), $whereOrderBy,$bindarr,$pkeysArr,$extra);
|
||||
}
|
||||
}
|
||||
}
|
||||
42
ext/admin/overtime/index.php
Normal file
42
ext/admin/overtime/index.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/*
|
||||
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 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/>.
|
||||
|
||||
------------------------------------------------------------------
|
||||
|
||||
Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
|
||||
Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
|
||||
*/
|
||||
|
||||
$moduleName = 'travel';
|
||||
define('MODULE_PATH',dirname(__FILE__));
|
||||
include APP_BASE_PATH.'header.php';
|
||||
include APP_BASE_PATH.'modulejslibs.inc.php';
|
||||
|
||||
$options = array();
|
||||
$options['setRemoteTable'] = 'true';
|
||||
|
||||
$moduleBuilder = new ModuleBuilder();
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab('OvertimeCategory','OvertimeCategory','Overtime Categories','OvertimeCategoryAdapter','','',true,$options));
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab('EmployeeOvertime','EmployeeOvertime','Overtime Requests','EmployeeOvertimeAdminAdapter','','',false,$options));
|
||||
echo UIManager::getInstance()->renderModule($moduleBuilder);
|
||||
|
||||
|
||||
$itemName = 'OvertimeRequest';
|
||||
$moduleName = 'Time Management';
|
||||
$itemNameLower = strtolower($itemName);
|
||||
|
||||
include APP_BASE_PATH.'footer.php';
|
||||
99
ext/admin/overtime/lib.js
Normal file
99
ext/admin/overtime/lib.js
Normal file
@@ -0,0 +1,99 @@
|
||||
/**
|
||||
* Author: Thilina Hasantha
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* OvertimeCategoryAdapter
|
||||
*/
|
||||
|
||||
function OvertimeCategoryAdapter(endPoint) {
|
||||
this.initAdapter(endPoint);
|
||||
}
|
||||
|
||||
OvertimeCategoryAdapter.inherits(AdapterBase);
|
||||
|
||||
|
||||
|
||||
OvertimeCategoryAdapter.method('getDataMapping', function() {
|
||||
return [
|
||||
"id",
|
||||
"name"
|
||||
];
|
||||
});
|
||||
|
||||
OvertimeCategoryAdapter.method('getHeaders', function() {
|
||||
return [
|
||||
{ "sTitle": "ID" ,"bVisible":false},
|
||||
{ "sTitle": "Name" }
|
||||
];
|
||||
});
|
||||
|
||||
OvertimeCategoryAdapter.method('getFormFields', function() {
|
||||
return [
|
||||
[ "id", {"label":"ID","type":"hidden"}],
|
||||
[ "name", {"label":"Name","type":"text","validation":""}]
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* EmployeeOvertimeAdminAdapter
|
||||
*/
|
||||
|
||||
|
||||
function EmployeeOvertimeAdminAdapter(endPoint,tab,filter,orderBy) {
|
||||
this.initAdapter(endPoint,tab,filter,orderBy);
|
||||
this.itemName = 'OvertimeRequest';
|
||||
this.itemNameLower = 'overtimerequest';
|
||||
this.modulePathName = 'overtime';
|
||||
}
|
||||
|
||||
EmployeeOvertimeAdminAdapter.inherits(ApproveAdminAdapter);
|
||||
|
||||
|
||||
|
||||
EmployeeOvertimeAdminAdapter.method('getDataMapping', function() {
|
||||
return [
|
||||
"id",
|
||||
"employee",
|
||||
"category",
|
||||
"start_time",
|
||||
"end_time",
|
||||
"project",
|
||||
"status"
|
||||
];
|
||||
});
|
||||
|
||||
EmployeeOvertimeAdminAdapter.method('getHeaders', function() {
|
||||
return [
|
||||
{ "sTitle": "ID" ,"bVisible":false},
|
||||
{ "sTitle": "Employee" },
|
||||
{ "sTitle": "Category" },
|
||||
{ "sTitle": "Start Time" },
|
||||
{ "sTitle": "End Time"},
|
||||
{ "sTitle": "Project"},
|
||||
{ "sTitle": "Status"}
|
||||
];
|
||||
});
|
||||
|
||||
EmployeeOvertimeAdminAdapter.method('getFormFields', function() {
|
||||
return [
|
||||
["id", {"label": "ID", "type": "hidden"}],
|
||||
["employee", {
|
||||
"label": "Employee",
|
||||
"type": "select2",
|
||||
"sort": "none",
|
||||
"allow-null": false,
|
||||
"remote-source": ["Employee", "id", "first_name+last_name", "getActiveSubordinateEmployees"]
|
||||
}],
|
||||
["category", {"label": "Category", "type": "select2", "allow-null":false, "remote-source": ["OvertimeCategory", "id", "name"]}],
|
||||
["start_time", {"label": "Start Time", "type": "datetime", "validation": ""}],
|
||||
["end_time", {"label": "End Time", "type": "datetime", "validation": ""}],
|
||||
["project", {"label": "Project", "type": "select2", "allow-null":true,"null=label":"none","remote-source": ["Project", "id", "name"]}],
|
||||
["notes", {"label": "Notes", "type": "textarea", "validation": "none"}]
|
||||
];
|
||||
});
|
||||
|
||||
12
ext/admin/overtime/meta.json
Normal file
12
ext/admin/overtime/meta.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"label":"Overtime Administration",
|
||||
"menu":"Employees",
|
||||
"order":"94",
|
||||
"icon":"fa-align-center",
|
||||
"user_levels":["Admin","Manager"],
|
||||
"dashboardPosition":13,
|
||||
|
||||
"permissions":
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -3,17 +3,17 @@
|
||||
<div class="small-box bg-aqua">
|
||||
<div class="inner">
|
||||
<h3>
|
||||
Permission
|
||||
<t>Permission</t>
|
||||
</h3>
|
||||
<p>
|
||||
Management
|
||||
<t>Management</t>
|
||||
</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>
|
||||
<t>Manage</t> <t>Permissions</t> <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -28,7 +28,7 @@ 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="tabPermission" href="#tabPagePermission">Permissions</a></li>
|
||||
<li class="active"><a id="tabPermission" href="#tabPagePermission"><?=LanguageManager::tran('Permissions')?></a></li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
|
||||
@@ -69,5 +69,52 @@ if (!class_exists('Project')) {
|
||||
public function getUserAccess(){
|
||||
return array("get","element");
|
||||
}
|
||||
|
||||
public function getAllProjects(){
|
||||
$project = new Project();
|
||||
$projects = $project->Find("status = ?",'Active');
|
||||
foreach($projects as $project){
|
||||
$client = new Client();
|
||||
$client->Load("id = ?",array($project->client));
|
||||
|
||||
$project->name = $project->name." (".$client->name.")";
|
||||
$employeeProjects[] = $project;
|
||||
}
|
||||
return $employeeProjects;
|
||||
}
|
||||
|
||||
public function getEmployeeProjects(){
|
||||
$allowAllProjects = SettingsManager::getInstance()->getSetting("Projects: Make All Projects Available to Employees");
|
||||
$employeeProjects = array();
|
||||
if($allowAllProjects == 0){
|
||||
$employeeProjectsTemp = new EmployeeProject();
|
||||
$employeeProjectsTemp = $employeeProjectsTemp->Find("employee = ?",array(BaseService::getInstance()->getCurrentProfileId()));
|
||||
foreach($employeeProjectsTemp as $p){
|
||||
$project = new Project();
|
||||
$project->Load("id = ?",array($p->project));
|
||||
if($project->status == 'Active'){
|
||||
|
||||
$client = new Client();
|
||||
$client->Load("id = ?",array($project->client));
|
||||
|
||||
$project->name = $project->name." (".$client->name.")";
|
||||
$employeeProjects[] = $project;
|
||||
}
|
||||
|
||||
}
|
||||
}else{
|
||||
$project = new Project();
|
||||
$projects = $project->Find("status = ?",array('Active'));
|
||||
foreach($projects as $project){
|
||||
$client = new Client();
|
||||
$client->Load("id = ?",array($project->client));
|
||||
|
||||
$project->name = $project->name." (".$client->name.")";
|
||||
$employeeProjects[] = $project;
|
||||
}
|
||||
}
|
||||
|
||||
return $employeeProjects;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
|
||||
<div class="small-box bg-red">
|
||||
<div class="inner">
|
||||
<h3>Projects</h3>
|
||||
<h3><t>Projects</t></h3>
|
||||
<p id="numberOfProjects">
|
||||
#_numberOfProjects_# Active Projects
|
||||
#_numberOfProjects_# <t>Active Projects</t>
|
||||
</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>
|
||||
<t>Update Clients/Projects</t> <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -28,9 +28,9 @@ 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="tabClient" href="#tabPageClient">Clients</a></li>
|
||||
<li><a id="tabProject" href="#tabPageProject">Projects</a></li>
|
||||
<li><a id="tabEmployeeProject" href="#tabPageEmployeeProject">Employee Projects</a></li>
|
||||
<li class="active"><a id="tabClient" href="#tabPageClient"><?=LanguageManager::tran('Clients')?></a></li>
|
||||
<li><a id="tabProject" href="#tabPageProject"><?=LanguageManager::tran('Projects')?></a></li>
|
||||
<li><a id="tabEmployeeProject" href="#tabPageEmployeeProject"><?=LanguageManager::tran('Employee Projects')?></a></li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
|
||||
@@ -95,13 +95,14 @@ ProjectAdapter.method('getHeaders', function() {
|
||||
});
|
||||
|
||||
ProjectAdapter.method('getFormFields', function() {
|
||||
|
||||
if(this.showSave){
|
||||
return [
|
||||
[ "id", {"label":"ID","type":"hidden"}],
|
||||
[ "name", {"label":"Name","type":"text"}],
|
||||
[ "client", {"label":"Client","type":"select2","allow-null":true,"remote-source":["Client","id","name"]}],
|
||||
[ "details", {"label":"Details","type":"textarea","validation":"none"}],
|
||||
[ "status", {"label":"Status","type":"select","source":[["Active","Active"],["Inactive","Inactive"]]}]
|
||||
[ "status", {"label":"Status","type":"select","source":[["Active","Active"],["On Hold","On Hold"],["Completed","Completed"],["Dropped","Dropped"]]}]
|
||||
];
|
||||
}else{
|
||||
return [
|
||||
@@ -109,7 +110,7 @@ ProjectAdapter.method('getFormFields', function() {
|
||||
[ "name", {"label":"Name","type":"placeholder"}],
|
||||
[ "client", {"label":"Client","type":"placeholder","allow-null":true,"remote-source":["Client","id","name"]}],
|
||||
[ "details", {"label":"Details","type":"placeholder","validation":"none"}],
|
||||
[ "status", {"label":"Status","type":"placeholder","source":[["Active","Active"],["Inactive","Inactive"]]}]
|
||||
[ "status", {"label":"Status","type":"select","source":[["Active","Active"],["On Hold","On Hold"],["Completed","Completed"],["Dropped","Dropped"]]}]
|
||||
];
|
||||
}
|
||||
|
||||
@@ -137,8 +138,7 @@ EmployeeProjectAdapter.method('getDataMapping', function() {
|
||||
return [
|
||||
"id",
|
||||
"employee",
|
||||
"project",
|
||||
"status"
|
||||
"project"
|
||||
];
|
||||
});
|
||||
|
||||
@@ -146,9 +146,7 @@ EmployeeProjectAdapter.method('getHeaders', function() {
|
||||
return [
|
||||
{ "sTitle": "ID" ,"bVisible":false},
|
||||
{ "sTitle": "Employee" },
|
||||
{ "sTitle": "Project" },
|
||||
/*{ "sTitle": "Start Date"},*/
|
||||
{ "sTitle": "Status"}
|
||||
{ "sTitle": "Project" }
|
||||
];
|
||||
});
|
||||
|
||||
@@ -157,9 +155,6 @@ EmployeeProjectAdapter.method('getFormFields', function() {
|
||||
[ "id", {"label":"ID","type":"hidden"}],
|
||||
[ "employee", {"label":"Employee","type":"select2","remote-source":["Employee","id","first_name+last_name"]}],
|
||||
[ "project", {"label":"Project","type":"select2","remote-source":["Project","id","name"]}],
|
||||
/*[ "date_start", {"label":"Start Date","type":"date","validation":""}],
|
||||
[ "date_end", {"label":"End Date","type":"date","validation":"none"}],*/
|
||||
[ "status", {"label":"Status","type":"select","source":[["Current","Current"],["Inactive","Inactive"],["Completed","Completed"]]}],
|
||||
[ "details", {"label":"Details","type":"textarea","validation":"none"}]
|
||||
];
|
||||
});
|
||||
|
||||
@@ -28,10 +28,10 @@ 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="tabSkill" href="#tabPageSkill">Skills</a></li>
|
||||
<li><a id="tabEducation" href="#tabPageEducation">Education</a></li>
|
||||
<li><a id="tabCertification" href="#tabPageCertification">Certifications</a></li>
|
||||
<li><a id="tabLanguage" href="#tabPageLanguage">Languages</a></li>
|
||||
<li class="active"><a id="tabSkill" href="#tabPageSkill"><?=LanguageManager::tran('Skills')?></a></li>
|
||||
<li><a id="tabEducation" href="#tabPageEducation"><?=LanguageManager::tran('Education')?></a></li>
|
||||
<li><a id="tabCertification" href="#tabPageCertification"><?=LanguageManager::tran('Certifications')?></a></li>
|
||||
<li><a id="tabLanguage" href="#tabPageLanguage"><?=LanguageManager::tran('Languages')?></a></li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
@@ -61,10 +61,10 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
|
||||
</div>
|
||||
<div class="tab-pane" id="tabPageLanguage">
|
||||
<div id="Language" class="reviewBlock" data-content="List" style="padding-left:5px;">
|
||||
|
||||
|
||||
</div>
|
||||
<div id="LanguageForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
|
||||
<div class="small-box bg-teal">
|
||||
<div class="inner">
|
||||
<h3>Reports</h3>
|
||||
<h3><t>Reports</t></h3>
|
||||
<p>
|
||||
View / Download Reports
|
||||
<t>View / Download Reports</t>
|
||||
</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>
|
||||
<t>Generate a Report</t> <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -7,7 +7,7 @@ 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="tabReport" href="#tabPageReport">Reports</a></li>
|
||||
<li class="active"><a id="tabReport" href="#tabPageReport"><?=LanguageManager::tran('Reports')?></a></li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
@@ -30,10 +30,7 @@ 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'];
|
||||
|
||||
|
||||
@@ -10,15 +10,20 @@
|
||||
|
||||
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":""}],
|
||||
[ "parameters", {"label":"Parameters","type":"fieldset","validation":"none"}]
|
||||
];
|
||||
this._construct();
|
||||
}
|
||||
|
||||
ReportAdapter.inherits(AdapterBase);
|
||||
|
||||
ReportAdapter.method('_construct', function() {
|
||||
this._formFileds = [
|
||||
[ "id", {"label":"ID","type":"hidden"}],
|
||||
[ "name", {"label":"Name","type":"label","validation":""}],
|
||||
[ "parameters", {"label":"Parameters","type":"fieldset","validation":"none"}]
|
||||
];
|
||||
this.remoteFieldsExists = false;
|
||||
});
|
||||
|
||||
ReportAdapter.method('_initLocalFormFields', function() {
|
||||
this._formFileds = [
|
||||
[ "id", {"label":"ID","type":"hidden"}],
|
||||
@@ -27,9 +32,14 @@ ReportAdapter.method('_initLocalFormFields', function() {
|
||||
];
|
||||
});
|
||||
|
||||
ReportAdapter.method('setRemoteFieldExists', function(val) {
|
||||
this.remoteFieldsExists = val;
|
||||
});
|
||||
|
||||
ReportAdapter.method('getDataMapping', function() {
|
||||
return [
|
||||
"id",
|
||||
"icon",
|
||||
"name",
|
||||
"details",
|
||||
"parameters"
|
||||
@@ -39,12 +49,14 @@ ReportAdapter.method('getDataMapping', function() {
|
||||
ReportAdapter.method('getHeaders', function() {
|
||||
return [
|
||||
{ "sTitle": "ID" ,"bVisible":false},
|
||||
{ "sTitle": "Name" },
|
||||
{ "sTitle": "","bSortable":false,"sWidth":"22px"},
|
||||
{ "sTitle": "Name","sWidth":"30%"},
|
||||
{ "sTitle": "Details"},
|
||||
{ "sTitle": "Parameters","bVisible":false},
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
ReportAdapter.method('getFormFields', function() {
|
||||
return this._formFileds;
|
||||
});
|
||||
@@ -55,12 +67,16 @@ ReportAdapter.method('processFormFieldsWithObject', function(object) {
|
||||
var len = this._formFileds.length;
|
||||
var fieldIDsToDelete = [];
|
||||
var fieldsToDelete = [];
|
||||
this.remoteFieldsExists = false;
|
||||
for(var i=0;i<len;i++){
|
||||
if(this._formFileds[i][1]['type']=="fieldset"){
|
||||
var newFields = JSON.parse(object[this._formFileds[i][0]]);
|
||||
fieldsToDelete.push(this._formFileds[i][0]);
|
||||
newFields.forEach(function(entry) {
|
||||
that._formFileds.push(entry);
|
||||
if(entry[1]['remote-source'] != undefined && entry[1]['remote-source'] != null){
|
||||
that.remoteFieldsExists = true;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
@@ -76,14 +92,179 @@ ReportAdapter.method('processFormFieldsWithObject', function(object) {
|
||||
that._formFileds = tempArray;
|
||||
});
|
||||
|
||||
|
||||
ReportAdapter.method('renderForm', function(object) {
|
||||
var that = this;
|
||||
this.processFormFieldsWithObject(object);
|
||||
var cb = function(){
|
||||
that.uber('renderForm',object);
|
||||
};
|
||||
this.initFieldMasterData(cb);
|
||||
if(this.remoteFieldsExists){
|
||||
var cb = function(){
|
||||
that.renderFormNew(object);
|
||||
};
|
||||
this.initFieldMasterData(cb);
|
||||
}else{
|
||||
this.initFieldMasterData();
|
||||
that.renderFormNew(object);
|
||||
}
|
||||
|
||||
this.currentReport = object;
|
||||
|
||||
});
|
||||
|
||||
ReportAdapter.method('renderFormNew', function(object) {
|
||||
|
||||
var that = this;
|
||||
var signatureIds = [];
|
||||
if(object == null || object == undefined){
|
||||
this.currentId = null;
|
||||
}
|
||||
|
||||
this.preRenderForm(object);
|
||||
|
||||
var formHtml = this.templates['formTemplate'];
|
||||
var html = "";
|
||||
var fields = this.getFormFields();
|
||||
|
||||
for(var i=0;i<fields.length;i++){
|
||||
var metaField = this.getMetaFieldForRendering(fields[i][0]);
|
||||
if(metaField == "" || metaField == undefined){
|
||||
html += this.renderFormField(fields[i]);
|
||||
}else{
|
||||
var metaVal = object[metaField];
|
||||
if(metaVal != '' && metaVal != null && metaVal != undefined && metaVal.trim() != ''){
|
||||
html += this.renderFormField(JSON.parse(metaVal));
|
||||
}else{
|
||||
html += this.renderFormField(fields[i]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
formHtml = formHtml.replace(/_id_/g,this.getTableName()+"_submit");
|
||||
formHtml = formHtml.replace(/_fields_/g,html);
|
||||
|
||||
|
||||
var $tempDomObj;
|
||||
var randomFormId = this.generateRandom(14);
|
||||
if(!this.showFormOnPopup){
|
||||
$tempDomObj = $("#"+this.getTableName()+'Form');
|
||||
}else{
|
||||
$tempDomObj = $('<div class="reviewBlock popupForm" data-content="Form"></div>');
|
||||
$tempDomObj.attr('id',randomFormId);
|
||||
|
||||
}
|
||||
|
||||
$tempDomObj.html(formHtml);
|
||||
|
||||
|
||||
$tempDomObj.find('.datefield').datepicker({'viewMode':2});
|
||||
$tempDomObj.find('.timefield').datetimepicker({
|
||||
language: 'en',
|
||||
pickDate: false
|
||||
});
|
||||
$tempDomObj.find('.datetimefield').datetimepicker({
|
||||
language: 'en'
|
||||
});
|
||||
|
||||
$tempDomObj.find('.colorpick').colorpicker();
|
||||
|
||||
//$tempDomObj.find('.select2Field').select2();
|
||||
$tempDomObj.find('.select2Field').each(function() {
|
||||
$(this).select2().select2('val', $(this).find("option:eq(0)").val());
|
||||
|
||||
});
|
||||
|
||||
$tempDomObj.find('.select2Multi').each(function() {
|
||||
$(this).select2().on("change",function(e){
|
||||
var parentRow = $(this).parents(".row");
|
||||
var height = parentRow.find(".select2-choices").height();
|
||||
parentRow.height(parseInt(height));
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
$tempDomObj.find('.signatureField').each(function() {
|
||||
//$(this).data('signaturePad',new SignaturePad($(this)));
|
||||
signatureIds.push($(this).attr('id'));
|
||||
});
|
||||
|
||||
for(var i=0;i<fields.length;i++){
|
||||
if(fields[i][1].type == "datagroup"){
|
||||
$tempDomObj.find("#"+fields[i][0]).data('field',fields[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if(this.showSave == false){
|
||||
$tempDomObj.find('.saveBtn').remove();
|
||||
}else{
|
||||
$tempDomObj.find('.saveBtn').off();
|
||||
$tempDomObj.find('.saveBtn').data("modJs",this);
|
||||
$tempDomObj.find('.saveBtn').on( "click", function() {
|
||||
if($(this ).data('modJs').saveSuccessItemCallback != null && $(this ).data('modJs').saveSuccessItemCallback!= undefined){
|
||||
$(this ).data('modJs').save($(this ).data('modJs').retriveItemsAfterSave(), $(this ).data('modJs').saveSuccessItemCallback);
|
||||
}else{
|
||||
$(this ).data('modJs').save();
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
if(this.showCancel== false){
|
||||
$tempDomObj.find('.cancelBtn').remove();
|
||||
}else{
|
||||
$tempDomObj.find('.cancelBtn').off();
|
||||
$tempDomObj.find('.cancelBtn').data("modJs",this);
|
||||
$tempDomObj.find('.cancelBtn').on( "click", function() {
|
||||
$(this ).data('modJs').cancel();
|
||||
return false;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
if(!this.showFormOnPopup){
|
||||
$("#"+this.getTableName()+'Form').show();
|
||||
$("#"+this.getTableName()).hide();
|
||||
|
||||
for(var i=0;i<signatureIds.length;i++){
|
||||
$("#"+signatureIds[i])
|
||||
.data('signaturePad',
|
||||
new SignaturePad(document.getElementById(signatureIds[i])));
|
||||
|
||||
}
|
||||
|
||||
if(object != undefined && object != null){
|
||||
this.fillForm(object);
|
||||
}
|
||||
|
||||
}else{
|
||||
|
||||
|
||||
|
||||
//var tHtml = $tempDomObj.wrap('<div>').parent().html();
|
||||
//this.showMessage("Edit",tHtml,null,null,true);
|
||||
this.showMessage("Edit","",null,null,true);
|
||||
|
||||
$("#plainMessageModel .modal-body").html("");
|
||||
$("#plainMessageModel .modal-body").append($tempDomObj);
|
||||
|
||||
|
||||
for(var i=0;i<signatureIds.length;i++){
|
||||
$("#"+signatureIds[i])
|
||||
.data('signaturePad',
|
||||
new SignaturePad(document.getElementById(signatureIds[i])));
|
||||
|
||||
}
|
||||
|
||||
if(object != undefined && object != null){
|
||||
this.fillForm(object,"#"+randomFormId);
|
||||
}
|
||||
}
|
||||
|
||||
this.postRenderForm(object,$tempDomObj);
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
ReportAdapter.method('getActionButtonsHtml', function(id,data) {
|
||||
@@ -94,40 +275,48 @@ ReportAdapter.method('getActionButtonsHtml', function(id,data) {
|
||||
});
|
||||
|
||||
ReportAdapter.method('addSuccessCallBack', function(callBackData,serverData) {
|
||||
//var link = '<a href="'+this.getCustomActionUrl("download",{'file':serverData})+'" target="_blank">Download Report <i class="icon-download-alt"></i> </a>';
|
||||
//this.showMessage("Download Report",link);
|
||||
|
||||
var fileName = serverData[0];
|
||||
var link;
|
||||
|
||||
|
||||
if(fileName.indexOf("https:") == 0){
|
||||
link = '<a href="'+fileName+'" target="_blank" style="font-size:14px;font-weight:bold;">Download Report <img src="_BASE_images/download.png"></img> </a>';
|
||||
link = '<a href="'+fileName+'" target="_blank" style="font-size:14px;font-weight:bold;">Download Report <img src="_BASE_images/download.png"></img> </a>';
|
||||
}else{
|
||||
link = '<a href="'+modJs.getCustomActionUrl("download",{'file':fileName})+'" target="_blank" style="font-size:14px;font-weight:bold;">Download Report <img src="_BASE_images/download.png"></img> </a>';
|
||||
}
|
||||
link = link.replace(/_BASE_/g,this.baseUrl);
|
||||
|
||||
var tableHtml = link+'<br/><br/><div class="box-body table-responsive" style="overflow-x:scroll;padding: 5px;border: solid 1px #DDD;"><table id="tempReportTable" cellpadding="0" cellspacing="0" border="0" class="table table-bordered table-striped"></table></div>';
|
||||
|
||||
//Delete existing temp report table
|
||||
$("#tempReportTable").remove();
|
||||
|
||||
//this.showMessage("Report",tableHtml);
|
||||
|
||||
$("#Report").html(tableHtml);
|
||||
$("#Report").show();
|
||||
$("#ReportForm").hide();
|
||||
|
||||
//Prepare headers
|
||||
var headers = [];
|
||||
for(title in serverData[1]){
|
||||
headers.push({ "sTitle": serverData[1][title]});
|
||||
}
|
||||
|
||||
var data = serverData[2];
|
||||
|
||||
|
||||
var dataTableParams = {
|
||||
if(this.currentReport.output == "PDF"){
|
||||
|
||||
this.showMessage("Download Report",link);
|
||||
|
||||
}else{
|
||||
if(serverData[1].length == 0){
|
||||
this.showMessage("Empty Report","There were no data for selected filters");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var tableHtml = link+'<br/><br/><div class="box-body table-responsive" style="overflow-x:scroll;padding: 5px;border: solid 1px #DDD;"><table id="tempReportTable" cellpadding="0" cellspacing="0" border="0" class="table table-bordered table-striped"></table></div>';
|
||||
|
||||
//Delete existing temp report table
|
||||
$("#tempReportTable").remove();
|
||||
|
||||
//this.showMessage("Report",tableHtml);
|
||||
|
||||
$("#"+this.table).html(tableHtml);
|
||||
$("#"+this.table).show();
|
||||
$("#"+this.table+"Form").hide();
|
||||
|
||||
//Prepare headers
|
||||
var headers = [];
|
||||
for(title in serverData[1]){
|
||||
headers.push({ "sTitle": serverData[1][title]});
|
||||
}
|
||||
|
||||
var data = serverData[2];
|
||||
|
||||
|
||||
var dataTableParams = {
|
||||
"oLanguage": {
|
||||
"sLengthMenu": "_MENU_ records per page"
|
||||
},
|
||||
@@ -137,17 +326,21 @@ ReportAdapter.method('addSuccessCallBack', function(callBackData,serverData) {
|
||||
"iDisplayLength": 15,
|
||||
"iDisplayStart": 0
|
||||
};
|
||||
|
||||
$("#tempReportTable").dataTable( dataTableParams );
|
||||
|
||||
$(".dataTables_paginate ul").addClass("pagination");
|
||||
$(".dataTables_length").hide();
|
||||
$(".dataTables_filter input").addClass("form-control");
|
||||
$(".dataTables_filter input").attr("placeholder","Search");
|
||||
$(".dataTables_filter label").contents().filter(function(){
|
||||
return (this.nodeType == 3);
|
||||
}).remove();
|
||||
$('.tableActionButton').tooltip();
|
||||
|
||||
$("#tempReportTable").dataTable( dataTableParams );
|
||||
|
||||
$(".dataTables_paginate ul").addClass("pagination");
|
||||
$(".dataTables_length").hide();
|
||||
$(".dataTables_filter input").addClass("form-control");
|
||||
$(".dataTables_filter input").attr("placeholder","Search");
|
||||
$(".dataTables_filter label").contents().filter(function(){
|
||||
return (this.nodeType == 3);
|
||||
}).remove();
|
||||
$('.tableActionButton').tooltip();
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -201,4 +394,3 @@ ReportGenAdapter.method('getActionButtonsHtml', function(id,data) {
|
||||
html = html.replace(/_BASE_/g,this.baseUrl);
|
||||
return html;
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"label":"Reports",
|
||||
"menu":"Reports",
|
||||
"menu":"Admin Reports",
|
||||
"order":"1",
|
||||
"icon":"fa-file-o",
|
||||
"user_levels":["Admin","Manager"],
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
if(!class_exists('ReportBuilder')){
|
||||
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilder.php';
|
||||
}
|
||||
class ActiveEmployeeReport extends ReportBuilder{
|
||||
class ActiveEmployeeReport extends CSVReportBuilder implements CSVReportBuilderInterface{
|
||||
|
||||
public function getMainQuery(){
|
||||
$query = "Select id, employee_id as 'Employee ID',
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user