Compare commits

...

16 Commits

Author SHA1 Message Date
Thilina Hasantha
d0d57b6575 Read me updated 2015-12-13 19:14:51 +05:30
Thilina Hasantha
d2c3a2af28 Ready updated 2015-12-13 19:11:44 +05:30
Thilina Hasantha
8eb1f9f4be Update read 2015-12-13 18:56:11 +05:30
Thilina Hasantha
6b87fdfcd8 Adding more info 2015-12-13 18:28:34 +05:30
Thilina Hasantha
934388d769 Adding upgrade script 2015-12-13 18:20:55 +05:30
Thilina Hasantha
08b4d93bef More fixes for dashboard and GA 2015-12-13 17:49:01 +05:30
Thilina Hasantha
3016ef518d Improve dashboards 2015-12-13 16:44:05 +05:30
Thilina Hasantha
6798312a78 Improve dashboards 2015-12-13 16:43:34 +05:30
Thilina Hasantha
ea106119ab New features for modules 2015-12-13 15:21:23 +05:30
Thilina Hasantha
ca3492e30e Upgraded to latest icehrm core 2015-12-13 02:56:30 +05:30
Thilina Hasantha
8dacf2a8f1 Show all errors when debug log enabled 2015-11-06 04:41:14 +05:30
Thilina Hasantha
16ce8fe461 Remove unwanted menus 2015-10-11 12:01:08 +05:30
Thilina Hasantha
51f9897ca2 Documents module 2015-10-11 11:56:34 +05:30
Thilina Hasantha
208d62d167 Fix employee leave issue 2015-10-11 08:51:36 +05:30
Thilina Hasantha
7c5c28047d Fix missing table issue in script 2015-10-11 08:38:22 +05:30
Thilina Hasantha
2881319247 Fix dashboard leave issue 2015-10-11 08:26:10 +05:30
107 changed files with 4741 additions and 3120 deletions

View File

@@ -1,157 +0,0 @@
Release note v9.1
-----------------
### Fixes
*Add missing S3FileSystem class
Release note v9.0
-----------------
### Features
*New user interface
*Decimal leave counts supported
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 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.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

View File

@@ -11,7 +11,7 @@ define('APP_DB', '_APP_DB_');
define('APP_USERNAME', '_APP_USERNAME_'); define('APP_USERNAME', '_APP_USERNAME_');
define('APP_PASSWORD', '_APP_PASSWORD_'); define('APP_PASSWORD', '_APP_PASSWORD_');
define('APP_HOST', '_APP_HOST_'); define('APP_HOST', '_APP_HOST_');
define('APP_CON_STR', 'mysql://'.APP_USERNAME.':'.APP_PASSWORD.'@'.APP_HOST.'/'.APP_DB); define('APP_CON_STR', 'mysqli://'.APP_USERNAME.':'.APP_PASSWORD.'@'.APP_HOST.'/'.APP_DB);
//file upload //file upload
define('FILE_TYPES', 'jpg,png,jpeg'); define('FILE_TYPES', 'jpg,png,jpeg');

View File

