Compare commits

..

42 Commits

Author SHA1 Message Date
Gamonoid
27779782fc Merge branch 'master' into v19.x 2016-12-14 12:52:08 +01:00
Gamonoid
04bafeec81 Merge branch 'v19.x' of https://github.com/gamonoid/icehrm into v19.x 2016-12-14 12:41:57 +01:00
Gamonoid
cc1ac5a75e fix dashboard error 2016-12-14 12:38:51 +01:00
Gamonoid
7528e5eabd Check updates 2016-12-06 18:14:19 +01:00
Gamonoid
ef72f8daa3 No need to have an extended login 2016-12-06 17:39:20 +01:00
Thilina Hasantha
967c69b04e Fix typo 2016-12-06 00:48:16 +01:00
Thilina Hasantha
a2a23a2bb4 Merge branch 'v19.x' 2016-12-05 23:43:13 +01:00
Thilina Hasantha
d022651a24 Fix https url installation issue 2016-12-05 23:42:29 +01:00
icehrm
a619f76b3a v19.0.OS (#35)
* Updates from pro v19

* Update travis

* Update db script

* Update docs

* change build script
2016-12-05 16:22:47 +01:00
Thilina Hasantha
9f0626c1f7 change build 2016-11-29 09:26:47 +01:00
Thilina Hasantha
ec85cfa521 Update ready 2016-11-29 00:19:56 +01:00
Thilina Hasantha
b15e432756 Update docs 2016-11-29 00:18:32 +01:00
Gamonoid
1b7bea571f Update db script 2016-11-28 16:45:05 +01:00
Gamonoid
1f60c4b217 Update travis 2016-11-25 17:27:24 +01:00
Gamonoid
ed739aa4e1 Updates from pro v19 2016-11-25 17:21:30 +01:00
Gamonoid
e6b4245334 Updates from pro v19 2016-11-25 17:20:39 +01:00
Gamonoid
4c171bfce3 PHP unit for build 2016-11-25 16:19:16 +01:00
Gamonoid
3bb3f038bf Approval Manager tester added 2016-11-25 16:15:41 +01:00
Gamonoid
4f6cdd98f8 add travis status 2016-11-25 15:06:29 +01:00
Gamonoid
81f7a97096 Fix travis-ci builds 2016-11-25 15:01:44 +01:00
Gamonoid
ab2a0293a6 fix travis-ci build path 2016-11-25 14:56:13 +01:00
Gamonoid
283ef1e377 fix travis-ci build path 2016-11-25 14:54:16 +01:00
Gamonoid
55f8ae364f fix travis-ci build path 2016-11-25 14:49:40 +01:00
Gamonoid
564ce43c18 fix travis-ci build path 2016-11-25 14:36:21 +01:00
Gamonoid
bd9e5acd65 fix travis-ci build path 2016-11-25 14:31:55 +01:00
Gamonoid
a4a38a1869 add ant buid 2016-11-25 14:29:23 +01:00
Gamonoid
e1aa2c1365 add ant buid 2016-11-25 14:09:17 +01:00
Gamonoid
b1bfd2f39d add ant buid 2016-11-25 14:05:58 +01:00
Gamonoid
4c3f27914b add ant buid 2016-11-25 14:04:02 +01:00
Gamonoid
214ab89ce8 add ant buid 2016-11-25 13:57:38 +01:00
Gamonoid
9348be0acd Add vagrant machine, new test and travis-ci config 2016-11-25 13:53:36 +01:00
Gamonoid
21c5d09bac Adding src dir 2016-11-25 11:39:25 +01:00
Thilina Hasantha
13085bcecc Remove submodule 2016-11-25 11:15:11 +01:00
Thilina Hasantha
9271156708 Adding sub module 2016-10-04 03:40:11 +02:00
Thilina Hasantha
6ac1320f6a no message 2016-10-04 03:28:35 +02:00
Thilina Hasantha
dcfc009938 Remove sub module 2016-10-04 03:23:36 +02:00
Thilina Hasantha
b9ba064dbb Adding isotope core submodule 2016-10-04 02:59:41 +02:00
Thilina Hasantha
f78f5592d3 Fix dashboard translations 2016-08-06 02:37:26 +05:30
Thilina Hasantha
d9f0d52eed Fix upgrade script 2016-08-05 13:37:56 +05:30
Thilina Hasantha
fb8e970f7e Update read me 2016-08-05 13:11:11 +05:30
Thilina Hasantha
e78331f5b3 Update readme 2016-08-05 09:43:37 +05:30
Thilina Hasantha
9e415d589e Update read 2016-08-05 09:42:02 +05:30
2759 changed files with 233918 additions and 70795 deletions

7
.gitignore vendored
View File

@@ -1,5 +1,8 @@
/.settings /.settings
/.buildpath /.buildpath
/.project /.project
/.idea /.idea/
build /build
/deployment/clients/dev/data/
/deployment/clients/test/data/
/.vagrant

13
.travis.yml Normal file
View 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
View 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

View File

@@ -3,6 +3,7 @@
<!-- By default, we assume all tools to be on the $PATH --> <!-- By default, we assume all tools to be on the $PATH -->
<property name="toolsdir" value=""/> <property name="toolsdir" value=""/>
<property name="destination" value="${basedir}/build/app"/> <property name="destination" value="${basedir}/build/app"/>
<property name="testdir" value="${basedir}/build/test"/>
<property name="origin" value="${basedir}/src"/> <property name="origin" value="${basedir}/src"/>
<property environment="env"/> <property environment="env"/>
<property name="env.appname" value="icehrm"/> <property name="env.appname" value="icehrm"/>
@@ -11,13 +12,21 @@
<property name="installLocalpath" value="/Applications/XAMPP/xamppfiles/htdocs/icehrm-open-core"/> <property name="installLocalpath" value="/Applications/XAMPP/xamppfiles/htdocs/icehrm-open-core"/>
<target name="build" <target name="build"
depends="prepare,lint,copyapp,release,install" depends="prepare,lint,copyapp,phpunit,release,install"
description=""/> description=""/>
<target name="buildlocal" <target name="buildlocal"
depends="prepare,copyapp,installLocal" depends="prepare,copyapp"
description=""/> description=""/>
<target name="releaseapp"
depends="prepare,lint,copyapp,phpunit,release"
description=""/>
<target name="ice"
depends="copyapp_quick"
description=""/>
<target name="clean" <target name="clean"
unless="clean.done" unless="clean.done"
@@ -181,22 +190,54 @@
<exec executable="${toolsdir}phpdox"/> <exec executable="${toolsdir}phpdox"/>
</target> </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" <target name="copyapp"
description="Copy generated files to QA app"> description="Copy generated files to QA app">
<delete includeemptydirs="true"> <delete includeemptydirs="true">
<fileset dir="${destination}"> <fileset dir="${destination}">
<include name="**/*"/> <include name="**/*"/>
</fileset> </fileset>
</delete> </delete>
<copy todir="${destination}" overwrite="true"> <copy todir="${destination}" overwrite="true">
<fileset dir="${origin}"> <fileset dir="${origin}">
<include name="**/*"/> <include name="**/*"/>
</fileset> </fileset>
</copy> </copy>
<copy todir="${destination}/lib" overwrite="true"> <copy todir="${destination}/lib" overwrite="true">
<fileset dir="${basedir}/lib"> <fileset dir="${basedir}/lib">
@@ -216,6 +257,12 @@
</fileset> </fileset>
</copy> </copy>
<copy todir="${testdir}" overwrite="true">
<fileset dir="${basedir}/test">
<include name="**/*"/>
</fileset>
</copy>
</target> </target>
<target name="install" <target name="install"

0
config/database.yml Normal file
View File

View 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';?>

View File

@@ -0,0 +1 @@
init log

View File

@@ -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('FB_URL')){define('FB_URL', 'https://www.facebook.com/icehrm');};
if(!defined('TWITTER_URL')){define('TWITTER_URL', 'https://twitter.com/icehrmapp');}; 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"); if(defined('CLIENT_BASE_URL')) {
define('HOME_LINK_OTHERS', CLIENT_BASE_URL."?g=modules&n=dashboard&m=module_Personal_Information"); 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 //Version
define('VERSION', '18.0.OS'); define('VERSION', '19.0.OS');
define('CACHE_VALUE', '18.0.OS'); define('CACHE_VALUE', '19.0.OS');
define('VERSION_DATE', '04/08/2016'); define('VERSION_NUMBER', '190');
define('VERSION_DATE', '19/11/2016');
if(!defined('CONTACT_EMAIL')){define('CONTACT_EMAIL','icehrm@gamonoid.com');} if(!defined('CONTACT_EMAIL')){define('CONTACT_EMAIL','icehrm@gamonoid.com');}
if(!defined('KEY_PREFIX')){define('KEY_PREFIX','IceHrm');} if(!defined('KEY_PREFIX')){define('KEY_PREFIX','IceHrm');}
@@ -26,3 +29,7 @@ define('MEMCACHE_PORT', '11211');
if(!defined('WK_HTML_PATH')){ if(!defined('WK_HTML_PATH')){
define('WK_HTML_PATH', '/usr/bin/wkhtmltopdf'); 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&');

View File

@@ -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
View 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
View 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"

View File

@@ -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&nbsp;&nbsp;<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&nbsp;&nbsp;<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&nbsp;&nbsp;<span class="icon-arrow-right"></span></button>
</fieldset>
</form>
<?php }?>
</div>
</div>
</div>
</div> <!-- /container -->
</body>
</html>

View File

@@ -18,9 +18,9 @@ class ICEHRM_Record extends ADOdb_Active_Record{
return array("get","element","save","delete"); return array("get","element","save","delete");
} }
public function getOtherAccess(){ public function getOtherAccess(){
return array("get","element","save","delete"); return array("get","element","save","delete");
} }
public function getManagerAccess(){ public function getManagerAccess(){
return array("get","element"); return array("get","element");
@@ -70,22 +70,22 @@ class ICEHRM_Record extends ADOdb_Active_Record{
} }
public function postProcessGetData($obj){ public function postProcessGetData($obj){
return $obj; return $obj;
} }
public function postProcessGetElement($obj){ public function postProcessGetElement($obj){
return $obj; return $obj;
} }
public function getDefaultAccessLevel(){ public function getDefaultAccessLevel(){
return array("get","element","save","delete"); return array("get","element","save","delete");
} }
public function getVirtualFields(){ public function getVirtualFields(){
return array( return array(
); );
} }
public function allowIndirectMapping(){ public function allowIndirectMapping(){
return false; return false;

View File

@@ -1,54 +1,54 @@
<!-- Delete Modal --> <!-- Delete Modal -->
<div class="modal fade" id="deleteModel" tabindex="-1" role="dialog" aria-labelledby="deleteModelLabel" aria-hidden="true"> <div class="modal fade" id="deleteModel" tabindex="-1" role="dialog" aria-labelledby="deleteModelLabel" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-times"/></button> <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> <h3 id="deleteModelLabel" style="font-size: 17px;"></h3>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<p id="deleteModelBody"></p> <p id="deleteModelBody"></p>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button class="btn" onclick="modJs.cancelDelete();">Cancel</button> <button class="btn" onclick="modJs.cancelDelete();">Cancel</button>
<button class="btn btn-primary" onclick="modJs.confirmDelete();">Delete</button> <button class="btn btn-primary" onclick="modJs.confirmDelete();">Delete</button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- Delete Modal --> <!-- Delete Modal -->
<!-- Message Modal --> <!-- Message Modal -->
<div class="modal fade" id="messageModel" tabindex="-1" role="dialog" aria-labelledby="messageModelLabel" aria-hidden="true"> <div class="modal fade" id="messageModel" tabindex="-1" role="dialog" aria-labelledby="messageModelLabel" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-times"/></button> <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> <h3 id="messageModelLabel" style="font-size: 17px;"></h3>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<p id="messageModelBody"></p> <p id="messageModelBody"></p>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button class="btn" onclick="modJs.closeMessage();">Ok</button> <button class="btn" onclick="modJs.closeMessage();">Ok</button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- Message Modal --> <!-- Message Modal -->
<!-- Plain Message Modal --> <!-- Plain Message Modal -->
<div class="modal fade" id="plainMessageModel" tabindex="-1" role="dialog" aria-labelledby="plainMessageModelLabel" aria-hidden="true"> <div class="modal fade" id="plainMessageModel" tabindex="-1" role="dialog" aria-labelledby="plainMessageModelLabel" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header" style="border-bottom:none;/*background-color: #3c8dbc;*/"> <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> <button type="button" class="close" data-dismiss="modal" aria-hidden="true" style="margin-top:-10px;"><li class="fa fa-times"/></button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<p id="plainMessageModelBody"></p> <p id="plainMessageModelBody"></p>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- Plain Message Modal --> <!-- Plain Message Modal -->
@@ -89,62 +89,62 @@
<!-- Upload Modal --> <!-- Upload Modal -->
<div class="modal fade" id="uploadModel" tabindex="-1" role="dialog" aria-hidden="true"> <div class="modal fade" id="uploadModel" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-times"/></button> <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> <h3 id="uploadModelLabel" style="font-size: 17px;"></h3>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<p id="uploadModelBody"></p> <p id="uploadModelBody"></p>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button class="btn" onclick="$('#uploadModel').modal('hide');">Cancel</button> <button class="btn" onclick="$('#uploadModel').modal('hide');">Cancel</button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- Upload Modal --> <!-- Upload Modal -->
<!-- Message Modal --> <!-- Message Modal -->
<div class="modal fade" id="verifyModel" tabindex="-1" role="dialog" aria-labelledby="verifyModelLabel" aria-hidden="true"> <div class="modal fade" id="verifyModel" tabindex="-1" role="dialog" aria-labelledby="verifyModelLabel" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-times"/></button> <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> <h3 id="verifyModelLabel" style="font-size: 17px;"></h3>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<p id="verifyModelBody"> <p id="verifyModelBody">
<b>Step 1:</b><br/> <b>Step 1:</b><br/>
Please get your Instance Key from here:<br/> Please get your Instance Key from here:<br/>
<a target="_blank" href="https://icehrm.com/generateInstanceKey.php?id=<?=$baseService->getInstanceId()?>"> <a target="_blank" href="https://icehrm.com/generateInstanceKey.php?id=<?=$baseService->getInstanceId()?>">
https://icehrm.com/generateInstanceKey.php?id=<?=$baseService->getInstanceId()?> https://icehrm.com/generateInstanceKey.php?id=<?=$baseService->getInstanceId()?>
</a> </a>
<br/><b>Step 2:</b><br/> <br/><b>Step 2:</b><br/>
Enter the key you generated in step 1 here and click "Verify"<br/> Enter the key you generated in step 1 here and click "Verify"<br/>
<form role="form"> <form role="form">
<div class="row"> <div class="row">
<label class="col-sm-12 control-label" for="verificationKey">Verification Key</label> <label class="col-sm-12 control-label" for="verificationKey">Verification Key</label>
<div class="controls col-sm-12"> <div class="controls col-sm-12">
<input class="form-control" type="text" id="verificationKey" name="verificationKey" value=""/> <input class="form-control" type="text" id="verificationKey" name="verificationKey" value=""/>
</div> </div>
</div> </div>
<br/><br/> <br/><br/>
<div class="control-group row"> <div class="control-group row">
<div class="controls col-sm-12"> <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="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> <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>
<div class="controls col-sm-3"> <div class="controls col-sm-3">
</div> </div>
</div> </div>
</div> </div>
</form> </form>
</p> </p>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- Message Modal --> <!-- Message Modal -->

61
core-ext/raml/api.raml Normal file
View 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

View File

@@ -0,0 +1 @@
Admin users of icehrm can find the access token under System->Settings

View 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 |

View 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
}

View 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"
}

View 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"
}
]