@@ -7,7 +7,7 @@ class NotificationManager{
$this->baseService = $baseService; $this->baseService = $baseService;
} }
public function addNotification($toEmployee, $message, $action, $type, $toUserId = null, $fromSystem = false){ public function addNotification($toEmployee, $message, $action, $type, $toUserId = null, $fromSystem = false, $sendEmail = false){
$userEmp = new User(); $userEmp = new User();
@@ -63,6 +63,11 @@ class NotificationManager{
$ok = $noti->Save(); $ok = $noti->Save();
if(!$ok){ if(!$ok){
error_log("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);
}
} }
} }

View File

@@ -0,0 +1 @@
<?php

View File

@@ -9,13 +9,13 @@ define('HOME_LINK_ADMIN', CLIENT_BASE_URL."?g=admin&n=dashboard&m=admin_Admin");
define('HOME_LINK_OTHERS', CLIENT_BASE_URL."?g=modules&n=dashboard&m=module_Personal_Information"); define('HOME_LINK_OTHERS', CLIENT_BASE_URL."?g=modules&n=dashboard&m=module_Personal_Information");
//Version //Version
define('VERSION', '13.1.OS'); define('VERSION', '14.0.OS');
define('CACHE_VALUE', '13.1'); define('CACHE_VALUE', '14.0.OS');
define('VERSION_DATE', '09/10/2015'); define('VERSION_DATE', '12/12/2015');
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');}
if(!defined('APP_SEC')){define('APP_SEC','dbcs234d2saaqw');} if(!defined('APP_SEC')){define('APP_SEC','dbcs234d2s111');}
define('UI_SHOW_SWITCH_PROFILE', true); define('UI_SHOW_SWITCH_PROFILE', true);
define('CRON_LOG', '/var/log/nginx/icehrmcron.log'); define('CRON_LOG', '/var/log/nginx/icehrmcron.log');

View File

@@ -1,519 +0,0 @@
.redFont{
color: red;
}
.box_ws{
background: white;
border-left: 1px solid #DDD;
border-right: 1px solid #DDD;
border-bottom: 1px solid #DDD;
color: #555;
}
.cal_box_ws{
background: white;
border: 1px solid #DDD;
color: #555;
height: 100px;
}
.cal_box_ws .wd_date_full{
font-weight:bold;
font-size:10px;
float: right;
margin-right: 5px;
}
.cal_box_ws .wd_date{
font-size:10px;
float: right;
margin-right: 5px;
}
.nav-pills li a:hover{
background: #1D64AD;
color:white;
};
.navbar-inverse .brand, .navbar-inverse .nav > li > a {
font-weight: bold;
font-size: 12px;
}
.categoryWrap p{
font-size:16px;
font-weight:bold;
padding: 3px;
}
.categoryWrap p:hover{
font-size:16px;
font-weight:bold;
color:white;
background: gray;
padding: 3px;
cursor:pointer;
border-radius: 4px;
}
.resultLogo{
text-align: center;
}
.pbar{
font-weight:bold;
font-size:11px;
}
.pbar .progress{
height: 10px;
}
.bs-docs-sidenav {
width: 228px;
margin: 30px 0 0;
padding: 0;
background-color: #fff;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
-webkit-box-shadow: 0 1px 4px rgba(0,0,0,.065);
-moz-box-shadow: 0 1px 4px rgba(0,0,0,.065);
box-shadow: 0 1px 4px rgba(0,0,0,.065);
}
.bs-docs-sidenav > li > a {
display: block;
*width: 190px;
margin: 0 0 -1px;
padding: 8px 14px;
border: 1px solid #e5e5e5;
}
.bs-docs-sidenav > li:first-child > a {
-webkit-border-radius: 6px 6px 0 0;
-moz-border-radius: 6px 6px 0 0;
border-radius: 6px 6px 0 0;
}
.bs-docs-sidenav > li:last-child > a {
-webkit-border-radius: 0 0 6px 6px;
-moz-border-radius: 0 0 6px 6px;
border-radius: 0 0 6px 6px;
}
.bs-docs-sidenav > .active > a {
position: relative;
z-index: 2;
padding: 9px 15px;
border: 0;
text-shadow: 0 1px 0 rgba(0,0,0,.15);
-webkit-box-shadow: inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1);
-moz-box-shadow: inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1);
box-shadow: inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1);
}
/* Chevrons */
.bs-docs-sidenav .icon-chevron-right {
float: right;
margin-top: 2px;
margin-right: -6px;
opacity: .25;
}
.bs-docs-sidenav > li > a:hover {
background-color: #f5f5f5;
}
.bs-docs-sidenav a:hover .icon-chevron-right {
opacity: .5;
}
.bs-docs-sidenav .active .icon-chevron-right,
.bs-docs-sidenav .active a:hover .icon-chevron-right {
background-image: url(../img/glyphicons-halflings-white.png);
opacity: 1;
}
.bs-docs-sidenav.affix {
top: 40px;
}
.bs-docs-sidenav.affix-bottom {
position: absolute;
top: auto;
bottom: 270px;
}
/* Responsive
-------------------------------------------------- */
/* Desktop large
------------------------- */
@media (min-width: 1200px) {
.bs-docs-container {
max-width: 970px;
}
.bs-docs-sidenav {
width: 258px;
}
}
.reviewPoints{
margin-top:10px;
}
.reviewPoints .star{
margin-left: 10px;
}
.reviewBlock {
position: relative;
margin: 0px 0;
padding: 39px 19px 14px;
background-color: white;
border: 1px solid #DDD;
/*
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
*/
font-size:12px;
}
/*.reviewBlock::after {
content: attr(data-content);
position: absolute;
top: -1px;
left: -1px;
padding: 3px 7px;
font-size: 12px;
font-weight: bold;
background-color: whiteSmoke;
border: 1px solid #DDD;
color: #9DA0A4;
-webkit-border-radius: 4px 0 4px 0;
-moz-border-radius: 4px 0 4px 0;
border-radius: 4px 0 4px 0;
}*/
.box_ws{
background: white;
border-left: 1px solid #DDD;
border-right: 1px solid #DDD;
border-bottom: 1px solid #DDD;
color: #555;
}
.cal_box_ws{
background: white;
border: 1px solid #DDD;
color: #555;
height: 100px;
}
.cal_box_ws .wd_date_full{
font-weight:bold;
font-size:10px;
float: right;
margin-right: 5px;
}
.cal_box_ws .wd_date{
font-size:10px;
float: right;
margin-right: 5px;
}
.nav-pills li a:hover{
background: #1D64AD;
color:white;
};
.nav-tabs > li > a {
color:white;
}
.nav-tabs > li > a:hover{
color:#555;
}
.topheader {
background: -moz-linear-gradient(#829AA8, #405A6A);
background: -webkit-linear-gradient(#829AA8, #405A6A);
background: linear-gradient(#829AA8, #405A6A);
border: 1px solid #677C89;
border-bottom-color: #6B808D;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4),0 0px 10px rgba(0, 0, 0, 0.1);
}
.bgbody{
background: #FAFAFA;
background: -moz-linear-gradient(#FAFAFA, #EAEAEA);
background: -webkit-linear-gradient(#FAFAFA, #EAEAEA);
background: linear-gradient(#FAFAFA, #EAEAEA);
border-bottom: 1px solid #CACACA;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4),0 0px 10px rgba(0, 0, 0, 0.1);
}
.leftMenu{
background-color: #E9F1F4;
border-style: solid;
border-width: 1px 1px 2px;
border-color: #E9F1F4 #D8DEE2 #D8DEE2;
border-radius: 0 0 5px 5px;
}
.nav > li > a:hover {
text-decoration: none;
background-color: whitesmoke;
border-radius: 5px;
}
/*
.nav-list > .active > a, .nav-list > .active > a:hover{
color: white;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
background-color: #405A6A;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4),0 0px 10px rgba(0, 0, 0, 0.1);
border-radius: 5px;
}
*/
a {
color: #405A6A;
text-decoration: none;
}
.nav-header {
display: block;
padding: 3px 15px;
font-size: 15px;
font-weight: bold;
line-height: 20px;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
text-transform: none;
background: -moz-linear-gradient(#829AA8, #405A6A);
background: -webkit-linear-gradient(#829AA8, #405A6A);
background: linear-gradient(#829AA8, #405A6A);
color: white;
border-radius: 2px;
}
.modal-backdrop,
.modal-backdrop.fade.in {
opacity: 0.4;
filter: alpha(opacity=40);
}
.error{
color:red;
}
.columnMain{
font-weight: bold;
}
.borderBox{
padding-bottom: 10px;
padding-left: 10px;
padding-top: 10px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-border-radius: 5px;
margin-bottom: 20px;
-moz-box-shadow: 1px 3px 3px rgba(0, 0, 0, 0.1);
-webkit-box-shadow: 1px 3px 3px rgba(0, 0, 0, 0.1);
box-shadow: 1px 3px 3px rgba(0, 0, 0, 0.1);
border: 1px solid #EEE;
}
.iceicon_edit{
background-image: url("../images/edit.png");
}
.iceicon_delete{
background-image: url("../images/delete.png");
}
.iceicon_user{
background-image: url("../images/user.png");
}
.dropdown-menu{
z-index: 10000;
}
.lightface .lightfaceContent .lightfaceTitle {
font-size: 14px;
color: #fff;
background-color: #405A6A;
border: 1px solid #405A6A;
font-weight: bold;
margin: -1px;
margin-bottom: 0;
padding: 5px 10px;
line-height: 30px;
}
.label-ice, .badge-ice{
background-color: #405A6A;
}
.dataTables_processing{
position: absolute;
margin-left: 40px;
font-weight: bold;
font-size: 13px;
color: gray;
}
/*changes to full caledar*/
.fc-header-title h2 {
margin-top: 0;
white-space: nowrap;
font-size: 20px;
margin-left: 10px;
color:#405A6A;
}
table.dataTable{
font-size: 1.1em;
}
.form-horizontal{
font-size: 1.2em;
}
.form-horizontal .row{
margin-bottom: 10px;
}
.table.dataTable {width:100% !important;}
.iceLabel{
font-size: 12px !important;
font-weight: bold;
color: #3c8dbc;
}
.nav-tabs>li>a{
border-radius:0px;
}
.nav > li > a:hover {
border-radius:0px;
}
.btn {
-webkit-border-radius: 0px;
-moz-border-radius: 0px;
border-radius: 0px;
}
/* select2 style overide */
.select2-choice{
border: none !important;
width: 100% !important;
border-radius: 0px !important;
background-color: #FFF !important;
background-image: none !important;
}
.select2-container{
padding:3px !important;
}
.select2-container-multi{
padding:0px !important;
border:none;
}
.select2-arrow{
background-image: none !important;
background: #FFF !important;
border: none !important;
}
.select2-drop-active {
/*border: 1px solid black !important;*/
border-top: none !important;
background: #f0f0f0 !important;
}
.logTime{
font-weight: bold;
font-size: 13px;
font-style: italic;
}
.popupForm{
border: none !important;
padding: 0px 19px 14px !important;
}
.content {
background: #FFF;
}
.wrapper {
background: #FFF;
}
.user-panel > .info > p {
margin-bottom: 9px;
max-width: 135px;
line-height: 17px;
}
.list-group-item-text{
margin-bottom:5px;
}
.list-group-item{
padding-bottom:30px;
}
/custom for v11.0 */
.table-bordered>thead>tr>th{
border:none !important;
}
.table-bordered>thead>tr>th, .table-bordered>thead>tr>td {
border-bottom-width: 2px;
border: none;
}
.table{
-webkit-transition: margin-left .15s linear;
transition: margin-left .15s linear;
-webkit-user-select: none;
background-color: #fff;
-webkit-box-shadow: 0 1px 2px 0 rgba(0,0,0,.2);
box-shadow: 0 1px 2px 0 rgba(0,0,0,.2);
}
.reviewBlock{
-webkit-box-sizing: border-box;
box-sizing: border-box
}
.treeview-menu li:hover{
font-weight:bold;
}

View File

@@ -0,0 +1,145 @@
ALTER TABLE EmployeeTravelRecords ADD COLUMN `funding` decimal(10,3) NULL AFTER `details`;
ALTER TABLE EmployeeTravelRecords ADD COLUMN `currency` bigint(20) NULL AFTER `funding`;
ALTER TABLE EmployeeTravelRecords ADD COLUMN `status` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled') default 'Pending';
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`) VALUES
('Travel Request Report', 'This report list employees travel requests for a specified period',
'[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}],\r\n[ "status", {"label":"Status","type":"select","source":[["NULL","All Statuses"],["Approved","Approved"],["Pending","Pending"],["Rejected","Rejected"],["Cancellation Requested","Cancellation Requested"],["Cancelled","Cancelled"]]}]\r\n]',
'TravelRequestReport',
'["employee","date_start","date_end","status"]', 'Class');
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Travel: Pre-Approve Travel Request', '0', '','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Attendance: Use Department Time Zone', '0', '','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
UPDATE `Settings` set value = '1' where name = 'System: Reset Modules and Permissions';
ALTER TABLE `CompanyStructures` ADD COLUMN `timezone` varchar(100) not null default 'Europe/London';
create table `Timezones` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) not null default '',
`details` varchar(255) not null default '',
primary key (`id`)
) engine=innodb default charset=utf8;
INSERT INTO `Timezones`(`id`, `name`, `details`) VALUES
(1, 'Pacific/Midway', '(GMT-11:00) Midway Island'),
(2, 'US/Samoa', '(GMT-11:00) Samoa'),
(3, 'US/Hawaii', '(GMT-10:00) Hawaii'),
(4, 'US/Alaska', '(GMT-09:00) Alaska'),
(5, 'US/Pacific', '(GMT-08:00) Pacific Time (US &amp; Canada)'),
(6, 'America/Tijuana', '(GMT-08:00) Tijuana'),
(7, 'US/Arizona', '(GMT-07:00) Arizona'),
(8, 'US/Mountain', '(GMT-07:00) Mountain Time (US &amp; Canada)'),
(9, 'America/Chihuahua', '(GMT-07:00) Chihuahua'),
(10, 'America/Mazatlan', '(GMT-07:00) Mazatlan'),
(11, 'America/Mexico_City', '(GMT-06:00) Mexico City'),
(12, 'America/Monterrey', '(GMT-06:00) Monterrey'),
(13, 'Canada/Saskatchewan', '(GMT-06:00) Saskatchewan'),
(14, 'US/Central', '(GMT-06:00) Central Time (US &amp; Canada)'),
(15, 'US/Eastern', '(GMT-05:00) Eastern Time (US &amp; Canada)'),
(16, 'US/East-Indiana', '(GMT-05:00) Indiana (East)'),
(17, 'America/Bogota', '(GMT-05:00) Bogota'),
(18, 'America/Lima', '(GMT-05:00) Lima'),
(19, 'America/Caracas', '(GMT-04:30) Caracas'),
(20, 'Canada/Atlantic', '(GMT-04:00) Atlantic Time (Canada)'),
(21, 'America/La_Paz', '(GMT-04:00) La Paz'),
(22, 'America/Santiago', '(GMT-04:00) Santiago'),
(23, 'Canada/Newfoundland', '(GMT-03:30) Newfoundland'),
(24, 'America/Buenos_Aires', '(GMT-03:00) Buenos Aires'),
(25, 'Greenland', '(GMT-03:00) Greenland'),
(26, 'Atlantic/Stanley', '(GMT-02:00) Stanley'),
(27, 'Atlantic/Azores', '(GMT-01:00) Azores'),
(28, 'Atlantic/Cape_Verde', '(GMT-01:00) Cape Verde Is.'),
(29, 'Africa/Casablanca', '(GMT) Casablanca'),
(30, 'Europe/Dublin', '(GMT) Dublin'),
(31, 'Europe/Lisbon', '(GMT) Lisbon'),
(32, 'Europe/London', '(GMT) London'),
(33, 'Africa/Monrovia', '(GMT) Monrovia'),
(34, 'Europe/Amsterdam', '(GMT+01:00) Amsterdam'),
(35, 'Europe/Belgrade', '(GMT+01:00) Belgrade'),
(36, 'Europe/Berlin', '(GMT+01:00) Berlin'),
(37, 'Europe/Bratislava', '(GMT+01:00) Bratislava'),
(38, 'Europe/Brussels', '(GMT+01:00) Brussels'),
(39, 'Europe/Budapest', '(GMT+01:00) Budapest'),
(40, 'Europe/Copenhagen', '(GMT+01:00) Copenhagen'),
(41, 'Europe/Ljubljana', '(GMT+01:00) Ljubljana'),
(42, 'Europe/Madrid', '(GMT+01:00) Madrid'),
(43, 'Europe/Paris', '(GMT+01:00) Paris'),
(44, 'Europe/Prague', '(GMT+01:00) Prague'),
(45, 'Europe/Rome', '(GMT+01:00) Rome'),
(46, 'Europe/Sarajevo', '(GMT+01:00) Sarajevo'),
(47, 'Europe/Skopje', '(GMT+01:00) Skopje'),
(48, 'Europe/Stockholm', '(GMT+01:00) Stockholm'),
(49, 'Europe/Vienna', '(GMT+01:00) Vienna'),
(50, 'Europe/Warsaw', '(GMT+01:00) Warsaw'),
(51, 'Europe/Zagreb', '(GMT+01:00) Zagreb'),
(52, 'Europe/Athens', '(GMT+02:00) Athens'),
(53, 'Europe/Bucharest', '(GMT+02:00) Bucharest'),
(54, 'Africa/Cairo', '(GMT+02:00) Cairo'),
(55, 'Africa/Harare', '(GMT+02:00) Harare'),
(56, 'Europe/Helsinki', '(GMT+02:00) Helsinki'),
(57, 'Europe/Istanbul', '(GMT+02:00) Istanbul'),
(58, 'Asia/Jerusalem', '(GMT+02:00) Jerusalem'),
(59, 'Europe/Kiev', '(GMT+02:00) Kyiv'),
(60, 'Europe/Minsk', '(GMT+02:00) Minsk'),
(61, 'Europe/Riga', '(GMT+02:00) Riga'),
(62, 'Europe/Sofia', '(GMT+02:00) Sofia'),
(63, 'Europe/Tallinn', '(GMT+02:00) Tallinn'),
(64, 'Europe/Vilnius', '(GMT+02:00) Vilnius'),
(65, 'Asia/Baghdad', '(GMT+03:00) Baghdad'),
(66, 'Asia/Kuwait', '(GMT+03:00) Kuwait'),
(67, 'Africa/Nairobi', '(GMT+03:00) Nairobi'),
(68, 'Asia/Riyadh', '(GMT+03:00) Riyadh'),
(69, 'Europe/Moscow', '(GMT+03:00) Moscow'),
(70, 'Asia/Tehran', '(GMT+03:30) Tehran'),
(71, 'Asia/Baku', '(GMT+04:00) Baku'),
(72, 'Europe/Volgograd', '(GMT+04:00) Volgograd'),
(73, 'Asia/Muscat', '(GMT+04:00) Muscat'),
(74, 'Asia/Tbilisi', '(GMT+04:00) Tbilisi'),
(75, 'Asia/Yerevan', '(GMT+04:00) Yerevan'),
(76, 'Asia/Kabul', '(GMT+04:30) Kabul'),
(77, 'Asia/Karachi', '(GMT+05:00) Karachi'),
(78, 'Asia/Tashkent', '(GMT+05:00) Tashkent'),
(79, 'Asia/Kolkata', '(GMT+05:30) Kolkata'),
(80, 'Asia/Kathmandu', '(GMT+05:45) Kathmandu'),
(81, 'Asia/Yekaterinburg', '(GMT+06:00) Ekaterinburg'),
(82, 'Asia/Almaty', '(GMT+06:00) Almaty'),
(83, 'Asia/Dhaka', '(GMT+06:00) Dhaka'),
(84, 'Asia/Novosibirsk', '(GMT+07:00) Novosibirsk'),
(85, 'Asia/Bangkok', '(GMT+07:00) Bangkok'),
(86, 'Asia/Jakarta', '(GMT+07:00) Jakarta'),
(87, 'Asia/Krasnoyarsk', '(GMT+08:00) Krasnoyarsk'),
(88, 'Asia/Chongqing', '(GMT+08:00) Chongqing'),
(89, 'Asia/Hong_Kong', '(GMT+08:00) Hong Kong'),
(90, 'Asia/Kuala_Lumpur', '(GMT+08:00) Kuala Lumpur'),
(91, 'Australia/Perth', '(GMT+08:00) Perth'),
(92, 'Asia/Singapore', '(GMT+08:00) Singapore'),
(93, 'Asia/Taipei', '(GMT+08:00) Taipei'),
(94, 'Asia/Ulaanbaatar', '(GMT+08:00) Ulaan Bataar'),
(95, 'Asia/Urumqi', '(GMT+08:00) Urumqi'),
(96, 'Asia/Irkutsk', '(GMT+09:00) Irkutsk'),
(97, 'Asia/Seoul', '(GMT+09:00) Seoul'),
(98, 'Asia/Tokyo', '(GMT+09:00) Tokyo'),
(99, 'Australia/Adelaide', '(GMT+09:30) Adelaide'),
(100, 'Australia/Darwin', '(GMT+09:30) Darwin'),
(101, 'Asia/Yakutsk', '(GMT+10:00) Yakutsk'),
(102, 'Australia/Brisbane', '(GMT+10:00) Brisbane'),
(103, 'Australia/Canberra', '(GMT+10:00) Canberra'),
(104, 'Pacific/Guam', '(GMT+10:00) Guam'),
(105, 'Australia/Hobart', '(GMT+10:00) Hobart'),
(106, 'Australia/Melbourne', '(GMT+10:00) Melbourne'),
(107, 'Pacific/Port_Moresby', '(GMT+10:00) Port Moresby'),
(108, 'Australia/Sydney', '(GMT+10:00) Sydney'),
(109, 'Asia/Vladivostok', '(GMT+11:00) Vladivostok'),
(110, 'Asia/Magadan', '(GMT+12:00) Magadan'),
(111, 'Pacific/Auckland', '(GMT+12:00) Auckland'),
(112, 'Pacific/Fiji', '(GMT+12:00) Fiji');

View File

@@ -91,12 +91,13 @@ if(!file_exists($logoFileName)){
/* The white background content wrapper */ /* The white background content wrapper */
.container > .content { .container > .content {
min-height: 0px !important;
background-color: #fff; background-color: #fff;
padding: 20px; padding: 20px;
margin: 0 -20px; margin: 0 -20px;
-webkit-border-radius: 10px 10px 10px 10px; -webkit-border-radius:0px;
-moz-border-radius: 10px 10px 10px 10px; -moz-border-radius:0px;
border-radius: 10px 10px 10px 10px; border-radius: 0px;
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.15); -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.15);
-moz-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); box-shadow: 0 1px 2px rgba(0,0,0,.15);
@@ -112,6 +113,18 @@ if(!file_exists($logoFileName)){
color: #404040; 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> </style>

View File

@@ -52,6 +52,41 @@
</div> </div>
<!-- Plain Message Modal --> <!-- Plain Message Modal -->
<!-- Data Message Modal -->
<div class="modal fade" id="dataMessageModel" tabindex="-1" role="dialog" aria-labelledby="dataMessageModelLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header" style="border-bottom:none;/*background-color: #3c8dbc;*/">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" style="margin-top:-10px;"><li class="fa fa-times"/></button>
</div>
<div class="modal-body">
<p id="dataMessageModelBody"></p>
</div>
</div>
</div>
</div>
<!-- Data Message Modal -->
<!-- Yes No Modal -->
<div class="modal fade" id="yesnoModel" tabindex="-1" role="dialog" aria-labelledby="yesnoModelLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-times"/></button>
<h3 id="yesnoModelLabel" style="font-size: 17px;"></h3>
</div>
<div class="modal-body">
<p id="yesnoModelBody"></p>
</div>
<div class="modal-footer">
<button id="yesnoModelNoBtn" class="btn" onclick="modJs.cancelYesno();">No</button>
<button id="yesnoModelYesBtn" class="btn btn-primary">Yes</button>
</div>
</div>
</div>
</div>
<!-- Yes No Modal -->
<!-- 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">

View File

@@ -1,3 +1,119 @@
INSERT INTO `Timezones`(`id`, `name`, `details`) VALUES
(1, 'Pacific/Midway', '(GMT-11:00) Midway Island'),
(2, 'US/Samoa', '(GMT-11:00) Samoa'),
(3, 'US/Hawaii', '(GMT-10:00) Hawaii'),
(4, 'US/Alaska', '(GMT-09:00) Alaska'),
(5, 'US/Pacific', '(GMT-08:00) Pacific Time (US, Canada)'),
(6, 'America/Tijuana', '(GMT-08:00) Tijuana'),
(7, 'US/Arizona', '(GMT-07:00) Arizona'),
(8, 'US/Mountain', '(GMT-07:00) Mountain Time (US, Canada)'),
(9, 'America/Chihuahua', '(GMT-07:00) Chihuahua'),
(10, 'America/Mazatlan', '(GMT-07:00) Mazatlan'),
(11, 'America/Mexico_City', '(GMT-06:00) Mexico City'),
(12, 'America/Monterrey', '(GMT-06:00) Monterrey'),
(13, 'Canada/Saskatchewan', '(GMT-06:00) Saskatchewan'),
(14, 'US/Central', '(GMT-06:00) Central Time (US , Canada)'),
(15, 'US/Eastern', '(GMT-05:00) Eastern Time (US , Canada)'),
(16, 'US/East-Indiana', '(GMT-05:00) Indiana (East)'),
(17, 'America/Bogota', '(GMT-05:00) Bogota'),
(18, 'America/Lima', '(GMT-05:00) Lima'),
(19, 'America/Caracas', '(GMT-04:30) Caracas'),
(20, 'Canada/Atlantic', '(GMT-04:00) Atlantic Time (Canada)'),
(21, 'America/La_Paz', '(GMT-04:00) La Paz'),
(22, 'America/Santiago', '(GMT-04:00) Santiago'),
(23, 'Canada/Newfoundland', '(GMT-03:30) Newfoundland'),
(24, 'America/Buenos_Aires', '(GMT-03:00) Buenos Aires'),
(25, 'Greenland', '(GMT-03:00) Greenland'),
(26, 'Atlantic/Stanley', '(GMT-02:00) Stanley'),
(27, 'Atlantic/Azores', '(GMT-01:00) Azores'),
(28, 'Atlantic/Cape_Verde', '(GMT-01:00) Cape Verde Is.'),
(29, 'Africa/Casablanca', '(GMT) Casablanca'),
(30, 'Europe/Dublin', '(GMT) Dublin'),
(31, 'Europe/Lisbon', '(GMT) Lisbon'),
(32, 'Europe/London', '(GMT) London'),
(33, 'Africa/Monrovia', '(GMT) Monrovia'),
(34, 'Europe/Amsterdam', '(GMT+01:00) Amsterdam'),
(35, 'Europe/Belgrade', '(GMT+01:00) Belgrade'),
(36, 'Europe/Berlin', '(GMT+01:00) Berlin'),
(37, 'Europe/Bratislava', '(GMT+01:00) Bratislava'),
(38, 'Europe/Brussels', '(GMT+01:00) Brussels'),
(39, 'Europe/Budapest', '(GMT+01:00) Budapest'),
(40, 'Europe/Copenhagen', '(GMT+01:00) Copenhagen'),
(41, 'Europe/Ljubljana', '(GMT+01:00) Ljubljana'),
(42, 'Europe/Madrid', '(GMT+01:00) Madrid'),
(43, 'Europe/Paris', '(GMT+01:00) Paris'),
(44, 'Europe/Prague', '(GMT+01:00) Prague'),
(45, 'Europe/Rome', '(GMT+01:00) Rome'),
(46, 'Europe/Sarajevo', '(GMT+01:00) Sarajevo'),
(47, 'Europe/Skopje', '(GMT+01:00) Skopje'),
(48, 'Europe/Stockholm', '(GMT+01:00) Stockholm'),
(49, 'Europe/Vienna', '(GMT+01:00) Vienna'),
(50, 'Europe/Warsaw', '(GMT+01:00) Warsaw'),
(51, 'Europe/Zagreb', '(GMT+01:00) Zagreb'),
(52, 'Europe/Athens', '(GMT+02:00) Athens'),
(53, 'Europe/Bucharest', '(GMT+02:00) Bucharest'),
(54, 'Africa/Cairo', '(GMT+02:00) Cairo'),
(55, 'Africa/Harare', '(GMT+02:00) Harare'),
(56, 'Europe/Helsinki', '(GMT+02:00) Helsinki'),
(57, 'Europe/Istanbul', '(GMT+02:00) Istanbul'),
(58, 'Asia/Jerusalem', '(GMT+02:00) Jerusalem'),
(59, 'Europe/Kiev', '(GMT+02:00) Kyiv'),
(60, 'Europe/Minsk', '(GMT+02:00) Minsk'),
(61, 'Europe/Riga', '(GMT+02:00) Riga'),
(62, 'Europe/Sofia', '(GMT+02:00) Sofia'),
(63, 'Europe/Tallinn', '(GMT+02:00) Tallinn'),
(64, 'Europe/Vilnius', '(GMT+02:00) Vilnius'),
(65, 'Asia/Baghdad', '(GMT+03:00) Baghdad'),
(66, 'Asia/Kuwait', '(GMT+03:00) Kuwait'),
(67, 'Africa/Nairobi', '(GMT+03:00) Nairobi'),
(68, 'Asia/Riyadh', '(GMT+03:00) Riyadh'),
(69, 'Europe/Moscow', '(GMT+03:00) Moscow'),
(70, 'Asia/Tehran', '(GMT+03:30) Tehran'),
(71, 'Asia/Baku', '(GMT+04:00) Baku'),
(72, 'Europe/Volgograd', '(GMT+04:00) Volgograd'),
(73, 'Asia/Muscat', '(GMT+04:00) Muscat'),
(74, 'Asia/Tbilisi', '(GMT+04:00) Tbilisi'),
(75, 'Asia/Yerevan', '(GMT+04:00) Yerevan'),
(76, 'Asia/Kabul', '(GMT+04:30) Kabul'),
(77, 'Asia/Karachi', '(GMT+05:00) Karachi'),
(78, 'Asia/Tashkent', '(GMT+05:00) Tashkent'),
(79, 'Asia/Kolkata', '(GMT+05:30) Kolkata'),
(80, 'Asia/Kathmandu', '(GMT+05:45) Kathmandu'),
(81, 'Asia/Yekaterinburg', '(GMT+06:00) Ekaterinburg'),
(82, 'Asia/Almaty', '(GMT+06:00) Almaty'),
(83, 'Asia/Dhaka', '(GMT+06:00) Dhaka'),
(84, 'Asia/Novosibirsk', '(GMT+07:00) Novosibirsk'),
(85, 'Asia/Bangkok', '(GMT+07:00) Bangkok'),
(86, 'Asia/Jakarta', '(GMT+07:00) Jakarta'),
(87, 'Asia/Krasnoyarsk', '(GMT+08:00) Krasnoyarsk'),
(88, 'Asia/Chongqing', '(GMT+08:00) Chongqing'),
(89, 'Asia/Hong_Kong', '(GMT+08:00) Hong Kong'),
(90, 'Asia/Kuala_Lumpur', '(GMT+08:00) Kuala Lumpur'),
(91, 'Australia/Perth', '(GMT+08:00) Perth'),
(92, 'Asia/Singapore', '(GMT+08:00) Singapore'),
(93, 'Asia/Taipei', '(GMT+08:00) Taipei'),
(94, 'Asia/Ulaanbaatar', '(GMT+08:00) Ulaan Bataar'),
(95, 'Asia/Urumqi', '(GMT+08:00) Urumqi'),
(96, 'Asia/Irkutsk', '(GMT+09:00) Irkutsk'),
(97, 'Asia/Seoul', '(GMT+09:00) Seoul'),
(98, 'Asia/Tokyo', '(GMT+09:00) Tokyo'),
(99, 'Australia/Adelaide', '(GMT+09:30) Adelaide'),
(100, 'Australia/Darwin', '(GMT+09:30) Darwin'),
(101, 'Asia/Yakutsk', '(GMT+10:00) Yakutsk'),
(102, 'Australia/Brisbane', '(GMT+10:00) Brisbane'),
(103, 'Australia/Canberra', '(GMT+10:00) Canberra'),
(104, 'Pacific/Guam', '(GMT+10:00) Guam'),
(105, 'Australia/Hobart', '(GMT+10:00) Hobart'),
(106, 'Australia/Melbourne', '(GMT+10:00) Melbourne'),
(107, 'Pacific/Port_Moresby', '(GMT+10:00) Port Moresby'),
(108, 'Australia/Sydney', '(GMT+10:00) Sydney'),
(109, 'Asia/Vladivostok', '(GMT+11:00) Vladivostok'),
(110, 'Asia/Magadan', '(GMT+12:00) Magadan'),
(111, 'Pacific/Auckland', '(GMT+12:00) Auckland'),
(112, 'Pacific/Fiji', '(GMT+12:00) Fiji');
INSERT INTO `CurrencyTypes`(`id`, `code`, `name`) VALUES INSERT INTO `CurrencyTypes`(`id`, `code`, `name`) VALUES
(3, 'AED', 'Utd. Arab Emir. Dirham'), (3, 'AED', 'Utd. Arab Emir. Dirham'),
(4, 'AFN', 'Afghanistan Afghani'), (4, 'AFN', 'Afghanistan Afghani'),
@@ -665,14 +781,6 @@ INSERT INTO `Nationality` (`id`, `name`) VALUES
(192, 'Zambian'), (192, 'Zambian'),
(193, 'Zimbabwean'); (193, 'Zimbabwean');
INSERT INTO `WorkDays` (`id`, `name`, `status`, `country`) VALUES
(1, 'Monday', 'Full Day',NULL),
(2, 'Tuesday', 'Full Day',NULL),
(3, 'Wednesday', 'Full Day',NULL),
(4, 'Thursday', 'Full Day',NULL),
(5, 'Friday', 'Full Day',NULL),
(6, 'Saturday', 'Non-working Day',NULL),
(7, 'Sunday', 'Non-working Day',NULL);
INSERT INTO `Reports` (`id`, `name`, `details`, `parameters`, `query`, `paramOrder`, `type`) VALUES INSERT INTO `Reports` (`id`, `name`, `details`, `parameters`, `query`, `paramOrder`, `type`) VALUES
@@ -681,10 +789,17 @@ INSERT INTO `Reports` (`id`, `name`, `details`, `parameters`, `query`, `paramOrd
(4, 'Employee Attendance Report', 'This report list all employee attendance entries by employee and date range', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeAttendanceReport', '["employee","date_start","date_end"]', 'Class'), (4, 'Employee Attendance Report', 'This report list all employee attendance entries by employee and date range', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeAttendanceReport', '["employee","date_start","date_end"]', 'Class'),
(5, 'Employee Time Tracking Report', 'This report list employee working hours and attendance details for each day for a given period ', '[\r\n[ "employee", {"label":"Employee","type":"select2","allow-null":false,"remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeTimeTrackReport', '["employee","date_start","date_end"]', 'Class'); (5, 'Employee Time Tracking Report', 'This report list employee working hours and attendance details for each day for a given period ', '[\r\n[ "employee", {"label":"Employee","type":"select2","allow-null":false,"remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeTimeTrackReport', '["employee","date_start","date_end"]', 'Class');
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`) VALUES
('Expense Report', 'This report list employees expenses for a specified period',
'[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}],\r\n[ "status", {"label":"Status","type":"select","source":[["NULL","All Statuses"],["Approved","Approved"],["Pending","Pending"],["Rejected","Rejected"],["Cancellation Requested","Cancellation Requested"],["Cancelled","Cancelled"]]}]\r\n]',
'ExpenseReport',
'["employee","date_start","date_end","status"]', 'Class');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Company: Logo', '', '','[ "value", {"label":"Logo","type":"fileupload","validation":"none"}]'),
('Company: Name', 'Sample Company Pvt Ltd', 'Update your company name - For updating company logo copy a file named logo.png to /app/data/ folder', ''), ('Company: Name', 'Sample Company Pvt Ltd', 'Update your company name - For updating company logo copy a file named logo.png to /app/data/ folder', ''),
('Company: Description', 'This is a company using icehrm.com', '',''),
('Email: Enable', '1', '0 will disable all outgoing emails from modules. Value 1 will enable outgoing emails','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'), ('Email: Enable', '1', '0 will disable all outgoing emails from modules. Value 1 will enable outgoing emails','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
('Email: Mode', 'SMTP', 'SMTP, PHP Mailer or Amazon SES. SMTP = send emails using local or a remote smtp server. PHP Mailer = send emails using mail function provided by php. Amazon SES = send emails trough amazon Simple Email Service.','["value", {"label":"Value","type":"select","source":[["SMTP","SMTP"],["PHP Mailer","PHP Mailer"],["SES","Amazon SES"]]}]'), ('Email: Mode', 'SMTP', 'SMTP, PHP Mailer or Amazon SES. SMTP = send emails using local or a remote smtp server. PHP Mailer = send emails using mail function provided by php. Amazon SES = send emails trough amazon Simple Email Service.','["value", {"label":"Value","type":"select","source":[["SMTP","SMTP"],["PHP Mailer","PHP Mailer"],["SES","Amazon SES"]]}]'),
('Email: SMTP Host', 'localhost', 'SMTP host IP',''), ('Email: SMTP Host', 'localhost', 'SMTP host IP',''),
@@ -704,6 +819,17 @@ INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Api: REST Api Enabled', '0', '','["value", {"label":"Value","type":"select","source":[["0","No"],["1","Yes"]]}]'); ('Api: REST Api Enabled', '0', '','["value", {"label":"Value","type":"select","source":[["0","No"],["1","Yes"]]}]');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Travel: Pre-Approve Travel Request', '0', '','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Attendance: Use Department Time Zone', '0', '','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Analytics: Google Key', 'UA-48048570-2', 'Google Analytics Key','');
INSERT INTO `Certifications` (`id`, `name`, `description`) VALUES INSERT INTO `Certifications` (`id`, `name`, `description`) VALUES
(1, 'Red Hat Certified Architect (RHCA)', 'Red Hat Certified Architect (RHCA)'), (1, 'Red Hat Certified Architect (RHCA)', 'Red Hat Certified Architect (RHCA)'),
(2, 'GIAC Secure Software Programmer -Java', 'GIAC Secure Software Programmer -Java'), (2, 'GIAC Secure Software Programmer -Java', 'GIAC Secure Software Programmer -Java'),
@@ -746,11 +872,6 @@ INSERT INTO `CompanyStructures` (`id`, `title`, `description`, `address`, `type`
(3, 'Marketing Department', 'Marketing Department', 'PO Box 001002\nSample Road, Sample Town', 'Department', 'US', 2); (3, 'Marketing Department', 'Marketing Department', 'PO Box 001002\nSample Road, Sample Town', 'Department', 'US', 2);
INSERT INTO `Documents` (`id`, `name`, `details`) VALUES
(1, 'ID Copy', 'Your ID copy'),
(2, 'Degree Ceritficate', 'Degree Ceritficate'),
(3, 'Driving License', 'Driving License');
INSERT INTO `Educations` (`id`, `name`, `description`) VALUES INSERT INTO `Educations` (`id`, `name`, `description`) VALUES
(1, 'Bachelors Degree', 'Bachelors Degree'), (1, 'Bachelors Degree', 'Bachelors Degree'),
@@ -758,9 +879,6 @@ INSERT INTO `Educations` (`id`, `name`, `description`) VALUES
(3, 'Masters Degree', 'Masters Degree'), (3, 'Masters Degree', 'Masters Degree'),
(4, 'Doctorate', 'Doctorate'); (4, 'Doctorate', 'Doctorate');
INSERT INTO `HoliDays` (`id`, `name`, `dateh`, `status`) VALUES
(1, 'New Year''s Day', '2015-01-01', 'Full Day'),
(2, 'Christmas Day', '2015-12-25', 'Full Day');
INSERT INTO `JobTitles` (`id`, `code`, `name`, `description`, `specification`) VALUES INSERT INTO `JobTitles` (`id`, `code`, `name`, `description`, `specification`) VALUES
@@ -887,6 +1005,33 @@ INSERT INTO `SalaryComponentType` (`id`,`code`, `name`) VALUES
(2,'B002', 'Allowance'); (2,'B002', 'Allowance');
INSERT INTO `SalaryComponent` VALUES INSERT INTO `SalaryComponent` (`id`,`name`, `componentType`) VALUES
(1,'Basic Salary', 1,''),(2,'Fixed Allowance', 1,''),(3,'Car Allowance', 2,''),(4,'Telephone Allowance', 2,''); (1,'Basic Salary', 1),
(2,'Fixed Allowance', 1),
(3,'Car Allowance', 2),
(4,'Telephone Allowance', 2);
INSERT INTO `ExpensesPaymentMethods` (`name`) VALUES
('Cash'),
('Check'),
('Credit Card'),
('Debit Card');
INSERT INTO `ExpensesCategories` (`name`) VALUES
('Auto - Gas'),
('Auto - Insurance'),
('Auto - Maintenance'),
('Auto - Payment'),
('Transportation'),
('Bank Fees'),
('Dining Out'),
('Entertainment'),
('Hotel / Motel'),
('Insurance'),
('Interest Charges'),
('Loan Payment'),
('Medical'),
('Mileage'),
('Rent'),
('Rental Car'),
('Utility');

View File

@@ -36,8 +36,7 @@ INSERT INTO `EmployeeDependents` (`id`, `employee`, `name`, `relationship`, `dob
(2, 1, 'Mica Singroo', 'Other', '2000-06-13', ''); (2, 1, 'Mica Singroo', 'Other', '2000-06-13', '');
INSERT INTO `EmployeeDocuments` (`id`, `employee`, `document`, `date_added`, `valid_until`, `status`, `details`) VALUES
(1, 2, 2, '2013-01-08', '0000-00-00', 'Active', 'zxczx');
INSERT INTO `EmployeeEducations` (`id`, `education_id`, `employee`, `institute`, `date_start`, `date_end`) VALUES INSERT INTO `EmployeeEducations` (`id`, `education_id`, `employee`, `institute`, `date_start`, `date_end`) VALUES
@@ -59,9 +58,9 @@ INSERT INTO `EmployeeProjects` (`id`, `employee`, `project`, `date_start`, `date
INSERT INTO `EmployeeSalary` (`id`, `employee`, `component`, `pay_frequency`, `currency`, `amount`, `details`) VALUES INSERT INTO `EmployeeSalary` (`id`, `employee`, `component`, `pay_frequency`, `currency`, `amount`, `details`) VALUES
(1, 1, 'Basic', 'Monthly', 131, '2700.00', ''), (1, 1, 1, 'Monthly', 131, '2700.00', ''),
(2, 2, 'Basic Salary', 'Monthly', 151, '12000.00', ''), (2, 2, 2, 'Monthly', 151, '12000.00', ''),
(3, 2, 'Travelling Allowance', 'Monthly', 131, '5000.00', ''); (3, 2, 3, 'Monthly', 131, '5000.00', '');
INSERT INTO `EmployeeSkills` (`id`, `skill_id`, `employee`, `details`) VALUES INSERT INTO `EmployeeSkills` (`id`, `skill_id`, `employee`, `details`) VALUES

View File

@@ -1,248 +0,0 @@
/* Upgrade v10.2 to v11.0 */
ALTER TABLE `LeaveTypes` ADD COLUMN `leave_color` varchar(10) NULL;
create table `RestAccessTokens` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`userId` bigint(20) NOT NULL,
`hash` varchar(32) default null,
`token` varchar(500) default null,
`created` DATETIME default '0000-00-00 00:00:00',
`updated` DATETIME default '0000-00-00 00:00:00',
primary key (`id`),
unique key `userId` (`userId`)
) engine=innodb default charset=utf8;
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Api: REST Api Enabled', '0', '','["value", {"label":"Value","type":"select","source":[["0","No"],["1","Yes"]]}]');
ALTER TABLE Employees ADD COLUMN `status` enum('Active','Terminated') default 'Active';
ALTER TABLE EmployeeLeaves MODIFY COLUMN `status` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled') default 'Pending';
ALTER TABLE EmployeeLeaveLog MODIFY COLUMN `status_from` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled') default 'Pending';
ALTER TABLE EmployeeLeaveLog MODIFY COLUMN `status_to` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled') default 'Pending';
create table `ArchivedEmployees` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`ref_id` bigint(20) NOT NULL,
`employee_id` varchar(50) default null,
`first_name` varchar(100) default '' not null,
`last_name` varchar(100) default '' not null,
`gender` enum('Male','Female') default NULL,
`ssn_num` varchar(100) default '',
`nic_num` varchar(100) default '',
`other_id` varchar(100) default '',
`work_email` varchar(100) default null,
`joined_date` DATETIME default '0000-00-00 00:00:00',
`confirmation_date` DATETIME default '0000-00-00 00:00:00',
`supervisor` bigint(20) default null,
`department` bigint(20) default null,
`termination_date` DATETIME default '0000-00-00 00:00:00',
`notes` text default null,
`data` longtext default null,
primary key (`id`)
) engine=innodb default charset=utf8;
/* Upgrade v11.0 to v11.1 */
create table `FieldNameMappings` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`type` varchar(20) NOT NULL,
`name` varchar(20) NOT NULL,
`textOrig` varchar(200) default null,
`textMapped` varchar(200) default null,
`display` enum('Form','Table and Form','Hidden') default 'Form',
`created` DATETIME default '0000-00-00 00:00:00',
`updated` DATETIME default '0000-00-00 00:00:00',
primary key (`id`)
) engine=innodb default charset=utf8;
INSERT INTO `FieldNameMappings` (`type`, `name`, `textOrig`, `textMapped`, `display`) VALUES
('Employee', 'employee_id', 'Employee Number', 'Employee Number', 'Table and Form'),
('Employee', 'first_name', 'First Name', 'First Name', 'Table and Form'),
('Employee', 'middle_name', 'Middle Name', 'Middle Name', 'Form'),
('Employee', 'last_name', 'Last Name', 'Last Name', 'Table and Form'),
('Employee', 'nationality', 'Nationality', 'Nationality', 'Form'),
('Employee', 'ethnicity', 'Ethnicity', 'Ethnicity', 'Form'),
('Employee', 'immigration_status', 'Immigration Status', 'Immigration Status', 'Form'),
('Employee', 'birthday', 'Date of Birth', 'Date of Birth', 'Form'),
('Employee', 'gender', 'Gender', 'Gender', 'Form'),
('Employee', 'marital_status', 'Marital Status', 'Marital Status', 'Form'),
('Employee', 'ssn_num', 'SSN/NRIC', 'SSN/NRIC', 'Form'),
('Employee', 'nic_num', 'NIC', 'NIC', 'Form'),
('Employee', 'other_id', 'Other ID', 'Other ID', 'Form'),
('Employee', 'driving_license', 'Driving License No', 'Driving License No', 'Form'),
('Employee', 'employment_status', 'Employment Status', 'Employment Status', 'Form'),
('Employee', 'job_title', 'Job Title', 'Job Title', 'Form'),
('Employee', 'pay_grade', 'Pay Grade', 'Pay Grade', 'Form'),
('Employee', 'work_station_id', 'Work Station Id', 'Work Station Id', 'Form'),
('Employee', 'address1', 'Address Line 1', 'Address Line 1', 'Form'),
('Employee', 'address2', 'Address Line 2', 'Address Line 2', 'Form'),
('Employee', 'city', 'City', 'City', 'Form'),
('Employee', 'country', 'Country', 'Country', 'Form'),
('Employee', 'province', 'Province', 'Province', 'Form'),
('Employee', 'postal_code', 'Postal/Zip Code', 'Postal/Zip Code', 'Form'),
('Employee', 'home_phone', 'Home Phone', 'Home Phone', 'Form'),
('Employee', 'mobile_phone', 'Mobile Phone', 'Mobile Phone', 'Table and Form'),
('Employee', 'work_phone', 'Work Phone', 'Work Phone', 'Form'),
('Employee', 'work_email', 'Work Email', 'Work Email', 'Form'),
('Employee', 'private_email', 'Private Email', 'Private Email', 'Form'),
('Employee', 'joined_date', 'Joined Date', 'Joined Date', 'Form'),
('Employee', 'confirmation_date', 'Confirmation Date', 'Confirmation Date', 'Form'),
('Employee', 'termination_date', 'Termination Date', 'Termination Date', 'Form'),
('Employee', 'supervisor', 'Supervisor', 'Supervisor', 'Table and Form'),
('Employee', 'department', 'Department', 'Department', 'Table and Form'),
('Employee', 'notes', 'Notes', 'Notes', 'Form');
create table `CustomFields` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`type` varchar(20) NOT NULL,
`name` varchar(20) NOT NULL,
`data` text default null,
`display` enum('Form','Table and Form','Hidden') default 'Form',
`created` DATETIME default '0000-00-00 00:00:00',
`updated` DATETIME default '0000-00-00 00:00:00',
primary key (`id`)
) engine=innodb default charset=utf8;
INSERT INTO `CustomFields` (`type`, `name`, `data`,`display`) VALUES
('Employee', 'custom1', '', 'Hidden'),
('Employee', 'custom2', '', 'Hidden'),
('Employee', 'custom3', '', 'Hidden'),
('Employee', 'custom4', '', 'Hidden'),
('Employee', 'custom5', '', 'Hidden'),
('Employee', 'custom6', '', 'Hidden'),
('Employee', 'custom7', '', 'Hidden'),
('Employee', 'custom8', '', 'Hidden'),
('Employee', 'custom9', '', 'Hidden'),
('Employee', 'custom10', '', 'Hidden');
Alter table `Employees` MODIFY COLUMN `middle_name` varchar(100) default null;
Alter table `Employees` MODIFY COLUMN `last_name` varchar(100) default null;
Alter table `Employees` MODIFY COLUMN `ssn_num` varchar(100) default NULL;
Alter table `Employees` MODIFY COLUMN `nic_num` varchar(100) default NULL;
Alter table `Employees` MODIFY COLUMN `other_id` varchar(100) default NULL;
Alter table `Employees` MODIFY COLUMN `driving_license` varchar(100) default NULL;
Alter table `Employees` MODIFY COLUMN `work_station_id` varchar(100) default NULL;
Alter table `Employees` MODIFY COLUMN `address1` varchar(100) default NULL;
Alter table `Employees` MODIFY COLUMN `address2` varchar(100) default NULL;
Alter table `Employees` MODIFY COLUMN `city` varchar(150) default NULL;
Alter table `Employees` ADD COLUMN `ethnicity` bigint(20) default null;
Alter table `Employees` ADD COLUMN `immigration_status` bigint(20) default null;
Alter table `EmployeeSalary` MODIFY COLUMN `component` bigint(20) NOT NULL;
Alter table `EmployeeSalary` MODIFY COLUMN `currency` bigint(20) NULL;
INSERT INTO `SalaryComponentType` (`id`,`code`, `name`) VALUES
(1,'B001', 'Basic'),
(2,'B002', 'Allowance');
INSERT INTO `SalaryComponent` VALUES
(1,'Basic Salary', 1,''),(2,'Fixed Allowance', 1,''),(3,'Car Allowance', 2,''),(4,'Telephone Allowance', 2,'');
/* Upgrade v11.1 to v12.0 */
ALTER TABLE Users ADD COLUMN user_roles text null;
ALTER TABLE Users ADD COLUMN `default_module` bigint(20) null after `employee`;
ALTER TABLE Modules ADD COLUMN user_roles text null AFTER `user_levels`;
ALTER TABLE Modules ADD COLUMN label varchar(100) NOT NULL AFTER `name`;
create table `UserRoles` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) default null,
primary key (`id`),
unique key `name` (`name`)
) engine=innodb default charset=utf8;
ALTER TABLE `Users` CHANGE `user_level` `user_level` enum('Admin','Employee','Manager','Other') default NULL;
create table `EmployeeEducationsTemp` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`education_id` bigint(20) NULL,
`employee` bigint(20) NOT NULL,
`institute` varchar(400) default null,
`date_start` date default '0000-00-00',
`date_end` date default '0000-00-00',
primary key (`id`)
) engine=innodb default charset=utf8;
insert into EmployeeEducationsTemp select * from EmployeeEducations;
drop table EmployeeEducations;
create table `EmployeeEducations` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`education_id` bigint(20) NULL,
`employee` bigint(20) NOT NULL,
`institute` varchar(400) default null,
`date_start` date default '0000-00-00',
`date_end` date default '0000-00-00',
CONSTRAINT `Fk_EmployeeEducations_Educations` FOREIGN KEY (`education_id`) REFERENCES `Educations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeEducations_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
insert into EmployeeEducations select * from EmployeeEducationsTemp;
drop table EmployeeEducationsTemp;
UPDATE `Settings` set value = '1' where name = 'System: Reset Modules and Permissions';
UPDATE `Settings` set value = '1' where name = 'System: Add New Permissions';
create table `SalaryComponentType` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`code` varchar(10) NOT NULL,
`name` varchar(100) NOT NULL,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `SalaryComponent` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`componentType` bigint(20) NULL,
`details` text default null,
CONSTRAINT `Fk_SalaryComponent_SalaryComponentType` FOREIGN KEY (`componentType`) REFERENCES `SalaryComponentType` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `ImmigrationStatus` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Ethnicity` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `EmployeeImmigrationStatus` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL,
`status` bigint(20) NOT NULL,
CONSTRAINT `Fk_EmployeeImmigrationStatus_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeImmigrationStatus_Type` FOREIGN KEY (`status`) REFERENCES `ImmigrationStatus` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `EmployeeEthnicity` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL,
`ethnicity` bigint(20) NOT NULL,
CONSTRAINT `Fk_EmployeeEthnicity_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeEthnicity_Ethnicity` FOREIGN KEY (`ethnicity`) REFERENCES `Ethnicity` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;

View File

@@ -6,6 +6,7 @@ create table `CompanyStructures` (
`type` enum('Company','Head Office','Regional Office','Department','Unit','Sub Unit','Other') default NULL, `type` enum('Company','Head Office','Regional Office','Department','Unit','Sub Unit','Other') default NULL,
`country` varchar(2) not null default '0', `country` varchar(2) not null default '0',
`parent` bigint(20) NULL, `parent` bigint(20) NULL,
`timezone` varchar(100) not null default 'Europe/London',
CONSTRAINT `Fk_CompanyStructures_Own` FOREIGN KEY (`parent`) REFERENCES `CompanyStructures` (`id`), CONSTRAINT `Fk_CompanyStructures_Own` FOREIGN KEY (`parent`) REFERENCES `CompanyStructures` (`id`),
primary key (`id`) primary key (`id`)
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
@@ -364,26 +365,7 @@ create table `EmployeeTimeEntry` (
primary key (`id`) primary key (`id`)
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
create table `Documents` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`details` text default null,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `EmployeeDocuments` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL,
`document` bigint(20) NULL,
`date_added` date NOT NULL,
`valid_until` date NOT NULL,
`status` enum('Active','Inactive','Draft') default 'Active',
`details` text default null,
`attachment` varchar(100) NULL,
CONSTRAINT `Fk_EmployeeDocuments_Documents` FOREIGN KEY (`document`) REFERENCES `Documents` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeDocuments_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `CompanyLoans` ( create table `CompanyLoans` (
`id` bigint(20) NOT NULL AUTO_INCREMENT, `id` bigint(20) NOT NULL AUTO_INCREMENT,
@@ -513,54 +495,6 @@ create table `Notifications` (
KEY `toUser_status_time` (`toUser`,`status`,`time`) KEY `toUser_status_time` (`toUser`,`status`,`time`)
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
create table `Courses` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`code` varchar(300) NOT NULL,
`name` varchar(300) NOT NULL,
`description` text default null,
`coordinator` bigint(20) NULL,
`trainer` varchar(300) NULL,
`trainer_info` text default null,
`paymentType` enum('Company Sponsored','Paid by Employee') default 'Company Sponsored',
`currency` varchar(3) not null,
`cost` decimal(12,2) DEFAULT 0.00,
`status` enum('Active','Inactive') default 'Active',
`created` datetime default '0000-00-00 00:00:00',
`updated` datetime default '0000-00-00 00:00:00',
CONSTRAINT `Fk_Courses_Employees` FOREIGN KEY (`coordinator`) REFERENCES `Employees` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `TrainingSessions` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(300) NOT NULL,
`course` bigint(20) NOT NULL,
`description` text default null,
`scheduled` datetime default '0000-00-00 00:00:00',
`dueDate` datetime default '0000-00-00 00:00:00',
`deliveryMethod` enum('Classroom','Self Study','Online') default 'Classroom',
`deliveryLocation` varchar(500) NULL,
`status` enum('Pending','Approved','Completed','Cancelled') default 'Pending',
`attendanceType` enum('Sign Up','Assign') default 'Sign Up',
`attachment` varchar(300) NULL,
`created` datetime default '0000-00-00 00:00:00',
`updated` datetime default '0000-00-00 00:00:00',
CONSTRAINT `Fk_TrainingSessions_Courses` FOREIGN KEY (`course`) REFERENCES `Courses` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `EmployeeTrainingSessions` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL,
`trainingSession` bigint(20) NULL,
`feedBack` varchar(1500) NULL,
`status` enum('Scheduled','Attended','Not-Attended') default 'Scheduled',
CONSTRAINT `Fk_EmployeeTrainingSessions_TrainingSessions` FOREIGN KEY (`trainingSession`) REFERENCES `TrainingSessions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeTrainingSessions_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `ImmigrationDocuments` ( create table `ImmigrationDocuments` (
`id` bigint(20) NOT NULL AUTO_INCREMENT, `id` bigint(20) NOT NULL AUTO_INCREMENT,
@@ -604,11 +538,14 @@ create table `EmployeeTravelRecords` (
`travel_date` datetime NULL default '0000-00-00 00:00:00', `travel_date` datetime NULL default '0000-00-00 00:00:00',
`return_date` datetime NULL default '0000-00-00 00:00:00', `return_date` datetime NULL default '0000-00-00 00:00:00',
`details` varchar(500) default null, `details` varchar(500) default null,
`funding` decimal(10,3) NULL,
`currency` bigint(20) NULL,
`attachment1` varchar(100) NULL, `attachment1` varchar(100) NULL,
`attachment2` varchar(100) NULL, `attachment2` varchar(100) NULL,
`attachment3` varchar(100) NULL, `attachment3` varchar(100) NULL,
`created` timestamp NULL default '0000-00-00 00:00:00', `created` timestamp NULL default '0000-00-00 00:00:00',
`updated` timestamp NULL default '0000-00-00 00:00:00', `updated` timestamp NULL default '0000-00-00 00:00:00',
`status` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled') default 'Pending',
CONSTRAINT `Fk_EmployeeTravelRecords_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `Fk_EmployeeTravelRecords_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`) primary key (`id`)
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
@@ -773,3 +710,69 @@ create table `DeductionRules` (
create table `Emails` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`subject` varchar(300) NOT NULL,
`toEmail` varchar(300) NOT NULL,
`template` text NULL,
`params` text NULL,
`cclist` varchar(500) NULL,
`bcclist` varchar(500) NULL,
`error` varchar(500) NULL,
`created` DATETIME default '0000-00-00 00:00:00',
`updated` DATETIME default '0000-00-00 00:00:00',
`status` enum('Pending','Sent','Error') default 'Pending',
primary key (`id`),
key `KEY_Emails_status` (`status`),
key `KEY_Emails_created` (`created`)
) engine=innodb default charset=utf8;
create table `ExpensesCategories` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(500) NOT NULL,
`created` timestamp NULL default '0000-00-00 00:00:00',
`updated` timestamp NULL default '0000-00-00 00:00:00',
`pre_approve` enum('Yes','No') default 'Yes',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `ExpensesPaymentMethods` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(500) NOT 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 `EmployeeExpenses` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL,
`expense_date` date NULL default '0000-00-00',
`payment_method` bigint(20) NOT NULL,
`transaction_no` varchar(300) NOT NULL,
`payee` varchar(500) NOT NULL,
`category` bigint(20) NOT NULL,
`notes` text,
`amount` decimal(10,3) NULL,
`currency` bigint(20) NULL,
`attachment1` varchar(100) NULL,
`attachment2` varchar(100) NULL,
`attachment3` varchar(100) NULL,
`created` timestamp NULL default '0000-00-00 00:00:00',
`updated` timestamp NULL default '0000-00-00 00:00:00',
`status` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled') default 'Pending',
CONSTRAINT `Fk_EmployeeExpenses_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeExpenses_pm` FOREIGN KEY (`payment_method`) REFERENCES `ExpensesPaymentMethods` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeExpenses_category` FOREIGN KEY (`category`) REFERENCES `ExpensesCategories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Timezones` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) not null default '',
`details` varchar(255) not null default '',
primary key (`id`)
) engine=innodb default charset=utf8;

View File

@@ -158,6 +158,13 @@ AttendanceAdapter.method('saveFailCallback', function(callBackData) {
this.showMessage("Error saving attendance entry", callBackData); this.showMessage("Error saving attendance entry", callBackData);
}); });
AttendanceAdapter.method('isSubProfileTable', function() {
if(this.user.user_level == "Admin"){
return false;
}else{
return true;
}
});
/* /*
@@ -216,3 +223,12 @@ AttendanceStatusAdapter.method('getActionButtonsHtml', function(id,data) {
} }
return html; return html;
}); });
AttendanceStatusAdapter.method('isSubProfileTable', function() {
if(this.user.user_level == "Admin"){
return false;
}else{
return true;
}
});

View File

@@ -3,7 +3,7 @@
"menu":"Employees", "menu":"Employees",
"order":"8", "order":"8",
"icon":"fa-clock-o", "icon":"fa-clock-o",
"user_levels":["Admin"], "user_levels":["Admin","Manager"],
"permissions": "permissions":
{} {}

View File

@@ -50,3 +50,23 @@ if (!class_exists('CompanyStructure')) {
} }
} }
} }
if (!class_exists('Timezone')) {
class Timezone extends ICEHRM_Record {
var $_table = 'Timezones';
public function getAdminAccess(){
return array("get","element","save","delete");
}
public function getManagerAccess(){
return array("get","element","save","delete");
}
public function getUserAccess(){
return array("get","element");
}
}
}

View File

@@ -17,6 +17,7 @@ CompanyStructureAdapter.method('getDataMapping', function() {
"address", "address",
"type", "type",
"country", "country",
"timezone",
"parent" "parent"
]; ];
}); });
@@ -28,6 +29,7 @@ CompanyStructureAdapter.method('getHeaders', function() {
{ "sTitle": "Address","bSortable":false}, { "sTitle": "Address","bSortable":false},
{ "sTitle": "Type"}, { "sTitle": "Type"},
{ "sTitle": "Country", "sClass": "center" }, { "sTitle": "Country", "sClass": "center" },
{ "sTitle": "Time Zone"},
{ "sTitle": "Parent Structure"} { "sTitle": "Parent Structure"}
]; ];
}); });
@@ -40,6 +42,7 @@ CompanyStructureAdapter.method('getFormFields', function() {
[ "address", {"label":"Address","type":"textarea","validation":"none"}], [ "address", {"label":"Address","type":"textarea","validation":"none"}],
[ "type", {"label":"Type","type":"select","source":[["Company","Company"],["Head Office","Head Office"],["Regional Office","Regional Office"],["Department","Department"],["Unit","Unit"],["Sub Unit","Sub Unit"],["Other","Other"]]}], [ "type", {"label":"Type","type":"select","source":[["Company","Company"],["Head Office","Head Office"],["Regional Office","Regional Office"],["Department","Department"],["Unit","Unit"],["Sub Unit","Sub Unit"],["Other","Other"]]}],
[ "country", {"label":"Country","type":"select","remote-source":["Country","code","name"]}], [ "country", {"label":"Country","type":"select","remote-source":["Country","code","name"]}],
[ "timezone", {"label":"Time Zone","type":"select","allow-null":false,"remote-source":["Timezone","name","details"]}],
[ "parent", {"label":"Parent Structure","type":"select","allow-null":true,"remote-source":["CompanyStructure","id","title"]}] [ "parent", {"label":"Parent Structure","type":"select","allow-null":true,"remote-source":["CompanyStructure","id","title"]}]
]; ];
}); });
@@ -298,7 +301,7 @@ CompanyGraphAdapter.method('fixCyclicParent', function(sourceData) {
}); });
CompanyGraphAdapter.method('getHelpLink', function () { CompanyGraphAdapter.method('getHelpLink', function () {
return 'http://blog.icehrm.com/?page_id=61'; return 'http://blog.icehrm.com/docs/companystructure/';
}); });

View File

@@ -41,8 +41,7 @@ class DashboardActionManager extends SubActionManager{
$attendance = new Attendance(); $attendance = new Attendance();
$data['numberOfAttendanceLastWeek'] = $attendance->Count("in_time > '".date("Y-m-d H:i:s",strtotime("-1 week"))."'"); $data['numberOfAttendanceLastWeek'] = $attendance->Count("in_time > '".date("Y-m-d H:i:s",strtotime("-1 week"))."'");
$empLeave = new EmployeeLeave(); $data['numberOfLeaves'] = 0;
$data['numberOfLeaves'] = $empLeave->Count("date_start > '".date("Y-m-d")."'");
$timeEntry = new EmployeeTimeEntry(); $timeEntry = new EmployeeTimeEntry();
$data['numberOfAttendanceLastWeek'] = $attendance->Count("in_time > '".date("Y-m-d H:i:s",strtotime("-1 week"))."'"); $data['numberOfAttendanceLastWeek'] = $attendance->Count("in_time > '".date("Y-m-d H:i:s",strtotime("-1 week"))."'");

View File

@@ -26,24 +26,9 @@ 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 id="iceannon">
<div class="callout callout-warning lead" style="font-size: 14px;">
<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, LDAP support 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/icehrm-pro/" class="btn btn-primary btn-xs" target="_blank">here</a>
<br/>
<br/>
<a href="http://icehrm.com/modules.php" class="btn btn-success btm-xs" target="_blank"><i class="fa fa-checkout"></i> Buy IceHrm Pro</a>
</p>
</div>
</div>
<div class="row"> <div class="row">
<div class="col-lg-3 col-xs-6"> <div class="col-lg-3 col-xs-12">
<!-- small box --> <!-- small box -->
<div class="small-box bg-aqua"> <div class="small-box bg-aqua">
<div class="inner"> <div class="inner">
@@ -62,7 +47,7 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
</a> </a>
</div> </div>
</div><!-- ./col --> </div><!-- ./col -->
<div class="col-lg-3 col-xs-6"> <div class="col-lg-3 col-xs-12">
<!-- small box --> <!-- small box -->
<div class="small-box bg-green"> <div class="small-box bg-green">
<div class="inner"> <div class="inner">
@@ -79,7 +64,7 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
</a> </a>
</div> </div>
</div><!-- ./col --> </div><!-- ./col -->
<div class="col-lg-3 col-xs-6"> <div class="col-lg-3 col-xs-12">
<!-- small box --> <!-- small box -->
<div class="small-box bg-yellow"> <div class="small-box bg-yellow">
<div class="inner"> <div class="inner">
@@ -96,7 +81,7 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
</a> </a>
</div> </div>
</div><!-- ./col --> </div><!-- ./col -->
<div class="col-lg-3 col-xs-6"> <div class="col-lg-3 col-xs-12">
<!-- small box --> <!-- small box -->
<div class="small-box bg-red"> <div class="small-box bg-red">
<div class="inner"> <div class="inner">
@@ -113,10 +98,8 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
</a> </a>
</div> </div>
</div><!-- ./col --> </div><!-- ./col -->
</div>
<div class="row"> <div class="col-lg-3 col-xs-12">
<div class="col-lg-3 col-xs-6">
<!-- small box --> <!-- small box -->
<div class="small-box bg-yellow"> <div class="small-box bg-yellow">
<div class="inner"> <div class="inner">
@@ -135,22 +118,7 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
</a> </a>
</div> </div>
</div><!-- ./col --> </div><!-- ./col -->
<div class="col-lg-3 col-xs-6"> <div class="col-lg-3 col-xs-12">
<!-- small box -->
<div class="small-box bg-red">
<div class="inner">
<h3 id="numberOfLeaves">..</h3>
<p >Upcoming Leaves</p>
</div>
<div class="icon">
<i class="ion ion-calendar"></i>
</div>
<a href="#" class="small-box-footer" id="leaveLink">
Leave Management <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div><!-- ./col -->
<div class="col-lg-3 col-xs-6">
<!-- small box --> <!-- small box -->
<div class="small-box bg-teal"> <div class="small-box bg-teal">
<div class="inner"> <div class="inner">
@@ -167,7 +135,7 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
</a> </a>
</div> </div>
</div><!-- ./col --> </div><!-- ./col -->
<div class="col-lg-3 col-xs-6"> <div class="col-lg-3 col-xs-12">
<!-- small box --> <!-- small box -->
<div class="small-box bg-green"> <div class="small-box bg-green">
<div class="inner"> <div class="inner">
@@ -184,6 +152,60 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
</a> </a>
</div> </div>
</div><!-- ./col --> </div><!-- ./col -->
<div class="col-lg-3 col-xs-12">
<!-- small box -->
<div class="small-box bg-red">
<div class="inner">
<h3>
Travel
</h3>
<p id="numberOfTravel">
Requests
</p>
</div>
<div class="icon">
<i class="ion ion-plane"></i>
</div>
<a href="#" class="small-box-footer" id="travelLink">
Manage Travel <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>
<div class="col-lg-3 col-xs-12">
<!-- small box -->
<div class="small-box bg-yellow">
<div class="inner">
<h3>
Help
</h3>
<p>
User Guide
</p>
</div>
<div class="icon">
<i class="ion ion-help"></i>
</div>
<a href="http://blog.icehrm.com/docs/home/" target="_blank" class="small-box-footer" id="icehrmHelpLink">
Documentation <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>
</div>
<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, LDAP support and number of other features over open source version.
Hit this <a href="http://icehrm.com/#compare" class="btn btn-primary btn-xs target="_blank">link</a> to do a full one to one comparison.
Also you can learn more about IceHrm Pro <a href="http://blog.icehrm.com/docs/icehrm-pro/" class="btn btn-primary btn-xs" target="_blank">here</a>
<br/>
<br/>
<a href="http://icehrm.com/modules.php" class="btn btn-success btm-xs" target="_blank"><i class="fa fa-checkout"></i> Buy IceHrm Pro</a>
</p>
</div>
</div> </div>
@@ -204,6 +226,8 @@ $("#attendanceLink").attr("href",modJs.getCustomUrl('?g=admin&n=attendance&m=adm
$("#leaveLink").attr("href",modJs.getCustomUrl('?g=admin&n=leaves&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')); $("#reportsLink").attr("href",modJs.getCustomUrl('?g=admin&n=reports&m=admin_Reports'));
$("#settingsLink").attr("href",modJs.getCustomUrl('?g=admin&n=settings&m=admin_System')); $("#settingsLink").attr("href",modJs.getCustomUrl('?g=admin&n=settings&m=admin_System'));
$("#travelLink").attr("href",modJs.getCustomUrl('?g=admin&n=travel&m=admin_Employees'));
modJs.getInitData(); modJs.getInitData();

View File

@@ -1,69 +0,0 @@
<?php
if (!class_exists('DocumentsAdminManager')) {
class DocumentsAdminManager extends AbstractModuleManager{
public function initializeUserClasses(){
}
public function initializeFieldMappings(){
$this->addFileFieldMapping('EmployeeDocument', 'attachment', 'name');
}
public function initializeDatabaseErrorMappings(){
$this->addDatabaseErrorMapping('CONSTRAINT `Fk_EmployeeDocuments_Documents` FOREIGN KEY','Can not delete Document Type, users have already uploaded these types of documents');
}
public function setupModuleClassDefinitions(){
$this->addModelClass('Document');
$this->addModelClass('EmployeeDocument');
}
}
}
if (!class_exists('Document')) {
class Document extends ICEHRM_Record {
var $_table = 'Documents';
public function getAdminAccess(){
return array("get","element","save","delete");
}
public function getUserAccess(){
return array();
}
}
}
if (!class_exists('EmployeeDocument')) {
class EmployeeDocument extends ICEHRM_Record {
var $_table = 'EmployeeDocuments';
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 Insert(){
if(empty($this->date_added)){
$this->date_added = date("Y-m-d H:i:s");
}
return parent::Insert();
}
}
}

View File

@@ -1,64 +0,0 @@
<?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 = 'documents';
define('MODULE_PATH',dirname(__FILE__));
include APP_BASE_PATH.'header.php';
include APP_BASE_PATH.'modulejslibs.inc.php';
?><div class="span9">
<ul class="nav nav-tabs" id="modTab" style="margin-bottom:0px;margin-left:5px;border-bottom: none;">
<li class="active"><a id="tabDocument" href="#tabPageDocument">Document Types</a></li>
<li class=""><a id="tabEmployeeDocument" href="#tabPageEmployeeDocument">Employee Documents</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tabPageDocument">
<div id="Document" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="DocumentForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
</div>
<div class="tab-pane" id="tabPageEmployeeDocument">
<div id="EmployeeDocument" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="EmployeeDocumentForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
</div>
</div>
</div>
<script>
var modJsList = new Array();
modJsList['tabDocument'] = new DocumentAdapter('Document','Document');
modJsList['tabEmployeeDocument'] = new EmployeeDocumentAdapter('EmployeeDocument','EmployeeDocument');
var modJs = modJsList['tabDocument'];
</script>
<?php include APP_BASE_PATH.'footer.php';?>

View File

@@ -1,107 +0,0 @@
/**
* Author: Thilina Hasantha
*/
/**
* DocumentAdapter
*/
function DocumentAdapter(endPoint) {
this.initAdapter(endPoint);
}
DocumentAdapter.inherits(AdapterBase);
DocumentAdapter.method('getDataMapping', function() {
return [
"id",
"name",
"details"
];
});
DocumentAdapter.method('getHeaders', function() {
return [
{ "sTitle": "ID" ,"bVisible":false},
{ "sTitle": "Name" },
{ "sTitle": "Details"}
];
});
DocumentAdapter.method('getFormFields', function() {
return [
[ "id", {"label":"ID","type":"hidden"}],
[ "name", {"label":"Name","type":"text","validation":""}],
[ "details", {"label":"Details","type":"textarea","validation":"none"}]
];
});
DocumentAdapter.method('getHelpLink', function () {
return 'http://blog.icehrm.com/?page_id=88';
});
function EmployeeDocumentAdapter(endPoint) {
this.initAdapter(endPoint);
}
EmployeeDocumentAdapter.inherits(AdapterBase);
EmployeeDocumentAdapter.method('getDataMapping', function() {
return [
"id",
"employee",
"document",
"details",
"date_added",
"status",
"attachment"
];
});
EmployeeDocumentAdapter.method('getHeaders', function() {
return [
{ "sTitle": "ID" ,"bVisible":false},
{ "sTitle": "Employee" },
{ "sTitle": "Document" },
{ "sTitle": "Details" },
{ "sTitle": "Date Added"},
{ "sTitle": "Status"},
{ "sTitle": "Attachment","bVisible":false}
];
});
EmployeeDocumentAdapter.method('getFormFields', function() {
return [
[ "id", {"label":"ID","type":"hidden"}],
[ "employee", {"label":"Employee","type":"select2","remote-source":["Employee","id","first_name+last_name"]}],
[ "document", {"label":"Document","type":"select2","remote-source":["Document","id","name"]}],
[ "date_added", {"label":"Date Added","type":"date","validation":""}],
[ "valid_until", {"label":"Valid Until","type":"date","validation":"none"}],
[ "status", {"label":"Status","type":"select","source":[["Active","Active"],["Inactive","Inactive"],["Draft","Draft"]]}],
[ "details", {"label":"Details","type":"textarea","validation":"none"}],
[ "attachment", {"label":"Attachment","type":"fileupload","validation":"none"}]
];
});
EmployeeDocumentAdapter.method('getFilters', function() {
return [
[ "employee", {"label":"Employee","type":"select2","remote-source":["Employee","id","first_name+last_name"]}]
];
});
EmployeeDocumentAdapter.method('getActionButtonsHtml', function(id,data) {
var html = '<div style="width:80px;"><img class="tableActionButton" src="_BASE_images/edit.png" style="cursor:pointer;" rel="tooltip" title="Edit" onclick="modJs.edit(_id_);return false;"></img><img class="tableActionButton" src="_BASE_images/download.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Download Document" onclick="download(\'_attachment_\');return false;"></img><img class="tableActionButton" src="_BASE_images/delete.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Delete" onclick="modJs.deleteRow(_id_);return false;"></img></div>';
html = html.replace(/_id_/g,id);
html = html.replace(/_attachment_/g,data[6]);
html = html.replace(/_BASE_/g,this.baseUrl);
return html;
});

View File

@@ -1,11 +0,0 @@
{
"label":"Document Management",
"menu":"Employees",
"order":"2",
"icon":"fa-files-o",
"user_levels":["Admin"],
"permissions":
{
}
}

View File

@@ -42,7 +42,7 @@ JobTitleAdapter.method('getFormFields', function() {
}); });
JobTitleAdapter.method('getHelpLink', function () { JobTitleAdapter.method('getHelpLink', function () {
return 'http://blog.icehrm.com/?page_id=80'; return 'http://blog.icehrm.com/docs/jobdetails/';
}); });

View File

@@ -1,7 +1,7 @@
{ {
"label":"Company Loans", "label":"Company Loans",
"menu":"Admin", "menu":"Admin",
"order":"7", "order":"81",
"icon":"fa-shield", "icon":"fa-shield",
"user_levels":["Admin"], "user_levels":["Admin"],

View File

@@ -63,7 +63,7 @@ ClientAdapter.method('getFormFields', function() {
}); });
ClientAdapter.method('getHelpLink', function () { ClientAdapter.method('getHelpLink', function () {
return 'http://blog.icehrm.com/?page_id=85'; return 'http://blog.icehrm.com/docs/projects/';
}); });
/** /**
@@ -116,7 +116,7 @@ ProjectAdapter.method('getFormFields', function() {
}); });
ProjectAdapter.method('getHelpLink', function () { ProjectAdapter.method('getHelpLink', function () {
return 'http://blog.icehrm.com/?page_id=85'; return 'http://blog.icehrm.com/docs/projects/';
}); });
@@ -172,6 +172,6 @@ EmployeeProjectAdapter.method('getFilters', function() {
}); });
EmployeeProjectAdapter.method('getHelpLink', function () { EmployeeProjectAdapter.method('getHelpLink', function () {
return 'http://blog.icehrm.com/?page_id=85'; return 'http://blog.icehrm.com/docs/projects/';
}); });

View File

@@ -40,7 +40,7 @@ SkillAdapter.method('getFormFields', function() {
}); });
SkillAdapter.method('getHelpLink', function () { SkillAdapter.method('getHelpLink', function () {
return 'http://blog.icehrm.com/?page_id=83'; return 'http://blog.icehrm.com/docs/qualifications/';
}); });

View File

@@ -162,6 +162,3 @@ ReportAdapter.method('fillForm', function(object) {
} }
}); });
ReportAdapter.method('getHelpLink', function () {
return 'http://blog.icehrm.com/?page_id=118';
});

View File

@@ -1,70 +0,0 @@
<?php
if(!class_exists('ReportBuilder')){
include_once MODULE_PATH.'/reportClasses/ReportBuilder.php';
}
class EmployeeLeavesReport extends ReportBuilder{
public function getMainQuery(){
$query = "SELECT
(SELECT concat(`first_name`,' ',`middle_name`,' ', `last_name`) from Employees where id = employee) as 'Employee',
(SELECT name from LeaveTypes where id = leave_type) as 'Leave Type',
(SELECT name from LeavePeriods where id = leave_type) as 'Leave Type',
date_start as 'Start Date',
date_end as 'End Date',
details as 'Reason',
status as 'Leave Status',
(select count(*) from EmployeeLeaveDays d where d.employee_leave = lv.id and leave_type = 'Full Day') as 'Full Day Count',
(select count(*) from EmployeeLeaveDays d where d.employee_leave = lv.id and leave_type = 'Half Day - Morning') as 'Half Day (Morning) Count',
(select count(*) from EmployeeLeaveDays d where d.employee_leave = lv.id and leave_type = 'Half Day - Afternoon') as 'Half Day (Afternoon) Count'
from EmployeeLeaves lv";
return $query;
}
public function getWhereQuery($request){
$employeeList = array();
if(!empty($request['employee'])){
$employeeList = json_decode($request['employee'],true);
}
if(in_array("NULL", $employeeList) ){
$employeeList = array();
}
if(!empty($employeeList) && ($request['status'] != "NULL" && !empty($request['status']))){
$query = "where employee in (".implode(",", $employeeList).") and date_start >= ? and date_end <= ? and status = ?;";
$params = array(
$request['date_start'],
$request['date_end'],
$request['status']
);
}else if(!empty($employeeList)){
$query = "where employee in (".implode(",", $employeeList).") and date_start >= ? and date_end <= ?;";
$params = array(
$request['date_start'],
$request['date_end']
);
}else if(($request['status'] != "NULL" && !empty($request['status']))){
$query = "where status = ? and date_start >= ? and date_end <= ?;";
$params = array(
$request['status'],
$request['date_start'],
$request['date_end']
);
}else{
$query = "where date_start >= ? and date_end <= ?;";
$params = array(
$request['date_start'],
$request['date_end']
);
}
LogManager::getInstance()->info("Query:".$query);
LogManager::getInstance()->info("Params:".json_encode($params));
return array($query, $params);
}
}

View File

@@ -63,5 +63,5 @@ SettingAdapter.method('fillForm', function(object) {
SettingAdapter.method('getHelpLink', function () { SettingAdapter.method('getHelpLink', function () {
return 'http://blog.icehrm.com/?page_id=126'; return 'http://blog.icehrm.com/docs/settings/';
}); });

View File

@@ -0,0 +1,19 @@
<?php
class TravelActionManager extends ApproveAdminActionManager{
public function getModelClass(){
return "EmployeeTravelRecord";
}
public function getItemName(){
return "TravelRequest";
}
public function getModuleName(){
return "Travel Management";
}
public function getModuleTabUrl(){
return "g=modules&n=travel&m=module_Travel_Management";
}
}

View File

@@ -0,0 +1,128 @@
<?php
if (!class_exists('TravelAdminManager')) {
class TravelAdminManager extends AbstractModuleManager{
public function initializeUserClasses(){
if(defined('MODULE_TYPE') && MODULE_TYPE != 'admin'){
$this->addUserClass("EmployeeImmigration");
$this->addUserClass("EmployeeTravelRecord");
}
}
public function initializeFieldMappings(){
$this->addFileFieldMapping('EmployeeImmigration', 'attachment1', 'name');
$this->addFileFieldMapping('EmployeeImmigration', 'attachment2', 'name');
$this->addFileFieldMapping('EmployeeImmigration', 'attachment3', 'name');
$this->addFileFieldMapping('EmployeeTravelRecord', 'attachment1', 'name');
$this->addFileFieldMapping('EmployeeTravelRecord', 'attachment2', 'name');
$this->addFileFieldMapping('EmployeeTravelRecord', 'attachment3', 'name');
}
public function initializeDatabaseErrorMappings(){
}
public function setupModuleClassDefinitions(){
$this->addModelClass('ImmigrationDocument');
$this->addModelClass('EmployeeImmigration');
$this->addModelClass('EmployeeTravelRecord');
}
}
}
if (!class_exists('ImmigrationDocument')) {
class ImmigrationDocument extends ICEHRM_Record {
var $_table = 'ImmigrationDocuments';
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('EmployeeImmigration')) {
class EmployeeImmigration extends ICEHRM_Record {
var $_table = 'EmployeeImmigrations';
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");
}
}
}
if (!class_exists('EmployeeTravelRecord')) {
class EmployeeTravelRecord extends ApproveModel
{
var $_table = 'EmployeeTravelRecords';
var $notificationModuleName = "Travel Management";
var $notificationUnitName = "TravelRequest";
var $notificationUnitPrefix = "A";
var $notificationUnitAdminUrl = "g=admin&n=travel&m=admin_Employees";
var $preApproveSettingName = "Travel: Pre-Approve Travel Request";
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(
"travel_from",
"travel_to",
"travel_date",
"return_date",
"funding",
"currency"
);
}
}
}

View File

@@ -0,0 +1,78 @@
<?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('EmployeeTravelRecord','EmployeeTravelRecord','Travel Requests','EmployeeTravelRecordAdapter','','',true,$options));
echo UIManager::getInstance()->renderModule($moduleBuilder);
$itemName = 'TravelRequest';
$moduleName = 'Travel Management';
$itemNameLower = strtolower($itemName);
$statuses = array("Approved","Pending","Rejected","Cancelled");
?><div class="modal" id="<?=$itemNameLower?>StatusModel" tabindex="-1" role="dialog" aria-labelledby="messageModelLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-times"/></button>
<h3 style="font-size: 17px;">Change <?=$itemName?> Status</h3>
</div>
<div class="modal-body">
<form id="expenseStatusForm">
<div class="control-group">
<label class="control-label" for="expense_status"><?=$itemName?> Status</label>
<div class="controls">
<select type="text" id="<?=$itemNameLower?>_status" class="form-control" name="<?=$itemNameLower?>_status" value="">
<?php foreach($statuses as $status){?>
<option value="<?=$status?>"><?=$status?></option>
<?php }?>
</select>
</div>
</div>
<div class="control-group">
<label class="control-label" for="expense_status">Status Change Note</label>
<div class="controls">
<textarea id="<?=$itemNameLower?>_reason" class="form-control" name="<?=$itemNameLower?>_reason" maxlength="500"></textarea>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button class="btn btn-primary" onclick="modJs.changeStatus();">Change <?=$itemName?> Status</button>
<button class="btn" onclick="modJs.closeDialog();">Not Now</button>
</div>
</div>
</div>
</div>
<?php
include APP_BASE_PATH.'footer.php';

182
ext/admin/travel/lib.js Normal file
View File

@@ -0,0 +1,182 @@
/**
* Author: Thilina Hasantha
*/
/**
* ImmigrationDocumentAdapter
*/
function ImmigrationDocumentAdapter(endPoint) {
this.initAdapter(endPoint);
}
ImmigrationDocumentAdapter.inherits(AdapterBase);
ImmigrationDocumentAdapter.method('getDataMapping', function() {
return [
"id",
"name",
"details",
"required",
"alert_on_missing",
"alert_before_expiry"
];
});
ImmigrationDocumentAdapter.method('getHeaders', function() {
return [
{ "sTitle": "ID" ,"bVisible":false},
{ "sTitle": "Name" },
{ "sTitle": "Details"},
{ "sTitle": "Compulsory"},
{ "sTitle": "Alert If Not Found"},
{ "sTitle": "Alert Before Expiry"}
];
});
ImmigrationDocumentAdapter.method('getFormFields', function() {
return [
[ "id", {"label":"ID","type":"hidden"}],
[ "name", {"label":"Name","type":"text","validation":""}],
[ "details", {"label":"Details","type":"textarea","validation":"none"}],
[ "required", {"label":"Compulsory","type":"select","source":[["No","No"],["Yes","Yes"]]}],
[ "alert_on_missing", {"label":"Alert If Not Found","type":"select","source":[["No","No"],["Yes","Yes"]]}],
[ "alert_before_expiry", {"label":"Alert Before Expiry","type":"select","source":[["No","No"],["Yes","Yes"]]}],
[ "alert_before_day_number", {"label":"Days for Expiry Alert","type":"text","validation":""}]
];
});
/**
* EmployeeImmigrationAdapter
*/
function EmployeeImmigrationAdapter(endPoint) {
this.initAdapter(endPoint);
}
EmployeeImmigrationAdapter.inherits(AdapterBase);
EmployeeImmigrationAdapter.method('getDataMapping', function() {
return [
"id",
"employee",
"document",
"documentname",
"valid_until",
"status"
];
});
EmployeeImmigrationAdapter.method('getHeaders', function() {
return [
{ "sTitle": "ID" ,"bVisible":false},
{ "sTitle": "Employee" },
{ "sTitle": "Document" },
{ "sTitle": "Document Id" },
{ "sTitle": "Valid Until"},
{ "sTitle": "Status"}
];
});
EmployeeImmigrationAdapter.method('getFormFields', function() {
return [
[ "id", {"label":"ID","type":"hidden"}],
[ "employee", {"label":"Employee","type":"select2","remote-source":["Employee","id","first_name+last_name"]}],
[ "document", {"label":"Document","type":"select2","remote-source":["ImmigrationDocument","id","name"]}],
[ "documentname", {"label":"Document Id","type":"text","validation":""}],
[ "valid_until", {"label":"Valid Until","type":"date","validation":"none"}],
[ "status", {"label":"Status","type":"select","source":[["Active","Active"],["Inactive","Inactive"],["Draft","Draft"]]}],
[ "details", {"label":"Details","type":"textarea","validation":"none"}],
[ "attachment1", {"label":"Attachment 1","type":"fileupload","validation":"none"}],
[ "attachment2", {"label":"Attachment 2","type":"fileupload","validation":"none"}],
[ "attachment3", {"label":"Attachment 3","type":"fileupload","validation":"none"}]
];
});
EmployeeImmigrationAdapter.method('getFilters', function() {
return [
[ "employee", {"label":"Employee","type":"select2","remote-source":["Employee","id","first_name+last_name"]}]
];
});
/**
* EmployeeTravelRecordAdapter
*/
function EmployeeTravelRecordAdapter(endPoint,tab,filter,orderBy) {
this.initAdapter(endPoint,tab,filter,orderBy);
this.itemName = 'TravelRequest';
this.itemNameLower = 'travelrequest';
this.modulePathName = 'travel';
}
EmployeeTravelRecordAdapter.inherits(ApproveAdminAdapter);
EmployeeTravelRecordAdapter.method('getDataMapping', function() {
return [
"id",
"employee",
"type",
"purpose",
"travel_from",
"travel_to",
"travel_date",
"status"
];
});
EmployeeTravelRecordAdapter.method('getHeaders', function() {
return [
{ "sTitle": "ID" ,"bVisible":false},
{ "sTitle": "Employee" },
{ "sTitle": "Travel Type" },
{ "sTitle": "Purpose" },
{ "sTitle": "From"},
{ "sTitle": "To"},
{ "sTitle": "Travel Date"},
{ "sTitle": "Status"}
];
});
EmployeeTravelRecordAdapter.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"]
}],
["type", {
"label": "Travel Type",
"type": "select",
"source": [["Local", "Local"], ["International", "International"]]
}],
["purpose", {"label": "Purpose of Travel", "type": "textarea", "validation": ""}],
["travel_from", {"label": "Travel From", "type": "text", "validation": ""}],
["travel_to", {"label": "Travel To", "type": "text", "validation": ""}],
["travel_date", {"label": "Travel Date", "type": "datetime", "validation": ""}],
["return_date", {"label": "Return Date", "type": "datetime", "validation": ""}],
["details", {"label": "Notes", "type": "textarea", "validation": "none"}],
["currency", {"label": "Currency", "type": "select2", "allow-null":false, "remote-source": ["CurrencyType", "id", "code"]}],
["funding", {"label": "Total Funding Proposed", "type": "text", "validation": "float"}],
["attachment1", {"label": "Itinerary / Cab Receipt", "type": "fileupload", "validation": "none"}],
["attachment2", {"label": "Other Attachment 1", "type": "fileupload", "validation": "none"}],
["attachment3", {"label": "Other Attachment 2", "type": "fileupload", "validation": "none"}]
];
});

View File

@@ -0,0 +1,11 @@
{
"label":"Travel Administration",
"menu":"Employees",
"order":"6",
"icon":"fa-plane",
"user_levels":["Admin","Manager"],
"permissions":
{
}
}

View File

@@ -46,13 +46,20 @@ class AttendanceActionManager extends SubActionManager{
public function savePunch($req){ public function savePunch($req){
$req->date = $req->time;
/* $useServerTime = SettingsManager::getInstance()->getSetting('Attendance: Use Department Time Zone');
if(strtotime($req->date) > strtotime($req->cdate)){ $currentEmployeeTimeZone = BaseService::getInstance()->getCurrentEmployeeTimeZone();
return new IceResponse(IceResponse::ERROR,"You are not allowed to punch a future time");
if($useServerTime == '1' && !empty($currentEmployeeTimeZone)){
date_default_timezone_set('Asia/Colombo');
$date = new DateTime("now", new DateTimeZone('Asia/Colombo'));
$date->setTimezone(new DateTimeZone($currentEmployeeTimeZone));
$req->time = $date->format('Y-m-d H:i:s');
} }
*/
$req->date = $req->time;
//check if there is an open punch //check if there is an open punch
$openPunch = $this->getPunch($req)->getData(); $openPunch = $this->getPunch($req)->getData();
@@ -65,13 +72,7 @@ class AttendanceActionManager extends SubActionManager{
$arr = explode(" ",$dateTime); $arr = explode(" ",$dateTime);
$date = $arr[0]; $date = $arr[0];
$currentDateTime = $req->cdate;
$arr = explode(" ",$currentDateTime);
$currentDate = $arr[0];
if($currentDate != $date){
return new IceResponse(IceResponse::ERROR,"You are not allowed to punch time for a previous date");
}
$employee = $this->baseService->getElement('Employee',$this->getCurrentProfileId(),null,true); $employee = $this->baseService->getElement('Employee',$this->getCurrentProfileId(),null,true);
@@ -98,18 +99,18 @@ class AttendanceActionManager extends SubActionManager{
} }
if(strtotime($attendance->out_time) >= strtotime($dateTime) && strtotime($attendance->in_time) <= strtotime($dateTime)){ if(strtotime($attendance->out_time) >= strtotime($dateTime) && strtotime($attendance->in_time) <= strtotime($dateTime)){
//-1---0---1---0 || ---0--1---1---0 //-1---0---1---0 || ---0--1---1---0
return new IceResponse(IceResponse::ERROR,"Time entry is overlapping with an existing one 1"); return new IceResponse(IceResponse::ERROR,"Time entry is overlapping with an existing one");
}else if(strtotime($attendance->out_time) >= strtotime($openPunch->in_time) && strtotime($attendance->in_time) <= strtotime($openPunch->in_time)){ }else if(strtotime($attendance->out_time) >= strtotime($openPunch->in_time) && strtotime($attendance->in_time) <= strtotime($openPunch->in_time)){
//---0---1---0---1 || ---0--1---1---0 //---0---1---0---1 || ---0--1---1---0
return new IceResponse(IceResponse::ERROR,"Time entry is overlapping with an existing one 2"); return new IceResponse(IceResponse::ERROR,"Time entry is overlapping with an existing one");
}else if(strtotime($attendance->out_time) <= strtotime($dateTime) && strtotime($attendance->in_time) >= strtotime($openPunch->in_time)){ }else if(strtotime($attendance->out_time) <= strtotime($dateTime) && strtotime($attendance->in_time) >= strtotime($openPunch->in_time)){
//--1--0---0--1-- //--1--0---0--1--
return new IceResponse(IceResponse::ERROR,"Time entry is overlapping with an existing one 3 ".$attendance->id); return new IceResponse(IceResponse::ERROR,"Time entry is overlapping with an existing one ".$attendance->id);
} }
}else{ }else{
if(strtotime($attendance->out_time) >= strtotime($dateTime) && strtotime($attendance->in_time) <= strtotime($dateTime)){ if(strtotime($attendance->out_time) >= strtotime($dateTime) && strtotime($attendance->in_time) <= strtotime($dateTime)){
//---0---1---0 //---0---1---0
return new IceResponse(IceResponse::ERROR,"Time entry is overlapping with an existing one 4"); return new IceResponse(IceResponse::ERROR,"Time entry is overlapping with an existing one");
} }
} }
} }

View File

@@ -25,6 +25,11 @@ $moduleName = 'attendance';
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';
$useServerTime = SettingsManager::getInstance()->getSetting('Attendance: Use Department Time Zone');
$currentEmployeeTimeZone = BaseService::getInstance()->getCurrentEmployeeTimeZone();
if(empty($currentEmployeeTimeZone)){
$useServerTime = 0;
}
?><div class="span9"> ?><div class="span9">
<ul class="nav nav-tabs" id="modTab" style="margin-bottom:0px;margin-left:5px;border-bottom: none;"> <ul class="nav nav-tabs" id="modTab" style="margin-bottom:0px;margin-left:5px;border-bottom: none;">
@@ -48,9 +53,11 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
<script> <script>
var modJsList = new Array(); var modJsList = new Array();
modJsList['tabAttendance'] = new AttendanceAdapter('Attendance','Attendance','','in_time desc'); modJsList['tabAttendance'] = new AttendanceAdapter('Attendance','Attendance','','in_time desc');
modJsList['tabAttendance'].setUseServerTime(<?=$useServerTime?>);
modJsList['tabAttendance'].setRemoteTable(true); modJsList['tabAttendance'].setRemoteTable(true);
modJsList['tabAttendance'].updatePunchButton(true); modJsList['tabAttendance'].updatePunchButton(true);
var modJs = modJsList['tabAttendance']; var modJs = modJsList['tabAttendance'];
</script> </script>

View File

@@ -23,6 +23,7 @@ Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilin
function AttendanceAdapter(endPoint,tab,filter,orderBy) { function AttendanceAdapter(endPoint,tab,filter,orderBy) {
this.initAdapter(endPoint,tab,filter,orderBy); this.initAdapter(endPoint,tab,filter,orderBy);
this.punch = null; this.punch = null;
this.useServerTime = 0;
} }
AttendanceAdapter.inherits(AdapterBase); AttendanceAdapter.inherits(AdapterBase);
@@ -31,6 +32,10 @@ AttendanceAdapter.method('updatePunchButton', function() {
this.getPunch('changePunchButtonSuccessCallBack'); this.getPunch('changePunchButtonSuccessCallBack');
}); });
AttendanceAdapter.method('setUseServerTime', function(val) {
this.useServerTime = val;
});
AttendanceAdapter.method('getDataMapping', function() { AttendanceAdapter.method('getDataMapping', function() {
return [ return [
@@ -51,11 +56,19 @@ AttendanceAdapter.method('getHeaders', function() {
}); });
AttendanceAdapter.method('getFormFields', function() { AttendanceAdapter.method('getFormFields', function() {
if(this.useServerTime == 0){
return [ return [
[ "id", {"label":"ID","type":"hidden"}], [ "id", {"label":"ID","type":"hidden"}],
[ "time", {"label":"Time","type":"datetime"}], [ "time", {"label":"Time","type":"datetime"}],
[ "note", {"label":"Note","type":"textarea","validation":"none"}] [ "note", {"label":"Note","type":"textarea","validation":"none"}]
]; ];
}else{
return [
[ "id", {"label":"ID","type":"hidden"}],
[ "note", {"label":"Note","type":"textarea","validation":"none"}]
];
}
}); });

View File

@@ -21,19 +21,12 @@ Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah) Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
*/ */
include (APP_BASE_PATH."modules/leaves/api/LeavesActionManager.php");
class DashboardActionManager extends SubActionManager{ class DashboardActionManager extends SubActionManager{
public function getPendingLeaves($req){ public function getPendingLeaves($req){
$lam = new LeavesActionManager(); return new IceResponse(IceResponse::SUCCESS,0);
$leavePeriod = $lam->getCurrentLeavePeriod(date("Y-m-d H:i:s"), date("Y-m-d H:i:s"));
$leave = new EmployeeLeave();
$pendingLeaves = $leave->Find("status = ? and employee = ?",array("Pending", $this->getCurrentProfileId()));
return new IceResponse(IceResponse::SUCCESS,count($pendingLeaves));
} }

View File

@@ -28,7 +28,7 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
?><div class="span9"> ?><div class="span9">
<div class="row"> <div class="row">
<div class="col-lg-3 col-xs-6"> <div class="col-lg-3 col-xs-12">
<!-- small box --> <!-- small box -->
<div class="small-box bg-aqua"> <div class="small-box bg-aqua">
<div class="inner"> <div class="inner">
@@ -47,24 +47,7 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
</a> </a>
</div> </div>
</div><!-- ./col --> </div><!-- ./col -->
<div class="col-lg-3 col-xs-6"> <div class="col-lg-3 col-xs-12">
<!-- small box -->
<div class="small-box bg-green">
<div class="inner">
<h3 id="pendingLeaveCount">..</h3>
<p>
Pending Leaves
</p>
</div>
<div class="icon">
<i class="ion ion-calendar"></i>
</div>
<a href="#" class="small-box-footer" id="leavesLink">
Check Leave Status <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div><!-- ./col -->
<div class="col-lg-3 col-xs-6">
<!-- small box --> <!-- small box -->
<div class="small-box bg-yellow"> <div class="small-box bg-yellow">
<div class="inner"> <div class="inner">
@@ -81,7 +64,7 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
</a> </a>
</div> </div>
</div><!-- ./col --> </div><!-- ./col -->
<div class="col-lg-3 col-xs-6"> <div class="col-lg-3 col-xs-12">
<!-- small box --> <!-- small box -->
<div class="small-box bg-red"> <div class="small-box bg-red">
<div class="inner"> <div class="inner">
@@ -98,6 +81,130 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
</a> </a>
</div> </div>
</div><!-- ./col --> </div><!-- ./col -->
<div class="col-lg-3 col-xs-12">
<!-- small box -->
<div class="small-box bg-teal">
<div class="inner">
<h3>
My Travel
</h3>
<p>
Requests
</p>
</div>
<div class="icon">
<i class="ion ion-plane"></i>
</div>
<a href="#" class="small-box-footer" id="travelLink">
Travel Requests <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>
<div class="col-lg-3 col-xs-12">
<!-- small box -->
<div class="small-box bg-yellow">
<div class="inner">
<h3>
Help
</h3>
<p>
User Guide
</p>
</div>
<div class="icon">
<i class="ion ion-help"></i>
</div>
<a href="http://blog.icehrm.com/docs/home/" target="_blank" class="small-box-footer" id="icehrmHelpLink">
Documentation <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>
<?php if($user->user_level == "Manager" || $user->user_level == "Admin"){?>
<div class="col-lg-3 col-xs-12">
<!-- small box -->
<div class="small-box bg-aqua">
<div class="inner">
<h3>
Employees
</h3>
<p id="numberOfEmployees">
Subordinates
</p>
</div>
<div class="icon">
<i class="ion ion-person-stalker"></i>
</div>
<a href="#" class="small-box-footer" id="employeeLink">
Manage Subordinates <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div><!-- ./col -->
<div class="col-lg-3 col-xs-12">
<!-- small box -->
<div class="small-box bg-yellow">
<div class="inner">
<h3>
Travel
</h3>
<p id="numberOfTravel">
Management
</p>
</div>
<div class="icon">
<i class="ion ion-plane"></i>
</div>
<a href="#" class="small-box-footer" id="traveAdminlLink">
Manage Travel <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div>
<div class="col-lg-3 col-xs-12">
<!-- small box -->
<div class="small-box bg-red">
<div class="inner">
<h3>
Attendance
</h3>
<p id="numberOfDocuments">
Monitor
</p>
</div>
<div class="icon">
<i class="ion ion-ios7-timer"></i>
</div>
<a href="#" class="small-box-footer" id="attendanceAdminLink">
View Attendance <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div><!-- ./col -->
<div class="col-lg-3 col-xs-12">
<!-- small box -->
<div class="small-box bg-teal">
<div class="inner">
<h3>Reports</h3>
<p>
View / Download Reports
</p>
</div>
<div class="icon">
<i class="ion ion-document-text"></i>
</div>
<a href="#" class="small-box-footer" id="reportsLink">
Create a Report <i class="fa fa-arrow-circle-right"></i>
</a>
</div>
</div><!-- ./col -->
<?php }?>
</div> </div>
</div> </div>
@@ -109,9 +216,15 @@ modJsList['tabDashboard'] = new DashboardAdapter('Dashboard','Dashboard');
var modJs = modJsList['tabDashboard']; var modJs = modJsList['tabDashboard'];
$("#atteandanceLink").attr("href",modJs.getCustomUrl('?g=modules&n=attendance&m=module_Time_Management')); $("#atteandanceLink").attr("href",modJs.getCustomUrl('?g=modules&n=attendance&m=module_Time_Management'));
$("#attendanceAdminLink").attr("href",modJs.getCustomUrl('?g=admin&n=attendance&m=admin_Admin'));
$("#leavesLink").attr("href",modJs.getCustomUrl('?g=modules&n=leaves&m=module_Leaves')); $("#leavesLink").attr("href",modJs.getCustomUrl('?g=modules&n=leaves&m=module_Leaves'));
$("#timesheetLink").attr("href",modJs.getCustomUrl('?g=modules&n=time_sheets&m=module_Time_Management')); $("#timesheetLink").attr("href",modJs.getCustomUrl('?g=modules&n=time_sheets&m=module_Time_Management'));
$("#projectsLink").attr("href",modJs.getCustomUrl('?g=modules&n=projects&m=module_Personal_Information')); $("#projectsLink").attr("href",modJs.getCustomUrl('?g=modules&n=projects&m=module_Time_Management'));
$("#traveAdminlLink").attr("href",modJs.getCustomUrl('?g=admin&n=travel&m=admin_Employees'));
$("#travelLink").attr("href",modJs.getCustomUrl('?g=modules&n=travel&m=module_Travel_Management'));
$("#reportsLink").attr("href",modJs.getCustomUrl('?g=admin&n=reports&m=admin_Reports'));
modJs.getPunch(); modJs.getPunch();
modJs.getPendingLeaves(); modJs.getPendingLeaves();

View File

@@ -1,64 +0,0 @@
<?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 = 'documents';
define('MODULE_PATH',dirname(__FILE__));
include APP_BASE_PATH.'header.php';
include APP_BASE_PATH.'modulejslibs.inc.php';
?><div class="span9">
<ul class="nav nav-tabs" id="modTab" style="margin-bottom:0px;margin-left:5px;border-bottom: none;">
<li class="active"><a id="tabEmployeeDocument" href="#tabPageEmployeeDocument">My Documents</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tabPageEmployeeDocument">
<div id="EmployeeDocument" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="EmployeeDocumentForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
</div>
</div>
</div>
<script>
var modJsList = new Array();
modJsList['tabEmployeeDocument'] = new EmployeeDocumentAdapter('EmployeeDocument','EmployeeDocument');
<?php if(isset($modulePermissions['perm']['Add Documents']) && $modulePermissions['perm']['Add Documents'] == "No"){?>
modJsList['tabEmployeeDocument'].setShowAddNew(false);
<?php }?>
<?php if(isset($modulePermissions['perm']['Delete Documents']) && $modulePermissions['perm']['Delete Documents'] == "No"){?>
modJsList['tabEmployeeDocument'].setShowDelete(false);
<?php }?>
<?php if(isset($modulePermissions['perm']['Edit Documents']) && $modulePermissions['perm']['Edit Documents'] == "No"){?>
modJsList['tabEmployeeDocument'].setShowEdit(false);
<?php }?>
var modJs = modJsList['tabEmployeeDocument'];
</script>
<?php include APP_BASE_PATH.'footer.php';?>

View File

@@ -1,90 +0,0 @@
/*
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)
*/
function EmployeeDocumentAdapter(endPoint) {
this.initAdapter(endPoint);
}
EmployeeDocumentAdapter.inherits(AdapterBase);
EmployeeDocumentAdapter.method('getDataMapping', function() {
return [
"id",
"document",
"details",
"date_added",
"status",
"attachment"
];
});
EmployeeDocumentAdapter.method('getHeaders', function() {
return [
{ "sTitle": "ID" ,"bVisible":false},
{ "sTitle": "Document" },
{ "sTitle": "Details" },
{ "sTitle": "Date Added"},
{ "sTitle": "Status"},
{ "sTitle": "Attachment","bVisible":false}
];
});
EmployeeDocumentAdapter.method('getFormFields', function() {
return [
[ "id", {"label":"ID","type":"hidden"}],
[ "document", {"label":"Document","type":"select2","remote-source":["Document","id","name"]}],
//[ "date_added", {"label":"Date Added","type":"date","validation":""}],
[ "valid_until", {"label":"Valid Until","type":"date","validation":"none"}],
[ "status", {"label":"Status","type":"select","source":[["Active","Active"],["Inactive","Inactive"],["Draft","Draft"]]}],
[ "details", {"label":"Details","type":"textarea","validation":"none"}],
[ "attachment", {"label":"Attachment","type":"fileupload","validation":"none"}]
];
});
EmployeeDocumentAdapter.method('getActionButtonsHtml', function(id,data) {
var downloadButton = '<img class="tableActionButton" src="_BASE_images/download.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Download Document" onclick="download(\'_attachment_\');return false;"></img>';
var editButton = '<img class="tableActionButton" src="_BASE_images/edit.png" style="cursor:pointer;" rel="tooltip" title="Edit" onclick="modJs.edit(_id_);return false;"></img>';
var deleteButton = '<img class="tableActionButton" src="_BASE_images/delete.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Delete" onclick="modJs.deleteRow(_id_);return false;"></img>';
var html = '<div style="width:80px;">_edit__download__delete_</div>';
html = html.replace('_download_',downloadButton);
if(this.showDelete){
html = html.replace('_delete_',deleteButton);
}else{
html = html.replace('_delete_','');
}
if(this.showEdit){
html = html.replace('_edit_',editButton);
}else{
html = html.replace('_edit_','');
}
html = html.replace(/_id_/g,id);
html = html.replace(/_attachment_/g,data[5]);
html = html.replace(/_BASE_/g,this.baseUrl);
return html;
});

View File

@@ -1,22 +0,0 @@
{
"label":"My Documents",
"menu":"Documents",
"order":"1",
"icon":"fa-files-o",
"user_levels":["Admin","Manager","Employee"],
"permissions":
{
"Manager":{
"Add Documents":"Yes",
"Edit Documents":"Yes",
"Delete Documents":"Yes"
},
"Employee":{
"Add Documents":"Yes",
"Edit Documents":"Yes",
"Delete Documents":"Yes"
}
}
}

View File

@@ -1,7 +1,7 @@
{ {
"label":"Loans", "label":"Loans",
"menu":"Loans", "menu":"Finance",
"order":"1", "order":"3",
"icon":"fa-shield", "icon":"fa-shield",
"user_levels":["Admin","Manager","Employee"], "user_levels":["Admin","Manager","Employee"],

View File

@@ -1,9 +1,7 @@
{ {
"Personal Information":"fa-male", "Personal Information":"fa-male",
"Subordinates":"fa-user", "Subordinates":"fa-user",
"Leaves":"fa-calendar-o",
"Time Management":"fa-clock-o", "Time Management":"fa-clock-o",
"Documents":"fa-files-o", "Travel Management":"fa-plane",
"Training":"fa-briefcase", "Finance":"fa-money"
"Loans":"fa-list-alt"
} }

View File

@@ -1,7 +1,7 @@
{ {
"label":"Salary", "label":"Salary",
"menu":"Personal Information", "menu":"Finance",
"order":"4", "order":"2",
"icon":"fa-calculator", "icon":"fa-calculator",
"user_levels":["Admin","Manager","Employee"], "user_levels":["Admin","Manager","Employee"],

View File

@@ -0,0 +1,59 @@
<?php
class TravelActionManager extends ApproveModuleActionManager{
public function getModelClass(){
return "EmployeeTravelRecord";
}
public function getItemName(){
return "TravelRequest";
}
public function getModuleName(){
return "Travel Management";
}
public function getModuleTabUrl(){
return "g=admin&n=travel&m=admin_Employees#tabEmployeeTravelRecord";
}
}
/*
class TravelActionManager extends SubActionManager{
public function cancelTravel($req){
$employee = $this->baseService->getElement('Employee',$this->getCurrentProfileId(),null,true);
$employeeTravel = new EmployeeTravelRecord();
$employeeTravel->Load("id = ?",array($req->id));
if($employeeTravel->id != $req->id){
return new IceResponse(IceResponse::ERROR,"Travel record not found");
}
if($this->user->user_level != 'Admin' && $this->getCurrentProfileId() != $employeeTravel->employee){
return new IceResponse(IceResponse::ERROR,"Only an admin or owner of the travel request can do this");
}
if($employeeTravel->status != 'Approved'){
return new IceResponse(IceResponse::ERROR,"Only an approved travel request can be cancelled");
}
$employeeTravel->status = 'Cancellation Requested';
$ok = $employeeTravel->Save();
if(!$ok){
LogManager::getInstance()->error("Error occured while cancelling the travel:".$employeeTravel->ErrorMsg());
return new IceResponse(IceResponse::ERROR,"Error occurred while cancelling the travel request. Please contact admin.");
}
$this->baseService->audit(IceConstants::AUDIT_ACTION, "Travel cancellation \ start:".$employeeTravel->date_start."\ end:".$employeeTravel->date_end);
$notificationMsg = $employee->first_name." ".$employee->last_name." cancelled a travel. Visit travel management module to approve";
$this->baseService->notificationManager->addNotification($employee->supervisor,$notificationMsg,'{"type":"url","url":"g=admin&n=travel&m=admin_Employees#tabEmployeeTravelRecord"}',
"Travel Module", null, false, true);
return new IceResponse(IceResponse::SUCCESS,$employeeTravel);
}
}
*/

View File

@@ -1,12 +1,10 @@
<?php <?php
if (!class_exists('DocumentsModulesManager')) { if (!class_exists('TravelModulesManager')) {
class DocumentsModulesManager extends AbstractModuleManager{ class TravelModulesManager extends AbstractModuleManager{
public function initializeUserClasses(){ public function initializeUserClasses(){
if(defined('MODULE_TYPE') && MODULE_TYPE != 'admin'){
$this->addUserClass("EmployeeDocument");
}
} }
public function initializeFieldMappings(){ public function initializeFieldMappings(){
@@ -19,6 +17,7 @@ if (!class_exists('DocumentsModulesManager')) {
public function setupModuleClassDefinitions(){ public function setupModuleClassDefinitions(){
} }
} }

View File

@@ -0,0 +1,66 @@
<?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';
$moduleMainName = "EmployeeTravelRecord";
$moduleItemName = "Travel Request";
define('MODULE_PATH',dirname(__FILE__));
include APP_BASE_PATH.'header.php';
include APP_BASE_PATH.'modulejslibs.inc.php';
?><div class="span9">
<ul class="nav nav-tabs" id="modTab" style="margin-bottom:0px;margin-left:5px;border-bottom: none;">
<li class="active"><a id="tab<?=$moduleMainName?>" href="#tabPage<?=$moduleMainName?>">Travel Requests</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>
</div>
<script>
var modJsList = new Array();
modJsList['tab<?=$moduleMainName?>'] = new <?=$moduleMainName?>Adapter('<?=$moduleMainName?>','<?=$moduleMainName?>');
<?php if(isset($modulePermissions['perm']['Add '.$moduleItemName]) && $modulePermissions['perm']['Add '.$moduleItemName] == "No"){?>
modJsList['tab<?=$moduleMainName?>'].setShowAddNew(false);
<?php }?>
<?php if(isset($modulePermissions['perm']['Delete '.$moduleItemName]) && $modulePermissions['perm']['Delete '.$moduleItemName] == "No"){?>
modJsList['tab<?=$moduleMainName?>'].setShowDelete(false);
<?php }?>
<?php if(isset($modulePermissions['perm']['Edit '.$moduleItemName]) && $modulePermissions['perm']['Edit '.$moduleItemName] == "No"){?>
modJsList['tab<?=$moduleMainName?>'].setShowEdit(false);
<?php }?>
var modJs = modJsList['tab<?=$moduleMainName?>'];
</script>
<?php include APP_BASE_PATH.'footer.php';?>

158
ext/modules/travel/lib.js Normal file
View File

@@ -0,0 +1,158 @@
/*
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 EmployeeImmigrationAdapter(endPoint) {
this.initAdapter(endPoint);
}
EmployeeImmigrationAdapter.inherits(AdapterBase);
EmployeeImmigrationAdapter.method('getDataMapping', function() {
return [
"id",
"document",
"documentname",
"valid_until",
"status"
];
});
EmployeeImmigrationAdapter.method('getHeaders', function() {
return [
{ "sTitle": "ID" ,"bVisible":false},
{ "sTitle": "Document" },
{ "sTitle": "Document Id" },
{ "sTitle": "Valid Until"},
{ "sTitle": "Status"}
];
});
EmployeeImmigrationAdapter.method('getFormFields', function() {
return [
[ "id", {"label":"ID","type":"hidden"}],
[ "document", {"label":"Document","type":"select2","remote-source":["ImmigrationDocument","id","name"]}],
[ "documentname", {"label":"Document Id","type":"text","validation":""}],
[ "valid_until", {"label":"Valid Until","type":"date","validation":"none"}],
[ "status", {"label":"Status","type":"select","source":[["Active","Active"],["Inactive","Inactive"],["Draft","Draft"]]}],
[ "details", {"label":"Details","type":"textarea","validation":"none"}],
[ "attachment1", {"label":"Attachment 1","type":"fileupload","validation":"none"}],
[ "attachment2", {"label":"Attachment 2","type":"fileupload","validation":"none"}],
[ "attachment3", {"label":"Attachment 3","type":"fileupload","validation":"none"}]
];
});
function EmployeeTravelRecordAdapter(endPoint) {
this.initAdapter(endPoint);
}
EmployeeTravelRecordAdapter.inherits(AdapterBase);
EmployeeTravelRecordAdapter.method('getDataMapping', function() {
return [
"id",
"type",
"purpose",
"travel_from",
"travel_to",
"travel_date",
"return_date",
"status"
];
});
EmployeeTravelRecordAdapter.method('getHeaders', function() {
return [
{ "sTitle": "ID" ,"bVisible":false},
{ "sTitle": "Travel Type" },
{ "sTitle": "Purpose" },
{ "sTitle": "From"},
{ "sTitle": "To"},
{ "sTitle": "Travel Date"},
{ "sTitle": "Return Date"},
{ "sTitle": "Status"}
];
});
EmployeeTravelRecordAdapter.method('getFormFields', function() {
return [
[ "id", {"label":"ID","type":"hidden"}],
[ "type", {"label":"Travel Type","type":"select","source":[["Local","Local"],["International","International"]]}],
[ "purpose", {"label":"Purpose of Travel","type":"textarea","validation":""}],
[ "travel_from", {"label":"Travel From","type":"text","validation":""}],
[ "travel_to", {"label":"Travel To","type":"text","validation":""}],
[ "travel_date", {"label":"Travel Date","type":"datetime","validation":""}],
[ "return_date", {"label":"Return Date","type":"datetime","validation":""}],
[ "details", {"label":"Notes","type":"textarea","validation":"none"}],
[ "currency", {"label":"Currency","type":"select2","allow-null":false,"remote-source":["CurrencyType","id","code"]}],
[ "funding", {"label":"Total Funding Proposed","type":"text","validation":"float"}],
[ "attachment1", {"label":"Itinerary / Cab Receipt","type":"fileupload","validation":"none"}],
[ "attachment2", {"label":"Other Attachment 1","type":"fileupload","validation":"none"}],
[ "attachment3", {"label":"Other Attachment 2","type":"fileupload","validation":"none"}]
];
});
EmployeeTravelRecordAdapter.method('getActionButtonsHtml', function(id,data) {
var editButton = '<img class="tableActionButton" src="_BASE_images/edit.png" style="cursor:pointer;" rel="tooltip" title="Edit" onclick="modJs.edit(_id_);return false;"></img>';
var deleteButton = '<img class="tableActionButton" src="_BASE_images/delete.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Delete" onclick="modJs.deleteRow(_id_);return false;"></img>';
var requestCancellationButton = '<img class="tableActionButton" src="_BASE_images/delete.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Cancel Travel Request" onclick="modJs.cancelTravel(_id_);return false;"></img>';
var html = '<div style="width:80px;">_edit__delete_</div>';
if(this.showDelete){
if(data[7] == "Approved"){
html = html.replace('_delete_',requestCancellationButton);
}else{
html = html.replace('_delete_',deleteButton);
}
}else{
html = html.replace('_delete_','');
}
if(this.showEdit){
html = html.replace('_edit_',editButton);
}else{
html = html.replace('_edit_','');
}
html = html.replace(/_id_/g,id);
html = html.replace(/_BASE_/g,this.baseUrl);
return html;
});
EmployeeTravelRecordAdapter.method('cancelTravel', function(id) {
var that = this;
var object = {};
object['id'] = id;
var reqJson = JSON.stringify(object);
var callBackData = [];
callBackData['callBackData'] = [];
callBackData['callBackSuccess'] = 'cancelSuccessCallBack';
callBackData['callBackFail'] = 'cancelFailCallBack';
this.customAction('cancelTravel','modules=travel',reqJson,callBackData);
});
EmployeeTravelRecordAdapter.method('cancelSuccessCallBack', function(callBackData) {
this.showMessage("Successful", "Travel request cancellation request sent");
this.get([]);
});
EmployeeTravelRecordAdapter.method('cancelFailCallBack', function(callBackData) {
this.showMessage("Error Occurred while cancelling Travel request", callBackData);
});

View File

@@ -0,0 +1,23 @@
{
"label":"Travel",
"menu":"Travel Management",
"order":"1",
"icon":"fa-plane",
"user_levels":["Admin","Manager","Employee"],
"permissions":
{
"Manager":{
"Add Travel Request":"Yes",
"Edit Travel Request":"Yes",
"Delete Travel Request":"Yes"
},
"Employee":{
"Add Travel Request":"Yes",
"Edit Travel Request":"Yes",
"Delete Travel Request":"Yes"
}
}
}

650
readme.md
View File

@@ -1,22 +1,575 @@
IceHrm IceHrm
=========== ===========
IceHrm is a [HRM software](http://icehrm.com) which enable companies of all sizes to [manage HR activities](http://icehrm.com)
properly.
Note: IceHrm is now fully compatible with PHP 7
Installation Installation
------------ ------------
Download the latest release https://github.com/gamonoid/icehrm/releases/latest * Download the latest release https://github.com/gamonoid/icehrm/releases/latest
Copy the downloaded file to the path you want to install iCE Hrm in your server and extract. * Copy the downloaded file to the path you want to install iCE Hrm in your server and extract.
Create a mysql DB for and user. Grant all on iCE Hrm DB to new DB user. * Create a mysql DB for and user. Grant all on iCE Hrm DB to new DB user.
Visit iCE Hrm installation path in your browser. * Visit iCE Hrm installation path in your browser.
During the installation form, fill in details appropriately. * During the installation form, fill in details appropriately.
Once the application is installed use the username = admin and password = admin to login to your system. * Once the application is installed use the username = admin and password = admin to login to your system.
Note: Please rename or delete the install folder (<ice hrm root>/app/install) since it could pose a security threat to your iCE Hrm instance. Note: Please rename or delete the install folder (<ice hrm root>/app/install) since it could pose a security threat to your iCE Hrm instance.
Upgrade from Previous Versions to Latest Version
------------------------------------------------
* Backup icehrm installation file and DB
* Remove all folders except icehrm/app from your existing installation
* Copy all folders except icehrm/app into installation folder
* Use sql scripts inside 'db_upgrade/(version)' folder to upgrade the icehrm current version
Note: If you are upgrading from older versions of icehrm please note that the icehrm leave module is removed since v13.0
Following is a list of features supported in each version of icehrm
-------------------------------------------------------------------
### IceHrm Open Source Version
* 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.
* [Performance Charts](http://icehrm.com) - Charts for monitoring attendance hours and comparing attendance with time sheets
* [Travel Management](http://icehrm.com) - Module for managing travel requests
### IceHrm Pro Version | [Buy now for 199 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.
#### Advanced Employee Module
![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.
#### 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)
### IceHrm Enterprise Version [Starts from 575 USD](http://icehrm.com)
In addition to pro version features icehrm enterprise version 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/)
#### LDAP Support
#### Training Management
Icehrm [training management system](http://icehrm.com) is for Module for managing courses, training sessions and employee attendance to training sessions.
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 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 Release note v12.6
----------------- -----------------
@@ -27,31 +580,38 @@ Release note v12.6
### Fixes ### Fixes
* Employee switching issue fixed * Employee switching issue fixed
Release note v10.2
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 ### Fixes
* Improvements to date time pickers * Improvements to date time pickers
* Fixing fatal error due to non writable log file
* Latest changes from ice-framework v2.0
Release note v10.1 Release note v10.1
----------------- -----------------
### Features ### Features
* Integration with ice-framework (http://github.com/thilinah/ice-framework) * Integration with ice-framework (http://githun.com/thilinah/ice-framework)
* Travel module
* Meta data module
* Option for only allow users to add an entry to a timesheet only if they have marked atteandance for the selected period * 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 * Restricting availability of leave types to employees using leave groups
* Admins and add notes to employees
### 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.1 Release note v9.1
----------------- -----------------
### Fixes ### Fixes
* Add missing S3FileSystem class * Add missing S3FileSystem class
* Fix issue: passing result of a method call directly into empty method is not supported in php v5.3 * Fix issue: passing result of a method call directly into empty method is not supported in php v5.3
@@ -59,12 +619,14 @@ Release note v9.1
Release note v9.0 Release note v9.0
----------------- -----------------
### Features ### Features
* New user interface * New user interface
* Decimal leave counts supported * Decimal leave counts supported
Update icehrm v8.4 to v9.0 Update icehrm v8.4 to v9.0
-------------------------- --------------------------
* Make a backup of your icehrm db * 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 * 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 * remove all folders except app folder in icehrm root folder
@@ -73,6 +635,7 @@ Update icehrm v8.4 to v9.0
Release note v8.4 Release note v8.4
----------------- -----------------
### Fixes ### Fixes
* Fix leave carry forward rounding issues * Fix leave carry forward rounding issues
* Fix issue: select2 default value not getting set for select2 * Fix issue: select2 default value not getting set for select2
@@ -80,6 +643,7 @@ Release note v8.4
Release note v8.3 Release note v8.3
----------------- -----------------
### Fixes ### Fixes
* Fix user table issue on windows, this will resolve errors such as: (Note that this fix has no effect on unix based installations) * 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 view user uploaded documents
@@ -88,40 +652,15 @@ Release note v8.3
* Employee projects can not be added * Employee projects can not be added
Update icehrm v8.2 to v8.3
--------------------------
Copy server.includes.inc.php from v8.3 to your icehrm folder
Update icehrm v7.x to v8.0
--------------------------
Delete all folders except <icehrm>/app directory
Copy contents of icehrm_v8.0.zip to existing icehrm directory except app directory
Execute 'icehrmdb_os_update_v7.x_to_v8.0.sql' on your icehrm database
Update icehrm v7.1 to v7.2
--------------------------
Download update from https://bitbucket.org/thilina/icehrm-opensource/downloads/icehrm_update_from_7.1_to_7.2.zip
Unzip icehrm_update_from_7.1_to_7.2.zip inside your icehrm installation
Update icehrm v6.1 to v7.1
--------------------------
Delete all folders except <icehrm>/app directory
Copy contents of icehrm_v7.1.zip to existing icehrm directory except app directory
Execute 'icehrmdb_os_update_v6.1_to_v7.1.sql' on your icehrm database
Release note v8.2 Release note v8.2
----------------- -----------------
### Features ### Features
* Instance verification added * Instance verification added
Release note v8.1 Release note v8.1
----------------- -----------------
### Fixes ### Fixes
* Fixed bug that caused a fatal error in php v5.4 * Fixed bug that caused a fatal error in php v5.4
* aws2.7.11 phar file replaced by a aws2.7.11 extracted files * aws2.7.11 phar file replaced by a aws2.7.11 extracted files
@@ -129,6 +668,7 @@ Release note v8.1
Release note v8.0 Release note v8.0
----------------- -----------------
### Features ### Features
* Admin dashbord module * Admin dashbord module
* If the employee joined in current leave period, his leave entitlement is calculated proportional to joined date * If the employee joined in current leave period, his leave entitlement is calculated proportional to joined date
@@ -149,12 +689,14 @@ Release note v8.0
Release note v7.2 Release note v7.2
----------------- -----------------
*Fixes
### Fixes
* Some critical vulnerabilities are fixed as recommend by http://zeroscience.mk/en/ * Some critical vulnerabilities are fixed as recommend by http://zeroscience.mk/en/
Release note v7.1 Release note v7.1
----------------- -----------------
*Features
### Features
* Improved company structure graph * Improved company structure graph
* Leave notes implementation <20> Supervisor can add a note when approving or rejecting leaves * Leave notes implementation <20> Supervisor can add a note when approving or rejecting leaves
* Filtering support * Filtering support
@@ -162,20 +704,22 @@ Release note v7.1
* Add/Edit/Delete company structure permissions added for managers * Add/Edit/Delete company structure permissions added for managers
* Add ability to disable employee information editing * Add ability to disable employee information editing
*Fixes ### Fixes
* Make loans editable only by admin * Make loans editable only by admin
* Fix: permissions not getting applied to employee documents * Fix: permissions not getting applied to employee documents
* Fix error adding employee documents when no user assigned to the admin * Fix error adding employee documents when no user assigned to the admin
*Code Quality ### Code Quality
* Moving all module related code and data into module folders * Moving all module related code and data into module folders
Release note v6.1 Release note v6.1
----------------- -----------------
Leave carry forwared related isue fixed Leave carry forwared related isue fixed
Release note v6.0 Release note v6.0
----------------- -----------------
* Features * Features
* Notifications for leaves and timesheets * Notifications for leaves and timesheets
* Leave module accrue and leave carry forward * Leave module accrue and leave carry forward
@@ -197,11 +741,13 @@ Release note v6.0
Release note v5.3 Release note v5.3
----------------- -----------------
* Fixes * Fixes
* Fix missing employee name in employee details report * Fix missing employee name in employee details report
Release note v5.2 Release note v5.2
----------------- -----------------
* Fixes * Fixes
* Remove unwanted error logs * Remove unwanted error logs
* Fix attendance module employee permission issue * Fix attendance module employee permission issue
@@ -211,12 +757,14 @@ Release note v5.2
Release note v5.1 Release note v5.1
----------------- -----------------
* Fixes * Fixes
* Fixing for non updating null fields * Fixing for non updating null fields
* https://bitbucket.org/thilina/icehrm-opensource/commits/df57308b53484a2e43ef5c72967ed1cd0dc756cc * https://bitbucket.org/thilina/icehrm-opensource/commits/df57308b53484a2e43ef5c72967ed1cd0dc756cc
Release note v5.0 Release note v5.0
----------------- -----------------
* Features * Features
* New user permission implementation * New user permission implementation
* Adding new user level - Manager * Adding new user level - Manager
@@ -226,14 +774,16 @@ Release note v5.0
Release note v4.2 Release note v4.2
----------------- -----------------
* Fixes
### Fixes
* https://bitbucket.org/thilina/icehrm-opensource/issue/23/subordinate-leaves-pagination-not-working * 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 * https://bitbucket.org/thilina/icehrm-opensource/issue/20/error-occured-while-time-punch
Release note v4.1 Release note v4.1
----------------- -----------------
* Features
### Features
* Better email format for notifications * Better email format for notifications
* Convert upload dialog to a bootstrp model * Convert upload dialog to a bootstrp model

View File

@@ -117,6 +117,9 @@ AdapterBase.method('addSuccessCallBack', function(callBackData,serverData, callG
}); });
AdapterBase.method('addFailCallBack', function(callBackData,serverData) { AdapterBase.method('addFailCallBack', function(callBackData,serverData) {
try{
this.closePlainMessage();
}catch(e){}
this.showMessage("Error saving",serverData); this.showMessage("Error saving",serverData);
this.trackEvent("addFailed",this.tab,this.table); this.trackEvent("addFailed",this.tab,this.table);
}); });
@@ -513,6 +516,163 @@ IdNameAdapter.method('getFormFields', function() {
}); });
/**
* ApproveAdminAdapter
*/
function ApproveAdminAdapter(endPoint,tab,filter,orderBy) {
this.initAdapter(endPoint,tab,filter,orderBy);
}
ApproveAdminAdapter.inherits(AdapterBase);
ApproveAdminAdapter.method('openStatus', function(id,status) {
$('#'+this.itemNameLower+'StatusModel').modal('show');
$('#'+this.itemNameLower+'_status').val(status);
this.statusChangeId = id;
});
ApproveAdminAdapter.method('closeDialog', function() {
$('#'+this.itemNameLower+'StatusModel').modal('hide');
});
ApproveAdminAdapter.method('changeStatus', function() {
var status = $('#'+this.itemNameLower+'_status').val();
var reason = $('#'+this.itemNameLower+'_reason').val();
if(status == undefined || status == null || status == ""){
this.showMessage("Error", "Please select "+this.itemNameLower+" status");
return;
}
var object = {"id":this.statusChangeId,"status":status,"reason":reason};
var reqJson = JSON.stringify(object);
var callBackData = [];
callBackData['callBackData'] = [];
callBackData['callBackSuccess'] = 'changeStatusSuccessCallBack';
callBackData['callBackFail'] = 'changeStatusFailCallBack';
this.customAction('changeStatus','admin='+this.modulePathName,reqJson,callBackData);
this.closeDialog();
this.statusChangeId = null;
});
ApproveAdminAdapter.method('changeStatusSuccessCallBack', function(callBackData) {
this.showMessage("Successful", this.itemName + " Request status changed successfully");
this.get([]);
});
ApproveAdminAdapter.method('changeStatusFailCallBack', function(callBackData) {
this.showMessage("Error", "Error occurred while changing "+this.itemName+" request status");
});
ApproveAdminAdapter.method('getActionButtonsHtml', function(id,data) {
var editButton = '<img class="tableActionButton" src="_BASE_images/edit.png" style="cursor:pointer;" rel="tooltip" title="Edit" onclick="modJs.edit(_id_);return false;"></img>';
var deleteButton = '<img class="tableActionButton" src="_BASE_images/delete.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Delete" onclick="modJs.deleteRow(_id_);return false;"></img>';
var statusChangeButton = '<img class="tableActionButton" src="_BASE_images/run.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Change Status" onclick="modJs.openStatus(_id_);return false;"></img>';
var html = '<div style="width:80px;">_edit__delete__status_</div>';
html = html.replace('_status_',statusChangeButton);
if(this.showDelete){
html = html.replace('_delete_',deleteButton);
}else{
html = html.replace('_delete_','');
}
if(this.showEdit){
html = html.replace('_edit_',editButton);
}else{
html = html.replace('_edit_','');
}
html = html.replace(/_id_/g,id);
html = html.replace(/_BASE_/g,this.baseUrl);
return html;
});
ApproveAdminAdapter.method('isSubProfileTable', function() {
if(this.user.user_level == "Admin"){
return false;
}else{
return true;
}
});
/**
* ApproveModuleAdapter
*/
function ApproveModuleAdapter(endPoint,tab,filter,orderBy) {
this.initAdapter(endPoint,tab,filter,orderBy);
}
ApproveModuleAdapter.inherits(AdapterBase);
ApproveModuleAdapter.method('cancelRequest', function(id) {
var that = this;
var object = {};
object['id'] = id;
var reqJson = JSON.stringify(object);
var callBackData = [];
callBackData['callBackData'] = [];
callBackData['callBackSuccess'] = 'cancelSuccessCallBack';
callBackData['callBackFail'] = 'cancelFailCallBack';
this.customAction('cancel','modules='+this.modulePathName,reqJson,callBackData);
});
ApproveModuleAdapter.method('cancelSuccessCallBack', function(callBackData) {
this.showMessage("Successful", this.itemName + " cancellation request sent");
this.get([]);
});
ApproveModuleAdapter.method('cancelFailCallBack', function(callBackData) {
this.showMessage("Error Occurred while cancelling "+this.itemName, callBackData);
});
ApproveModuleAdapter.method('getActionButtonsHtml', function(id,data) {
var editButton = '<img class="tableActionButton" src="_BASE_images/edit.png" style="cursor:pointer;" rel="tooltip" title="Edit" onclick="modJs.edit(_id_);return false;"></img>';
var deleteButton = '<img class="tableActionButton" src="_BASE_images/delete.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Delete" onclick="modJs.deleteRow(_id_);return false;"></img>';
var requestCancellationButton = '<img class="tableActionButton" src="_BASE_images/delete.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Cancel '+this.itemName+'" onclick="modJs.cancelRequest(_id_);return false;"></img>';
var html = '<div style="width:80px;">_edit__delete_</div>';
if(this.showDelete){
if(data[7] == "Approved"){
html = html.replace('_delete_',requestCancellationButton);
}else{
html = html.replace('_delete_',deleteButton);
}
}else{
html = html.replace('_delete_','');
}
if(this.showEdit){
html = html.replace('_edit_',editButton);
}else{
html = html.replace('_edit_','');
}
html = html.replace(/_id_/g,id);
html = html.replace(/_BASE_/g,this.baseUrl);
return html;
});
/** /**
* RequestCache * RequestCache
@@ -538,7 +698,16 @@ RequestCache.method('getData', function(key) {
var strData = localStorage.getItem(key); var strData = localStorage.getItem(key);
if(strData != undefined && strData != null && strData != ""){ if(strData != undefined && strData != null && strData != ""){
return JSON.parse(strData); data = JSON.parse(strData);
if(data == undefined || data == null){
return null;
}
if(data.status != undefined && data.status != null && data.status != "SUCCESS"){
return null;
}
return data;
} }
return null; return null;
@@ -550,6 +719,10 @@ RequestCache.method('setData', function(key, data) {
return null; return null;
} }
if(data.status != undefined && data.status != null && data.status != "SUCCESS"){
return null;
}
var strData = JSON.stringify(data); var strData = JSON.stringify(data);
var strData = localStorage.setItem(key,strData); var strData = localStorage.setItem(key,strData);
return strData; return strData;

View File

@@ -411,7 +411,7 @@ IceHRMBase.method('getTableTopButtonHtml', function() {
if(html != ""){ if(html != ""){
html += "&nbsp;&nbsp;"; html += "&nbsp;&nbsp;";
} }
html+='<button onclick="modJs.showFilters();return false;" class="btn btn-small btn-primary">Fillter <i class="fa fa-filter"></i></button>'; html+='<button onclick="modJs.showFilters();return false;" class="btn btn-small btn-primary">Filter <i class="fa fa-filter"></i></button>';
html += "&nbsp;&nbsp;"; html += "&nbsp;&nbsp;";
if(this.filtersAlreadySet){ if(this.filtersAlreadySet){
html+='<button id="__id___resetFilters" onclick="modJs.resetFilters();return false;" class="btn btn-small btn-default">__filterString__ <i class="fa fa-times"></i></button>'; html+='<button id="__id___resetFilters" onclick="modJs.resetFilters();return false;" class="btn btn-small btn-default">__filterString__ <i class="fa fa-times"></i></button>';
@@ -445,6 +445,10 @@ IceHRMBase.method('getTableHTMLTemplate', function() {
return '<div class="box-body table-responsive"><table cellpadding="0" cellspacing="0" border="0" class="table table-bordered table-striped" id="grid"></table></div>'; return '<div class="box-body table-responsive"><table cellpadding="0" cellspacing="0" border="0" class="table table-bordered table-striped" id="grid"></table></div>';
}); });
IceHRMBase.method('isSortable', function() {
return true;
});
/** /**
* Create the data table on provided element id * Create the data table on provided element id
* @method createTable * @method createTable
@@ -453,6 +457,9 @@ IceHRMBase.method('getTableHTMLTemplate', function() {
IceHRMBase.method('createTable', function(elementId) { IceHRMBase.method('createTable', function(elementId) {
var that = this;
if(this.getRemoteTable()){ if(this.getRemoteTable()){
this.createTableServer(elementId); this.createTableServer(elementId);
return; return;
@@ -497,7 +504,7 @@ IceHRMBase.method('createTable', function(elementId) {
}, },
"aaData": data, "aaData": data,
"aoColumns": headers, "aoColumns": headers,
"bSort": true, "bSort": that.isSortable(),
"iDisplayLength": 15, "iDisplayLength": 15,
"iDisplayStart": start "iDisplayStart": start
}; };
@@ -559,7 +566,7 @@ IceHRMBase.method('createTableServer', function(elementId) {
"bServerSide": true, "bServerSide": true,
"sAjaxSource": that.getDataUrl(that.getDataMapping()), "sAjaxSource": that.getDataUrl(that.getDataMapping()),
"aoColumns": headers, "aoColumns": headers,
"bSort": true, "bSort": that.isSortable(),
"parent":that, "parent":that,
"iDisplayLength": 15, "iDisplayLength": 15,
"iDisplayStart": start "iDisplayStart": start
@@ -683,6 +690,38 @@ IceHRMBase.method('renderModel', function(id,header,body) {
$('#'+id+'ModelBody').html(body); $('#'+id+'ModelBody').html(body);
}); });
IceHRMBase.method('renderYesNoModel', function(header,body,yesBtnName,noBtnName,callback, callbackParams) {
var that = this;
var modelId = "#yesnoModel";
if(body == undefined || body == null){
body = "";
}
$(modelId+'Label').html(header);
$(modelId+'Body').html(body);
if(yesBtnName != null){
$(modelId+'YesBtn').html(yesBtnName);
}
if(noBtnName != null){
$(modelId+'NoBtn').html(noBtnName);
}
$(modelId+'YesBtn').off().on('click',function(){
if(callback != undefined && callback != null){
callback.apply(that,callbackParams);
that.cancelYesno();
}
});
$(modelId).modal({
backdrop: 'static'
});
});
IceHRMBase.method('renderModelFromDom', function(id,header,element) { IceHRMBase.method('renderModelFromDom', function(id,header,element) {
$('#'+id+'ModelBody').html(""); $('#'+id+'ModelBody').html("");
@@ -746,8 +785,8 @@ IceHRMBase.method('showDomElement', function(title,element,closeCallback,closeCa
var that = this; var that = this;
var modelId = ""; var modelId = "";
if(isPlain){ if(isPlain){
modelId = "#plainMessageModel"; modelId = "#dataMessageModel";
this.renderModelFromDom('plainMessage',title,element); this.renderModelFromDom('dataMessage',title,element);
}else{ }else{
modelId = "#messageModel"; modelId = "#messageModel";
this.renderModelFromDom('message',title,element); this.renderModelFromDom('message',title,element);
@@ -781,10 +820,18 @@ IceHRMBase.method('closeMessage', function() {
$('#messageModel').modal('hide'); $('#messageModel').modal('hide');
}); });
IceHRMBase.method('cancelYesno', function() {
$('#yesnoModel').modal('hide');
});
IceHRMBase.method('closePlainMessage', function() { IceHRMBase.method('closePlainMessage', function() {
$('#plainMessageModel').modal('hide'); $('#plainMessageModel').modal('hide');
}); });
IceHRMBase.method('closeDataMessage', function() {
$('#dataMessageModel').modal('hide');
});
/** /**
* Create or edit an element * Create or edit an element
@@ -1435,7 +1482,7 @@ IceHRMBase.method('addDataGroup', function() {
$("#"+field[0]+"_div").html(html); $("#"+field[0]+"_div").html(html);
this.closePlainMessage(); this.closeDataMessage();
} }
}); });
@@ -1482,7 +1529,7 @@ IceHRMBase.method('editDataGroup', function() {
$("#"+field[0]+"_div").html(html); $("#"+field[0]+"_div").html(html);
this.closePlainMessage(); this.closeDataMessage();
} }
} }

View File

@@ -15,7 +15,7 @@ define('APP_DB', '_APP_DB_');
define('APP_USERNAME', '_APP_USERNAME_'); define('APP_USERNAME', '_APP_USERNAME_');
define('APP_PASSWORD', '_APP_PASSWORD_'); define('APP_PASSWORD', '_APP_PASSWORD_');
define('APP_HOST', '_APP_HOST_'); define('APP_HOST', '_APP_HOST_');
define('APP_CON_STR', 'mysql://'.APP_USERNAME.':'.APP_PASSWORD.'@'.APP_HOST.'/'.APP_DB); define('APP_CON_STR', 'mysqli://'.APP_USERNAME.':'.APP_PASSWORD.'@'.APP_HOST.'/'.APP_DB);
//file upload //file upload
define('FILE_TYPES', 'jpg,png,jpeg'); define('FILE_TYPES', 'jpg,png,jpeg');

7
src/app/cron.php Normal file
View File

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

18
src/app/entry.php Normal 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

@@ -21,7 +21,7 @@ $action = $_REQUEST['action'];
if($action == "TEST_DB"){ if($action == "TEST_DB"){
$db = NewADOConnection('mysql'); $db = NewADOConnection('mysqli');
$res = $db->Connect($_REQUEST["APP_HOST"], $_REQUEST["APP_USERNAME"], $_REQUEST["APP_PASSWORD"], $_REQUEST["APP_DB"]); $res = $db->Connect($_REQUEST["APP_HOST"], $_REQUEST["APP_USERNAME"], $_REQUEST["APP_PASSWORD"], $_REQUEST["APP_DB"]);
if (!$res){ if (!$res){
@@ -72,7 +72,7 @@ if($action == "TEST_DB"){
$con = mysql_connect($_REQUEST["APP_HOST"],$_REQUEST["APP_USERNAME"],$_REQUEST["APP_PASSWORD"]); $con = mysql_connect($_REQUEST["APP_HOST"],$_REQUEST["APP_USERNAME"],$_REQUEST["APP_PASSWORD"]);
$db = NewADOConnection('mysql'); $db = NewADOConnection('mysqli');
$res = $db->Connect($_REQUEST["APP_HOST"], $_REQUEST["APP_USERNAME"], $_REQUEST["APP_PASSWORD"], $_REQUEST["APP_DB"]); $res = $db->Connect($_REQUEST["APP_HOST"], $_REQUEST["APP_USERNAME"], $_REQUEST["APP_PASSWORD"], $_REQUEST["APP_DB"]);

18
src/app/update.php Normal 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.'/update.php';
}else{
exit();
}

View File

@@ -61,6 +61,11 @@ abstract class AbstractModuleManager{
public abstract function setupModuleClassDefinitions(); public abstract function setupModuleClassDefinitions();
public function getDashboardItem(){
return null;
}
public function setupRestEndPoints(){ public function setupRestEndPoints(){
} }

View File

@@ -0,0 +1,218 @@
<?php
abstract class ApproveAdminActionManager extends SubActionManager{
public abstract function getModelClass();
public abstract function getItemName();
public abstract function getModuleName();
public abstract function getModuleTabUrl();
public function changeStatus($req){
$class = $this->getModelClass();
$itemName = $this->getItemName();
$obj = new $class();
$obj->Load("id = ?",array($req->id));
if($obj->id != $req->id){
return new IceResponse(IceResponse::ERROR,"$itemName not found");
}
if($this->user->user_level != 'Admin' && $this->user->user_level != 'Manager'){
return new IceResponse(IceResponse::ERROR,"Only an admin or manager can do this");
}
$oldStatus = $obj->status;
$obj->status = $req->status;
$ok = $obj->Save();
if(!$ok){
LogManager::getInstance()->info($obj->ErrorMsg());
return new IceResponse(IceResponse::ERROR,"Error occurred while saving $itemName information. Please contact admin");
}
$this->baseService->audit(IceConstants::AUDIT_ACTION, "$itemName status changed from:".$oldStatus." to:".$obj->status." id:".$obj->id);
$currentEmpId = $this->getCurrentProfileId();
if(!empty($currentEmpId)){
$employee = $this->baseService->getElement('Employee',$currentEmpId);
$notificationMsg = "Your $itemName has been $obj->status by ".$employee->first_name." ".$employee->last_name;
if(!empty($req->reason)){
$notificationMsg.=" (Note:".$req->reason.")";
}
$this->baseService->notificationManager->addNotification($obj->employee,$notificationMsg,'{"type":"url","url":"'.$this->getModuleTabUrl().'"}',$this->getModuleName(), null, false, true);
}
return new IceResponse(IceResponse::SUCCESS,"");
}
}
abstract class ApproveModuleActionManager extends SubActionManager{
public abstract function getModelClass();
public abstract function getItemName();
public abstract function getModuleName();
public abstract function getModuleTabUrl();
public function cancel($req){
$employee = $this->baseService->getElement('Employee',$this->getCurrentProfileId(),null,true);
$class = $this->getModelClass();
$itemName = $this->getItemName();
$obj = new $class();
$obj->Load("id = ?",array($req->id));
if($obj->id != $req->id){
return new IceResponse(IceResponse::ERROR,"$itemName record not found");
}
if($this->user->user_level != 'Admin' && $this->getCurrentProfileId() != $obj->employee){
return new IceResponse(IceResponse::ERROR,"Only an admin or owner of the $itemName can do this");
}
if($obj->status != 'Approved'){
return new IceResponse(IceResponse::ERROR,"Only an approved $itemName can be cancelled");
}
$obj->status = 'Cancellation Requested';
$ok = $obj->Save();
if(!$ok){
LogManager::getInstance()->error("Error occurred while cancelling the $itemName:".$obj->ErrorMsg());
return new IceResponse(IceResponse::ERROR,"Error occurred while cancelling the $itemName. Please contact admin.");
}
$this->baseService->audit(IceConstants::AUDIT_ACTION, "Expense cancellation | start:".$obj->date_start."| end:".$obj->date_end);
$notificationMsg = $employee->first_name." ".$employee->last_name." cancelled a expense. Visit expense management module to approve";
$this->baseService->notificationManager->addNotification($employee->supervisor,$notificationMsg,'{"type":"url","url":"'.$this->getModuleTabUrl().'"}',
$this->getModuleTabUrl(), null, false, true);
return new IceResponse(IceResponse::SUCCESS,$obj);
}
}
class ApproveModel extends ICEHRM_Record {
public function executePreSaveActions($obj){
$preApprove = SettingsManager::getInstance()->getSetting($this->preApproveSettingName);
$sendNotificationEmail = true;
if(empty($obj->status)){
if($preApprove == "1"){
$obj->status = "Approved";
$sendNotificationEmail = false;
}else{
$obj->status = "Pending";
}
}
if($preApprove){
return new IceResponse(IceResponse::SUCCESS,$obj);
}
$currentEmpId = BaseService::getInstance()->getCurrentProfileId();
//Auto approve if the current user is an admin
if(!empty($currentEmpId)){
$employee = BaseService::getInstance()->getElement('Employee',$currentEmpId);
if(!empty($employee->supervisor)) {
$notificationMsg = "A new ".$this->notificationUnitName." has been added by " . $employee->first_name . " " . $employee->last_name . ". Please visit ".$this->notificationModuleName." module to review it";
BaseService::getInstance()->notificationManager->addNotification($employee->supervisor, $notificationMsg, '{"type":"url","url":"'.$this->notificationUnitAdminUrl.'"}', $this->notificationModuleName, null, false, $sendNotificationEmail);
}else{
$user = BaseService::getInstance()->getCurrentUser();
if($user->user_level == "Admin"){
//Auto approve
$obj->status = "Approved";
$notificationMsg = "Your ".$this->notificationUnitName." is auto approved since you are an administrator and do not have any supervisor assigned";
BaseService::getInstance()->notificationManager->addNotification(null, $notificationMsg, '{"type":"url","url":"'.$this->notificationUnitAdminUrl.'"}', $this->notificationModuleName, $user->id, false, $sendNotificationEmail);
}else{
//If the user do not have a supervisor, notify all admins
$admins = BaseService::getInstance()->getAllAdmins();
foreach($admins as $admin){
$notificationMsg = "A new ".$this->notificationUnitName." has been added by " . $employee->first_name . " " . $employee->last_name . ". Please visit ".$this->notificationModuleName." module to review it. You are getting this notification since you are an administrator and the user do not have any supervisor assigned.";
BaseService::getInstance()->notificationManager->addNotification(null, $notificationMsg, '{"type":"url","url":"'.$this->notificationUnitAdminUrl.'"}', $this->notificationModuleName, $admin->id, false, $sendNotificationEmail);
}
}
}
}
return new IceResponse(IceResponse::SUCCESS,$obj);
}
public function executePreUpdateActions($obj){
$preApprove = SettingsManager::getInstance()->getSetting($this->preApproveSettingName);
$sendNotificationEmail = true;
$fieldsToCheck = $this->fieldsNeedToBeApproved();
$travelRequest = new EmployeeTravelRecord();
$travelRequest->Load('id = ?',array($obj->id));
$needToApprove = false;
if($preApprove != "1"){
foreach($fieldsToCheck as $field){
if($obj->$field != $travelRequest->$field) {
$needToApprove = true;
break;
}
}
}else{
$sendNotificationEmail = false;
}
if($preApprove){
return new IceResponse(IceResponse::SUCCESS,$obj);
}
if($needToApprove && $obj->status != 'Pending'){
$currentEmpId = BaseService::getInstance()->getCurrentProfileId();
//Auto approve if the current user is an admin
if(!empty($currentEmpId)){
$employee = BaseService::getInstance()->getElement('Employee',$currentEmpId);
if(!empty($employee->supervisor)) {
$notificationMsg = $this->notificationUnitPrefix." ".$this->notificationUnitName." has been updated by " . $employee->first_name . " " . $employee->last_name . ". Please visit ".$this->notificationModuleName." module to review it";
BaseService::getInstance()->notificationManager->addNotification($employee->supervisor, $notificationMsg, '{"type":"url","url":"'.$this->notificationUnitAdminUrl.'"}', $this->notificationModuleName, null, false, $sendNotificationEmail);
}else{
$user = BaseService::getInstance()->getCurrentUser();
if($user->user_level == "Admin"){
}else{
//If the user do not have a supervisor, notify all admins
$admins = BaseService::getInstance()->getAllAdmins();
foreach($admins as $admin){
$notificationMsg = $this->notificationUnitPrefix." ".$this->notificationUnitName." request has been updated by " . $employee->first_name . " " . $employee->last_name . ". Please visit ".$this->notificationModuleName." module to review it. You are getting this notification since you are an administrator and the user do not have any supervisor assigned.";
BaseService::getInstance()->notificationManager->addNotification(null, $notificationMsg, '{"type":"url","url":"g=admin&n=travel&m=admin_Employees"}', "Travel Module", $admin->id, false, $sendNotificationEmail);
}
}
}
}
}
return new IceResponse(IceResponse::SUCCESS,$obj);
}
}

View File

@@ -1022,7 +1022,7 @@ class BaseService{
} }
public function getGAKey(){ public function getGAKey(){
return ""; return SettingsManager::getInstance()->getSetting('Analytics: Google Key');
} }
/** /**
@@ -1103,6 +1103,30 @@ class BaseService{
$data = $customField->Find("type = ?",array($type)); $data = $customField->Find("type = ?",array($type));
return $data; return $data;
} }
public function getAllAdmins(){
$user = new User();
$admins = $user->Find('user_level = ?',array('Admin'));
return $admins;
}
public function getCurrentEmployeeTimeZone(){
$cemp = $this->getCurrentProfileId();
if(empty($cemp)){
return NULL;
}
$emp = new Employee();
$emp->Load("id = ?",array($cemp));
if(empty($emp->id) || empty($emp->department)){
return NULL;
}
$dept = new CompanyStructure();
$dept->Load("id = ?",array($emp->department));
return $dept->timezone;
}
} }
class IceConstants{ class IceConstants{

View File

@@ -6,7 +6,7 @@ class CronUtils{
private static $me = null; private static $me = null;
private function __construct($clientBasePath, $cronFile){ private function __construct($clientBasePath, $cronFile){
$this->clientBasePath = $clientBasePath; $this->clientBasePath = $clientBasePath."/";
$this->cronFile = $cronFile; $this->cronFile = $cronFile;
} }
@@ -20,13 +20,177 @@ class CronUtils{
public function run(){ public function run(){
$ams = scandir($this->clientBasePath); $ams = scandir($this->clientBasePath);
$count = 0;
foreach($ams as $am){ foreach($ams as $am){
if(is_dir($this->clientBasePath.$am) && $am != '.' && $am != '..'){ if(is_dir($this->clientBasePath.$am) && $am != '.' && $am != '..'){
$command = "php ".$this->cronFile." -c".$this->clientBasePath.$am; //$command = "php ".$this->cronFile." -c".$this->clientBasePath.$am;
$command = "php ".$this->clientBasePath.$am."/".$this->cronFile;
echo "Run:".$command."\r\n"; echo "Run:".$command."\r\n";
passthru($command, $res); passthru($command, $res);
echo "Result :".$res."\r\n"; echo "Result :".$res."\r\n";
$count++;
if($count > 25){
sleep(1);
$count = 0;
}
}
}
}
}
class IceCron{
const MINUTELY = "Minutely";
const HOURLY = "Hourly";
const DAILY = "Daily";
const WEEKLY = "Weekly";
const MONTHLY = "Monthly";
const YEARLY = "Yearly";
private $cron;
public function __construct($cron){
$this->cron = $cron;
}
public function isRunNow(){
LogManager::getInstance()->debug("Cron ".print_r($this->cron,true));
$lastRunTime = $this->cron->lastrun;
if(empty($lastRunTime)){
LogManager::getInstance()->debug("Cron ".$this->cron->name." is running since last run time is empty");
return true;
}
$type = $this->cron->type;
$frequency = intval($this->cron->frequency);
$time = intval($this->cron->time);
if(empty($frequency) || !is_int($frequency)){
LogManager::getInstance()->debug("Cron ".$this->cron->name." is not running since frequency is not an integer");
return false;
}
if($type == self::MINUTELY){
$diff = (strtotime("now") - strtotime($lastRunTime));
if(empty($this->time) || !is_int($time)){
if($diff > 60){
return true;
}
}else{
if($diff > 60 * $time){
return true;
}
}
}else if($type == self::HOURLY){
if(empty($time) || !is_int($time)){
if(date('H') != date('H',strtotime($lastRunTime))){
return true;
}
}else{
if(intval(date('m')) <= intval($time) && date('H') != date('H',strtotime($lastRunTime))){
return true;
}
}
}else if($type == self::DAILY){
if(empty($time) || !is_int($time)){
if(date('d') != date('d',strtotime($lastRunTime))){
return true;
}
}else{
if(intval(date('H')) <= intval($time) && date('d') != date('d',strtotime($lastRunTime))){
return true;
}
}
}else if($type == self::MONTHLY){
if(empty($time) || !is_int($time)){
if(date('m') != date('m',strtotime($lastRunTime))){
return true;
}
}else{
if(intval(date('d')) <= intval($time) && date('m') != date('m',strtotime($lastRunTime))){
return true;
}
}
}else if($type == self::YEARLY){
if(empty($time) || !is_int($time)){
if(date('Y') != date('Y',strtotime($lastRunTime))){
return true;
}
}else{
if(intval(date('m')) <= intval($time) && date('Y') != date('Y',strtotime($lastRunTime))){
return true;
}
}
}
return false;
}
public function execute(){
$class = $this->cron->class;
$obj = new $class();
$obj->execute($this->cron);
$this->cronCompleted();
}
private function cronCompleted(){
$this->cron->lastrun = date("Y-m-d H:i:s");
$ok = $this->cron->Save();
if(!$ok){
LogManager::getInstance()->error("Error saving cron due to :".$this->cron->ErrorMsg());
}
}
}
interface IceTask{
public function execute($cron);
}
abstract class EmailIceTask implements IceTask{
public abstract function execute($cron);
public function sendEmployeeEmails($emailList, $subject){
foreach($emailList as $employeeId => $emailData){
$ccList = array();
if(SettingsManager::getInstance()->getSetting('Notifications: Copy Document Expiry Emails to Manager') == '1'){
$employee = new Employee();
$employee->Load("id = ?",array($employeeId));
if(!empty($employee->supervisor)){
$supperuser = BaseService::getInstance()->getUserFromProfileId($employee->supervisor);
if(!empty($supperuser)){
$ccList[] = $supperuser->email;
}
}
}
$user = BaseService::getInstance()->getUserFromProfileId($employeeId);
if(!empty($user) && !empty($user->email)){
$email = new IceEmail();
$email->subject = $subject;
$email->toEmail = $user->email;
$email->template = $emailData;
$email->params = '[]';
$email->cclist = json_encode($ccList);
$email->bcclist = '[]';
$email->status = 'Pending';
$email->created = date('Y-m-d H:i:s');
$email->updated = date('Y-m-d H:i:s');
$ok = $email->Save();
if(!$ok){
LogManager::getInstance()->error("Error Saving Email: ".$email->ErrorMsg());
}
} }
} }
} }

View File

@@ -13,6 +13,56 @@ abstract class EmailSender{
$this->settings = $settings; $this->settings = $settings;
} }
public function sendEmailFromNotification($notification){
$toEmail = null;
$user = new User();
$user->Load("id = ?",array($notification->toUser));
if(!empty($user->email)){
$name = "User";
$employee = new Employee();
$employee->Load("id = ?",array($user->employee));
if($employee->id == $user->employee && !empty($employee->id)){
$name = $employee->first_name;
}
$action = json_decode($notification->action);
$emailBody = file_get_contents(APP_BASE_PATH.'/templates/email/notificationEmail.html');
$emailBody = str_replace("#_user_#", $name, $emailBody);
$emailBody = str_replace("#_message_#", $notification->message, $emailBody);
if($action->type == "url"){
$emailBody = str_replace("#_url_#", CLIENT_BASE_URL."?".$action->url, $emailBody);
}
$this->sendEmail('IceHrm Notification from '.$notification->type,
$user->email,
$emailBody,
array(),
array(),
array()
);
}
}
public function sendEmailFromDB($email){
$params = array();
if(!empty($email->params)){
$params = json_decode($email->params, true);
}
$cclist = array();
if(!empty($email->cclist)){
$cclist = json_decode($email->cclist, true);
}
$bcclist = array();
if(!empty($email->bcclist)){
$bcclist = json_decode($email->bcclist, true);
}
$resp = $this->sendEmail($email->subject, $email->toEmail, $email->template, $params, $cclist, $bcclist);
}
public function sendEmail($subject, $toEmail, $template, $params, $ccList = array(), $bccList = array()){ public function sendEmail($subject, $toEmail, $template, $params, $ccList = array(), $bccList = array()){
$body = $template; $body = $template;
@@ -225,7 +275,7 @@ class SMTPEmailSender extends EmailSender{
$mail = $smtp->send($toEmail, $headers, $body); $mail = $smtp->send($toEmail, $headers, $body);
return true; return $mail;
} }
} }
@@ -255,6 +305,6 @@ class PHPMailer extends EmailSender{
LogManager::getInstance()->info("PHP mailer result : ".$res); LogManager::getInstance()->info("PHP mailer result : ".$res);
return true; return $res;
} }
} }

View File

@@ -12,8 +12,8 @@ class ReportHandler{
return $this->executeReport($report,$query,$where[1]); return $this->executeReport($report,$query,$where[1]);
}else if($report->type == 'Class'){ }else if($report->type == 'Class'){
$className = $report->query; $className = $report->query;
include MODULE_PATH.'/reportClasses/ReportBuilder.php'; include APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilder.php';
include MODULE_PATH.'/reportClasses/'.$className.".php"; include APP_BASE_PATH.'admin/reports/reportClasses/'.$className.".php";
$cls = new $className(); $cls = new $className();
$data = $cls->getData($report,$request); $data = $cls->getData($report,$request);
return $this->generateReport($report,$data); return $this->generateReport($report,$data);

View File

@@ -153,10 +153,27 @@ class UIManager{
} }
if($this->user->user_level == "Admin"){ if($this->user->user_level == "Admin"){
$reg = '';
$num = '';
if(class_exists('ProVersion')){
$pro = new ProVersion();
if(!empty($pro->employeeLimit)){
$num = "<br/>Employee Limit: ".$pro->employeeLimit;
}
if(method_exists($pro,'getRegisteredTo')){
$reg = "<br/>Registered To: ".$pro->getRegisteredTo();
}
}
$manuItems[] = new MenuItemTemplate('menuButtonHelp', array( $manuItems[] = new MenuItemTemplate('menuButtonHelp', array(
"APP_NAME"=>APP_NAME, "APP_NAME"=>APP_NAME,
"VERSION"=>VERSION, "VERSION"=>VERSION,
"VERSION_DATE"=>VERSION_DATE "VERSION_DATE"=>VERSION_DATE,
"REG"=>$reg,
"NUM"=>$num
)); ));
} }
@@ -199,6 +216,23 @@ class UIManager{
return $str; return $str;
} }
public function getCompanyLogoUrl(){
$logoFileSet = false;
$logoFileName = CLIENT_BASE_PATH."data/logo.png";
$logoSettings = SettingsManager::getInstance()->getSetting("Company: Logo");
if(!empty($logoSettings)){
$logoFileName = FileService::getInstance()->getFileUrl($logoSettings);
$logoFileSet = true;
}
if(!$logoFileSet && !file_exists($logoFileName)){
return BASE_URL."images/logo.png";
}
return $logoFileName;
}
} }

23
src/common.cron.tasks.php Normal file
View File

@@ -0,0 +1,23 @@
<?php
class EmailSenderTask implements IceTask{
public function execute($cron){
$email = new IceEmail();
$emails = $email->Find("status = ? limit 10",array('Pending'));
$emailSender = BaseService::getInstance()->getEmailSender();
foreach($emails as $email){
try{
$emailSender->sendEmailFromDB($email);
}catch(Exception $e){
LogManager::getInstance()->error("Error sending email:".$e->getMessage());
}
$email->status = 'Sent';
$email->updated = date('Y-m-d H:i:s');
$email->Save();
}
}
}
include('common.cron.tasks.ext.php');

View File

@@ -9,4 +9,4 @@ if(!defined('SIGN_IN_ELEMENT_MAPPING_FIELD_NAME')){define('SIGN_IN_ELEMENT_MAPPI
if(!defined('CONTACT_EMAIL')){define('CONTACT_EMAIL','ice-framework@gamonoid.com');} if(!defined('CONTACT_EMAIL')){define('CONTACT_EMAIL','ice-framework@gamonoid.com');}
if(!defined('KEY_PREFIX')){define('KEY_PREFIX','iCEf');} if(!defined('KEY_PREFIX')){define('KEY_PREFIX','iCEf');}
if(!defined('APP_SEC')){define('APP_SEC','4dcxswfrds');} if(!defined('APP_SEC')){define('APP_SEC','4dcxudersqw');}

22
src/crons/cron.php Normal file
View File

@@ -0,0 +1,22 @@
<?php
include dirname(__FILE__).'/include.cron.php';
$cron = new Cron();
$crons = $cron->Find("status = ?",array('Enabled'));
if(!$crons){
LogManager::getInstance()->info(CLIENT_NAME." error :".$cron->ErrorMsg());
}
LogManager::getInstance()->info(CLIENT_NAME." cron count :".count($crons));
foreach($crons as $cron){
$count++;
$iceCron = new IceCron($cron);
LogManager::getInstance()->info(CLIENT_NAME." check cron :".$cron->name);
if($iceCron->isRunNow()){
LogManager::getInstance()->info(CLIENT_NAME." execute cron :".$cron->name);
$iceCron->execute();
sleep(1);
}
}

View File

@@ -10,7 +10,7 @@ $basePath = $opts['p'];
include (dirname(__FILE__)."/../classes/CronUtils.php"); include (dirname(__FILE__)."/../classes/CronUtils.php");
$cronUtils = CronUtils::getInstance($basePath, dirname(__FILE__)."/".$file); $cronUtils = CronUtils::getInstance($basePath, $file);
echo "Cron Runner created \r\n"; echo "Cron Runner created \r\n";

View File

@@ -2,14 +2,10 @@
if(php_sapi_name() != 'cli'){ if(php_sapi_name() != 'cli'){
exit(); exit();
} }
$opts = getopt('c:');
$clientPath = $opts['c'];
if(empty($clientPath)){ define('CLIENT_PATH',dirname(__FILE__)."/..");
echo "No client path defined\r\n";
exit(); include (APP_BASE_PATH."config.base.php");
}
include $clientPath."/config.php";
include (APP_BASE_PATH."include.common.php"); include (APP_BASE_PATH."include.common.php");
include("server.includes.inc.php"); include(APP_BASE_PATH."server.includes.inc.php");

View File

@@ -407,7 +407,7 @@ table.dataTable{
-webkit-border-radius: 0px; -webkit-border-radius: 0px;
-moz-border-radius: 0px; -moz-border-radius: 0px;
border-radius: 0px; border-radius: 0px;
box-shadow: 0 1px 1px rgba(0,0,0,.12),0 1px 1px rgba(0,0,0,.24);
} }
@@ -457,6 +457,13 @@ table.dataTable{
background: #FFF; background: #FFF;
} }
/*
@media (min-width:1025px) {
.content {
min-height: 1100px;
}
}*/
.wrapper { .wrapper {
background: #FFF; background: #FFF;
} }
@@ -481,6 +488,16 @@ table.dataTable{
/*custom for v11.0 */
.table-bordered>thead>tr>th{ .table-bordered>thead>tr>th{
border:none !important; border:none !important;
} }
@@ -499,9 +516,11 @@ table.dataTable{
box-shadow: 0 1px 2px 0 rgba(0,0,0,.2); box-shadow: 0 1px 2px 0 rgba(0,0,0,.2);
} }
.reviewBlock{ .reviewBlock{/*
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;
box-sizing: border-box box-sizing: border-box*/
box-shadow: 0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24);
border: none;
} }
.treeview-menu li:hover{ .treeview-menu li:hover{
@@ -589,3 +608,47 @@ table.dataTable{
.fc-toolbar h2{ .fc-toolbar h2{
font-size: 15px; font-size: 15px;
} }
.navbar, .right-side{
box-shadow: 0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24);
border: none;
}
.right-side{
margin-bottom: 20px;
}
.sidebar .sidebar-menu {
box-shadow: 0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24);
border: none;
background: #FFF;
}
.treeview.active{
box-shadow: 0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24);
border: none;
background: #FFF;
}
.sidebar .sidebar-menu .treeview-menu > li {
background: #FFF;
}
.skin-blue .sidebar > .sidebar-menu > li > a:hover, .skin-blue .sidebar > .sidebar-menu > li.active > a {
color: #222;
background: #fff !important;
}
.right-side > .content-header > h1 > small {
color: #FFF;
}
.modal-content {
border-radius: 0px;
}
.panel {
border-radius: 0px;
-moz-border-radius: 0px;
-webkit-border-radius: 0px;
}

49
src/entry_footer.php Normal file
View File

@@ -0,0 +1,49 @@
</section><!-- /.content -->
</aside><!-- /.right-side -->
</div><!-- ./wrapper -->
<script type="text/javascript">
for (var prop in modJsList) {
if(modJsList.hasOwnProperty(prop)){
modJsList[prop].setPermissions(<?=json_encode($modulePermissions['perm'])?>);
modJsList[prop].setFieldTemplates(<?=json_encode($fieldTemplates)?>);
modJsList[prop].setTemplates(<?=json_encode($templates)?>);
modJsList[prop].setCustomTemplates(<?=json_encode($customTemplates)?>);
<?php if(isset($emailTemplates)){?>
modJsList[prop].setEmailTemplates(<?=json_encode($emailTemplates)?>);
<?php } ?>
modJsList[prop].setUser(<?=json_encode($user)?>);
//Test
<?php if(isset($_REQUEST['action']) && $_REQUEST['action'] == "new"){?>
if(modJsList[prop].newInitObject == undefined || modJsList[prop].newInitObject == null){
modJsList[prop].initFieldMasterData(null,modJsList[prop].renderForm);
}else{
modJsList[prop].initFieldMasterData(null,modJsList[prop].renderForm, modJsList[prop].newInitObject);
}
<?php }else{?>
modJsList[prop].initFieldMasterData(null, modJs.loadingFunction);
<?php }?>
modJsList[prop].setBaseUrl('<?=BASE_URL?>');
modJsList[prop].setCurrentProfile(<?=json_encode($activeProfile)?>);
modJsList[prop].setInstanceId('<?=$baseService->getInstanceId()?>');
modJsList[prop].setNoJSONRequests('<?=$noJSONRequests?>');
}
}
//Other static js objects
var timeUtils = new TimeUtils();
timeUtils.setServerGMToffset('<?=$diffHoursBetweenServerTimezoneWithGMT?>');
var clientUrl = '<?=CLIENT_BASE_URL?>';
</script>
<?php include 'popups.php';?>
<?php include APP_BASE_PATH.'js/bootstrapDataTable.php';?>
</body>
</html>

91
src/entry_header.php Normal file
View File

@@ -0,0 +1,91 @@
<?php
$logoFileName = CLIENT_BASE_PATH."data/logo.png";
$logoFileUrl = CLIENT_BASE_URL."data/logo.png";
if(!file_exists($logoFileName)){
$logoFileUrl = BASE_URL."images/logo.png";
}
?><!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title><?=$meta->title?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link rel="image_src" href="<?=!empty($meta->imageUrl)?$meta->imageUrl:$logoFileUrl?>"/>
<meta property="og:image" content="<?=!empty($meta->imageUrl)?$meta->imageUrl:$logoFileUrl?>"/>
<meta property="og:url" content="<?=$meta->url?>"/>
<meta property="og:title" content="<?=$meta->title?>"/>
<meta property="og:description" content="<?=$meta->description?>"/>
<link href="<?=BASE_URL?>themecss/bootstrap.min.css" rel="stylesheet">
<link href="<?=BASE_URL?>themecss/font-awesome.min.css" rel="stylesheet">
<link href="<?=BASE_URL?>themecss/ionicons.min.css" rel="stylesheet">
<script type="text/javascript" src="<?=BASE_URL?>js/jquery2.0.2.min.js"></script>
<script src="<?=BASE_URL?>themejs/bootstrap.js"></script>
<script src="<?=BASE_URL?>js/jquery.placeholder.js"></script>
<script src="<?=BASE_URL?>js/base64.js"></script>
<script src="<?=BASE_URL?>js/bootstrap-datepicker.js"></script>
<script src="<?=BASE_URL?>js/jquery.timepicker.js"></script>
<script src="<?=BASE_URL?>js/bootstrap-datetimepicker.js"></script>
<script src="<?=BASE_URL?>js/fullcalendar.min.js"></script>
<script src="<?=BASE_URL?>js/select2/select2.min.js"></script>
<script src="<?=BASE_URL?>js/bootstrap-colorpicker-2.1.1/js/bootstrap-colorpicker.min.js"></script>
<link href="<?=BASE_URL?>themecss/datatables/dataTables.bootstrap.css" rel="stylesheet">
<link href="<?=BASE_URL?>css/jquery.timepicker.css" rel="stylesheet">
<link href="<?=BASE_URL?>css/datepicker.css" rel="stylesheet">
<link href="<?=BASE_URL?>css/bootstrap-datetimepicker.min.css" rel="stylesheet">
<link href="<?=BASE_URL?>css/fullcalendar.css" rel="stylesheet">
<link href="<?=BASE_URL?>js/select2/select2.css" rel="stylesheet">
<link href="<?=BASE_URL?>js/bootstrap-colorpicker-2.1.1/css/bootstrap-colorpicker.min.css" rel="stylesheet">
<link href="<?=BASE_URL?>themecss/AdminLTE.css" rel="stylesheet">
<script src="<?=BASE_URL?>themejs/plugins/datatables/jquery.dataTables.js"></script>
<script src="<?=BASE_URL?>themejs/plugins/datatables/dataTables.bootstrap.js"></script>
<script src="<?=BASE_URL?>themejs/AdminLTE/app.js"></script>
<link href="<?=BASE_URL?>css/style.css?v=<?=$cssVersion?>" rel="stylesheet">
<script type="text/javascript" src="<?=BASE_URL?>js/date.js"></script>
<script type="text/javascript" src="<?=BASE_URL?>js/json2.js"></script>
<script type="text/javascript" src="<?=BASE_URL?>js/CrockfordInheritance.v0.1.js"></script>
<script type="text/javascript" src="<?=BASE_URL?>api/Base.js?v=<?=$jsVersion?>"></script>
<script type="text/javascript" src="<?=BASE_URL?>api/AdapterBase.js?v=<?=$jsVersion?>"></script>
<script type="text/javascript" src="<?=BASE_URL?>api/FormValidation.js?v=<?=$jsVersion?>"></script>
<script type="text/javascript" src="<?=BASE_URL?>api/Notifications.js?v=<?=$jsVersion?>"></script>
<script type="text/javascript" src="<?=BASE_URL?>api/TimeUtils.js?v=<?=$jsVersion?>"></script>
<script type="text/javascript" src="<?=BASE_URL?>api/AesCrypt.js?v=<?=$jsVersion?>"></script>
<?php include APP_BASE_PATH.'/modulejslibs.inc.php';?>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
<script>
var baseUrl = '<?=CLIENT_BASE_URL?>service.php';
var CLIENT_BASE_URL = '<?=CLIENT_BASE_URL?>';
</script>
<script type="text/javascript" src="<?=BASE_URL?>js/app-global.js"></script>
</head>
<body>

View File

@@ -70,7 +70,7 @@ class qqFileUploader {
*/ */
function handleUpload($uploadDirectory,$saveFileName, $replaceOldFile = FALSE){ function handleUpload($uploadDirectory,$saveFileName, $replaceOldFile = FALSE){
if (!is_writable($uploadDirectory)){ if (!is_writable($uploadDirectory)){
return array('success'=>0,'error' => "Server error. Upload directory isn't writable."); return array('success'=>0,'error' => "Server error. Upload directory ($uploadDirectory) is not writable");
} }
if (!$this->file){ if (!$this->file){

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

106
src/font/roboto/Roboto.css Normal file
View File

@@ -0,0 +1,106 @@
@font-face {
font-family: 'Roboto';
src: local('Roboto'), url('https://roboto-webfont.googlecode.com/files/Roboto-Regular-webfont.woff') format('woff');
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: 'Roboto';
src: local('Roboto'), url('https://roboto-webfont.googlecode.com/files/Roboto-Italic-webfont.woff') format('woff');
font-weight: 400;
font-style: italic;
}
@font-face {
font-family: 'Roboto';
src: local('Roboto'), url('https://roboto-webfont.googlecode.com/files/Roboto-Bold-webfont.woff') format('woff');
font-weight: 700;
font-style: normal;
}
@font-face {
font-family: 'Roboto';
src: local('Roboto'), url('https://roboto-webfont.googlecode.com/files/Roboto-BoldItalic-webfont.woff') format('woff');
font-weight: 700;
font-style: italic;
}
@font-face {
font-family: 'Roboto Condensed';
src: local('Roboto Condensed'), url('https://roboto-webfont.googlecode.com/files/Roboto-Condensed-webfont.woff') format('woff');
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: 'Roboto Condensed';
src: local('Roboto Condensed'), url('https://roboto-webfont.googlecode.com/files/Roboto-CondensedItalic-webfont.woff') format('woff');
font-weight: 400;
font-style: italic;
}
@font-face {
font-family: 'Roboto Condensed';
src: local('Roboto Condensed'), url('https://roboto-webfont.googlecode.com/files/Roboto-BoldCondensed-webfont.woff') format('woff');
font-weight: 700;
font-style: normal;
}
@font-face {
font-family: 'Roboto Condensed';
src: local('Roboto Condensed'), url('https://roboto-webfont.googlecode.com/files/Roboto-BoldCondensedItalic-webfont.woff') format('woff');
font-weight: 700;
font-style: italic;
}
@font-face {
font-family: 'Roboto Thin';
src: local('Roboto Thin'), url('https://roboto-webfont.googlecode.com/files/Roboto-Thin-webfont.woff') format('woff');
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: 'Roboto Thin';
src: local('Roboto Thin'), url('https://roboto-webfont.googlecode.com/files/Roboto-ThinItalic-webfont.woff') format('woff');
font-weight: 400;
font-style: italic;
}
@font-face {
font-family: 'Roboto Light';
src: local('Roboto Light'), url('https://roboto-webfont.googlecode.com/files/Roboto-Light-webfont.woff') format('woff');
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: 'Roboto Light';
src: local('Roboto Light'), url('https://roboto-webfont.googlecode.com/files/Roboto-LightItalic-webfont.woff') format('woff');
font-weight: 400;
font-style: italic;
}
@font-face {
font-family: 'Roboto Medium';
src: local('Roboto Medium'), url('https://roboto-webfont.googlecode.com/files/Roboto-Medium-webfont.woff') format('woff');
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: 'Roboto Medium';
src: local('Roboto Medium'), url('https://roboto-webfont.googlecode.com/files/Roboto-MediumItalic-webfont.woff') format('woff');
font-weight: 400;
font-style: italic;
}
@font-face {
font-family: 'Roboto Black';
src: local('Roboto Black'), url('https://roboto-webfont.googlecode.com/files/Roboto-Black-webfont.woff') format('woff');
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: 'Roboto Black';
src: local('Roboto Black'), url('https://roboto-webfont.googlecode.com/files/Roboto-BlackItalic-webfont.woff') format('woff');
font-weight: 400;
font-style: italic;
}

View File

@@ -23,6 +23,8 @@ Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilin
include 'includes.inc.php'; include 'includes.inc.php';
if(empty($user)){ if(empty($user)){
$actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
SessionUtils::saveSessionObject('loginRedirect',$actual_link);
header("Location:".CLIENT_BASE_URL."login.php"); header("Location:".CLIENT_BASE_URL."login.php");
} }
@@ -54,6 +56,7 @@ if(!in_array($user->user_level, $modulePermissions['user'])){
$commonRoles = array_intersect($modulePermissions['user_roles'], $userRoles); $commonRoles = array_intersect($modulePermissions['user_roles'], $userRoles);
if(empty($commonRoles)){ if(empty($commonRoles)){
echo "You are not allowed to access this page"; echo "You are not allowed to access this page";
header("Location:".CLIENT_BASE_URL."logout.php");
exit(); exit();
} }
@@ -162,7 +165,7 @@ include('configureUIManager.php');
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) 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'); })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', '<?=BaseService::getInstance()->getGAKey()?>', 'gamonoid.com'); ga('create', '<?=BaseService::getInstance()->getGAKey()?>', 'auto');
ga('send','pageview'); ga('send','pageview');
</script> </script>
@@ -266,7 +269,7 @@ include('configureUIManager.php');
<?=$meta['label']?> <?=$meta['label']?>
<small> <small>
<?=$meta['menu']?>&nbsp;&nbsp; <?=$meta['menu']?>&nbsp;&nbsp;
<a href="#" class="helpLink" target="_blank" style="display:none;"><i class="glyphicon glyphicon-question-sign"></i></a> <a href="#" class="helpLink" target="_blank" style="display:none;color:#fff;"><i class="glyphicon glyphicon-question-sign"></i></a>
</small> </small>
</h1> </h1>
</section> </section>
@@ -275,4 +278,3 @@ include('configureUIManager.php');
<section class="content"> <section class="content">

View File

@@ -19,7 +19,7 @@ $_GET = InputCleaner::cleanParameters($_GET);
$_POST = InputCleaner::cleanParameters($_POST); $_POST = InputCleaner::cleanParameters($_POST);
date_default_timezone_set('Asia/Colombo');
//Find timezone diff with GMT //Find timezone diff with GMT
$dateTimeZoneColombo = new DateTimeZone("Asia/Colombo"); $dateTimeZoneColombo = new DateTimeZone("Asia/Colombo");
$dateTimeColombo = new DateTime("now", $dateTimeZoneColombo); $dateTimeColombo = new DateTime("now", $dateTimeZoneColombo);

View File

@@ -46,12 +46,13 @@ if(empty($user)){
$tuser = SessionUtils::getSessionObject('user'); $tuser = SessionUtils::getSessionObject('user');
//check user //check user
/*
$logoFileName = CLIENT_BASE_PATH."data/logo.png"; $logoFileName = CLIENT_BASE_PATH."data/logo.png";
$logoFileUrl = CLIENT_BASE_URL."data/logo.png"; $logoFileUrl = CLIENT_BASE_URL."data/logo.png";
if(!file_exists($logoFileName)){ if(!file_exists($logoFileName)){
$logoFileUrl = BASE_URL."images/logo.png"; $logoFileUrl = BASE_URL."images/logo.png";
} }*/
$logoFileUrl = UIManager::getInstance()->getCompanyLogoUrl();
?><!DOCTYPE html> ?><!DOCTYPE html>
<html lang="en"> <html lang="en">
@@ -90,16 +91,18 @@ if(!file_exists($logoFileName)){
} }
.container { .container {
width: 300px; width: 300px;
min-height: 0px !important;
} }
/* The white background content wrapper */ /* The white background content wrapper */
.container > .content { .container > .content {
min-height: 0px !important;
background-color: #fff; background-color: #fff;
padding: 20px; padding: 20px;
margin: 0 -20px; margin: 0 -20px;
-webkit-border-radius: 10px 10px 10px 10px; -webkit-border-radius:0px;
-moz-border-radius: 10px 10px 10px 10px; -moz-border-radius:0px;
border-radius: 10px 10px 10px 10px; border-radius: 0px;
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.15); -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.15);
-moz-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); box-shadow: 0 1px 2px rgba(0,0,0,.15);
@@ -115,6 +118,18 @@ if(!file_exists($logoFileName)){
color: #404040; 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> </style>

View File

@@ -83,5 +83,13 @@ class RestAccessToken extends ICEHRM_Record {
var $_table = 'RestAccessTokens'; var $_table = 'RestAccessTokens';
} }
class Cron extends ICEHRM_Record {
var $_table = 'Crons';
}
class IceEmail extends ICEHRM_Record {
var $_table = 'Emails';
}

View File

@@ -51,6 +51,42 @@
</div> </div>
<!-- Plain Message Modal --> <!-- Plain Message Modal -->
<!-- Data Message Modal -->
<div class="modal fade" id="dataMessageModel" tabindex="-1" role="dialog" aria-labelledby="dataMessageModelLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header" style="border-bottom:none;/*background-color: #3c8dbc;*/">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" style="margin-top:-10px;"><li class="fa fa-times"/></button>
</div>
<div class="modal-body">
<p id="dataMessageModelBody"></p>
</div>
</div>
</div>
</div>
<!-- Data Message Modal -->
<!-- Yes No Modal -->
<div class="modal fade" id="yesnoModel" tabindex="-1" role="dialog" aria-labelledby="yesnoModelLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-times"/></button>
<h3 id="yesnoModelLabel" style="font-size: 17px;"></h3>
</div>
<div class="modal-body">
<p id="yesnoModelBody"></p>
</div>
<div class="modal-footer">
<button id="yesnoModelNoBtn" class="btn" onclick="modJs.cancelYesno();">No</button>
<button id="yesnoModelYesBtn" class="btn btn-primary">Yes</button>
</div>
</div>
</div>
</div>
<!-- Yes No Modal -->
<!-- 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">

View File

@@ -667,6 +667,8 @@ INSERT INTO `Nationality` (`id`, `name`) VALUES
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Company: Logo', '', '','[ "value", {"label":"Logo","type":"fileupload","validation":"none"}]'),
('Company: Name', 'Sample Company Pvt Ltd', 'Update your company name - For updating company logo copy a file named logo.png to /app/data/ folder', ''),
('Email: Enable', '1', '0 will disable all outgoing emails from modules. Value 1 will enable outgoing emails','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'), ('Email: Enable', '1', '0 will disable all outgoing emails from modules. Value 1 will enable outgoing emails','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
('Email: Mode', 'SMTP', 'SMTP, PHP Mailer or Amazon SES. SMTP = send emails using local or a remote smtp server. PHP Mailer = send emails using mail function provided by php. Amazon SES = send emails trough amazon Simple Email Service.','["value", {"label":"Value","type":"select","source":[["SMTP","SMTP"],["PHP Mailer","PHP Mailer"],["SES","Amazon SES"]]}]'), ('Email: Mode', 'SMTP', 'SMTP, PHP Mailer or Amazon SES. SMTP = send emails using local or a remote smtp server. PHP Mailer = send emails using mail function provided by php. Amazon SES = send emails trough amazon Simple Email Service.','["value", {"label":"Value","type":"select","source":[["SMTP","SMTP"],["PHP Mailer","PHP Mailer"],["SES","Amazon SES"]]}]'),
('Email: SMTP Host', 'localhost', 'SMTP host IP',''), ('Email: SMTP Host', 'localhost', 'SMTP host IP',''),

View File

@@ -205,3 +205,33 @@ create table `Files` (
primary key (`id`), primary key (`id`),
unique key `filename` (`filename`) unique key `filename` (`filename`)
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
create table `Crons` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`class` varchar(100) NOT NULL,
`lastrun` DATETIME default '0000-00-00 00:00:00',
`frequency` int(4) NOT NULL,
`time` varchar(50) NOT NULL,
`type` enum('Minutely','Hourly','Daily','Weekly','Monthly','Yearly') default 'Hourly',
`status` enum('Enabled','Disabled') default 'Enabled',
primary key (`id`),
key `KEY_Crons_frequency` (`frequency`)
) engine=innodb default charset=utf8;
create table `Emails` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`subject` varchar(300) NOT NULL,
`toEmail` varchar(300) NOT NULL,
`template` text NULL,
`params` text NULL,
`cclist` varchar(500) NULL,
`bcclist` varchar(500) NULL,
`error` varchar(500) NULL,
`created` DATETIME default '0000-00-00 00:00:00',
`updated` DATETIME default '0000-00-00 00:00:00',
`status` enum('Pending','Sent','Error') default 'Pending',
primary key (`id`),
key `KEY_Emails_status` (`status`),
key `KEY_Emails_created` (`created`)
) engine=innodb default charset=utf8;

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