View 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"
]
}

View 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"
]
}

View 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"
]
}
}

View 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"
]
}

File diff suppressed because one or more lines are too long

View File

@@ -40,7 +40,26 @@ 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), (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), (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), (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 = 2, indirect_supervisors = '[3,4]', approver1 = 5, approver2 = 6, approver3 = 7 where id = 1;
@@ -150,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); (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 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 INSERT INTO `EmployeeDocuments` (`id`,`employee`, `document`, `date_added`, `valid_until`, `status`, `details`, `attachment`, `expire_notification_last`) VALUES
@@ -201,39 +220,8 @@ INSERT INTO `Attendance` (`employee`,`in_time`,`out_time`,`note`) VALUES
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 23 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 23 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''), (3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 23 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 23 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''); (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 `PayslipTemplates` (`id`, `name`, `data`, `status`, `created`, `updated`) VALUES
(1, 'Basic', '[{"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":"","text":"","fontSize":"Normal","fontStyle":"Normal","fontColor":"","status":"Show","id":"data_3"},{"type":"Payroll Column","payrollColumn":"6","label":"","text":"","fontSize":"Normal","fontStyle":"Normal","fontColor":"","status":"Show","id":"data_4"},{"type":"Payroll Column","payrollColumn":"17","label":"","text":"","fontSize":"Normal","fontStyle":"Normal","fontColor":"","status":"Show","id":"data_5"},{"type":"Separators","payrollColumn":"NULL","label":"","text":"","fontSize":"Normal","fontStyle":"Normal","fontColor":"","status":"Show","id":"data_9"},{"type":"Payroll Column","payrollColumn":"18","label":"","text":"","fontSize":"Normal","fontStyle":"Normal","fontColor":"","status":"Show","id":"data_6"},{"type":"Separators","payrollColumn":"NULL","label":"","text":"","fontSize":"Normal","fontStyle":"Normal","fontColor":"","status":"Show","id":"data_10"},{"type":"Text","payrollColumn":"NULL","label":"","text":"Big Company Ltd. is a limited company registered in England and Wales. Registered number: 1234567. Registered office: 123 Some Street, Somewhere, Someshire.","fontSize":"Normal","fontStyle":"Normal","fontColor":"","status":"Show","id":"data_7"}]', NULL, '2016-06-30 03:37:12', '2016-06-30 03:37:12');
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', 1),
(2,'2016-03-Weekly',2,1,2,'[\"1\",\"2\",\"3\"]','2016-03-01','2016-03-31','Draft', 1);
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 INSERT INTO `PayrollEmployees` VALUES
(1,1,4,151,'[]','[]',1), (1,1,4,151,'[]','[]',1),

File diff suppressed because it is too large Load Diff

View File

@@ -472,10 +472,11 @@ INSERT INTO `SupportedLanguages` (`name`, `description`) VALUES
('es', 'Spanish'); ('es', 'Spanish');
Alter table `Users` add column varchar(100) default null; Alter table `Users` add column `lang` bigint(20) default null;
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES 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"]}]'); ('System: Language', 'en', 'Current Language','["value", {"label":"Value","type":"select2","allow-null":false,"remote-source":["SupportedLanguage","name","description"]}]');

View 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;

View 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);

View File

@@ -0,0 +1,7 @@
<?php
if(php_sapi_name() != 'cli'){
exit();
}
include ('config.php');
include (APP_BASE_PATH.'crons/cron.php');

View File

@@ -0,0 +1,3 @@
<?php
include ('config.php');
include (APP_BASE_PATH.'data.php');

View File

@@ -0,0 +1 @@
Test File

View 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();
}

View File

@@ -0,0 +1,3 @@
<?php
include ('config.php');
include (APP_BASE_PATH.'fileupload.php');

View File

@@ -0,0 +1,3 @@
<?php
include ('config.php');
include (APP_BASE_PATH.'fileupload_page.php');

View File

@@ -0,0 +1,3 @@
<?php
include (APP_BASE_PATH.'header.php');

View 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();
}

View File

@@ -0,0 +1,3 @@
<?php
include ('config.php');
include (APP_BASE_PATH.'login.php');

View File

@@ -0,0 +1,3 @@
<?php
include ('config.php');
include (APP_BASE_PATH.'logout.php');

View File

@@ -0,0 +1,3 @@
<?php
include ('config.php');
include (APP_BASE_PATH.'rest.php');

View File

@@ -0,0 +1,3 @@
<?php
include ('config.php');
include (APP_BASE_PATH.'service.php');

View 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();
}

View 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);

View File

@@ -0,0 +1,7 @@
<?php
if(php_sapi_name() != 'cli'){
exit();
}
include ('config.php');
include (APP_BASE_PATH.'crons/cron.php');

View File

@@ -0,0 +1,3 @@
<?php
include ('config.php');
include (APP_BASE_PATH.'data.php');

View File

@@ -0,0 +1 @@
Test File

View 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();
}

View File

@@ -0,0 +1,3 @@
<?php
include ('config.php');
include (APP_BASE_PATH.'fileupload.php');

View File

@@ -0,0 +1,3 @@
<?php
include ('config.php');
include (APP_BASE_PATH.'fileupload_page.php');

View File

@@ -0,0 +1,3 @@
<?php
include (APP_BASE_PATH.'header.php');

View 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();
}

View File

@@ -0,0 +1,3 @@
<?php
include ('config.php');
include (APP_BASE_PATH.'login.php');

View File

@@ -0,0 +1,3 @@
<?php
include ('config.php');
include (APP_BASE_PATH.'logout.php');

View File

@@ -0,0 +1,3 @@
<?php
include ('config.php');
include (APP_BASE_PATH.'rest.php');

View File

@@ -0,0 +1,3 @@
<?php
include ('config.php');
include (APP_BASE_PATH.'service.php');

View 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();
}

View File

@@ -25,74 +25,68 @@ $moduleName = 'dashboard';
define('MODULE_PATH',dirname(__FILE__)); define('MODULE_PATH',dirname(__FILE__));
include APP_BASE_PATH.'header.php'; include APP_BASE_PATH.'header.php';
include APP_BASE_PATH.'modulejslibs.inc.php'; include APP_BASE_PATH.'modulejslibs.inc.php';
?><div class="span9"> ?><div class="span9">
<div class="row"> <div class="row">
<?php <?php
$moduleManagers = BaseService::getInstance()->getModuleManagers(); $moduleManagers = BaseService::getInstance()->getModuleManagers();
$dashBoardList = array(); $dashBoardList = array();
foreach($moduleManagers as $moduleManagerObj){ foreach($moduleManagers as $moduleManagerObj){
//Check if this is not an admin module //Check if this is not an admin module
if($moduleManagerObj->getModuleType() != 'admin'){ if($moduleManagerObj->getModuleType() != 'admin'){
continue; continue;
}
$allowed = BaseService::getInstance()->isModuleAllowedForUser($moduleManagerObj);
if(!$allowed){
continue;
}
$item = $moduleManagerObj->getDashboardItem();
if(!empty($item)) {
$index = $moduleManagerObj->getDashboardItemIndex();
$dashBoardList[$index] = $item;
}
} }
ksort($dashBoardList); $allowed = BaseService::getInstance()->isModuleAllowedForUser($moduleManagerObj);
foreach($dashBoardList as $k=>$v){ if(!$allowed){
echo $v; 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> $item = $moduleManagerObj->getDashboardItem();
<br/> if(!empty($item)) {
<br/> $index = $moduleManagerObj->getDashboardItemIndex();
<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> $dashBoardList[$index] = $item;
</p> }
</div> }
</div>
ksort($dashBoardList);
foreach($dashBoardList as $k=>$v){
echo LanguageManager::translateTnrText($v);
}
?>
</div>
</div> </div>
<script> <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 { $("#employeeLink").attr("href",modJs.getCustomUrl('?g=admin&n=employees&m=admin_Admin'));
$.ajax({ $("#companyLink").attr("href",modJs.getCustomUrl('?g=admin&n=company_structure&m=admin_Admin'));
url: "https://icehrm-public.s3.amazonaws.com/icehrmnews.html", $("#usersLink").attr("href",modJs.getCustomUrl('?g=admin&n=users&m=admin_System'));
success: function (result) { $("#projectsLink").attr("href",modJs.getCustomUrl('?g=admin&n=projects&m=admin_Admin'));
$('#iceannon').html(result); $("#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'));
} catch (e) { $("#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> </script>
<?php include APP_BASE_PATH.'footer.php';?> <?php include APP_BASE_PATH.'footer.php';?>

View File

@@ -102,12 +102,13 @@ class EmployeesActionManager extends SubActionManager{
$ok = $archived->Save(); $ok = $archived->Save();
if(!$ok){ 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(); $ok = $employee->Delete();
if(!$ok){ 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); return new IceResponse(IceResponse::SUCCESS, $archived);

View File

@@ -16,10 +16,6 @@ if (!class_exists('EmployeesAdminManager')) {
$empRestEndPoint->process('get',$pathParams); $empRestEndPoint->process('get',$pathParams);
}); });
\NoahBuscher\Macaw\Macaw::get(REST_API_PATH.'employees', function() {
$empRestEndPoint = new EmployeesRestEndPoint();
$empRestEndPoint->process('get',NULL);
});
} }
public function initializeDatabaseErrorMappings(){ public function initializeDatabaseErrorMappings(){
@@ -231,11 +227,11 @@ if (!class_exists('Employee')) {
} }
public static function cleanEmployeeData($obj){ public static function cleanEmployeeData($obj){
unset($obj->keysToIgnore);
unset($obj->historyFieldsToTrack); unset($obj->historyFieldsToTrack);
unset($obj->historyUpdateList); unset($obj->historyUpdateList);
unset($obj->oldObjOrig); unset($obj->oldObjOrig);
unset($obj->oldObj); unset($obj->oldObj);
unset($obj->oldObj);
return $obj; return $obj;
} }
@@ -312,48 +308,39 @@ if (!class_exists('EmployeeApproval')) {
if (!class_exists('EmployeeRestEndPoint')) { if (!class_exists('EmployeeRestEndPoint')) {
class EmployeeRestEndPoint extends RestEndPoint{ class EmployeeRestEndPoint extends RestEndPoint{
public function get($parameter){ public function get($parameter){
if(empty($parameter)){ if(empty($parameter)){
return new IceResponse(IceResponse::ERROR, "Employee ID not provided"); return new IceResponse(IceResponse::ERROR, "Employee ID not provided");
} }
$accessTokenValidation = $this->validateAccessToken(); if($parameter === 'list'){
if($accessTokenValidation->getStatus() == IceResponse::ERROR){ $emp = new Employee();
return $accessTokenValidation; $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);
}
}
}

View File

@@ -7,27 +7,27 @@
</div> </div>
</div> </div>
<div class="col-xs-12 col-md-10"> <div class="col-xs-12 col-md-10">
<div class="row-fluid"> <div class="row-fluid">
<div class="col-md-12"><h2 id="name"></h2></div> <div class="col-md-12"><h2 id="name"></h2></div>
</div> </div>
<div class="row-fluid"> <div class="row-fluid">
<div class="col-md-12"> <div class="col-md-12">
<p> <p>
<i class="fa fa-phone"></i> <span id="mobile_phone"></span>&nbsp;&nbsp; <i class="fa fa-phone"></i> <span id="mobile_phone"></span>&nbsp;&nbsp;
<i class="fa fa-envelope"></i> <span id="work_email"></span> <i class="fa fa-envelope"></i> <span id="work_email"></span>
</p> </p>
</div> </div>
</div> </div>
<div class="row-fluid"> <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="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="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="employeeUploadProfileImage" onclick="showUploadDialog('profile_image__id_','Upload Profile Image','profile_image',_id_,'profile_image__id_','src','url','image');return false;" class="btn btn-small btn-primary" type="button" style="margin-right:10px;"><i class="fa fa-upload"></i> Upload Profile Image</button>
<button id="employeeDeleteProfileImage" onclick="modJs.deleteProfileImage(_id_);return false;" class="btn btn-small btn-warning" type="button" style="margin-right:10px;"><i class="fa fa-times"></i> Delete Profile Image</button> <button id="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> </div>
<div class="row-fluid" style="border-top: 1px;"> <div class="row-fluid" style="border-top: 1px;">
<div class="col-xs-6 col-md-4" style="font-size:16px;"> <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" 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> <label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="employee_id"></label>
@@ -41,18 +41,19 @@
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="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>
</div> </div>
<ul class="nav nav-tabs" id="subModTab" style="margin-bottom:0px;margin-left:5px;border-bottom: none;"> <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="active"><a id="tabBasic" href="#tabPageBasic">Basic Information</a></li>
<li class=""><a id="tabQualifications" href="#tabPageQualifications">Qualifications</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> <li class=""><a id="tabDocuments" href="#tabPageDocuments">Documents</a></li>
</ul> </ul>
<div class="tab-content"> <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="row" style="margin-left:10px;margin-top:20px;">
<div class="panel panel-default" style="width:97.5%;"> <div class="panel panel-default" style="width:97.5%;">
<div class="panel-heading"><h4>Personal Information</h4></div> <div class="panel-heading"><h4>Personal Information</h4></div>
@@ -202,31 +203,45 @@
</div> </div>
</div> </div>
</div><!-- End tabPageBasic --> </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="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 id="EmployeeSkillSubTab" class="" data-content="List" style="padding-left:5px;">
</div> </div>
</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 id="EmployeeEducationSubTab" class="" data-content="List" style="padding-left:5px;">
</div> </div>
</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 id="EmployeeCertificationSubTab" class="" data-content="List" style="padding-left:5px;">
</div> </div>
</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 id="EmployeeLanguageSubTab" class="" data-content="List" style="padding-left:5px;">
</div> </div>
</div> </div>
</div><!-- End tabPageQualifications --> </div><!-- End tabPageQualifications -->
</div> </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="row" style="margin-top:20px;">
<div class="col-md-12"> <div class="col-md-12">
<div id="EmployeeDocumentSubTab" class="" data-content="List" style="padding-left:5px;"> <div id="EmployeeDocumentSubTab" class="" data-content="List" style="padding-left:5px;">

View File

@@ -197,6 +197,9 @@ EmployeeAdapter.method('getFormFields', function() {
[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"]}], [ "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"]}], [ "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"]}], [ "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", [ "notes", {"label":"Notes","type":"datagroup",
"form":[ "form":[
[ "note", {"label":"Note","type":"textarea","validation":""}] [ "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); html = html.replace(/_id_/g,data.id);
$("#"+this.getTableName()).html(html); $("#"+this.getTableName()).html(html);
@@ -506,6 +509,12 @@ EmployeeAdapter.method('renderEmployee', function(data) {
modJs.subModJsList['tabEmployeeLanguageSubTab'] = new EmployeeSubLanguageAdapter('EmployeeLanguage','EmployeeLanguageSubTab',{"employee":data.id}); modJs.subModJsList['tabEmployeeLanguageSubTab'] = new EmployeeSubLanguageAdapter('EmployeeLanguage','EmployeeLanguageSubTab',{"employee":data.id});
modJs.subModJsList['tabEmployeeLanguageSubTab'].parent = this; 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")) { if(this.isModuleInstalled("admin","documents")) {
modJs.subModJsList['tabEmployeeDocumentSubTab'] = new EmployeeSubDocumentAdapter('EmployeeDocument', 'EmployeeDocumentSubTab', {"employee": data.id}); modJs.subModJsList['tabEmployeeDocumentSubTab'] = new EmployeeSubDocumentAdapter('EmployeeDocument', 'EmployeeDocumentSubTab', {"employee": data.id});
modJs.subModJsList['tabEmployeeDocumentSubTab'].parent = this; modJs.subModJsList['tabEmployeeDocumentSubTab'].parent = this;
@@ -547,6 +556,16 @@ EmployeeAdapter.method('renderEmployee', function(data) {
modJs.subModJsList['tabEmployeeLanguageSubTab'].setShowCancel(false); modJs.subModJsList['tabEmployeeLanguageSubTab'].setShowCancel(false);
modJs.subModJsList['tabEmployeeLanguageSubTab'].get([]); 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")) { if(this.isModuleInstalled("admin","documents")) {
modJs.subModJsList['tabEmployeeDocumentSubTab'].setShowFormOnPopup(true); modJs.subModJsList['tabEmployeeDocumentSubTab'].setShowFormOnPopup(true);
modJs.subModJsList['tabEmployeeDocumentSubTab'].setShowAddNew(false); modJs.subModJsList['tabEmployeeDocumentSubTab'].setShowAddNew(false);
@@ -1372,7 +1391,7 @@ EmployeeSubSkillsAdapter.method('getSubHeaderTitle', function() {
}); });
EmployeeSubSkillsAdapter.method('getSubItemHtml', function(item, itemDelete, itemEdit) { 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; return itemHtml;
}); });
@@ -1451,8 +1470,8 @@ EmployeeSubEducationAdapter.method('getSubItemHtml', function(item, itemDelete,
try{ try{
end = Date.parse(item[5]).toString('MMM d, yyyy'); end = Date.parse(item[5]).toString('MMM d, yyyy');
}catch(e){} }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 = $('<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 = $('<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"><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; return itemHtml;
}); });
@@ -1529,7 +1548,7 @@ EmployeeSubCertificationAdapter.method('getSubItemHtml', function(item, itemDele
try{ try{
end = Date.parse(item[5]).toString('MMM d, yyyy'); end = Date.parse(item[5]).toString('MMM d, yyyy');
}catch(e){} }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; return itemHtml;
}); });
@@ -1607,7 +1626,7 @@ EmployeeSubLanguageAdapter.method('getSubHeaderTitle', function() {
}); });
EmployeeSubLanguageAdapter.method('getSubItemHtml', function(item, itemDelete, itemEdit) { 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; return itemHtml;
}); });
@@ -1619,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 * @class EmployeeSubDocumentAdapter
@@ -1692,10 +1859,15 @@ EmployeeSubDocumentAdapter.method('getSubItemHtml', function(item, itemDelete, i
try{ try{
expire = Date.parse(item[5]).toString('MMM d, yyyy'); expire = Date.parse(item[5]).toString('MMM d, yyyy');
}catch(e){} }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; return itemHtml;
}); });
EmployeeSubDocumentAdapter.method('isSubProfileTable', function() { EmployeeSubDocumentAdapter.method('isSubProfileTable', function() {
if(this.user.user_level == "Admin"){ if(this.user.user_level == "Admin"){
return false; return false;

View File

@@ -3,5 +3,6 @@
"Employees":"fa-users", "Employees":"fa-users",
"Admin Reports":"fa-file-text", "Admin Reports":"fa-file-text",
"System":"fa-cogs", "System":"fa-cogs",
"Insights":"fa-bar-chart-o",
"Payroll":"fa-money" "Payroll":"fa-money"
} }

View 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";
}
}

View 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);
}
}
}

View 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
View 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"}]
];
});

View File

@@ -0,0 +1,12 @@
{
"label":"Overtime Administration",
"menu":"Employees",
"order":"94",
"icon":"fa-align-center",
"user_levels":["Admin","Manager"],
"dashboardPosition":13,
"permissions":
{
}
}

View File

@@ -0,0 +1,66 @@
<?php
if(!class_exists('ReportBuilder')){
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilder.php';
}
class OvertimeRequestReport extends CSVReportBuilder implements CSVReportBuilderInterface{
public function getMainQuery(){
$query = "SELECT
(SELECT `employee_id` from Employees where id = at.employee) as 'Employee',
(SELECT concat(`first_name`,' ',`middle_name`,' ', `last_name`) from Employees where id = at.employee) as 'Employee',
(SELECT `name` from OvertimeCategories where id = at.category) as 'Category',
(SELECT `name` from Projects where id = at.project) as 'Project',
start_time as 'Start Time',
end_time as 'End Time',
notes as 'Notes',
status as 'Status'
FROM EmployeeOvertime at";
return $query;
}
public function getWhereQuery($request){
$employeeList = array();
if(!empty($request['employee'])){
$employeeList = json_decode($request['employee'],true);
}
if(in_array("NULL", $employeeList) ){
$employeeList = array();
}
if(!empty($employeeList)){
$query = "where employee in (".implode(",", $employeeList).") and start_time >= ? and end_time <= ?";
$params = array(
$request['date_start']." 00:00:00",
$request['date_end']." 23:59:59",
);
}else{
$query = "where start_time >= ? and end_time <= ?";
$params = array(
$request['date_start']." 00:00:00",
$request['date_end']." 23:59:59",
);
}
if(!empty($request['category']) && $request['category'] != "NULL"){
$query.= " and category = ?";
$params[] = $request['category'];
}
if(!empty($request['project']) && $request['project'] != "NULL"){
$query.= " and project = ?";
$params[] = $request['project'];
}
$query.=" order by start_time desc;";
LogManager::getInstance()->info("Query:".$query);
LogManager::getInstance()->info("Params:".json_encode($params));
return array($query, $params);
}
}

View File

@@ -37,6 +37,8 @@ class SettingsInitialize extends AbstractInitialize{
} }
} }
BaseService::getInstance()->getMigrationManager()->ensureMigrations();
} }
} }

View File

@@ -34,7 +34,10 @@ $options1['setShowAddNew'] = 'false';
$moduleBuilder->addModuleOrGroup(new ModuleTab('CompanySetting','Setting','Company','SettingAdapter','{"name":["Company:"]}','name',true,$options1)); $moduleBuilder->addModuleOrGroup(new ModuleTab('CompanySetting','Setting','Company','SettingAdapter','{"name":["Company:"]}','name',true,$options1));
$moduleBuilder->addModuleOrGroup(new ModuleTab('SystemSetting','Setting','System','SettingAdapter','{"name":["System:"]}','name',false,$options1)); $moduleBuilder->addModuleOrGroup(new ModuleTab('SystemSetting','Setting','System','SettingAdapter','{"name":["System:"]}','name',false,$options1));
$moduleBuilder->addModuleOrGroup(new ModuleTab('EmailSetting','Setting','Email','SettingAdapter','{"name":["Email:"]}','name',false,$options1)); $moduleBuilder->addModuleOrGroup(new ModuleTab('EmailSetting','Setting','Email','SettingAdapter','{"name":["Email:"]}','name',false,$options1));
$moduleBuilder->addModuleOrGroup(new ModuleTab('LDAPSetting','Setting','LDAP','SettingAdapter','{"name":["LDAP:"]}','name',false,$options1)); $moduleBuilder->addModuleOrGroup(new ModuleTab('LeaveSetting','Setting','Leave / PTO','SettingAdapter','{"name":["Leave:"]}','name',false,$options1));
if(!defined('LDAP_ENABLED') || LDAP_ENABLED == true){
$moduleBuilder->addModuleOrGroup(new ModuleTab('LDAPSetting','Setting','LDAP','SettingAdapter','{"name":["LDAP:"]}','name',false,$options1));
}
$moduleBuilder->addModuleOrGroup(new ModuleTab('AttendanceSetting','Setting','Attendance','SettingAdapter','{"name":["Attendance:"]}','name',false,$options1)); $moduleBuilder->addModuleOrGroup(new ModuleTab('AttendanceSetting','Setting','Attendance','SettingAdapter','{"name":["Attendance:"]}','name',false,$options1));
$moduleBuilder->addModuleOrGroup(new ModuleTab('OtherSetting','Setting','Other','SettingAdapter','{"name":["Projects:","Recruitment:","Notifications:","Expense:","Travel:","Api:","Overtime:"]}','name',false,$options1)); $moduleBuilder->addModuleOrGroup(new ModuleTab('OtherSetting','Setting','Other','SettingAdapter','{"name":["Projects:","Recruitment:","Notifications:","Expense:","Travel:","Api:","Overtime:"]}','name',false,$options1));
echo UIManager::getInstance()->renderModule($moduleBuilder); echo UIManager::getInstance()->renderModule($moduleBuilder);

View File

@@ -167,7 +167,14 @@
<div class="row" id="customFieldsCont" style="margin-left:10px;margin-top:20px;"> <div class="row" id="customFieldsCont" style="margin-left:10px;margin-top:20px;">
<div class="panel panel-default" style="width:97.5%;">
<div class="panel-heading"><h4>Other Details</h4></div>
<div class="panel-body">
<div class="row-fluid" id="customFields">
</div>
</div>
</div>
</div> </div>

View File

@@ -263,7 +263,7 @@ EmployeeAdapter.method('modEmployeeGetSuccessCallBack' , function(data) {
} }
} }
html = html.replace(/#_.+_#/i,""); html = html.replace(/#_.+_#/gi,"");
html = html.replace(/_id_/g,data.id); html = html.replace(/_id_/g,data.id);

View File

@@ -0,0 +1,19 @@
<?php
class OvertimeActionManager extends ApproveModuleActionManager{
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#SubordinateEmployeeOvertime";
}
}

View File

@@ -0,0 +1,24 @@
<?php
if (!class_exists('OvertimeModulesManager')) {
class OvertimeModulesManager extends AbstractModuleManager{
public function initializeUserClasses(){
}
public function initializeFieldMappings(){
}
public function initializeDatabaseErrorMappings(){
}
public function setupModuleClassDefinitions(){
}
}
}

View File

@@ -0,0 +1,94 @@
<?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 = 'overtime';
$moduleMainName = "EmployeeOvertime"; // for creating module js lib
$subModuleMainName = "SubordinateEmployeeOvertime";
$moduleItemName = "Overtime Request"; // For permissions
$itemName = $moduleItemName; // for status change popup
$itemNameLower = strtolower($moduleMainName); // for status change popup
$appModName = $moduleMainName.'Approval';
define('MODULE_PATH',dirname(__FILE__));
include APP_BASE_PATH.'header.php';
$additionalJs = array();
$additionalJs[] = BASE_URL.'admin/overtime/lib.js?v='.$jsVersion;
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="tab<?=$moduleMainName?>" href="#tabPage<?=$moduleMainName?>"><?=LanguageManager::tran('Overtime Requests')?></a></li>
<li class=""><a id="tab<?=$subModuleMainName?>" href="#tabPage<?=$subModuleMainName?>"><?=LanguageManager::tran('Subordinate Overtime Requests')?></a></li>
<li class=""><a id="tab<?=$appModName?>" href="#tabPage<?=$appModName?>"><?=LanguageManager::tran('Overtime Request Approval')?></a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tabPage<?=$moduleMainName?>">
<div id="<?=$moduleMainName?>" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="<?=$moduleMainName?>Form" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
</div>
<div class="tab-pane" id="tabPage<?=$subModuleMainName?>">
<div id="<?=$subModuleMainName?>" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="<?=$subModuleMainName?>Form" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
</div>
<div class="tab-pane" id="tabPage<?=$appModName?>">
<div id="<?=$appModName?>" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="<?=$appModName?>Form" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
</div>
</div>
</div>
<script>
var modJsList = new Array();
modJsList['tab<?=$moduleMainName?>'] = new <?=$moduleMainName?>Adapter('<?=$moduleMainName?>','<?=$moduleMainName?>');
modJsList['tab<?=$appModName?>'] = new <?=$moduleMainName?>ApproverAdapter('<?=$appModName?>', '<?=$appModName?>');
modJsList['tab<?=$appModName?>'].setShowAddNew(false);
modJsList['tab<?=$appModName?>'].setShowDelete(false);
modJsList['tab<?=$appModName?>'].setShowEdit(false);
modJsList['tab<?=$subModuleMainName?>'] = new <?=$subModuleMainName?>Adapter('<?=$moduleMainName?>','<?=$subModuleMainName?>');
modJsList['tab<?=$subModuleMainName?>'].setRemoteTable(true);
modJsList['tab<?=$subModuleMainName?>'].setShowAddNew(false);
modJsList['tab<?=$subModuleMainName?>'].setShowDelete(false);
modJsList['tab<?=$subModuleMainName?>'].setShowEdit(true);
var modJs = modJsList['tab<?=$moduleMainName?>'];
</script>
<?php include APP_BASE_PATH.'footer.php';?>

120
ext/modules/overtime/lib.js Normal file
View File

@@ -0,0 +1,120 @@
/*
This file is part of iCE Hrm.
Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
*/
function EmployeeOvertimeAdapter(endPoint) {
this.initAdapter(endPoint);
this.itemName = 'Overtime';
this.itemNameLower = 'employeeovertime';
this.modulePathName = 'overtime';
}
EmployeeOvertimeAdapter.inherits(ApproveModuleAdapter);
EmployeeOvertimeAdapter.method('getDataMapping', function() {
return [
"id",
"category",
"start_time",
"end_time",
"project",
"status"
];
});
EmployeeOvertimeAdapter.method('getHeaders', function() {
return [
{ "sTitle": "ID" ,"bVisible":false},
{ "sTitle": "Category" },
{ "sTitle": "Start Time" },
{ "sTitle": "End Time"},
{ "sTitle": "Project"},
{ "sTitle": "Status"}
];
});
EmployeeOvertimeAdapter.method('getFormFields', function() {
return [
["id", {"label": "ID", "type": "hidden"}],
["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"}]
];
});
/*
EmployeeOvertimeApproverAdapter
*/
function EmployeeOvertimeApproverAdapter(endPoint) {
this.initAdapter(endPoint);
this.itemName = 'Overtime';
this.itemNameLower = 'employeeovertime';
this.modulePathName = 'overtime';
}
EmployeeOvertimeApproverAdapter.inherits(EmployeeOvertimeAdminAdapter);
EmployeeOvertimeApproverAdapter.method('getActionButtonsHtml', function(id,data) {
var statusChangeButton = '<img class="tableActionButton" src="_BASE_images/run.png" style="cursor:pointer;" rel="tooltip" title="Change Status" onclick="modJs.openStatus(_id_, \'_cstatus_\');return false;"></img>';
var viewLogsButton = '<img class="tableActionButton" src="_BASE_images/log.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="View Logs" onclick="modJs.getLogs(_id_);return false;"></img>';
var html = '<div style="width:80px;">_status__logs_</div>';
html = html.replace('_logs_',viewLogsButton);
if(data[this.getStatusFieldPosition()] == 'Processing'){
html = html.replace('_status_',statusChangeButton);
}else{
html = html.replace('_status_','');
}
html = html.replace(/_id_/g,id);
html = html.replace(/_BASE_/g,this.baseUrl);
html = html.replace(/_cstatus_/g,data[this.getStatusFieldPosition()]);
return html;
});
EmployeeOvertimeApproverAdapter.method('getStatusOptionsData', function(currentStatus) {
var data = {};
if(currentStatus != 'Processing'){
}else{
data["Approved"] = "Approved";
data["Rejected"] = "Rejected";
}
return data;
});
EmployeeOvertimeApproverAdapter.method('getStatusOptions', function(currentStatus) {
return this.generateOptions(this.getStatusOptionsData(currentStatus));
});
/*
EmployeeOvertimeAdapter
*/
function SubordinateEmployeeOvertimeAdapter(endPoint,tab,filter,orderBy) {
this.initAdapter(endPoint,tab,filter,orderBy);
this.itemName = 'Overtime';
this.itemNameLower = 'employeeovertime';
this.modulePathName = 'overtime';
}
SubordinateEmployeeOvertimeAdapter.inherits(EmployeeOvertimeAdminAdapter);

View File

@@ -0,0 +1,12 @@
{
"label":"Overtime Requests",
"menu":"Time Management",
"order":"5",
"icon":"fa-align-center",
"user_levels":["Admin","Manager","Employee"],
"dashboardPosition":106,
"permissions":
{
}
}

84
features.md Normal file
View File

@@ -0,0 +1,84 @@
Following is a list of features supported in each edition of icehrm
-------------------------------------------------------------------
### IceHrm Open Source Edition
![Employee Module](https://icehrm.s3.amazonaws.com/images/blog-images/advanced-employee-module.png)
#### Employee Management
- Basic [Employee Management](https://icehrm.com) - Store, manage and retrieve employee information when required
- Update all employee information without having to switch employees.
- Search employee skills, qualifications and other information<br/>easily across whole company.
- Terminate employees while keeping data in system.
- Re-enable temporarily terminated employees with one click.
- Employee archive feature to archive data of terminated employee
#### Other Features
* [Company Information Management](https://icehrm.com) - Store and manage details about how companies, departments and branches of the organisation are connected
* Time sheets - IceHrm is a [timesheet app](https://icehrm.com) / [Open source timesheet management](https://icehrm.com) application to track time spent by employees on various projects
* [Attendance Management](https://icehrm.com) - IceHrm can be used as a [attendance management system](https://icehrm.com) effectively for any size a company.
* [LDAP Login](https://icehrm.com) - Users can share login with company LDAP server
* [Travel Management](https://icehrm.com) - Module for managing travel requests
### IceHrm Pro Edition | [IceHrm.com](https://icehrm.com/modules.php)
IceHrm Profession version (in short IceHrmPro) is the feature rich commercial alternative for icehrm
open source version. IceHrm Pro supports following features
#### Leave Management
IceHrm [Leave management system](https://icehrm.com) is only available in IceHrm Pro or Enterprise versions. IceHrm leave module is a complete [leave management system](https://icehrm.com) for any type of a company
To learn more about leave management in icehrm refer:
- [Leave Admin Guide](http://blog.icehrm.com/docs/leave-admin)
- [Configuring Leave Module](http://blog.icehrm.com/docs/leave-setup)
- [Leave Rules](http://blog.icehrm.com/docs/leave-rules)
#### Audit Trial
Sometimes you need to access audit trail for your HRM system. Audit module records all the write actions (which alters your HRM system)
of your employees in a quickly accessible and understandable manor. This help you to identify potential issues with the way employees
are using the system.
#### Expense Tracking
[Track Employee Expenses](https://icehrm.com) with expense management module.
You can learn more about [IceHrm Pro here](http://blog.icehrm.com/docs/icehrm-pro/)
To purchase IceHrmPro please visit [https://icehrm.com/modules.php](https://icehrm.com/modules.php)
#### Training Management
Icehrm [training management system](https://icehrm.com) is for Module for managing courses, training sessions and employee attendance to training sessions.
### IceHrm Enterprise Edition
In addition to pro version features IceHrm enterprise cloud edition includes following features
#### [Employee History Management](https://icehrm.com)
#### [Payroll](https://icehrm.com)
IceHrm Enterprise has a full featured payroll module including [PDF salary slip generation](https://icehrm.com)
#### Candidate / Recruitment Management
Recruitment module can be used as a [applicant tracking system](https://icehrm.com) or a [recruiting software](https://icehrm.com). IceHrm recruitment management system offers
following features
![Recruitment Job Position Sharing](https://icehrm.s3.amazonaws.com/images/blog-images/recruitment-share.png)
- Post jobs
- Let candidates apply for these jobs
- Schedule interviews
- Track candidate progress with notes
- Share job links with linkedIn, facebook, twitter and google+ directly from icehrm
![Candidate Details](https://icehrm.s3.amazonaws.com/images/blog-images/candidates.png)
More about [recruitment module](http://blog.icehrm.com/docs/recruitment/)

909
readme.md
View File

@@ -1,10 +1,71 @@
IceHrm IceHrm
=========== ===========
[![Build Status](https://travis-ci.org/gamonoid/icehrm.svg?branch=master)](https://travis-ci.org/gamonoid/icehrm)
IceHrm is a [HRM software](http://icehrm.com) which enable companies of all sizes to [manage HR activities](http://icehrm.com) IceHrm is a [HRM software](https://icehrm.com) which enable companies of all sizes to [manage HR activities](https://icehrm.com)
properly. properly.
Note: IceHrm is now fully compatible with PHP 7 Setup IceHrm Development Environment
------------------------------------
IceHrm development environment is packaged as a Vagrant box. I includes php7, nginx, phpunit and other
software required for runing icehrm
Preparing development VM
------------------------
- Clone icehrm from https://github.com/gamonoid/icehrm.git or download the source
- Install Vagrant [https://www.vagrantup.com/downloads.html](https://www.vagrantup.com/downloads.html)
- Install Vagrant host updater plugin [https://github.com/cogitatio/vagrant-hostsupdater](https://github.com/cogitatio/vagrant-hostsupdater)
- Run vagrant up in icehrm root directory (this will download icehrm vagrant image which is ~1 GB)
```
~ $ vagrant up
```
- Run vagrant ssh to login to the Virtual machine
```
~ $ vagrant ssh
```
- Install ant build in your VM
```
~ $ sudo apt-get install ant
```
- Build Icehrm (your icehrm root directory is mapped to /vagrant/ directory in VM)
```
~ $ cd /vagrant
~ $ ant buildlocal
```
- Navigate to [](http://clients.app.dev/dev) to load icehrm from VM. (user:admin/pass:admin)
- Runing unit test
```
~ $ cd /vagrant
~ $ phpunit
```
Useful Links
-------------
* IceHrm Opensource Blog: [http://icehrm.org](http://icehrm.org)
* IceHrm Cloud Hosting: [https://icehrm.com](https://icehrm.com)
* IceHrm Documentation (Opensource and Commercial): [http://blog.icehrm.com](http://blog.icehrm.com)
* IceHrm Blog: [https://icehrm.com/blog](http://icehrm.com/blog)
* Purchase IceHrm Pro: [https://icehrm.com/modules.php](https://icehrm.com/modules.php)
* Report Issues: [https://github.com/gamonoid/icehrm/issues](https://github.com/gamonoid/icehrm/issues)
* Feature Requests: [https://bitbucket.org/thilina/icehrm-opensource/issues](https://bitbucket.org/thilina/icehrm-opensource/issues)
* Community Support: [http://stackoverflow.com/search?q=icehrm](http://stackoverflow.com/search?q=icehrm)
Installation Installation
------------ ------------
@@ -27,847 +88,3 @@ Upgrade from Previous Versions to Latest Version
------------------------------------------------ ------------------------------------------------
Refer: [http://blog.icehrm.com/docs/upgrade/](http://blog.icehrm.com/docs/upgrade/) Refer: [http://blog.icehrm.com/docs/upgrade/](http://blog.icehrm.com/docs/upgrade/)
Following is a list of features supported in each edition of icehrm
-------------------------------------------------------------------
### IceHrm Open Source Edition
* IceHrm Core Modules - Both Enterprise and Open source versions developed on same core concept. But the core modules in professional and enterprise versions are more feature rich and updated with latest security improvements.
* [Company Information Management](http://icehrm.com/compare.php) - Store and manage details about how companies, departments and branches of the organisation are connected
* Basic [Employee Management](http://icehrm.com) - Store, manage and retrieve employee information when required
* Time sheets - IceHrm is a [timesheet app](http://icehrm.com) / [Open source timesheet management](http://icehrm.com) application to track time spent by employees on various projects
* [Attendance Management](http://icehrm.com) - IceHrm can be used as a [attendance management system](http://icehrm.com) effectively for any size a company.
* [LDAP Login](http://icehrm.com) - Users can share login with company LDAP server
* [Travel Management](http://icehrm.com) - Module for managing travel requests
#### Advanced Employee Module (from v16.0.OS)
![Advanced Employee Module](https://icehrm.s3.amazonaws.com/images/blog-images/advanced-employee-module.png)
- Update all employee information without having to switch employees.
- Search employee skills, qualifications and other information<br/>easily across whole company.
- Terminate employees while keeping data in system.
- Re-enable temporarily terminated employees with one click.
- Employee archive feature to archive data of terminated employees.
### IceHrm Pro Edition | [Buy now for 349.49 USD](http://icehrm.com)
IceHrm Profession version (in short IceHrmPro) is the feature rich commercial alternative for icehrm
open source version. IceHrm Pro supports following features
Following features are supported in IceHrm Pro version in addition to the features supported in open source version.
#### Leave Management
IceHrm [Leave management system](http://icehrm.com) is only available in IceHrm Pro or Enterprise versions. IceHrm leave module is a complete [leave management system](http://icehrm.com) for any type of a company
To learn more about leave management in icehrm refer:
- [Leave Admin Guide](http://blog.icehrm.com/docs/leave-admin)
- [Configuring Leave Module](http://blog.icehrm.com/docs/leave-setup)
- [Leave Rules](http://blog.icehrm.com/docs/leave-rules)
#### Audit Trial
Sometimes you need to access audit trail for your HRM system. Audit module records all the write actions (which alters your HRM system)
of your employees in a quickly accessible and understandable manor. This help you to identify potential issues with the way employees
are using the system.
#### Expense Tracking
[Track Employee Expenses](http://icehrm.com) with expense management module.
You can learn more about [IceHrm Pro here](http://blog.icehrm.com/docs/icehrm-pro/)
To purchase IceHrmPro please visit [http://icehrm.com/modules.php](http://icehrm.com/modules.php)
#### Training Management
Icehrm [training management system](http://icehrm.com) is for Module for managing courses, training sessions and employee attendance to training sessions.
### IceHrm Hosted Edition [Starts from 1498 USD](http://icehrm.com)
In addition to pro version features icehrm enterprise hosted edition includes following features
#### Candidate / Recruitment Management
Recruitment module can be used as a [applicant tracking system](http://icehrm.com) or a [recruiting software](http://icehrm.com). IceHrm recruitment management system offers
following features
![Recruitment Job Position Sharing](https://icehrm.s3.amazonaws.com/images/blog-images/recruitment-share.png)
- Post jobs
- Let candidates apply for these jobs
- Schedule interviews
- Track candidate progress with notes
- Share job links with linkedIn, facebook, twitter and google+ directly from icehrm
![Candidate Details](https://icehrm.s3.amazonaws.com/images/blog-images/candidates.png)
More about [recruitment module](http://blog.icehrm.com/docs/recruitment/)
Your Company Structure (Departments / Branches and other Organization Units)
-------------------------------------------
Company structure module allows you to define the structure of you company by
creating parent structure of the company, branches, departments and other
company units. Also it provides a graphical overview of how each of
your company units are interconnected.
![Company Structure](https://icehrm.s3.amazonaws.com/images/blog-images/Company_stucture.png)
Employee Management
-------------------
Employees module is used to list, edit, add and search employees in your company.
You can use the search box to search employees by ID, name or department.
Also you can use filter button to filter employees by job title, department or supervisor.
###Difference Between Users and Employees
A user is a person who can login to icehrm. Its not required for admin users to have an employee attached but
each non admin user must have an associated employee. Having an employee added in icehrm wont
allow the person to login to icehrm. You need to create user with a Manager or Employee user level
for that employee to be able to login to the system.
###Adding Employees
Adding employees to ICE Hrm can only be done by the admin. The employee Id field should have a unique value.
In order to complete adding an employee you need to provide job title, employment status and pay grade.
These values can be defined in admin: Jobs module.
Once an employee is added to the system you will be asked to create a user for the newly added employee
###Switching Employees
One of the key features of ICE Hrm, is admins and mangers ability to login as another employee.
This feature can be used to apply leaves, add attendance records or update time sheets behalf of other employees.
To login as an employee you can use the switch user icon on employee list or the “Switch Employee” menu in top right hand corner.
In open source version you must switch employee to edit employee basic information like skills and qualifications.
But on Pro and Enterprise versions you can directly update employee information through Advanced Employee Management module.
Settings
--------
After installation the settings module can be accessed by login in as admin and going to System->Settings
## Global Settings
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Setting</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><p><code>Company: Name</code></p></td>
<td><p>
Name of the company
</p></td>
</tr>
<tr>
<td><p><code>Company: Logo</code></p></td>
<td><p>
Company logo. You may upload the company logo here.
Ideally should be 200px wide and height between 50px to 150 px.
</p></td>
</tr>
<tr>
<td><p><code>Company: Description</code></p></td>
<td><p>
A short description about the company. Will be used mainly in recruitment module
</p></td>
</tr>
<tr>
<td><p><code>Email: Enable</code></p></td>
<td><p>
Set this to "No" to disable all outgoing emails from modules. Value "Yes" will enable outgoing emails
</p></td>
</tr>
</tbody>
</table>
</div>
## Email Settings
### Configuring Email with SMTP
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Setting</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><p><code>Email: Mode</code></p></td>
<td><p>
This should be set to SMTP
</p></td>
</tr>
<tr>
<td><p><code>Email: SMTP Host</code></p></td>
<td><p>
If you are using local machine to send emails, set this to localhost. If not set the IP address of the server you are using to send emails
</p></td>
</tr>
<tr>
<td><p><code>Email: SMTP Authentication</code></p></td>
<td><p>
Set this to "Yes" if SMTP server authorization is enabled
</p></td>
</tr>
<tr>
<td><p><code>Email: SMTP User</code></p></td>
<td><p>
User name of the SMTP user
</p></td>
</tr>
<tr>
<td><p><code>Email: SMTP Password</code></p></td>
<td><p>
SMTP user password
</p></td>
</tr>
<tr>
<td><p><code>Email: SMTP Port</code></p></td>
<td><p>
Port configured in SMTP server (Default 25)
</p></td>
</tr>
<tr>
<td><p><code>Email: Email From</code></p></td>
<td><p>
From email address (e.g icehrm@mydomain.com)
</p></td>
</tr>
</tbody>
</table>
</div>
### Configuring Email with Amazon SES
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Setting</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><p><code>Email: Mode</code></p></td>
<td><p>
This should be set to SES
</p></td>
</tr>
<tr>
<td><p><code>Email: Amazon SES Key</code></p></td>
<td><p>
Amazon access key Id (You can get this through AWS console)
</p></td>
</tr>
<tr>
<td><p><code>Email: Amazone SES Secret</code></p></td>
<td><p>
Amazon access key secret
</p></td>
</tr>
<tr>
<td><p><code>Email: Email From</code></p></td>
<td><p>
Authorized email address for sending emails through SES
</p></td>
</tr>
</tbody>
</table>
</div>
### Configuring Email with Gmail
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Setting</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><p><code>Email: Mode</code></p></td>
<td><p>
This should be set to SMTP
</p></td>
</tr>
<tr>
<td><p><code>Email: SMTP Host</code></p></td>
<td><p>
ssl://smtp.gmail.com
</p></td>
</tr>
<tr>
<td><p><code>Email: SMTP Authentication</code></p></td>
<td><p>
Yes
</p></td>
</tr>
<tr>
<td><p><code>Email: SMTP User</code></p></td>
<td><p>
yourgmailaddress@gmail.com
</p></td>
</tr>
<tr>
<td><p><code>Email: SMTP Password</code></p></td>
<td><p>
Gmail password
</p></td>
</tr>
<tr>
<td><p><code>Email: SMTP Port</code></p></td>
<td><p>
465
</p></td>
</tr>
<tr>
<td><p><code>Email: Email From</code></p></td>
<td><p>
yourgmailaddress@gmail.com
</p></td>
</tr>
</tbody>
</table>
</div>
## Developer Settings
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Setting</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><p><code>System: Do not pass JSON in request</code></p></td>
<td><p>
Select Yes if you are having trouble loading data for some tables
</p></td>
</tr>
<tr>
<td><p><code>System: Reset Modules and Permissions</code></p></td>
<td><p>
When this is set to “Yes” IceHrm will reset all values given in System->Permissions module. This setting can be used to reload permissions after adding new permissions to module meta.json file
</p></td>
</tr>
<tr>
<td><p><code>System: Add New Permissions</code></p></td>
<td><p>
Add new permissions without resetting modules
</p></td>
</tr>
<tr>
<td><p><code>System: Debug Mode</code></p></td>
<td><p>
Print debug log messages
</p></td>
</tr>
</tbody>
</table>
</div>
## Other Settings
<div class="mobile-side-scroller">
<table>
<thead>
<tr>
<th>Setting</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><p><code>Leave: Share Calendar to Whole Company</code></p></td>
<td><p>
If "Yes" all the employees of company can see other peoples' leave schedules.
If set to "No" only admins and supervisors will be able to see leave schedule of subordinates
</p></td>
</tr>
<tr>
<td><p><code>Leave: CC Emails</code></p></td>
<td><p>
Every email sent though leave module will be CC to these comma seperated list of emails addresses
</p></td>
</tr>
<tr>
<td><p><code>Leave: BCC Emails</code></p></td>
<td><p>
Every email sent though leave module will be BCC to these comma seperated list of emails addresses
</p></td>
</tr>
<tr>
<td><p><code>Attendance: Time-sheet Cross Check</code></p></td>
<td><p>
Only allow users to add an entry to a timesheet only if they have marked atteandance for the selected period
</p></td>
</tr>
<tr>
<td><p><code>Recruitment: Show Quick Apply</code></p></td>
<td><p>
Show quick apply button when candidates are applying for jobs. Quick apply allow candidates to apply with minimum amount of information
</p></td>
</tr>
<tr>
<td><p><code>Recruitment: Show Apply</code></p></td>
<td><p>
Show apply button when candidates are applying for jobs
</p></td>
</tr>
</tbody>
</table>
</div>
Projects Module
---------------
Projects module is used to add clients, projects and assign projects to employees
Each and every project is attached to a client. Because of that, ICE Hrm allow adding
clients with basic information. Once clients are added, you can start creating project
for these clients. The clients section represent both external and internal clients of the company.
That way you can attach each and every project to a client.
###Employee Projects
Under employee projects tab you can assign projects to employees. You need to add projects to employees to enable them to add time against
these projects in time-sheets.
Release note v18.0
------------------
### Features
* Translations (beta) for German, French, Polish, Italian, Sinhala, Chinese, Japanese, Hindi and Spanish
* PDF Reports
* Ability to specify department heads
* Add advanced custom fields to employees via UI
* Allow indirect admins to approve travel requests
* Adding more languages to Language meta data table
* Improvements to report module
* Ability to select sections for placing custom fields on employee detail view screen
* Introducing clone button
* Unlimited custom fields for employees
* PDF report for monitoring time employee spent on projects
* Report files module - Allow downloading all previously generated reports
### Fixes
* Fix: subordinates are not showing beyond first page issue.
Release note v16.1
------------------
### Fixes
* Fix LDAP user login issue
* Allow creating users with username having dot and dash
Release note v16.0
------------------
### Features
* Advanced Employee Management Module is now included in IceHrm Open Source Edition
* LDAP Module which was only available in IceHrm Enterprise is now included in open source also
* Initial implementation of icehrm REST Api for reading employee details
* Improvements to data filtering
* Multiple tabs for settings module
* Overtime reports - now its possible to calculate overtime for employees.compatible with US overtime rules
* Logout the user if tried accessing an unauthorized module
* Setting for updating module names
### Fixes
* Fix issue: classes should be loaded even the module is disabled
* Deleting the only Admin user is not allowed
* Fixes for handling non UTF-8
* Fix for non-mandatory select boxes are shown as mandatory
Release note v15.2
------------------
### Features
* Overtime Reports
* Overtime calculation for california
### Fixes
* Fix issue: uncaught error when placeholder value is empty
* Log email sending success status
* Fix broken longer company name issue
* Make the application accessible when client on an intranet with no internet connection
* Fix issue: when a module is disabled other modules depend on it stops working
Release note v15.0
------------------
### Features
* Clear HTML5 local storage when logging in and switching users
* Showing a loading message while getting data from server
* Adding a new field to show total time of each time sheet
* New report added for listing Employee Time Sheets
* Company logo uploaded via settings will be used for all email headers
### Fixes
* Fix issue: default module URL is incorrect for Employees
* Fix date parsing issue in time sheets
* AWS phar is included only when required
Release note v14.1
------------------
### Features
* Add Quick access menu
### Fixes
* Fix issue: salary module not loading
* Add travel report
Release note v14.0
------------------
### Features
* IceHrm is now fully compatible with PHP 7
* Improvements to travel management module to change the process of applying for travel requests
* New report add for getting travel requests
* Improvements to user interface
* Bunch of UI improvements including changing menu order and font sizes
* Add a setting to use server time for time zone defined on department that a user is attached to create new attendance records
* Improvements to admin/manager and user dashboard
* Managers allowed to view/add/edit employee documents
* New reports added for employee expenses and travel
### Fixes
* Fix unavailable help links
Release note v13.4
-----------------
### Features
### Fixes
* Fix employee leave report leave type field
Release note v13.0
-----------------
### Features
* Recruitment module
* Allow managers to edit attendance of direct report employees
### Fixes
* Employee switching issue fixed
* Fix terminated employee labels
* Fix issue with punch-in
Release note v12.6
-----------------
### Features
* Charts module
* Code level security improvements
### Fixes
* Employee switching issue fixed
Release note v11.1
-----------------
### Features
* Add/Edit or remove employee fields
Release note v11.0
-----------------
### Features
* Employee data archiving
* Leave cancellation requests
* Adding view employee feature
### Fixes
* Improvements to date time pickers
Release note v10.1
-----------------
### Features
* Integration with ice-framework (http://githun.com/thilinah/ice-framework)
* Option for only allow users to add an entry to a timesheet only if they have marked atteandance for the selected period
* Restricting availability of leave types to employees using leave groups
* Admins and add notes to employees
Release note v9.1
-----------------
### Fixes
* Add missing S3FileSystem class
* Fix issue: passing result of a method call directly into empty method is not supported in php v5.3
Release note v9.0
-----------------
### Features
* New user interface
* Decimal leave counts supported
Update icehrm v8.4 to v9.0
--------------------------
* Make a backup of your icehrm db
* Run db script "icehrmdb_update_v8.4_to_v9.0.sql" which can be found inside script folder of icehrm_v9.0
* remove all folders except app folder in icehrm root folder
* copy all folders except app folder from new installation to icehrm root folder
Release note v8.4
-----------------
### Fixes
* Fix leave carry forward rounding issues
* Fix issue: select2 default value not getting set for select2
* Fix issue: email not sent when admin changing leave status
Release note v8.3
-----------------
### Fixes
* Fix user table issue on windows, this will resolve errors such as: (Note that this fix has no effect on unix based installations)
* Admin not able to view user uploaded documents
* Admin not able to upload documants for users
* Admin can not view employee attendance records
* Employee projects can not be added
Release note v8.2
-----------------
### Features
* Instance verification added
Release note v8.1
-----------------
### Fixes
* Fixed bug that caused a fatal error in php v5.4
* aws2.7.11 phar file replaced by a aws2.7.11 extracted files
* old aws sdk removed
Release note v8.0
-----------------
### Features
* Admin dashbord module
* If the employee joined in current leave period, his leave entitlement is calculated proportional to joined date
* Improvements to reporting module
* Adding new employee time tracking report
* Join date for employees made mandatory
* Sending welcome email when a user is added
* Let users directly reply to admin user from any email sent out from icehrm
* All the users who are not admins must have an employee object attached
* Upgrade aws sdk to v2.7.11
* Allow employees to change password
* Use only the email address defined under user for sending mails
* Making work_email and private_email fields optional
### Fixes
* Upload dialog close button issue fixed
Release note v7.2
-----------------
### Fixes
* Some critical vulnerabilities are fixed as recommend by http://zeroscience.mk/en/
Release note v7.1
-----------------
### Features
* Improved company structure graph
* Leave notes implementation <20> Supervisor can add a note when approving or rejecting leaves
* Filtering support
* Select boxes with long lists are now searchable
* Add/Edit/Delete company structure permissions added for managers
* Add ability to disable employee information editing
### Fixes
* Make loans editable only by admin
* Fix: permissions not getting applied to employee documents
* Fix error adding employee documents when no user assigned to the admin
### Code Quality
* Moving all module related code and data into module folders
Release note v6.1
-----------------
Leave carry forwared related isue fixed
Release note v6.0
-----------------
* Features
* Notifications for leaves and timesheets
* Leave module accrue and leave carry forward
* Employee leave entitlement sub module
* Ability to put system on debug mode
* Allow admins to see documents of all the employees at one place
* Backup data when deleting an employee
* Employee attendance report added
* Changes to time entry form in timesheet module to make time entry process faster
* Admin can make all projects available to employees or just the set of prjects assigned to them using Setting "Projects: Make All Projects Available to Employees"
* Employee document, date added field can not be changed by the employee anymore
* About dialog added for admins
* Fixes
* Fix default employee delete issue (when the default employee is deleted the admin user attached to it also get deleted)
* Fix user duplicate email issue
* Fix manager can not logout from switched employee
* Remove admin guide from non admin users
Release note v5.3
-----------------
* Fixes
* Fix missing employee name in employee details report
Release note v5.2
-----------------
* Fixes
* Remove unwanted error logs
* Fix attendance module employee permission issue
* Resolve warnings
* Remove add new button from subordinates module
* Adding administrators' guide
Release note v5.1
-----------------
* Fixes
* Fixing for non updating null fields
* https://bitbucket.org/thilina/icehrm-opensource/commits/df57308b53484a2e43ef5c72967ed1cd0dc756cc
Release note v5.0
-----------------
* Features
* New user permission implementation
* Adding new user level - Manager
* Fixes
* Fixing remote table loading issue
Release note v4.2
-----------------
### Fixes
* https://bitbucket.org/thilina/icehrm-opensource/issue/23/subordinate-leaves-pagination-not-working
* https://bitbucket.org/thilina/icehrm-opensource/issue/20/error-occured-while-time-punch
Release note v4.1
-----------------
### Features
* Better email format for notifications
* Convert upload dialog to a bootstrp model
* Fixes
* Fix error sending emails with amazon SES
* Fix errors related to XAMPP and WAMPP servers
* Fix php warnings and notifications
* Fix company structure graph issues
* Allow icehrm client to work without an internet connection
* Fix installer incorrect base url issue
* Fix empty user creation issue

357
release.md Normal file
View File

@@ -0,0 +1,357 @@
Release note v19.0
------------------
### Features
* Payroll Module
* Development environment
* Overtime module
* Department heads who can manage all employees attached to a company structure
Release note v18.0
------------------
### Features
* Translations (beta) for German, French, Polish, Italian, Sinhala, Chinese, Japanese, Hindi and Spanish
* PDF Reports
* Ability to specify department heads
* Add advanced custom fields to employees via UI
* Allow indirect admins to approve travel requests
* Adding more languages to Language meta data table
* Improvements to report module
* Ability to select sections for placing custom fields on employee detail view screen
* Introducing clone button
* Unlimited custom fields for employees
* PDF report for monitoring time employee spent on projects
* Report files module - Allow downloading all previously generated reports
### Fixes
* Fix: subordinates are not showing beyond first page issue.
Release note v16.1
------------------
### Fixes
* Fix LDAP user login issue
* Allow creating users with username having dot and dash
Release note v16.0
------------------
### Features
* Advanced Employee Management Module is now included in IceHrm Open Source Edition
* LDAP Module which was only available in IceHrm Enterprise is now included in open source also
* Initial implementation of icehrm REST Api for reading employee details
* Improvements to data filtering
* Multiple tabs for settings module
* Overtime reports - now its possible to calculate overtime for employees.compatible with US overtime rules
* Logout the user if tried accessing an unauthorized module
* Setting for updating module names
### Fixes
* Fix issue: classes should be loaded even the module is disabled
* Deleting the only Admin user is not allowed
* Fixes for handling non UTF-8
* Fix for non-mandatory select boxes are shown as mandatory
Release note v15.2
------------------
### Features
* Overtime Reports
* Overtime calculation for california
### Fixes
* Fix issue: uncaught error when placeholder value is empty
* Log email sending success status
* Fix broken longer company name issue
* Make the application accessible when client on an intranet with no internet connection
* Fix issue: when a module is disabled other modules depend on it stops working
Release note v15.0
------------------
### Features
* Clear HTML5 local storage when logging in and switching users
* Showing a loading message while getting data from server
* Adding a new field to show total time of each time sheet
* New report added for listing Employee Time Sheets
* Company logo uploaded via settings will be used for all email headers
### Fixes
* Fix issue: default module URL is incorrect for Employees
* Fix date parsing issue in time sheets
* AWS phar is included only when required
Release note v14.1
------------------
### Features
* Add Quick access menu
### Fixes
* Fix issue: salary module not loading
* Add travel report
Release note v14.0
------------------
### Features
* IceHrm is now fully compatible with PHP 7
* Improvements to travel management module to change the process of applying for travel requests
* New report add for getting travel requests
* Improvements to user interface
* Bunch of UI improvements including changing menu order and font sizes
* Add a setting to use server time for time zone defined on department that a user is attached to create new attendance records
* Improvements to admin/manager and user dashboard
* Managers allowed to view/add/edit employee documents
* New reports added for employee expenses and travel
### Fixes
* Fix unavailable help links
Release note v13.4
-----------------
### Features
### Fixes
* Fix employee leave report leave type field
Release note v13.0
-----------------
### Features
* Recruitment module
* Allow managers to edit attendance of direct report employees
### Fixes
* Employee switching issue fixed
* Fix terminated employee labels
* Fix issue with punch-in
Release note v12.6
-----------------
### Features
* Charts module
* Code level security improvements
### Fixes
* Employee switching issue fixed
Release note v11.1
-----------------
### Features
* Add/Edit or remove employee fields
Release note v11.0
-----------------
### Features
* Employee data archiving
* Leave cancellation requests
* Adding view employee feature
### Fixes
* Improvements to date time pickers
Release note v10.1
-----------------
### Features
* Integration with ice-framework (http://githun.com/thilinah/ice-framework)
* Option for only allow users to add an entry to a timesheet only if they have marked atteandance for the selected period
* Restricting availability of leave types to employees using leave groups
* Admins and add notes to employees
Release note v9.1
-----------------
### Fixes
* Add missing S3FileSystem class
* Fix issue: passing result of a method call directly into empty method is not supported in php v5.3
Release note v9.0
-----------------
### Features
* New user interface
* Decimal leave counts supported
Update icehrm v8.4 to v9.0
--------------------------
* Make a backup of your icehrm db
* Run db script "icehrmdb_update_v8.4_to_v9.0.sql" which can be found inside script folder of icehrm_v9.0
* remove all folders except app folder in icehrm root folder
* copy all folders except app folder from new installation to icehrm root folder
Release note v8.4
-----------------
### Fixes
* Fix leave carry forward rounding issues
* Fix issue: select2 default value not getting set for select2
* Fix issue: email not sent when admin changing leave status
Release note v8.3
-----------------
### Fixes
* Fix user table issue on windows, this will resolve errors such as: (Note that this fix has no effect on unix based installations)
* Admin not able to view user uploaded documents
* Admin not able to upload documants for users
* Admin can not view employee attendance records
* Employee projects can not be added
Release note v8.2
-----------------
### Features
* Instance verification added
Release note v8.1
-----------------
### Fixes
* Fixed bug that caused a fatal error in php v5.4
* aws2.7.11 phar file replaced by a aws2.7.11 extracted files
* old aws sdk removed
Release note v8.0
-----------------
### Features
* Admin dashbord module
* If the employee joined in current leave period, his leave entitlement is calculated proportional to joined date
* Improvements to reporting module
* Adding new employee time tracking report
* Join date for employees made mandatory
* Sending welcome email when a user is added
* Let users directly reply to admin user from any email sent out from icehrm
* All the users who are not admins must have an employee object attached
* Upgrade aws sdk to v2.7.11
* Allow employees to change password
* Use only the email address defined under user for sending mails
* Making work_email and private_email fields optional
### Fixes
* Upload dialog close button issue fixed
Release note v7.2
-----------------
### Fixes
* Some critical vulnerabilities are fixed as recommend by http://zeroscience.mk/en/
Release note v7.1
-----------------
### Features
* Improved company structure graph
* Leave notes implementation <20> Supervisor can add a note when approving or rejecting leaves
* Filtering support
* Select boxes with long lists are now searchable
* Add/Edit/Delete company structure permissions added for managers
* Add ability to disable employee information editing
### Fixes
* Make loans editable only by admin
* Fix: permissions not getting applied to employee documents
* Fix error adding employee documents when no user assigned to the admin
### Code Quality
* Moving all module related code and data into module folders
Release note v6.1
-----------------
Leave carry forwared related isue fixed
Release note v6.0
-----------------
* Features
* Notifications for leaves and timesheets
* Leave module accrue and leave carry forward
* Employee leave entitlement sub module
* Ability to put system on debug mode
* Allow admins to see documents of all the employees at one place
* Backup data when deleting an employee
* Employee attendance report added
* Changes to time entry form in timesheet module to make time entry process faster
* Admin can make all projects available to employees or just the set of prjects assigned to them using Setting "Projects: Make All Projects Available to Employees"
* Employee document, date added field can not be changed by the employee anymore
* About dialog added for admins
* Fixes
* Fix default employee delete issue (when the default employee is deleted the admin user attached to it also get deleted)
* Fix user duplicate email issue
* Fix manager can not logout from switched employee
* Remove admin guide from non admin users
Release note v5.3
-----------------
* Fixes
* Fix missing employee name in employee details report
Release note v5.2
-----------------
* Fixes
* Remove unwanted error logs
* Fix attendance module employee permission issue
* Resolve warnings
* Remove add new button from subordinates module
* Adding administrators' guide
Release note v5.1
-----------------
* Fixes
* Fixing for non updating null fields
* https://bitbucket.org/thilina/icehrm-opensource/commits/df57308b53484a2e43ef5c72967ed1cd0dc756cc
Release note v5.0
-----------------
* Features
* New user permission implementation
* Adding new user level - Manager
* Fixes
* Fixing remote table loading issue
Release note v4.2
-----------------
### Fixes
* https://bitbucket.org/thilina/icehrm-opensource/issue/23/subordinate-leaves-pagination-not-working
* https://bitbucket.org/thilina/icehrm-opensource/issue/20/error-occured-while-time-punch
Release note v4.1
-----------------
### Features
* Better email format for notifications
* Convert upload dialog to a bootstrp model
* Fixes
* Fix error sending emails with amazon SES
* Fix errors related to XAMPP and WAMPP servers
* Fix php warnings and notifications
* Fix company structure graph issues
* Allow icehrm client to work without an internet connection
* Fix installer incorrect base url issue
* Fix empty user creation issue

21
src/LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2016 Thilina Hasantha
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

File diff suppressed because it is too large Load Diff

View File

@@ -122,6 +122,24 @@ IceHRMBase.method('scrollToTop' , function() {
$("html, body").animate({ scrollTop: 0 }, "fast"); $("html, body").animate({ scrollTop: 0 }, "fast");
}); });
IceHRMBase.method('scrollToBottom' , function() {
$("html, body").animate({ scrollTop: $(document).height() }, "slow");
});
IceHRMBase.method('scrollToElement' , function(element) {
if($(window).height() <= element.offset().top){
$("html, body").animate({ scrollTop: element.offset().top }, "slow");
}
});
IceHRMBase.method('scrollToElementBottom' , function(element) {
if($(window).height() <= element.offset().top + element.height()){
$("html, body").animate({ scrollTop: element.offset().top + element.height() }, "slow");
}
});
IceHRMBase.method('setTranslations' , function(txt) { IceHRMBase.method('setTranslations' , function(txt) {
this.translations = txt['messages']['']; this.translations = txt['messages'][''];
@@ -355,6 +373,80 @@ IceHRMBase.method('getMetaFieldValues' , function(key, fields) {
return null; return null;
}); });
IceHRMBase.method('getThemeColors' , function() {
var colors = ["red","yellow","aqua","blue",
"light-blue","green","navy","teal","olive","orange",
"fuchsia","purple"];
return colors;
});
IceHRMBase.method('getColorByRandomString' , function(string) {
var colors = this.getThemeColors();
var k = string.charCodeAt(0);
return colors[k % colors.length];
});
IceHRMBase.method('getColorByFileType' , function(type) {
type = type.toLowerCase();
var colorMap = {};
colorMap['pdf'] = 'red';
colorMap['csv'] = 'yellow';
colorMap['xls'] = 'green';
colorMap['xlsx'] = 'green';
colorMap['doc'] = 'light-blue';
colorMap['docx'] = 'light-blue';
colorMap['docx'] = 'blue';
colorMap['ppt'] = 'orange';
colorMap['pptx'] = 'orange';
colorMap['jpg'] = 'teal';
colorMap['jpeg'] = 'teal';
colorMap['gif'] = 'green';
colorMap['png'] = 'yellow';
colorMap['bmp'] = 'fuchsia';
if(colorMap[type] != undefined || colorMap[type] != null){
return colorMap[type];
}else{
return getColorByRandomString(type);
}
});
IceHRMBase.method('getIconByFileType' , function(type) {
type = type.toLowerCase();
var iconMap = {};
iconMap['pdf'] = 'fa fa-file-pdf-o';
iconMap['csv'] = 'fa fa fa-file-code-o';
iconMap['xls'] = 'fa fa-file-excel-o';
iconMap['xlsx'] = 'fa fa-file-excel-o';
iconMap['doc'] = 'fa fa-file-word-o';
iconMap['docx'] = 'fa fa-file-word-o';
iconMap['ppt'] = 'fa fa-file-powerpoint-o';
iconMap['pptx'] = 'fa fa-file-powerpoint-o';
iconMap['jpg'] = 'fa fa-file-image-o';
iconMap['jpeg'] = 'fa fa-file-image-o';
iconMap['gif'] = 'fa fa-file-image-o';
iconMap['png'] = 'fa fa-file-image-o';
iconMap['bmp'] = 'fa fa-file-image-o';
iconMap['txt'] = 'fa fa-file-text-o';
iconMap['rtf'] = 'fa fa-file-text-o';
if(iconMap[type] != undefined || iconMap[type] != null){
return iconMap[type];
}else{
return 'fa fa-file-o';
}
});
IceHRMBase.method('getSourceMapping' , function() { IceHRMBase.method('getSourceMapping' , function() {
return this.sourceMapping ; return this.sourceMapping ;
}); });
@@ -650,6 +742,7 @@ IceHRMBase.method('createTableServer', function(elementId) {
}).remove(); }).remove();
$('.tableActionButton').tooltip(); $('.tableActionButton').tooltip();
}); });
/** /**
@@ -884,6 +977,7 @@ IceHRMBase.method('cancelYesno', function() {
IceHRMBase.method('closePlainMessage', function() { IceHRMBase.method('closePlainMessage', function() {
$('#plainMessageModel').modal('hide'); $('#plainMessageModel').modal('hide');
$('#dataMessageModel').modal('hide');
}); });
IceHRMBase.method('closeDataMessage', function() { IceHRMBase.method('closeDataMessage', function() {
@@ -1591,6 +1685,24 @@ IceHRMBase.method('addDataGroup', function() {
} }
}); });
IceHRMBase.method('nl2br' , function(str, len) {
var t = "";
try{
var arr = str.split(" ");
var count = 0;
for(var i=0;i<arr.length;i++){
count += arr[i].length + 1;
if(count > len){
t += arr[i] + "<br/>";
count = 0;
}else{
t += arr[i] + " ";
}
}
}catch(e){}
return t;
});
IceHRMBase.method('makeDataGroupSortable', function(field, obj) { IceHRMBase.method('makeDataGroupSortable', function(field, obj) {
obj.data('field',field); obj.data('field',field);
obj.data('firstSort',true); obj.data('firstSort',true);
@@ -1656,6 +1768,19 @@ IceHRMBase.method('editDataGroup', function() {
var validator = new FormValidation(this.getTableName()+"_field_"+field[0],true,{'ShowPopup':false,"LabelErrorClass":"error"}); var validator = new FormValidation(this.getTableName()+"_field_"+field[0],true,{'ShowPopup':false,"LabelErrorClass":"error"});
if(validator.checkValues()){ if(validator.checkValues()){
var params = validator.getFormParameters(); var params = validator.getFormParameters();
if(field[1]['custom-validate-function'] != undefined && field[1]['custom-validate-function'] != null){
tempParams = field[1]['custom-validate-function'].apply(this,[params]);
if(tempParams['valid']){
params = tempParams['params'];
}else{
$("#"+this.getTableName()+"_field_"+field[0]+"_error").html(tempParams['message']);
$("#"+this.getTableName()+"_field_"+field[0]+"_error").show();
return false;
}
}
if(this.doCustomFilterValidation(params)){ if(this.doCustomFilterValidation(params)){
var val = $("#"+field[0]).val(); var val = $("#"+field[0]).val();
@@ -1965,6 +2090,12 @@ IceHRMBase.method('renderFormField', function(field) {
t = t.replace(/_userId_/g,userId); t = t.replace(/_userId_/g,userId);
t = t.replace(/_group_/g,this.tab); t = t.replace(/_group_/g,this.tab);
if(field[1].filetypes != undefined && field[1].filetypes != null){
t = t.replace(/_filetypes_/g,field[1].filetypes);
}else{
t = t.replace(/_filetypes_/g,'all');
}
/* /*
if(object != null && object != undefined && object[field[0]] != null && object[field[0]] != undefined && object[field[0]] != ""){ if(object != null && object != undefined && object[field[0]] != null && object[field[0]] != undefined && object[field[0]] != ""){
t = t.replace(/_id___rand_/g,field[0]); t = t.replace(/_id___rand_/g,field[0]);
@@ -1986,6 +2117,13 @@ IceHRMBase.method('renderFormField', function(field) {
}else{ }else{
t = t.replace(/_validation_/g,''); t = t.replace(/_validation_/g,'');
} }
if(field[1].help != undefined || field[1].help != null){
t = t.replace(/_helpline_/g,field[1].help);
}else{
t = t.replace(/_helpline_/g,'');
}
return t; return t;
}); });

View File

@@ -131,7 +131,7 @@ if(!$isDataFolderExists){
return; return;
} }
if(request["BASE_URL"].indexOf("http://") == 0 || request["BASE_URL"].indexOf("https://")){ if(request["BASE_URL"].indexOf("http://") == 0 || request["BASE_URL"].indexOf("https://") == 0){
}else{ }else{
alert("Invalid Base URL"); alert("Invalid Base URL");
return; return;
@@ -162,7 +162,7 @@ if(!$isDataFolderExists){
<div class="container-fluid bgbody" style="max-width:800px;padding-top:10px;margin:auto"> <div class="container-fluid bgbody" style="max-width:800px;padding-top:10px;margin:auto">
<h1>IceHRM Installation</h1> <h1>IceHRM Installation</h1>
<p class="p1"> <p class="p1">
Please do not install this application if you have already installed (this could currupt existing instalation) Please do not install this application if you have already installed (this could break existing installation)
</p> </p>
<?php if(count($errorMap)>0){?> <?php if(count($errorMap)>0){?>
<?php foreach($errorMap as $error){?> <?php foreach($errorMap as $error){?>

View File

@@ -48,6 +48,7 @@ class BaseService{
var $historyManagers = array(); var $historyManagers = array();
var $calculationHooks = array(); var $calculationHooks = array();
var $customFieldManager = null; var $customFieldManager = null;
var $migrationManager = null;
private static $me = null; private static $me = null;
@@ -488,13 +489,13 @@ class BaseService{
$tObj = new $fTable(); $tObj = new $fTable();
$tObj->Load($v[1]."= ?",array($item->$k)); $tObj->Load($v[1]."= ?",array($item->$k));
if($tObj->$v[1] == $item->$k){ if($tObj->{$v[1]} == $item->$k){
$v[2] = str_replace("+"," ",$v[2]); $v[2] = str_replace("+"," ",$v[2]);
$values = explode(" ", $v[2]); $values = explode(" ", $v[2]);
if(count($values) == 1){ if(count($values) == 1){
$idField = $k."_id"; $idField = $k."_id";
$item->$idField = $item->$k; $item->$idField = $item->$k;
$item->$k = $tObj->$v[2]; $item->$k = $tObj->{$v[2]};
}else{ }else{
$objVal = ""; $objVal = "";
@@ -551,13 +552,13 @@ class BaseService{
$fTable = $v[0]; $fTable = $v[0];
$tObj = new $fTable(); $tObj = new $fTable();
$tObj->Load($v[1]."= ?",array($obj->$k)); $tObj->Load($v[1]."= ?",array($obj->$k));
if($tObj->$v[1] == $obj->$k){ if($tObj->{$v[1]} == $obj->$k){
$name = $k."_Name"; $name = $k."_Name";
$values = explode("+", $v[2]); $values = explode("+", $v[2]);
if(count($values) == 1){ if(count($values) == 1){
$idField = $name."_id"; $idField = $name."_id";
$obj->$idField = $obj->$name; $obj->$idField = $obj->$name;
$obj->$name = $tObj->$v[2]; $obj->$name = $tObj->{$v[2]};
}else{ }else{
$objVal = ""; $objVal = "";
foreach($values as $v){ foreach($values as $v){
@@ -751,7 +752,7 @@ class BaseService{
return $this->findError($error); return $this->findError($error);
}else{ }else{
//Backup //Backup
if($table == "Profile"){ if($table == ucfirst(SIGN_IN_ELEMENT_MAPPING_FIELD_NAME)){
$newObj = $this->cleanUpAdoDB($ele); $newObj = $this->cleanUpAdoDB($ele);
$dataEntryBackup = new DataEntryBackup(); $dataEntryBackup = new DataEntryBackup();
$dataEntryBackup->tableType = $table; $dataEntryBackup->tableType = $table;
@@ -773,6 +774,11 @@ class BaseService{
} }
} }
$cfs = $this->customFieldManager->getCustomFields($table,$id);
foreach($cfs as $cf){
$cf->Delete();
}
return null; return null;
} }
@@ -1239,6 +1245,14 @@ class BaseService{
return SettingsManager::getInstance()->getSetting('Analytics: Google Key'); return SettingsManager::getInstance()->getSetting('Analytics: Google Key');
} }
public function setMigrationManager($migrationManager){
$this->migrationManager = $migrationManager;
}
public function getMigrationManager(){
return $this->migrationManager;
}
/** /**
* Set the audit manager * Set the audit manager
* @method setAuditManager * @method setAuditManager
@@ -1485,7 +1499,7 @@ class CustomFieldManager {
$customFields[$cf->name] = $cf; $customFields[$cf->name] = $cf;
} }
$customFieldValues = $this->getCustomFields('Employee',$object->id); $customFieldValues = $this->getCustomFields($table,$object->id);
$object->customFields = array(); $object->customFields = array();
foreach ($customFieldValues as $cf){ foreach ($customFieldValues as $cf){
@@ -1571,6 +1585,11 @@ class CustomFieldManager {
} }
public function syncMigrations(){
}
} }

View File

@@ -84,7 +84,7 @@ class IceCron{
if($type == self::MINUTELY){ if($type == self::MINUTELY){
$diff = (strtotime("now") - strtotime($lastRunTime)); $diff = (strtotime("now") - strtotime($lastRunTime));
if(empty($this->time) || !is_int($time)){ if(empty($time) || !is_int($time)){
if($diff > 60){ if($diff > 60){
return true; return true;
} }
@@ -102,7 +102,7 @@ class IceCron{
return true; return true;
} }
}else{ }else{
if(intval(date('i')) <= intval($time) && date('H') != date('H',strtotime($lastRunTime))){ if(intval(date('i')) >= intval($time) && date('H') != date('H',strtotime($lastRunTime))){
return true; return true;
} }
} }

View File

@@ -312,4 +312,24 @@ class FileService{
} }
return true; return true;
} }
public function getFileData($name){
$file = new File();
$file->Load("name = ?",array($name));
if(!empty($file->id)){
$arr= explode(".",$file->filename);
$file->type = $arr[count($arr) - 1];
}else{
return null;
}
return $file;
}
public function getReadableSize($size, $precision = 2){
$base = log($size, 1024);
$suffixes = array('', 'K', 'M', 'G', 'T');
return round(pow(1024, $base - floor($base)), $precision) .' '. $suffixes[floor($base)];
}
} }

View File

@@ -35,12 +35,13 @@ class LanguageManager{
private function getCurrentLang(){ private function getCurrentLang(){
$user = BaseService::getInstance()->getCurrentUser(); $user = BaseService::getInstance()->getCurrentUser();
LogManager::getInstance()->info("User:".json_encode($user));
if(empty($user) || empty($user->lang) || $user->lang == "NULL"){ if(empty($user) || empty($user->lang) || $user->lang == "NULL"){
$lang = SettingsManager::getInstance()->getSetting('System: Language'); $lang = SettingsManager::getInstance()->getSetting('System: Language');
LogManager::getInstance()->info("System Lang:".$lang); LogManager::getInstance()->info("System Lang:".$lang);
}else{ }else{
$lang = $user->lang; $supportedLang = new SupportedLanguage();
$supportedLang->Load("id = ?",array($user->lang));
$lang = $supportedLang->name;
} }
if(empty($lang) || !file_exists(APP_BASE_PATH.'lang/'.$lang.'.po')){ if(empty($lang) || !file_exists(APP_BASE_PATH.'lang/'.$lang.'.po')){
$lang = 'en'; $lang = 'en';

260
src/classes/Migration.php Normal file
View File

@@ -0,0 +1,260 @@
<?php
abstract class AbstractMigration
{
protected $file;
private $db;
protected $lastError;
public function __construct($file)
{
$this->file = $file;
}
public function up(){
return true;
}
public function down(){
return true;
}
protected function db(){
if($this->db == null){
$this->db = NewADOConnection('mysqli');
$res = $this->db->Connect(APP_HOST, APP_USERNAME, APP_PASSWORD, APP_DB);
}
return $this->db;
}
public function getLastError(){
return $this->lastError;
}
public function executeQuery($sql){
$ret = $this->db()->Execute($sql);
if(!$ret){
$this->lastError = $this->db()->ErrorMsg();
}
return $ret;
}
/*
public function up()
{
$sql = <<<'SQL'
create table `Migrations` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`file` varchar(300) 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_status` (`version`)
) engine=innodb default charset=utf8;
SQL;
return $this->db()->Execute($sql);
}
public function down()
{
return $this->db()->Execute('DROP TABLE Migrations');
}
*/
}
class MigrationManager{
private $migration_path;
protected $db = null;
public function __construct()
{
$this->migration_path = APP_BASE_PATH .'/db_migrations/';
}
public function setMigrationPath($migration_path){
$this->migration_path = $migration_path;
}
public function getMigrationById($id){
$migration = new Migration();
$migration->Load("id = ?",array($id));
return $migration;
}
public function getCurrentMigrations(){
$migration = new Migration();
return $migration->Find("1 = 1");
}
public function getPendingMigrations(){
$migration = new Migration();
return $migration->Find("status = ?",array('Pending'));
}
public function getFirstAddedMigration($statuses){
$migration = new Migration();
return $migration->Find("status in ('".implode("','",$statuses)."') order by created limit 1",array());
}
public function getLastRunMigration($statuses){
$migration = new Migration();
return $migration->Find("status in ('".implode("','",$statuses)."') order by updated desc limit 1",array());
}
public function queueMigrations(){
$migrations = array();
$ams = scandir($this->migration_path);
foreach($ams as $am) {
if (is_file($this->migration_path . $am)) {
$migrations[$am] = $this->migration_path . $am;
}
}
ksort($migrations);
if(!empty($migrations)){
$migrationsInDB = $this->getCurrentMigrations();
$migrationsInDBKeyVal = array();
foreach ($migrationsInDB as $migration){
$migrationsInDBKeyVal[$migration->file] = $migration;
}
foreach($migrations as $file => $path){
if(!isset($migrationsInDBKeyVal[$file])){
if($file == 'list.php'){
continue;
}
$migration = new Migration();
$migration->file = $file;
$parts = explode("_",$file);
$migration->version = intval($parts[1]);
$migration->created = date("Y-m-d H:i:s");
$migration->updated = date("Y-m-d H:i:s");
$migration->status = 'Pending';
$migration->Save();
}
}
}
}
public function runPendingMigrations(){
$migrations = $this->getPendingMigrations();
foreach ($migrations as $migration){
$this->runMigrationUp($migration);
}
}
public function runMigration($action){
$method = 'runMigration'.ucfirst($action);
if($action == 'up'){
$statuses = array("Pending","Down");
$queryMethod = 'getFirstAddedMigration';
}else if($action == 'down'){
$statuses = array("Up");
$queryMethod = 'getLastRunMigration';
}else{
return false;
}
$migrations = $this->$queryMethod($statuses);
if(count($migrations) > 0){
$this->$method($migrations[0]);
return $this->getMigrationById($migrations[0]->id);
}else{
$this->queueMigrations();
$migrations = $this->$queryMethod($statuses);
if(count($migrations) > 0){
$this->$method($migrations[0]);
return $this->getMigrationById($migrations[0]->id);
}
}
return false;
}
public function runMigrationUp($migration){
if($migration->status != 'Pending' && $migration->status != 'UpError' && $migration->status != 'Down'){
return false;
}
$path = $this->migration_path . $migration->file;
if(!file_exists($path)){
return false;
}
$migrationName = str_replace('.php','',$migration->file);
if(!class_exists($migrationName)){
include $path;
}
$migClass = new $migrationName;
$res = $migClass->up();
if(!$res){
$migration->last_error = $migClass->getLastError();
$migration->status = "UpError";
$migration->updated = date("Y-m-d H:i:s");
$migration->Save();
}
$migration->status = "Up";
$migration->updated = date("Y-m-d H:i:s");
$migration->Save();
return $migration;
}
public function runMigrationDown($migration){
if($migration->status != 'Up' && $migration->status != 'UpError'){
return false;
}
$path = $this->migration_path . $migration->file;
if(!file_exists($path)){
return false;
}
$migrationName = str_replace('.php','',$migration->file);
if(!class_exists($migrationName)){
include $path;
}
$migClass = new $migrationName;
$res = $migClass->down();
if(!$res){
$migration->last_error = $migClass->getLastError();
$migration->status = "DownError";
$migration->updated = date("Y-m-d H:i:s");
$migration->Save();
}
$migration->status = "Down";
$migration->updated = date("Y-m-d H:i:s");
$migration->Save();
return $migration;
}
public function ensureMigrations(){
$migration = new Migration();
$migration->Load("1 = 1 order by id desc limit 1");
include $this->migration_path . "list.php";
if (count($migrationList) > 0 && (empty($migration->id) || $migrationList[0].".php" != $migration->file)) {
LogManager::getInstance()->info("ensureMigrations - execute migrations");
$this->queueMigrations();
$this->runPendingMigrations();
}
}
}

View File

@@ -7,36 +7,60 @@ class NotificationManager{
$this->baseService = $baseService; $this->baseService = $baseService;
} }
public function addNotification($toUser, $message, $action, $type){ public function addNotification($toEmployee, $message, $action, $type, $toUserId = null, $fromSystem = false, $sendEmail = false){
$profileVar = SIGN_IN_ELEMENT_MAPPING_FIELD_NAME;
$profileClass = ucfirst(SIGN_IN_ELEMENT_MAPPING_FIELD_NAME);
$userEmp = new User();
$userEmp->load("profile = ?",array($toUser));
if(!empty($userEmp->$profileVar) && $userEmp->$profileVar == $toUser){ $userEmp = new User();
$toUser = $userEmp->id;
}else{ if(!empty($toEmployee)){
return; $userEmp->load("employee = ?",array($toEmployee));
if(!empty($userEmp->employee) && $userEmp->employee == $toEmployee){
$toUser = $userEmp->id;
}else{
return;
}
}else if(!empty($toUserId)){
$toUser = $toUserId;
} }
$noti = new Notification(); $noti = new Notification();
$user = $this->baseService->getCurrentUser(); if($fromSystem){
$noti->fromUser = $user->id; $noti->fromUser = 0;
$noti->fromProfile = $user->$profileVar; $noti->fromEmployee = 0;
$noti->image = BASE_URL."images/icehrm.png";
}else{
$user = $this->baseService->getCurrentUser();
$noti->fromUser = $user->id;
$noti->fromEmployee = $user->employee;
}
if(!empty($toEmployee)){
$noti->employee = $toEmployee;
}else if(!empty($toUserId)){
$tempUser = new User();
$tempUser->Load("id = ?",array($toUserId));
$noti->employee = $tempUser->employee;
}
$noti->toUser = $toUser; $noti->toUser = $toUser;
$noti->message = $message; $noti->message = $message;
if(!empty($noti->fromProfile)){ if(!empty($noti->fromEmployee) && $noti->fromEmployee != 0){
$profile = $this->baseService->getElement($profileClass,$noti->fromProfile,null,true); $employee = $this->baseService->getElement('Employee',$noti->fromEmployee,null,true);
if(!empty($profile)){ if(!empty($employee)){
$fs = FileService::getInstance(); $employee = FileService::getInstance()->updateProfileImage($employee);
$profile = $fs->updateProfileImage($profile); $noti->image = $employee->image;
$noti->image = $profile->image;
} }
} }
if(empty($noti->image)){ if(empty($noti->image)){
$noti->image = BASE_URL."images/user_male.png"; if($employee->gender == 'Male'){
$noti->image = BASE_URL."images/user_male.png";
}else{
$noti->image = BASE_URL."images/user_female.png";
}
} }
$noti->action = $action; $noti->action = $action;
@@ -46,7 +70,12 @@ class NotificationManager{
$ok = $noti->Save(); $ok = $noti->Save();
if(!$ok){ if(!$ok){
LogManager::getInstance()->info("Error adding notification: ".$noti->ErrorMsg()); error_log("Error adding notification: ".$noti->ErrorMsg());
}else if($sendEmail){
$emailSender = BaseService::getInstance()->getEmailSender();
if(!empty($emailSender)){
$emailSender->sendEmailFromNotification($noti);
}
} }
} }
@@ -61,16 +90,52 @@ class NotificationManager{
} }
} }
public function getNotificationByTypeAndDate($type, $date){
$noti = new Notification();
$noti->Load("date(time) = ? and type = ?",array($date,$type));
if(!empty($noti->id) && $noti->type = $type){
return $noti;
}
return null;
}
public function getLatestNotificationsAndCounts($userId){ public function getLatestNotificationsAndCounts($userId){
$notification = new Notification(); $notification = new Notification();
$listUnread = $notification->Find("toUser = ? and status = ?",array($userId,'Unread')); $listUnread = $notification->Find("toUser = ? and status = ?",array($userId,'Unread'));
$unreadCount = count($listUnread); $unreadCount = count($listUnread);
$limit = ($unreadCount < 20)?20:$unreadCount; $limit = ($unreadCount < 10)?10:$unreadCount;
$list = $notification->Find("toUser = ? order by time desc limit ?",array($userId,$limit)); $list = $notification->Find("toUser = ? order by time desc limit ?",array($userId,$limit));
$newList = array();
$fs = FileService::getInstance();
foreach($list as $noti){
if($noti->fromEmployee > 0){
$employee = $this->baseService->getElement('Employee',$noti->fromEmployee,null,true);
if(!empty($employee)){
$employee = $fs->updateProfileImage($employee);
$noti->image = $employee->image;
if(empty($noti->image)){
if($employee->gender == 'Male'){
$noti->image = BASE_URL."images/user_male.png";
}else{
$noti->image = BASE_URL."images/user_female.png";
}
}
$newList[] = $noti;
}
}else{
$noti->image = BASE_URL."images/syslogo.png";
$newList[] = $noti;
}
}
return array($unreadCount, $list); return array($unreadCount, $list);
} }

View File

@@ -125,26 +125,124 @@ class RestApiManager{
class RestEndPoint{ class RestEndPoint{
public function process($type , $parameter = NULL){ public function process($type , $parameter = NULL){
$resp = $this->$type($parameter);
$this->printResponse($resp); $accessTokenValidation = $this->validateAccessToken();
if($accessTokenValidation->getStatus() == IceResponse::ERROR){
$resp = $accessTokenValidation;
}else{
$resp = $this->$type($parameter);
}
if($resp->getStatus() == IceResponse::SUCCESS && $resp->getCode() == null){
header('Content-Type: application/json');
http_response_code(200);
$this->printResponse($resp->getObject());
}else if($resp->getStatus() == IceResponse::SUCCESS){
header('Content-Type: application/json');
http_response_code($resp->getCode());
$this->printResponse($resp->getObject());
}else{
header('Content-Type: application/json');
http_response_code($resp->getCode());
$messages = array();
$messages[] = array(
"code" => $resp->getCode(),
"message" => $resp->getObject()
);
$this->printResponse(array("error",[$messages]));
}
} }
public function get($parameter){ public function get($parameter){
return new IceResponse(IceResponse::ERROR, "Method not Implemented"); return new IceResponse(IceResponse::ERROR, "Method not Implemented", 404);
} }
public function post($parameter){ public function post($parameter){
return new IceResponse(IceResponse::ERROR, "Method not Implemented"); return new IceResponse(IceResponse::ERROR, "Method not Implemented", 404);
} }
public function put($parameter){ public function put($parameter){
return new IceResponse(IceResponse::ERROR, "Method not Implemented"); return new IceResponse(IceResponse::ERROR, "Method not Implemented", 404);
} }
public function delete($parameter){ public function delete($parameter){
return new IceResponse(IceResponse::ERROR, "Method not Implemented"); return new IceResponse(IceResponse::ERROR, "Method not Implemented", 404);
} }
public function basicValidation($map, $data){
$validator = new Validator();
$map = $this->getAssocMap($map);
unset($map['id']);
foreach ($data as $key=>$val) {
if(!isset($map[$key])){
unset($data[$key]);
continue;
}
$vrules = $map[$key];
if ((!isset($vrules['allow-null']) || $vrules['allow-null'] == false) && $vrules['validation'] != "none" && empty($data[$key])){
return new IceResponse(IceResponse::ERROR, "Field should have a value - ".$key, 400);
} else if(isset($vrules['remote-source'])){
$class = $vrules['remote-source'][0];
$obj = new $class();
$idField = $vrules['remote-source'][1];
$obj->Load($idField." = ?", array($val));
if(empty($obj->$idField) || $obj->$idField != $val){
if($vrules['allow-null'] == true ){
$data[$key] = null;
}else{
return new IceResponse(IceResponse::ERROR, "Not found - ".$key, 400);
}
}
}
if(!isset($vrules['remote-source'])){
if((!isset($vrules['validation']) || empty($vrules['validation']))){
if(!$validator->validateRequired($val)){
return new IceResponse(IceResponse::ERROR, "Required field value missing - ".$key, 400);
}
}else if($vrules['validation'] != "none"){
$validationRule = "validate". ucfirst($vrules['validation']);
if(!$validator->$validationRule($val)){
return new IceResponse(IceResponse::ERROR, "Validation failed - ".$key, 400);
}
}
}
}
//check if request has all required fields
foreach ($map as $key=>$val) {
$vrules = $map[$key];
if(!isset($vrules['remote-source'])) {
if ($vrules['validation'] != "none") {
if (!isset($data[$key])) {
return new IceResponse(IceResponse::ERROR, "Required field missing - " . $key, 400);
}
}
}else{
if (!isset($vrules['allow-null']) || $vrules['allow-null'] == false) {
if (!isset($data[$key])) {
return new IceResponse(IceResponse::ERROR, "Required field missing - " . $key, 400);
}
}
}
}
return new IceResponse(IceResponse::SUCCESS, null);
}
public function getAssocMap($map){
$amap = array();
foreach ($map as $item){
$amap[$item[0]] = $item[1];
}
return $amap;
}
public function clearObject($obj){ public function clearObject($obj){
return BaseService::getInstance()->cleanUpAdoDB($obj); return BaseService::getInstance()->cleanUpAdoDB($obj);
} }
@@ -155,8 +253,39 @@ class RestEndPoint{
return $accessTokenValidation; return $accessTokenValidation;
} }
public function getValidate($parameter, $data){
return new IceResponse(IceResponse::SUCCESS, null);
}
public function postValidate($parameter, $data){
return new IceResponse(IceResponse::SUCCESS, null);
}
public function putValidate($parameter, $data){
return new IceResponse(IceResponse::SUCCESS, null);
}
public function deleteValidate($parameter, $data){
return new IceResponse(IceResponse::SUCCESS, null);
}
public function cleanDBObject($obj){
unset($obj->keysToIgnore);
return $obj;
}
public function printResponse($response){ public function printResponse($response){
echo json_encode($response,JSON_PRETTY_PRINT); echo json_encode($response,JSON_PRETTY_PRINT);
} }
public function getRequestBodyJSON() {
$rawInput = file_get_contents('php://input');
return json_decode($rawInput, true);
}
public function getRequestBody() {
$rawInput = file_get_contents('php://input');
return $rawInput;
}
} }

View File

@@ -41,4 +41,19 @@ class SettingsManager{
$setting->Save(); $setting->Save();
} }
} }
public function addSetting($name, $value){
$setting = new Setting();
$setting->Load("name = ?",array($name));
if($setting->name == $name){
$setting->value = $value;
$setting->Save();
}else{
$setting->name = $name;
$setting->value = $value;
$setting->description = $value;
$setting->meta = '';
$setting->Save();
}
}
} }

View File

@@ -28,10 +28,12 @@ class IceResponse{
var $status; var $status;
var $data; var $data;
var $code;
public function __construct($status,$data = null){ public function __construct($status, $data = null, $code = null){
$this->status = $status; $this->status = $status;
$this->data = $data; $this->data = $data;
$this->code = $code;
} }
public function getStatus(){ public function getStatus(){
@@ -46,6 +48,10 @@ class IceResponse{
return $this->data; return $this->data;
} }
public function getCode(){
return $this->code;
}
public function getJsonArray(){ public function getJsonArray(){
return array("status"=>$this->status,"data"=>$this->data); return array("status"=>$this->status,"data"=>$this->data);
} }

46
src/classes/Validator.php Normal file
View File

@@ -0,0 +1,46 @@
<?php
class Validator
{
public static function validateDate($val){
return (DateTime::createFromFormat('Y-m-d', $val) !== false);
}
public static function validateDateTime($val){
return (DateTime::createFromFormat('Y-m-d H:i:s', $val) !== false);
}
public function validateFloat($val){
return filter_var($val, FILTER_VALIDATE_FLOAT);
}
public function validateNumber($val){
return filter_var($val, FILTER_VALIDATE_FLOAT);
}
public function validateNumberOrEmpty($val){
if(empty($val)){
return true;
}
return filter_var($val, FILTER_VALIDATE_FLOAT);
}
public function validateRequired($val){
if(empty($val)){
return false;
}
return true;
}
public function validateEmail($val){
return filter_var($val, FILTER_VALIDATE_EMAIL);
}
public function validateEmailOrEmpty($val){
if(empty($val)){
return false;
}
return filter_var($val, FILTER_VALIDATE_EMAIL);
}
}

View File

@@ -2,8 +2,10 @@
"require": { "require": {
"monolog/monolog": "1.13.1", "monolog/monolog": "1.13.1",
"twig/twig": "1.23.*", "twig/twig": "1.23.*",
"gettext/gettext": "4.0.0" "gettext/gettext": "4.0.0",
"consolidation/robo": "~1"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "5.5.*"
} }
} }

File diff suppressed because it is too large Load Diff

1
src/composer/vendor/bin/phpdoc-md vendored Symbolic link
View File

@@ -0,0 +1 @@
../victorjonsson/markdowndocs/bin/phpdoc-md

1
src/composer/vendor/bin/phpunit vendored Symbolic link
View File

@@ -0,0 +1 @@
../phpunit/phpunit/phpunit

1
src/composer/vendor/bin/robo vendored Symbolic link
View File

@@ -0,0 +1 @@
../consolidation/robo/robo

Some files were not shown because too many files have changed in this diff Show More