IceHrm v18.0

This commit is contained in:
Thilina Hasantha committed 2016-08-04 14:27:59 +05:30
1 parent 9e243073df
commit a10fbba14a
882 files changed
+90619 -2546

No files matched your search

+10 -3
View File
@@ -9,9 +9,9 @@ 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', '16.1.OS'); define('VERSION', '18.0.OS');
define('CACHE_VALUE', '16.1.OS'); define('CACHE_VALUE', '18.0.OS');
define('VERSION_DATE', '02/05/2016'); define('VERSION_DATE', '04/08/2016');
if(!defined('CONTACT_EMAIL')){define('CONTACT_EMAIL','icehrm@gamonoid.com');} if(!defined('CONTACT_EMAIL')){define('CONTACT_EMAIL','icehrm@gamonoid.com');}
if(!defined('KEY_PREFIX')){define('KEY_PREFIX','IceHrm');} if(!defined('KEY_PREFIX')){define('KEY_PREFIX','IceHrm');}
@@ -19,3 +19,10 @@ 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');
define('MEMCACHE_HOST', '127.0.0.1');
define('MEMCACHE_PORT', '11211');
if(!defined('WK_HTML_PATH')){
define('WK_HTML_PATH', '/usr/bin/wkhtmltopdf');
}
+61 -3
View File
@@ -1,6 +1,19 @@
<?php <?php
class ICEHRM_Record extends ADOdb_Active_Record{ class ICEHRM_Record extends ADOdb_Active_Record{
var $keysToIgnore = array(
"_table",
"_dbat",
"_tableat",
"_where",
"_saved",
"_lasterr",
"_original",
"foreignName",
"a",
"t"
);
public function getAdminAccess(){ public function getAdminAccess(){
return array("get","element","save","delete"); return array("get","element","save","delete");
} }
@@ -74,7 +87,52 @@ class ICEHRM_Record extends ADOdb_Active_Record{
); );
} }
public function allowIndirectMapping(){ public function allowIndirectMapping(){
return false; return false;
}
public function getDisplayName() {
return get_called_class();
} }
}
public function getObjectKeys(){
$keys = array();
foreach($this as $k=>$v){
if(in_array($k,$this->keysToIgnore )){
continue;
}
if(is_array($v) || is_object($v)){
continue;
}
$keys[$k] = $k;
}
return $keys;
}
public function getCustomFields($obj){
$keys = array();
$objKeys = $this->getObjectKeys();
foreach($obj as $k=>$v){
if(isset($objKeys[$k])){
continue;
}
if(is_array($v) || is_object($v)){
continue;
}
if(in_array($k,$this->keysToIgnore )){
continue;
}
$keys[$k] = $k;
}
return $keys;
}
}
+35 -35
View File
@@ -118,8 +118,8 @@
<p id="verifyModelBody"> <p id="verifyModelBody">
<b>Step 1:</b><br/> <b>Step 1:</b><br/>
Please get your Instance Key from here:<br/> Please get your Instance Key from here:<br/>
<a target="_blank" href="http://icehrm.com/generateInstanceKey.php?id=<?=$baseService->getInstanceId()?>"> <a target="_blank" href="https://icehrm.com/generateInstanceKey.php?id=<?=$baseService->getInstanceId()?>">
http://icehrm.com/generateInstanceKey.php?id=<?=$baseService->getInstanceId()?> https://icehrm.com/generateInstanceKey.php?id=<?=$baseService->getInstanceId()?>
</a> </a>
<br/><b>Step 2:</b><br/> <br/><b>Step 2:</b><br/>
@@ -151,36 +151,36 @@
<?php if($user->user_level == 'Admin'){?> <?php if($user->user_level == 'Admin'){?>
<!-- Modal --> <!-- Modal -->
<div class="modal fade" id="profileSwitchModal" tabindex="-1" role="dialog" aria-hidden="true"> <div class="modal fade" id="profileSwitchModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-times"/></button> <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-times"/></button>
<h3 id="myModalLabel">Switch Employee</h3> <h3 id="myModalLabel"><?=LanguageManager::tran('Switch Employee')?></h3>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<p>Select the employee to Edit</p> <p><?=LanguageManager::tran('Select The Employee to Switch Into')?></p>
<div style="border: solid 1px #EEE;"> <div style="border: solid 1px #EEE;">
<select id="switch_emp" style="width:100%;"> <select id="switch_emp" style="width:100%;">
<!-- <!--
<option value="-1">No Employee</option> <option value="-1">No Employee</option>
--> -->
<?php <?php
$employees = $baseService->get('Employee'); $employees = $baseService->get('Employee');
foreach($employees as $empTemp){ foreach($employees as $empTemp){
?> ?>
<option value="<?=$empTemp->id?>"><?=$empTemp->first_name." ".$empTemp->last_name?></option> <option value="<?=$empTemp->id?>"><?=$empTemp->first_name." ".$empTemp->last_name?></option>
<?php }?> <?php }?>
</select> </select>
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button> <button class="btn" data-dismiss="modal" aria-hidden="true"><?=LanguageManager::tran('Close')?></button>
<button class="btn btn-primary" onclick="modJs.setAdminProfile($('#switch_emp').val());return false;">Switch</button> <button class="btn btn-primary" onclick="modJs.setAdminProfile($('#switch_emp').val());return false;"><?=LanguageManager::tran('Switch')?></button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- Modal --> <!-- Modal -->
<?php }?> <?php }?>
+270 -32
View File
@@ -791,46 +791,45 @@ INSERT INTO `WorkDays` (`id`, `name`, `status`, `country`) VALUES
(7, 'Sunday', 'Non-working Day',NULL); (7, 'Sunday', 'Non-working Day',NULL);
INSERT INTO `Reports` (`id`, `name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
(1, 'Employee Details Report', 'This report list all employee details and you can filter employees by department, employment status or job title', '[\r\n[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}],\r\n[ "employment_status", {"label":"Employment Status","type":"select2","remote-source":["EmploymentStatus","id","name"],"allow-null":true}],\r\n[ "job_title", {"label":"Job Title","type":"select2","remote-source":["JobTitle","id","name"],"allow-null":true}]\r\n]', 'Select id, employee_id as ''Employee ID'',\r\nconcat(`first_name`,'' '',`middle_name`,'' '', `last_name`) as ''Name'',\r\n(SELECT name from Nationality where id = nationality) as ''Nationality'',\r\nbirthday as ''Birthday'',\r\ngender as ''Gender'',\r\nmarital_status as ''Marital Status'',\r\nssn_num as ''SSN Number'',\r\nnic_num as ''NIC Number'',\r\nother_id as ''Other IDs'',\r\ndriving_license as ''Driving License Number'',\r\n(SELECT name from EmploymentStatus where id = employment_status) as ''Employment Status'',\r\n(SELECT name from JobTitles where id = job_title) as ''Job Title'',\r\n(SELECT name from PayGrades where id = pay_grade) as ''Pay Grade'',\r\nwork_station_id as ''Work Station ID'',\r\naddress1 as ''Address 1'',\r\naddress2 as ''Address 2'',\r\ncity as ''City'',\r\n(SELECT name from Country where code = country) as ''Country'',\r\n(SELECT name from Province where id = province) as ''Province'',\r\npostal_code as ''Postal Code'',\r\nhome_phone as ''Home Phone'',\r\nmobile_phone as ''Mobile Phone'',\r\nwork_phone as ''Work Phone'',\r\nwork_email as ''Work Email'',\r\nprivate_email as ''Private Email'',\r\njoined_date as ''Joined Date'',\r\nconfirmation_date as ''Confirmation Date'',\r\n(SELECT title from CompanyStructures where id = department) as ''Department'',\r\n(SELECT concat(`first_name`,'' '',`middle_name`,'' '', `last_name`,'' [Employee ID:'',`employee_id`,'']'') from Employees e1 where e1.id = e.supervisor) as ''Supervisor'' \r\nFROM Employees e _where_', '["department","employment_status","job_title"]', 'Query', 'Employee Information'), ('Employee Details Report', 'This report list all employee details and you can filter employees by department, employment status or job title', '[\r\n[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}],\r\n[ "employment_status", {"label":"Employment Status","type":"select2","remote-source":["EmploymentStatus","id","name"],"allow-null":true}],\r\n[ "job_title", {"label":"Job Title","type":"select2","remote-source":["JobTitle","id","name"],"allow-null":true}]\r\n]', 'Select id, employee_id as ''Employee ID'',\r\nconcat(`first_name`,'' '',`middle_name`,'' '', `last_name`) as ''Name'',\r\n(SELECT name from Nationality where id = nationality) as ''Nationality'',\r\nbirthday as ''Birthday'',\r\ngender as ''Gender'',\r\nmarital_status as ''Marital Status'',\r\nssn_num as ''SSN Number'',\r\nnic_num as ''NIC Number'',\r\nother_id as ''Other IDs'',\r\ndriving_license as ''Driving License Number'',\r\n(SELECT name from EmploymentStatus where id = employment_status) as ''Employment Status'',\r\n(SELECT name from JobTitles where id = job_title) as ''Job Title'',\r\n(SELECT name from PayGrades where id = pay_grade) as ''Pay Grade'',\r\nwork_station_id as ''Work Station ID'',\r\naddress1 as ''Address 1'',\r\naddress2 as ''Address 2'',\r\ncity as ''City'',\r\n(SELECT name from Country where code = country) as ''Country'',\r\n(SELECT name from Province where id = province) as ''Province'',\r\npostal_code as ''Postal Code'',\r\nhome_phone as ''Home Phone'',\r\nmobile_phone as ''Mobile Phone'',\r\nwork_phone as ''Work Phone'',\r\nwork_email as ''Work Email'',\r\nprivate_email as ''Private Email'',\r\njoined_date as ''Joined Date'',\r\nconfirmation_date as ''Confirmation Date'',\r\n(SELECT title from CompanyStructures where id = department) as ''Department'',\r\n(SELECT concat(`first_name`,'' '',`middle_name`,'' '', `last_name`,'' [Employee ID:'',`employee_id`,'']'') from Employees e1 where e1.id = e.supervisor) as ''Supervisor'' \r\nFROM Employees e _where_', '["department","employment_status","job_title"]', 'Query', 'Employee Information','CSV'),
(3, 'Employee Time Entry Report', 'This report list all employee time entries by employee, date range and project', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "project", {"label":"Project","type":"select","allow-null":true,"remote-source":["Project","id","name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeTimesheetReport', '["employee","date_start","date_end","status"]', 'Class','Time Management'), ('Employee Attendance Report', 'This report list all employee attendance entries by employee and date range', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeAttendanceReport', '["employee","date_start","date_end"]', 'Class','Time Management','CSV'),
(4, 'Employee Attendance Report', 'This report list all employee attendance entries by employee and date range', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeAttendanceReport', '["employee","date_start","date_end"]', 'Class','Time Management'), ('Employee Time Tracking Report', 'This report list employee working hours and attendance details for each day for a given period ', '[\r\n[ "employee", {"label":"Employee","type":"select2","allow-null":false,"remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeTimeTrackReport', '["employee","date_start","date_end"]', 'Class','Time Management','CSV');
(5, 'Employee Time Tracking Report', 'This report list employee working hours and attendance details for each day for a given period ', '[\r\n[ "employee", {"label":"Employee","type":"select2","allow-null":false,"remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeTimeTrackReport', '["employee","date_start","date_end"]', 'Class','Time Management');
INSERT INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
('Employee Time Entry Report', 'View employee time entries by date range and project',
'[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "client", {"label":"Select Client","type":"select","allow-null":true,"null-label":"Not Selected","remote-source":["Client","id","name"]}],\r\n[ "project", {"label":"Or Project","type":"select","allow-null":true,"null-label":"All Projects","remote-source":["Project","id","name","getAllProjects"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]',
'EmployeeTimesheetReport', '["employee","client","project","date_start","date_end","status"]', 'Class','Time Management','CSV');
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
('Active Employee Report', 'This report list employees who are currently active based on joined date and termination date ', ('Active Employee Report', 'This report list employees who are currently active based on joined date and termination date ',
'[\r\n[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}]\r\n]', '[\r\n[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}]\r\n]',
'ActiveEmployeeReport', 'ActiveEmployeeReport',
'["department"]', 'Class','Employee Information'); '["department"]', 'Class','Employee Information','CSV');
INSERT INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`, `report_group`) VALUES REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`, `report_group`,`output`) VALUES
('New Hires Employee Report', 'This report list employees who are joined between given two dates ', ('New Hires Employee Report', 'This report list employees who are joined between given two dates ',
'[[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', '[[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]',
'NewHiresEmployeeReport', 'NewHiresEmployeeReport',
'["department","date_start","date_end"]', 'Class','Employee Information'); '["department","date_start","date_end"]', 'Class','Employee Information','CSV');
INSERT INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`, `report_group`) VALUES REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`, `report_group`,`output`) VALUES
('Terminated Employee Report', 'This report list employees who are terminated between given two dates ', ('Terminated Employee Report', 'This report list employees who are terminated between given two dates ',
'[[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', '[[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"],"allow-null":true}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]',
'TerminatedEmployeeReport', 'TerminatedEmployeeReport',
'["department","date_start","date_end"]', 'Class','Employee Information'); '["department","date_start","date_end"]', 'Class','Employee Information','CSV');
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
('Travel Request Report', 'This report list employees travel requests for a specified period', ('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]', '[\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', 'TravelRequestReport',
'["employee","date_start","date_end","status"]', 'Class', 'Travel and Expense Management'); '["employee","date_start","date_end","status"]', 'Class', 'Travel and Expense Management','CSV');
INSERT INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
('Employee Time Sheet Report', 'This report list all employee time sheets by employee and date range', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}],\r\n[ "status", {"label":"Status","allow-null":true,"null-label":"All Status","type":"select","source":[["Approved","Approved"],["Pending","Pending"],["Rejected","Rejected"]]}]\r\n]', 'EmployeeTimeSheetData', '["employee","date_start","date_end","status"]', 'Class','Time Management'); ('Employee Time Sheet Report', 'This report list all employee time sheets by employee and date range', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}],\r\n[ "status", {"label":"Status","allow-null":true,"null-label":"All Status","type":"select","source":[["Approved","Approved"],["Pending","Pending"],["Rejected","Rejected"]]}]\r\n]', 'EmployeeTimeSheetData', '["employee","date_start","date_end","status"]', 'Class','Time Management','CSV');
INSERT INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
('Overtime Report', 'This report list all employee attendance entries by employee with overtime calculations', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'OvertimeReport', '["employee","date_start","date_end"]', 'Class','Time Management');
INSERT INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`) VALUES
('Overtime Summary Report', 'This report list all employee attendance entries by employee with overtime calculation summary', '[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'OvertimeSummaryReport', '["employee","date_start","date_end"]', 'Class','Time Management');
@@ -871,7 +870,7 @@ REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('LDAP: Version 3', '1', 'Are you using LDAP v3','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'), ('LDAP: Version 3', '1', 'Are you using LDAP v3','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
('LDAP: User Filter', '', 'e.g: uid={}, we will replace {} with actual username provided by the user at the time of login',''); ('LDAP: User Filter', '', 'e.g: uid={}, we will replace {} with actual username provided by the user at the time of login','');
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Recruitment: Show Quick Apply', '1', 'Show quick apply button when candidates are applying for jobs. Quick apply allow candidates to apply with minimum amount of information','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'), ('Recruitment: Show Quick Apply', '1', 'Show quick apply button when candidates are applying for jobs. Quick apply allow candidates to apply with minimum amount of information','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'),
('Recruitment: Show Apply', '1', 'Show apply button when candidates are applying for jobs','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'); ('Recruitment: Show Apply', '1', 'Show apply button when candidates are applying for jobs','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
@@ -888,24 +887,33 @@ INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Leave: Allow Indirect Admins to Approve', '0', 'Allow indirect admins to approve leave requests','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]'); ('Leave: Allow Indirect Admins to Approve', '0', 'Allow indirect admins to approve leave requests','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Attendance: Overtime Calculation Class', 'BasicOvertimeCalculator', 'Set the method used to calculate overtime','["value", {"label":"Value","type":"select","source":[["BasicOvertimeCalculator","BasicOvertimeCalculator"],["CaliforniaOvertimeCalculator","CaliforniaOvertimeCalculator"]]}]'); ('Expense: Allow Indirect Admins to Approve', '0', 'Allow indirect admins to approve expense requests','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Travel: Allow Indirect Admins to Approve', '0', 'Allow indirect admins to approve travel requests','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Attendance: Overtime Calculation Class', 'BasicOvertimeCalculator', 'Set the method used to calculate overtime','["value", {"label":"Value","type":"select","source":[["BasicOvertimeCalculator","BasicOvertimeCalculator"],["CaliforniaOvertimeCalculator","CaliforniaOvertimeCalculator"]]}]');
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Attendance: Overtime Calculation Period', 'Daily', 'Set the period for overtime calculation. (Affects attendance sheets)','["value", {"label":"Value","type":"select","source":[["Daily","Daily"],["Weekly","Weekly"]]}]');
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Attendance: Overtime Start Hour', '8', 'Overtime calculation will start after an employee work this number of hours per day, 0 to indicate no overtime', ''), ('Attendance: Overtime Start Hour', '8', 'Overtime calculation will start after an employee work this number of hours per day, 0 to indicate no overtime', ''),
('Attendance: Double time Start Hour', '12', 'Double time calculation will start after an employee work this number of hours per day, 0 to indicate no double time', ''); ('Attendance: Double time Start Hour', '12', 'Double time calculation will start after an employee work this number of hours per day, 0 to indicate no double time', '');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Attendance: Work Week Start Day', '0', 'Set the starting day of the work week','["value", {"label":"Value","type":"select","source":[["0","Sunday"],["1","Monday"],["2","Tuesday"],["3","Wednesday"],["4","Thursday"],["5","Friday"],["6","Saturday"]]}]'); ('Attendance: Work Week Start Day', '0', 'Set the starting day of the work week','["value", {"label":"Value","type":"select","source":[["0","Sunday"],["1","Monday"],["2","Tuesday"],["3","Wednesday"],["4","Thursday"],["5","Friday"],["6","Saturday"]]}]');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('System: Allowed Countries', '', 'Only these countries will be allowed in select boxes','["value", {"label":"Value","type":"select2multi","remote-source":["Country","id","name"]}]'); ('System: Allowed Countries', '', 'Only these countries will be allowed in select boxes','["value", {"label":"Value","type":"select2multi","remote-source":["Country","id","name"]}]');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('System: Allowed Currencies', '', 'Only these currencies will be allowed in select boxes','["value", {"label":"Value","type":"select2multi","remote-source":["CurrencyType","id","code+name"]}]'); ('System: Allowed Currencies', '', 'Only these currencies will be allowed in select boxes','["value", {"label":"Value","type":"select2multi","remote-source":["CurrencyType","id","code+name"]}]');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('System: Allowed Nationality', '', 'Only these nationalities will be allowed in select boxes','["value", {"label":"Value","type":"select2multi","remote-source":["Nationality","id","name"]}]'); ('System: Allowed Nationality', '', 'Only these nationalities will be allowed in select boxes','["value", {"label":"Value","type":"select2multi","remote-source":["Nationality","id","name"]}]');
@@ -986,12 +994,204 @@ INSERT INTO `JobTitles` (`id`, `code`, `name`, `description`, `specification`) V
INSERT INTO `Languages` (`id`, `name`, `description`) VALUES INSERT INTO `Languages` (`id`, `name`, `description`) VALUES
(1, 'English', 'English'), (1, 'en', 'English'),
(2, 'French', 'French'), (2, 'fr', 'French'),
(3, 'German', 'German'), (3, 'de', 'German'),
(4, 'Chinese', 'Chinese'); (4, 'zh', 'Chinese'),
(5, 'aa', 'Afar'),
(6, 'ab', 'Abkhaz'),
(7, 'ae', 'Avestan'),
(8, 'af', 'Afrikaans'),
(9, 'ak', 'Akan'),
(10, 'am', 'Amharic'),
(11, 'an', 'Aragonese'),
(12, 'ar', 'Arabic'),
(13, 'as', 'Assamese'),
(14, 'av', 'Avaric'),
(15, 'ay', 'Aymara'),
(16, 'az', 'Azerbaijani'),
(17, 'ba', 'Bashkir'),
(18, 'be', 'Belarusian'),
(19, 'bg', 'Bulgarian'),
(20, 'bh', 'Bihari'),
(21, 'bi', 'Bislama'),
(22, 'bm', 'Bambara'),
(23, 'bn', 'Bengali'),
(24, 'bo', 'Tibetan Standard, Tibetan, Central'),
(25, 'br', 'Breton'),
(26, 'bs', 'Bosnian'),
(27, 'ca', 'Catalan; Valencian'),
(28, 'ce', 'Chechen'),
(29, 'ch', 'Chamorro'),
(30, 'co', 'Corsican'),
(31, 'cr', 'Cree'),
(32, 'cs', 'Czech'),
(33, 'cu', 'Old Church Slavonic, Church Slavic, Church Slavonic, Old Bulgarian, Old Slavonic'),
(34, 'cv', 'Chuvash'),
(35, 'cy', 'Welsh'),
(36, 'da', 'Danish'),
(37, 'dv', 'Divehi; Dhivehi; Maldivian;'),
(38, 'dz', 'Dzongkha'),
(39, 'ee', 'Ewe'),
(40, 'el', 'Greek, Modern'),
(41, 'eo', 'Esperanto'),
(42, 'es', 'Spanish; Castilian'),
(43, 'et', 'Estonian'),
(44, 'eu', 'Basque'),
(45, 'fa', 'Persian'),
(46, 'ff', 'Fula; Fulah; Pulaar; Pular'),
(47, 'fi', 'Finnish'),
(48, 'fj', 'Fijian'),
(49, 'fo', 'Faroese'),
(50, 'fy', 'Western Frisian'),
(51, 'ga', 'Irish'),
(52, 'gd', 'Scottish Gaelic; Gaelic'),
(53, 'gl', 'Galician'),
(54, 'gn', 'Guaraní'),
(55, 'gu', 'Gujarati'),
(56, 'gv', 'Manx'),
(57, 'ha', 'Hausa'),
(58, 'he', 'Hebrew (modern)'),
(59, 'hi', 'Hindi'),
(60, 'ho', 'Hiri Motu'),
(61, 'hr', 'Croatian'),
(62, 'ht', 'Haitian; Haitian Creole'),
(63, 'hu', 'Hungarian'),
(64, 'hy', 'Armenian'),
(65, 'hz', 'Herero'),
(66, 'ia', 'Interlingua'),
(67, 'id', 'Indonesian'),
(68, 'ie', 'Interlingue'),
(69, 'ig', 'Igbo'),
(70, 'ii', 'Nuosu'),
(71, 'ik', 'Inupiaq'),
(72, 'io', 'Ido'),
(73, 'is', 'Icelandic'),
(74, 'it', 'Italian'),
(75, 'iu', 'Inuktitut'),
(76, 'ja', 'Japanese (ja)'),
(77, 'jv', 'Javanese (jv)'),
(78, 'ka', 'Georgian'),
(79, 'kg', 'Kongo'),
(80, 'ki', 'Kikuyu, Gikuyu'),
(81, 'kj', 'Kwanyama, Kuanyama'),
(82, 'kk', 'Kazakh'),
(83, 'kl', 'Kalaallisut, Greenlandic'),
(84, 'km', 'Khmer'),
(85, 'kn', 'Kannada'),
(86, 'ko', 'Korean'),
(87, 'kr', 'Kanuri'),
(88, 'ks', 'Kashmiri'),
(89, 'ku', 'Kurdish'),
(90, 'kv', 'Komi'),
(91, 'kw', 'Cornish'),
(92, 'ky', 'Kirghiz, Kyrgyz'),
(93, 'la', 'Latin'),
(94, 'lb', 'Luxembourgish, Letzeburgesch'),
(95, 'lg', 'Luganda'),
(96, 'li', 'Limburgish, Limburgan, Limburger'),
(97, 'ln', 'Lingala'),
(98, 'lo', 'Lao'),
(99, 'lt', 'Lithuanian'),
(100, 'lu', 'Luba-Katanga'),
(101, 'lv', 'Latvian'),
(102, 'mg', 'Malagasy'),
(103, 'mh', 'Marshallese'),
(104, 'mi', 'Maori'),
(105, 'mk', 'Macedonian'),
(106, 'ml', 'Malayalam'),
(107, 'mn', 'Mongolian'),
(108, 'mr', 'Marathi (Mara?hi)'),
(109, 'ms', 'Malay'),
(110, 'mt', 'Maltese'),
(111, 'my', 'Burmese'),
(112, 'na', 'Nauru'),
(113, 'nb', 'Norwegian Bokmål'),
(114, 'nd', 'North Ndebele'),
(115, 'ne', 'Nepali'),
(116, 'ng', 'Ndonga'),
(117, 'nl', 'Dutch'),
(118, 'nn', 'Norwegian Nynorsk'),
(119, 'no', 'Norwegian'),
(120, 'nr', 'South Ndebele'),
(121, 'nv', 'Navajo, Navaho'),
(122, 'ny', 'Chichewa; Chewa; Nyanja'),
(123, 'oc', 'Occitan'),
(124, 'oj', 'Ojibwe, Ojibwa'),
(125, 'om', 'Oromo'),
(126, 'or', 'Oriya'),
(127, 'os', 'Ossetian, Ossetic'),
(128, 'pa', 'Panjabi, Punjabi'),
(129, 'pi', 'Pali'),
(130, 'pl', 'Polish'),
(131, 'ps', 'Pashto, Pushto'),
(132, 'pt', 'Portuguese'),
(133, 'qu', 'Quechua'),
(134, 'rm', 'Romansh'),
(135, 'rn', 'Kirundi'),
(136, 'ro', 'Romanian, Moldavian, Moldovan'),
(137, 'ru', 'Russian'),
(138, 'rw', 'Kinyarwanda'),
(139, 'sa', 'Sanskrit (Sa?sk?ta)'),
(140, 'sc', 'Sardinian'),
(141, 'sd', 'Sindhi'),
(142, 'se', 'Northern Sami'),
(143, 'sg', 'Sango'),
(144, 'si', 'Sinhala, Sinhalese'),
(145, 'sk', 'Slovak'),
(146, 'sl', 'Slovene'),
(147, 'sm', 'Samoan'),
(148, 'sn', 'Shona'),
(149, 'so', 'Somali'),
(150, 'sq', 'Albanian'),
(151, 'sr', 'Serbian'),
(152, 'ss', 'Swati'),
(153, 'st', 'Southern Sotho'),
(154, 'su', 'Sundanese'),
(155, 'sv', 'Swedish'),
(156, 'sw', 'Swahili'),
(157, 'ta', 'Tamil'),
(158, 'te', 'Telugu'),
(159, 'tg', 'Tajik'),
(160, 'th', 'Thai'),
(161, 'ti', 'Tigrinya'),
(162, 'tk', 'Turkmen'),
(163, 'tl', 'Tagalog'),
(164, 'tn', 'Tswana'),
(165, 'to', 'Tonga (Tonga Islands)'),
(166, 'tr', 'Turkish'),
(167, 'ts', 'Tsonga'),
(168, 'tt', 'Tatar'),
(169, 'tw', 'Twi'),
(170, 'ty', 'Tahitian'),
(171, 'ug', 'Uighur, Uyghur'),
(172, 'uk', 'Ukrainian'),
(173, 'ur', 'Urdu'),
(174, 'uz', 'Uzbek'),
(175, 've', 'Venda'),
(176, 'vi', 'Vietnamese'),
(177, 'vo', 'Volapük'),
(178, 'wa', 'Walloon'),
(179, 'wo', 'Wolof'),
(180, 'xh', 'Xhosa'),
(181, 'yi', 'Yiddish'),
(182, 'yo', 'Yoruba'),
(183, 'za', 'Zhuang, Chuang'),
(184, 'zu', 'Zulu');
INSERT INTO `SupportedLanguages` (`name`, `description`) VALUES
('en', 'English'),
('de', 'German'),
('fr', 'French'),
('pl', 'Polish'),
('it', 'Italian'),
('si', 'Sinhala'),
('zh', 'Chinese'),
('ja', 'Japanese'),
('hi', 'Hindi'),
('es', 'Spanish');
INSERT INTO `LeavePeriods` (`id`, `name`, `date_start`, `date_end`, `status`) VALUES INSERT INTO `LeavePeriods` (`id`, `name`, `date_start`, `date_end`, `status`) VALUES
(3, 'Year 2015', '2015-01-01', '2015-12-31', 'Active'), (3, 'Year 2015', '2015-01-01', '2015-12-31', 'Active'),
(4, 'Year 2016', '2016-01-01', '2016-12-31', 'Active'), (4, 'Year 2016', '2016-01-01', '2016-12-31', 'Active'),
@@ -1117,7 +1317,7 @@ INSERT INTO `UserRoles` VALUES
INSERT INTO `Users` VALUES INSERT INTO `Users` VALUES
(1,'admin','icehrm+admin@web-stalk.com','21232f297a57a5a743894a0e4a801fc3',1,NULL,'Admin','',NULL,NULL,NULL,NULL); (1,'admin','icehrm+admin@web-stalk.com','21232f297a57a5a743894a0e4a801fc3',1,NULL,'Admin','',NULL,NULL,NULL,NULL,NULL);
INSERT INTO `SalaryComponentType` (`id`,`code`, `name`) VALUES INSERT INTO `SalaryComponentType` (`id`,`code`, `name`) VALUES
@@ -1263,3 +1463,41 @@ INSERT INTO `PayrollColumnTemplates` (`name`,`columns`) VALUES
('All Columns','[\"1\",\"2\",\"3\",\"4\"]'), ('All Columns','[\"1\",\"2\",\"3\",\"4\"]'),
('All Time Management Columns','[\"1\",\"2\",\"3\"]'); ('All Time Management Columns','[\"1\",\"2\",\"3\"]');
INSERT INTO `DataImport` (`name`, `dataType`, `details`, `columns`, `updated`, `created`) VALUES
('Sage50 Import - Employee Data', 'Sage50Employees', '', '[{"name":"employee_id","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"Yes","id":"columns_7"},{"name":"title","title":"title","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_1"},{"name":"initial","title":"Initial","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_2"},{"name":"first_name","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_3"},{"name":"middle_name","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_4"},{"name":"middle_name","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_5"},{"name":"last_name","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_6"},{"name":"address1","title":"Address1","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_8"},{"name":"address3","title":"Address3","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_10"},{"name":"address2","title":"Address2","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_9"},{"name":"address4","title":"Address4","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_11"},{"name":"address5","title":"Address5","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_12"},{"name":"postal_code","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_13"},{"name":"home_phone","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_14"},{"name":"mobile_phone","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_15"},{"name":"private_email","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_16"},{"name":"gender","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_17"},{"name":"marital_status","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_18"},{"name":"previous_surname","title":"Previous Surname","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_19"},{"name":"birthday","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_20"},{"name":"disabled","title":"Disabled","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_21"},{"name":"nationality","title":"Nationality","type":"Reference","dependOn":"Nationality","dependOnField":"name","isKeyField":"Yes","idField":"No","id":"columns_22"},{"name":"ethnicity","title":"Ethnicity","type":"Normal","dependOn":"Ethnicity","dependOnField":"name","isKeyField":"Yes","idField":"No","id":"columns_23"},{"name":"EmergencyContact/name","title":"","type":"Attached","dependOn":"EmergencyContact","dependOnField":"name","isKeyField":"Yes","idField":"No","id":"columns_24"},{"name":"EmergencyContact/relationship","title":"","type":"Attached","dependOn":"EmergencyContact","dependOnField":"relationship","isKeyField":"No","idField":"No","id":"columns_25"},{"name":"EmergencyContact/home_phone","title":"","type":"Attached","dependOn":"EmergencyContact","dependOnField":"home_phone","isKeyField":"No","idField":"No","id":"columns_26"},{"name":"tax_code","title":"Tax Code","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_27"},{"name":"wk1_mth1_basis","title":"Wk1Mth1 Basis","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_28"},{"name":"NI_category","title":"NI Category","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_29"},{"name":"nic_num","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_30"},{"name":"ssn_num","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_31"},{"name":"job_title","title":"","type":"Reference","dependOn":"JobTitle","dependOnField":"name","isKeyField":"Yes","idField":"No","id":"columns_32"},{"name":"employment_status","title":"","type":"Reference","dependOn":"EmploymentStatus","dependOnField":"name","isKeyField":"Yes","idField":"No","id":"columns_33"},{"name":"pay_frequency","title":"Pay Frequency","type":"Reference","dependOn":"PayFrequency","dependOnField":"name","isKeyField":Line truncated
REPLACE INTO `UserReports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
('Time Entry Report', 'View your time entries by date range and project',
'[\r\n[ "client", {"label":"Select Client","type":"select","allow-null":true,"null-label":"Not Selected","remote-source":["Client","id","name"]}],\r\n[ "project", {"label":"Or Project","type":"select","allow-null":true,"null-label":"All Projects","remote-source":["Project","id","name","getAllProjects"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]',
'EmployeeTimesheetReport', '["client","project","date_start","date_end","status"]', 'Class','Time Management','CSV');
REPLACE INTO `UserReports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
('Attendance Report', 'View your attendance entries by date range', '[\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeAttendanceReport', '["date_start","date_end"]', 'Class','Time Management','CSV');
REPLACE INTO `UserReports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
('Time Tracking Report', 'View your working hours and attendance details for each day for a given period ', '[\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeTimeTrackReport', '["date_start","date_end"]', 'Class','Time Management','CSV');
REPLACE INTO `UserReports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
('Travel Request Report', 'View travel requests for a specified period',
'[\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}],\r\n[ "status", {"label":"Status","type":"select","source":[["NULL","All Statuses"],["Approved","Approved"],["Pending","Pending"],["Rejected","Rejected"],["Cancellation Requested","Cancellation Requested"],["Cancelled","Cancelled"]]}]\r\n]',
'TravelRequestReport',
'["date_start","date_end","status"]', 'Class', 'Travel and Expense Management','CSV');
REPLACE INTO `UserReports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
('Time Sheet Report', 'This report list all employee time sheets by employee and date range',
'[\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}],\r\n[ "status", {"label":"Status","allow-null":true,"null-label":"All Status","type":"select","source":[["Approved","Approved"],["Pending","Pending"],["Rejected","Rejected"]]}]\r\n]',
'EmployeeTimeSheetData',
'["date_start","date_end","status"]', 'Class','Time Management','CSV');
REPLACE INTO `UserReports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
('Client Project Time Report', 'View your time entries for projects under a given client',
'[\r\n[ "client", {"label":"Select Client","type":"select","allow-null":false,"remote-source":["Client","id","name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]',
'ClientProjectTimeReport', '["client","date_start","date_end","status"]', 'Class','Time Management','PDF');
+17 -5
View File
@@ -43,6 +43,10 @@ INSERT INTO `Employees` (`id`, `employee_id`, `first_name`, `middle_name`, `last
(15, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); (15, CONCAT('EMP', RAND()), generate_fname(), '', generate_fname(), 10, '1979-07-15 18:30:00', 'Female', 'Single', '158-06-2292', '158-06-2292', '', '', NULL, 1, 5, 2, '', '1164', 'Walnut Avenue', 'Rochelle Park', 'US', 35, '7662', '201-474-8048', '201-474-8048', '201-474-8048', 'icehrm+user2@web-stalk.com', 'icehrm+user2@web-stalk.com', '2006-07-12 18:30:00', '0000-00-00 00:00:00', 2, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
UPDATE `Employees` set supervisor = 2, indirect_supervisors = '[3,4]', approver1 = 5, approver2 = 6, approver3 = 7 where id = 1;
UPDATE `Employees` set supervisor = 1, indirect_supervisors = '[3,4]', approver1 = 5, approver2 = 6 where id = 2;
UPDATE `Employees` set supervisor = 2, indirect_supervisors = '[1,4]', approver1 = 5 where id = 3;
INSERT INTO `EmergencyContacts` (`id`, `employee`, `name`, `relationship`, `home_phone`, `work_phone`, `mobile_phone`) VALUES INSERT INTO `EmergencyContacts` (`id`, `employee`, `name`, `relationship`, `home_phone`, `work_phone`, `mobile_phone`) VALUES
(1, 1, 'Emma Owns', 'Mother', '+874463422', '+874463422', '+874463422'), (1, 1, 'Emma Owns', 'Mother', '+874463422', '+874463422', '+874463422'),
(2, 2, 'Casey Watson', 'Sister', '231-453-876', '231-453-876', '231-453-876'); (2, 2, 'Casey Watson', 'Sister', '231-453-876', '231-453-876', '231-453-876');
@@ -129,7 +133,13 @@ INSERT INTO `Users` (`id`, `username`, `email`, `password`, `employee`,`default_
(2, 'manager', 'icehrm+manager@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 2,NULL, 'Manager','', '2013-01-03 02:47:37', '2013-01-03 02:47:37', '2013-01-03 02:47:37'), (2, 'manager', 'icehrm+manager@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 2,NULL, 'Manager','', '2013-01-03 02:47:37', '2013-01-03 02:47:37', '2013-01-03 02:47:37'),
(3, 'user1', 'icehrm+user1@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 3,NULL, 'Employee','', '2013-01-03 02:48:32', '2013-01-03 02:48:32', '2013-01-03 02:48:32'), (3, 'user1', 'icehrm+user1@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 3,NULL, 'Employee','', '2013-01-03 02:48:32', '2013-01-03 02:48:32', '2013-01-03 02:48:32'),
(4, 'user2', 'icehrm+user2@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 4,NULL, 'Employee','', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55'), (4, 'user2', 'icehrm+user2@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 4,NULL, 'Employee','', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55'),
(5, 'user3', 'icehrm+user3@web-stalk.com', '4048bb914a704a0728549a26b92d8550', NULL,NULL, 'Other','["1"]', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55'); (5, 'user3', 'icehrm+user3@web-stalk.com', '4048bb914a704a0728549a26b92d8550', NULL,NULL, 'Other','["1"]', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55'),
(6, 'user4', 'icehrm+user4@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 5,NULL, 'Manager','', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55'),
(7, 'user5', 'icehrm+user5@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 6,NULL, 'Employee','', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55'),
(8, 'user6', 'icehrm+user6@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 7,NULL, 'Employee','', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55'),
(9, 'user7', 'icehrm+user7@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 8,NULL, 'Employee','', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55'),
(10, 'user8', 'icehrm+user8@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 9,NULL, 'Employee','', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55'),
(11, 'user9', 'icehrm+user9@web-stalk.com', '4048bb914a704a0728549a26b92d8550', 10,NULL, 'Employee','', '2013-01-03 02:58:55', '2013-01-03 02:58:55', '2013-01-03 02:58:55');
INSERT INTO `Job` VALUES INSERT INTO `Job` VALUES
(1,'Software Engineer','More than 375,000 users world-wide rely on our software for their daily business as it makes creating graphical presentations so much easier, faster and more enjoyable. Among our customers are many renowned consulting companies and large international corporations.','More than 375,000 users world-wide rely on our software for their daily business as it makes creating graphical presentations so much easier, faster and more enjoyable. Among our customers are many renowned consulting companies and large international corporations.\n\nWe follow our own strategy and do not have to make compromises with regard to code quality and beauty, because think-cell is profitable and has no outside investors. We are flourishing without program managers, meetings, and marketing-driven deadlines. Our code quality is extraordinarily high because we only release software when it is ready. We are willing to do the leg work of developing sophisticated algorithms and refining our user interface, which makes working with think-cell’s software so satisfying.','Challenging C++ coding with high personal responsibility\nWork with a competent and creative team in a modern loft office in Berlin\nFamily-friendly working hours, no deadlines\nAbove-average salary (we offer our developers EUR 120,000 annually after one year of employment)\nFree supply of drinks, fruits, sweets and snacks\nFlat hierarchies and plenty of room for your ideas\nA full-time company nanny who is available for free when children are sick, or when you just feel like spending an evening out','[\"Health plan\",\"Paid vacations\"]',226,2,NULL,'JC001',1,NULL,7,14,9,151,'Yes',3500,5500,'job, engineer','Active','0000-00-00 00:00:00',NULL,'Text Only',1), (1,'Software Engineer','More than 375,000 users world-wide rely on our software for their daily business as it makes creating graphical presentations so much easier, faster and more enjoyable. Among our customers are many renowned consulting companies and large international corporations.','More than 375,000 users world-wide rely on our software for their daily business as it makes creating graphical presentations so much easier, faster and more enjoyable. Among our customers are many renowned consulting companies and large international corporations.\n\nWe follow our own strategy and do not have to make compromises with regard to code quality and beauty, because think-cell is profitable and has no outside investors. We are flourishing without program managers, meetings, and marketing-driven deadlines. Our code quality is extraordinarily high because we only release software when it is ready. We are willing to do the leg work of developing sophisticated algorithms and refining our user interface, which makes working with think-cell’s software so satisfying.','Challenging C++ coding with high personal responsibility\nWork with a competent and creative team in a modern loft office in Berlin\nFamily-friendly working hours, no deadlines\nAbove-average salary (we offer our developers EUR 120,000 annually after one year of employment)\nFree supply of drinks, fruits, sweets and snacks\nFlat hierarchies and plenty of room for your ideas\nA full-time company nanny who is available for free when children are sick, or when you just feel like spending an evening out','[\"Health plan\",\"Paid vacations\"]',226,2,NULL,'JC001',1,NULL,7,14,9,151,'Yes',3500,5500,'job, engineer','Active','0000-00-00 00:00:00',NULL,'Text Only',1),
@@ -191,10 +201,13 @@ INSERT INTO `Attendance` (`employee`,`in_time`,`out_time`,`note`) VALUES
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 23 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 23 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''), (3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 23 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 23 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''),
(3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), ''); (3, FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))) + FLOOR(28800 + (RAND() * 3600)),'%Y-%m-%d %T'), FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))) + FLOOR(57600 + (RAND() * 21600)),'%Y-%m-%d %T'), '');
INSERT INTO `PayslipTemplates` (`id`, `name`, `data`, `status`, `created`, `updated`) VALUES
(1, 'Basic', '[{"type":"Company Logo","payrollColumn":"NULL","label":"","text":"","fontSize":"Normal","fontStyle":"Normal","fontColor":"#000000","status":"Show","id":"data_1"},{"type":"Company Name","payrollColumn":"NULL","label":"","text":"","fontSize":"Normal","fontStyle":"Normal","fontColor":"","status":"Show","id":"data_2"},{"type":"Separators","payrollColumn":"NULL","label":"","text":"","fontSize":"Normal","fontStyle":"Normal","fontColor":"","status":"Show","id":"data_8"},{"type":"Payroll Column","payrollColumn":"5","label":"","text":"","fontSize":"Normal","fontStyle":"Normal","fontColor":"","status":"Show","id":"data_3"},{"type":"Payroll Column","payrollColumn":"6","label":"","text":"","fontSize":"Normal","fontStyle":"Normal","fontColor":"","status":"Show","id":"data_4"},{"type":"Payroll Column","payrollColumn":"17","label":"","text":"","fontSize":"Normal","fontStyle":"Normal","fontColor":"","status":"Show","id":"data_5"},{"type":"Separators","payrollColumn":"NULL","label":"","text":"","fontSize":"Normal","fontStyle":"Normal","fontColor":"","status":"Show","id":"data_9"},{"type":"Payroll Column","payrollColumn":"18","label":"","text":"","fontSize":"Normal","fontStyle":"Normal","fontColor":"","status":"Show","id":"data_6"},{"type":"Separators","payrollColumn":"NULL","label":"","text":"","fontSize":"Normal","fontStyle":"Normal","fontColor":"","status":"Show","id":"data_10"},{"type":"Text","payrollColumn":"NULL","label":"","text":"Big Company Ltd. is a limited company registered in England and Wales. Registered number: 1234567. Registered office: 123 Some Street, Somewhere, Someshire.","fontSize":"Normal","fontStyle":"Normal","fontColor":"","status":"Show","id":"data_7"}]', NULL, '2016-06-30 03:37:12', '2016-06-30 03:37:12');
INSERT INTO `Payroll` VALUES INSERT INTO `Payroll` VALUES
(1,'2016-03',4,1,1,'[\"5\",\"8\",\"9\",\"10\",\"6\",\"7\",\"4\",\"3\",\"2\",\"1\",\"11\",\"12\",\"13\",\"14\",\"15\",\"16\"]','2016-03-01','2016-03-31','Draft'), (1,'2016-03',4,1,1,'[\"5\",\"8\",\"9\",\"10\",\"6\",\"7\",\"4\",\"3\",\"2\",\"1\",\"11\",\"12\",\"13\",\"14\",\"15\",\"16\"]','2016-03-01','2016-03-31','Draft', 1),
(2,'2016-03-Weekly',2,1,2,'[\"1\",\"2\",\"3\"]','2016-03-01','2016-03-31','Draft'); (2,'2016-03-Weekly',2,1,2,'[\"1\",\"2\",\"3\"]','2016-03-01','2016-03-31','Draft', 1);
INSERT INTO `PayrollColumns` VALUES INSERT INTO `PayrollColumns` VALUES
(5,'Basic Salary',NULL,'[\"1\"]','[]','[]','[]',5,'No','Yes','0.00',NULL,NULL), (5,'Basic Salary',NULL,'[\"1\"]','[]','[]','[]',5,'No','Yes','0.00',NULL,NULL),
@@ -276,12 +289,11 @@ INSERT INTO `EmployeeLeaveDays` VALUES
(17,3,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 21 DAY))),'%Y-%m-%d'),'Full Day'), (17,3,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 21 DAY))),'%Y-%m-%d'),'Full Day'),
(18,3,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))),'%Y-%m-%d'),'Full Day'); (18,3,FROM_UNIXTIME((UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 22 DAY))),'%Y-%m-%d'),'Full Day');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Instance : ID', '0847429146712c108e23c435e8f93b4d', '',''), ('Instance : ID', '0847429146712c108e23c435e8f93b4d', '',''),
('Instance: Key', 'UQHEYBx9H1eNR66nhNCNCz1WCDDhkjtx1OuJbO3ZQMt+8tfSGvuOH/YEHntRajY=', '',''); ('Instance: Key', 'UQHEYBx9H1eNR66nhNCNCz1WCDDhkjtx1OuJbO3ZQMt+8tfSGvuOH/YEHntRajY=', '','');
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+313 -149
View File
@@ -7,6 +7,7 @@ create table `CompanyStructures` (
`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', `timezone` varchar(100) not null default 'Europe/London',
`heads` varchar(255) NULL default NULL,
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;
@@ -93,6 +94,13 @@ create table `Languages` (
primary key (`id`) primary key (`id`)
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
create table `SupportedLanguages` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) default null,
`description` varchar(100) default null,
primary key (`id`)
) engine=innodb default charset=utf8;
create table `Nationality` ( create table `Nationality` (
`id` bigint(20) NOT NULL AUTO_INCREMENT, `id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) default null, `name` varchar(100) default null,
@@ -106,65 +114,68 @@ CREATE TABLE `PayFrequency` (
) ENGINE=InnoDB default charset=utf8; ) ENGINE=InnoDB default charset=utf8;
create table `Employees` ( create table `Employees` (
`id` bigint(20) NOT NULL AUTO_INCREMENT, `id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee_id` varchar(50) default null, `employee_id` varchar(50) default null,
`first_name` varchar(100) default '' not null, `first_name` varchar(100) default '' not null,
`middle_name` varchar(100) default null, `middle_name` varchar(100) default null,
`last_name` varchar(100) default null, `last_name` varchar(100) default null,
`nationality` bigint(20) default null, `nationality` bigint(20) default null,
`birthday` date default '0000-00-00', `birthday` date default '0000-00-00',
`gender` enum('Male','Female') default NULL, `gender` enum('Male','Female') default NULL,
`marital_status` enum('Married','Single','Divorced','Widowed','Other') default NULL, `marital_status` enum('Married','Single','Divorced','Widowed','Other') default NULL,
`ssn_num` varchar(100) default NULL, `ssn_num` varchar(100) default NULL,
`nic_num` varchar(100) default NULL, `nic_num` varchar(100) default NULL,
`other_id` varchar(100) default NULL, `other_id` varchar(100) default NULL,
`driving_license` varchar(100) default NULL, `driving_license` varchar(100) default NULL,
`driving_license_exp_date` date default '0000-00-00', `driving_license_exp_date` date default '0000-00-00',
`employment_status` bigint(20) default null, `employment_status` bigint(20) default null,
`job_title` bigint(20) default null, `job_title` bigint(20) default null,
`pay_grade` bigint(20) null, `pay_grade` bigint(20) null,
`work_station_id` varchar(100) default NULL, `work_station_id` varchar(100) default NULL,
`address1` varchar(100) default NULL, `address1` varchar(100) default NULL,
`address2` varchar(100) default NULL, `address2` varchar(100) default NULL,
`city` varchar(150) default NULL, `city` varchar(150) default NULL,
`country` char(2) default null, `country` char(2) default null,
`province` bigint(20) default null, `province` bigint(20) default null,
`postal_code` varchar(20) default null, `postal_code` varchar(20) default null,
`home_phone` varchar(50) default null, `home_phone` varchar(50) default null,
`mobile_phone` varchar(50) default null, `mobile_phone` varchar(50) default null,
`work_phone` varchar(50) default null, `work_phone` varchar(50) default null,
`work_email` varchar(100) default null, `work_email` varchar(100) default null,
`private_email` varchar(100) default null, `private_email` varchar(100) default null,
`joined_date` date default '0000-00-00', `joined_date` date default '0000-00-00',
`confirmation_date` date default '0000-00-00', `confirmation_date` date default '0000-00-00',
`supervisor` bigint(20) default null, `supervisor` bigint(20) default null,
`indirect_supervisors` varchar(250) default null, `indirect_supervisors` varchar(250) default null,
`department` bigint(20) default null, `department` bigint(20) default null,
`custom1` varchar(250) default null, `custom1` varchar(250) default null,
`custom2` varchar(250) default null, `custom2` varchar(250) default null,
`custom3` varchar(250) default null, `custom3` varchar(250) default null,
`custom4` varchar(250) default null, `custom4` varchar(250) default null,
`custom5` varchar(250) default null, `custom5` varchar(250) default null,
`custom6` varchar(250) default null, `custom6` varchar(250) default null,
`custom7` varchar(250) default null, `custom7` varchar(250) default null,
`custom8` varchar(250) default null, `custom8` varchar(250) default null,
`custom9` varchar(250) default null, `custom9` varchar(250) default null,
`custom10` varchar(250) default null, `custom10` varchar(250) default null,
`termination_date` date default '0000-00-00', `termination_date` date default '0000-00-00',
`notes` text default null, `notes` text default null,
`status` enum('Active','Terminated') default 'Active', `status` enum('Active','Terminated') default 'Active',
`ethnicity` bigint(20) default null, `ethnicity` bigint(20) default null,
`immigration_status` bigint(20) default null, `immigration_status` bigint(20) default null,
CONSTRAINT `Fk_Employee_Nationality` FOREIGN KEY (`nationality`) REFERENCES `Nationality` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, `approver1` bigint(20) default null,
CONSTRAINT `Fk_Employee_JobTitle` FOREIGN KEY (`job_title`) REFERENCES `JobTitles` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, `approver2` bigint(20) default null,
CONSTRAINT `Fk_Employee_EmploymentStatus` FOREIGN KEY (`employment_status`) REFERENCES `EmploymentStatus` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, `approver3` bigint(20) default null,
CONSTRAINT `Fk_Employee_Country` FOREIGN KEY (`country`) REFERENCES `Country` (`code`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `Fk_Employee_Nationality` FOREIGN KEY (`nationality`) REFERENCES `Nationality` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT `Fk_Employee_Province` FOREIGN KEY (`province`) REFERENCES `Province` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `Fk_Employee_JobTitle` FOREIGN KEY (`job_title`) REFERENCES `JobTitles` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT `Fk_Employee_Supervisor` FOREIGN KEY (`supervisor`) REFERENCES `Employees` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `Fk_Employee_EmploymentStatus` FOREIGN KEY (`employment_status`) REFERENCES `EmploymentStatus` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT `Fk_Employee_CompanyStructures` FOREIGN KEY (`department`) REFERENCES `CompanyStructures` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `Fk_Employee_Country` FOREIGN KEY (`country`) REFERENCES `Country` (`code`) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT `Fk_Employee_PayGrades` FOREIGN KEY (`pay_grade`) REFERENCES `PayGrades` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `Fk_Employee_Province` FOREIGN KEY (`province`) REFERENCES `Province` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
primary key (`id`), CONSTRAINT `Fk_Employee_Supervisor` FOREIGN KEY (`supervisor`) REFERENCES `Employees` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
unique key `employee_id` (`employee_id`) CONSTRAINT `Fk_Employee_CompanyStructures` FOREIGN KEY (`department`) REFERENCES `CompanyStructures` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT `Fk_Employee_PayGrades` FOREIGN KEY (`pay_grade`) REFERENCES `PayGrades` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
primary key (`id`),
unique key `employee_id` (`employee_id`)
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
@@ -199,22 +210,24 @@ create table `UserRoles` (
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
create table `Users` ( create table `Users` (
`id` bigint(20) NOT NULL AUTO_INCREMENT, `id` bigint(20) NOT NULL AUTO_INCREMENT,
`username` varchar(100) default null, `username` varchar(100) default null,
`email` varchar(100) default null, `email` varchar(100) default null,
`password` varchar(100) default null, `password` varchar(100) default null,
`employee` bigint(20) null, `employee` bigint(20) null,
`default_module` bigint(20) null, `default_module` bigint(20) null,
`user_level` enum('Admin','Employee','Manager','Other') default NULL, `user_level` enum('Admin','Employee','Manager','Other') default NULL,
`user_roles` text null, `user_roles` text null,
`last_login` timestamp default '0000-00-00 00:00:00', `last_login` timestamp default '0000-00-00 00:00:00',
`last_update` timestamp default '0000-00-00 00:00:00', `last_update` timestamp default '0000-00-00 00:00:00',
`created` timestamp default '0000-00-00 00:00:00', `created` timestamp default '0000-00-00 00:00:00',
`login_hash` varchar(64) default null, `login_hash` varchar(64) default null,
CONSTRAINT `Fk_User_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, `lang` bigint(20) default null,
primary key (`id`), CONSTRAINT `Fk_User_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
unique key `username` (`username`), CONSTRAINT `Fk_User_SupportedLanguages` FOREIGN KEY (`lang`) REFERENCES `SupportedLanguages` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
INDEX login_hash_index (`login_hash`) primary key (`id`),
unique key `username` (`username`),
INDEX login_hash_index (`login_hash`)
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
@@ -387,32 +400,32 @@ create table `HoliDays` (
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
create table `EmployeeLeaves` ( create table `EmployeeLeaves` (
`id` bigint(20) NOT NULL AUTO_INCREMENT, `id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL, `employee` bigint(20) NOT NULL,
`leave_type` bigint(20) NOT NULL, `leave_type` bigint(20) NOT NULL,
`leave_period` bigint(20) NOT NULL, `leave_period` bigint(20) NOT NULL,
`date_start` date default '0000-00-00', `date_start` date default '0000-00-00',
`date_end` date default '0000-00-00', `date_end` date default '0000-00-00',
`details` text default null, `details` text default null,
`status` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled') default 'Pending', `status` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled','Processing') default 'Pending',
`attachment` varchar(100) NULL, `attachment` varchar(100) NULL,
CONSTRAINT `Fk_EmployeeLeaves_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `Fk_EmployeeLeaves_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeLeaves_LeaveTypes` FOREIGN KEY (`leave_type`) REFERENCES `LeaveTypes` (`id`), CONSTRAINT `Fk_EmployeeLeaves_LeaveTypes` FOREIGN KEY (`leave_type`) REFERENCES `LeaveTypes` (`id`),
CONSTRAINT `Fk_EmployeeLeaves_LeavePeriods` FOREIGN KEY (`leave_period`) REFERENCES `LeavePeriods` (`id`), CONSTRAINT `Fk_EmployeeLeaves_LeavePeriods` FOREIGN KEY (`leave_period`) REFERENCES `LeavePeriods` (`id`),
primary key (`id`) primary key (`id`)
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
create table `EmployeeLeaveLog` ( create table `EmployeeLeaveLog` (
`id` bigint(20) NOT NULL AUTO_INCREMENT, `id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee_leave` bigint(20) NOT NULL, `employee_leave` bigint(20) NOT NULL,
`user_id` bigint(20) NULL, `user_id` bigint(20) NULL,
`data` varchar(500) NOT NULL, `data` varchar(500) NOT NULL,
`status_from` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled') default 'Pending', `status_from` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled','Processing') default 'Pending',
`status_to` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled') default 'Pending', `status_to` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled','Processing') default 'Pending',
`created` timestamp default '0000-00-00 00:00:00', `created` timestamp default '0000-00-00 00:00:00',
CONSTRAINT `Fk_EmployeeLeaveLog_EmployeeLeaves` FOREIGN KEY (`employee_leave`) REFERENCES `EmployeeLeaves` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `Fk_EmployeeLeaveLog_EmployeeLeaves` FOREIGN KEY (`employee_leave`) REFERENCES `EmployeeLeaves` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeLeaveLog_Users` FOREIGN KEY (`user_id`) REFERENCES `Users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `Fk_EmployeeLeaveLog_Users` FOREIGN KEY (`user_id`) REFERENCES `Users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
primary key (`id`) primary key (`id`)
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
create table `EmployeeLeaveDays` ( create table `EmployeeLeaveDays` (
@@ -454,7 +467,7 @@ create table `Projects` (
`client` bigint(20) NULL, `client` bigint(20) NULL,
`details` text default null, `details` text default null,
`created` timestamp default '0000-00-00 00:00:00', `created` timestamp default '0000-00-00 00:00:00',
`status` enum('Active','Inactive') default 'Active', `status` enum('Active','On Hold','Completed', 'Dropped') default 'Active',
CONSTRAINT `Fk_Projects_Client` FOREIGN KEY (`client`) REFERENCES `Clients` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, CONSTRAINT `Fk_Projects_Client` FOREIGN KEY (`client`) REFERENCES `Clients` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
primary key (`id`) primary key (`id`)
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
@@ -612,6 +625,7 @@ create table `Reports` (
`paramOrder` varchar(500) NOT NULL, `paramOrder` varchar(500) NOT NULL,
`type` enum('Query','Class') default 'Query', `type` enum('Query','Class') default 'Query',
`report_group` varchar(500) NULL, `report_group` varchar(500) NULL,
`output` varchar(15) NOT NULL default 'CSV',
primary key (`id`), primary key (`id`),
UNIQUE KEY `Reports_Name` (`name`) UNIQUE KEY `Reports_Name` (`name`)
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
@@ -764,25 +778,25 @@ create table `EmployeeImmigrations` (
create table `EmployeeTravelRecords` ( create table `EmployeeTravelRecords` (
`id` bigint(20) NOT NULL AUTO_INCREMENT, `id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL, `employee` bigint(20) NOT NULL,
`type` enum('Local','International') default 'Local', `type` enum('Local','International') default 'Local',
`purpose` varchar(200) NOT NULL, `purpose` varchar(200) NOT NULL,
`travel_from` varchar(200) NOT NULL, `travel_from` varchar(200) NOT NULL,
`travel_to` varchar(200) NOT NULL, `travel_to` varchar(200) NOT NULL,
`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, `funding` decimal(10,3) NULL,
`currency` bigint(20) 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', `status` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled','Processing') 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;
@@ -818,7 +832,13 @@ create table `CustomFields` (
`display` enum('Form','Table and Form','Hidden') default 'Form', `display` enum('Form','Table and Form','Hidden') default 'Form',
`created` DATETIME default '0000-00-00 00:00:00', `created` DATETIME default '0000-00-00 00:00:00',
`updated` DATETIME default '0000-00-00 00:00:00', `updated` DATETIME default '0000-00-00 00:00:00',
primary key (`id`) `field_type` varchar(20) NULL,
`field_label` varchar(50) NULL,
`field_validation` varchar(50) NULL,
`field_options` varchar(500) NULL,
`display_order` int(11) default 0,
primary key (`id`),
unique key `CustomFields_name` (`type`,`name`)
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
@@ -926,16 +946,17 @@ CREATE TABLE `PayrollColumnTemplates` (
) ENGINE=InnoDB default charset=utf8; ) ENGINE=InnoDB default charset=utf8;
create table `Payroll` ( create table `Payroll` (
`id` bigint(20) NOT NULL AUTO_INCREMENT, `id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(200) NULL, `name` varchar(200) NULL,
`pay_period` bigint(20) NOT NULL, `pay_period` bigint(20) NOT NULL,
`department` bigint(20) NOT NULL, `department` bigint(20) NOT NULL,
`column_template` bigint(20) NOT NULL, `column_template` bigint(20) NULL,
`columns` varchar(500) DEFAULT NULL, `columns` varchar(500) DEFAULT NULL,
`date_start` DATE NULL default '0000-00-00', `date_start` DATE NULL default '0000-00-00',
`date_end` DATE NULL default '0000-00-00', `date_end` DATE NULL default '0000-00-00',
`status` enum('Draft','Completed','Processing') default 'Draft', `status` enum('Draft','Completed','Processing') default 'Draft',
primary key (`id`) `payslipTemplate` bigint(20) NULL,
primary key (`id`)
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
@@ -1210,26 +1231,26 @@ create table `ExpensesPaymentMethods` (
create table `EmployeeExpenses` ( create table `EmployeeExpenses` (
`id` bigint(20) NOT NULL AUTO_INCREMENT, `id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL, `employee` bigint(20) NOT NULL,
`expense_date` date NULL default '0000-00-00', `expense_date` date NULL default '0000-00-00',
`payment_method` bigint(20) NOT NULL, `payment_method` bigint(20) NOT NULL,
`transaction_no` varchar(300) NOT NULL, `transaction_no` varchar(300) NOT NULL,
`payee` varchar(500) NOT NULL, `payee` varchar(500) NOT NULL,
`category` bigint(20) NOT NULL, `category` bigint(20) NOT NULL,
`notes` text, `notes` text,
`amount` decimal(10,3) NULL, `amount` decimal(10,3) NULL,
`currency` bigint(20) 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', `status` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled','Processing') default 'Pending',
CONSTRAINT `Fk_EmployeeExpenses_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, 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_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, CONSTRAINT `Fk_EmployeeExpenses_category` FOREIGN KEY (`category`) REFERENCES `ExpensesCategories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`) primary key (`id`)
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
@@ -1257,3 +1278,146 @@ create table `EmployeeDataHistory` (
) engine=innodb default charset=utf8; ) engine=innodb default charset=utf8;
create table `EmployeeAttendanceSheets` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL,
`date_start` date NOT NULL,
`date_end` date NOT NULL,
`status` enum('Approved','Pending','Rejected','Submitted') default 'Pending',
CONSTRAINT `Fk_EmployeeAttendanceSheets_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
UNIQUE KEY `EmployeeAttendanceSheetsKey` (`employee`,`date_start`,`date_end`),
KEY `EmployeeAttendanceSheets_date_end` (`date_end`),
primary key (`id`)
) engine=innodb default charset=utf8;
create table `CustomFieldValues` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`type` varchar(20) not null,
`name` varchar(60) not null,
`object_id` varchar(60) not null,
`value` text default NULL,
`updated` timestamp default '0000-00-00 00:00:00',
`created` timestamp default '0000-00-00 00:00:00',
primary key (`id`),
UNIQUE key `CustomFields_type_name_object_id` (`type`,`name`,`object_id`),
INDEX `CustomFields_type_object_id` (`type`,`object_id`)
) engine=innodb default charset=utf8;
create table `DataImport` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(60) not null,
`dataType` varchar(60) not null,
`details` text default NULL,
`columns` text default NULL,
`updated` timestamp default '0000-00-00 00:00:00',
`created` timestamp default '0000-00-00 00:00:00',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `DataImportFiles` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(60) not null,
`data_import_definition` varchar(200) not null,
`status` varchar(15) null,
`file` varchar(100) null,
`details` text default NULL,
`updated` timestamp default '0000-00-00 00:00:00',
`created` timestamp default '0000-00-00 00:00:00',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `UserReports` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`details` text default null,
`parameters` text default null,
`query` text default null,
`paramOrder` varchar(500) NOT NULL,
`type` enum('Query','Class') default 'Query',
`report_group` varchar(500) NULL,
`output` varchar(15) NOT NULL default 'CSV',
primary key (`id`),
UNIQUE KEY `UserReports_Name` (`name`)
) engine=innodb default charset=utf8;
create table `ReportFiles` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NULL,
`name` varchar(100) NOT NULL,
`attachment` varchar(100) NOT NULL,
`created` timestamp default '0000-00-00 00:00:00',
unique key `ReportFiles_attachment` (`attachment`),
primary key (`id`)
) engine=innodb default charset=utf8;
create table `PayslipTemplates` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`data` longtext NULL,
`status` enum('Show','Hide') default 'Show',
`created` timestamp default '0000-00-00 00:00:00',
`updated` timestamp default '0000-00-00 00:00:00',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `EmployeeApprovals` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`type` varchar(100) NOT NULL,
`element` bigint(20) NOT NULL,
`approver` bigint(20) NULL,
`level` int(11) default 0,
`status` int(11) default 0,
`active` int(11) default 0,
`created` timestamp default '0000-00-00 00:00:00',
`updated` timestamp default '0000-00-00 00:00:00',
UNIQUE key `EmployeeApprovals_type_element_level` (`type`,`element`,`level`),
INDEX `EmployeeApprovals_type_element_status_level` (`type`,`element`,`status`,`level`),
INDEX `EmployeeApprovals_type_element` (`type`,`element`),
INDEX `EmployeeApprovals_type` (`type`),
primary key (`id`)
) engine=innodb default charset=utf8;
create table `StatusChangeLogs` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`type` varchar(100) NOT NULL,
`element` bigint(20) NOT NULL,
`user_id` bigint(20) NULL,
`data` varchar(500) NOT NULL,
`status_from` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled','Processing') default 'Pending',
`status_to` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled','Processing') default 'Pending',
`created` timestamp default '0000-00-00 00:00:00',
INDEX `EmployeeApprovals_type_element` (`type`,`element`),
primary key (`id`)
) engine=innodb default charset=utf8;
create table `OvertimeCategories` (
`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 `EmployeeOvertime` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL,
`start_time` timestamp NULL default '0000-00-00 00:00:00',
`end_time` timestamp NULL default '0000-00-00 00:00:00',
`category` bigint(20) NOT NULL,
`project` bigint(20) NULL,
`notes` text 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','Processing') default 'Pending',
CONSTRAINT `Fk_EmployeeOvertime_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeOvertime_Category` FOREIGN KEY (`category`) REFERENCES `OvertimeCategories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
@@ -0,0 +1,481 @@
create table `EmployeeAttendanceSheets` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL,
`date_start` date NOT NULL,
`date_end` date NOT NULL,
`status` enum('Approved','Pending','Rejected','Submitted') default 'Pending',
CONSTRAINT `Fk_EmployeeAttendanceSheets_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
UNIQUE KEY `EmployeeAttendanceSheetsKey` (`employee`,`date_start`,`date_end`),
KEY `EmployeeAttendanceSheets_date_end` (`date_end`),
primary key (`id`)
) engine=innodb default charset=utf8;
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Attendance: Overtime Calculation Period', 'Daily', 'Set the period for overtime calculation. (Affects attendance sheets)','["value", {"label":"Value","type":"select","source":[["Daily","Daily"],["Weekly","Weekly"]]}]');
ALTER TABLE `CustomFields` ADD unique key `CustomFields_name` (`type`,`name`);
Alter table `Reports` ADD COLUMN `output` varchar(15) NOT NULL default 'CSV';
Update Reports set output = 'CSV';
create table `CustomFieldValues` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`type` varchar(20) not null,
`name` varchar(60) not null,
`object_id` varchar(60) not null,
`value` text default NULL,
`updated` timestamp default '0000-00-00 00:00:00',
`created` timestamp default '0000-00-00 00:00:00',
primary key (`id`),
UNIQUE key `CustomFields_type_name_object_id` (`type`,`name`,`object_id`),
INDEX `CustomFields_type_object_id` (`type`,`object_id`)
) engine=innodb default charset=utf8;
ALTER TABLE `CustomFields` ADD COLUMN `field_type` varchar(20) NULL;
ALTER TABLE `CustomFields` ADD COLUMN `field_label` varchar(50) NULL;
ALTER TABLE `CustomFields` ADD COLUMN `field_validation` varchar(50) NULL;
ALTER TABLE `CustomFields` ADD COLUMN `field_options` varchar(500) NULL;
ALTER TABLE `CustomFields` ADD COLUMN `display_order` int(11) default 0;
create table `DataImport` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(60) not null,
`dataType` varchar(60) not null,
`details` text default NULL,
`columns` text default NULL,
`updated` timestamp default '0000-00-00 00:00:00',
`created` timestamp default '0000-00-00 00:00:00',
primary key (`id`)
) engine=innodb default charset=utf8;
create table `DataImportFiles` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(60) not null,
`data_import_definition` varchar(200) not null,
`status` varchar(15) null,
`file` varchar(100) null,
`details` text default NULL,
`updated` timestamp default '0000-00-00 00:00:00',
`created` timestamp default '0000-00-00 00:00:00',
primary key (`id`)
) engine=innodb default charset=utf8;
INSERT INTO `DataImport` (`id`, `name`, `dataType`, `details`, `columns`, `updated`, `created`) VALUES
(1, 'Sage50 Import - Employee Data', 'Sage50Employees', '', '[{"name":"employee_id","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"Yes","id":"columns_7"},{"name":"title","title":"title","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_1"},{"name":"initial","title":"Initial","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_2"},{"name":"first_name","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_3"},{"name":"middle_name","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_4"},{"name":"middle_name","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_5"},{"name":"last_name","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_6"},{"name":"address1","title":"Address1","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_8"},{"name":"address3","title":"Address3","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_10"},{"name":"address2","title":"Address2","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_9"},{"name":"address4","title":"Address4","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_11"},{"name":"address5","title":"Address5","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_12"},{"name":"postal_code","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_13"},{"name":"home_phone","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_14"},{"name":"mobile_phone","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_15"},{"name":"private_email","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_16"},{"name":"gender","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_17"},{"name":"marital_status","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_18"},{"name":"previous_surname","title":"Previous Surname","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_19"},{"name":"birthday","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_20"},{"name":"disabled","title":"Disabled","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_21"},{"name":"nationality","title":"Nationality","type":"Reference","dependOn":"Nationality","dependOnField":"name","isKeyField":"Yes","idField":"No","id":"columns_22"},{"name":"ethnicity","title":"Ethnicity","type":"Normal","dependOn":"Ethnicity","dependOnField":"name","isKeyField":"Yes","idField":"No","id":"columns_23"},{"name":"EmergencyContact/name","title":"","type":"Attached","dependOn":"EmergencyContact","dependOnField":"name","isKeyField":"Yes","idField":"No","id":"columns_24"},{"name":"EmergencyContact/relationship","title":"","type":"Attached","dependOn":"EmergencyContact","dependOnField":"relationship","isKeyField":"No","idField":"No","id":"columns_25"},{"name":"EmergencyContact/home_phone","title":"","type":"Attached","dependOn":"EmergencyContact","dependOnField":"home_phone","isKeyField":"No","idField":"No","id":"columns_26"},{"name":"tax_code","title":"Tax Code","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_27"},{"name":"wk1_mth1_basis","title":"Wk1Mth1 Basis","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_28"},{"name":"NI_category","title":"NI Category","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_29"},{"name":"nic_num","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_30"},{"name":"ssn_num","title":"","type":"Normal","dependOn":"NULL","dependOnField":"","isKeyField":"No","idField":"No","id":"columns_31"},{"name":"job_title","title":"","type":"Reference","dependOn":"JobTitle","dependOnField":"name","isKeyField":"Yes","idField":"No","id":"columns_32"},{"name":"employment_status","title":"","type":"Reference","dependOn":"EmploymentStatus","dependOnField":"name","isKeyField":"Yes","idField":"No","id":"columns_33"},{"name":"pay_frequency","title":"Pay Frequency","type":"Reference","dependOn":"PayFrequency","dependOnField":"name","isKeyField"Line truncated
create table `UserReports` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`details` text default null,
`parameters` text default null,
`query` text default null,
`paramOrder` varchar(500) NOT NULL,
`type` enum('Query','Class') default 'Query',
`report_group` varchar(500) NULL,
`output` varchar(15) NOT NULL default 'CSV',
primary key (`id`),
UNIQUE KEY `UserReports_Name` (`name`)
) engine=innodb default charset=utf8;
REPLACE INTO `UserReports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
('Time Entry Report', 'View your time entries by date range and project',
'[\r\n[ "client", {"label":"Select Client","type":"select","allow-null":true,"null-label":"Not Selected","remote-source":["Client","id","name"]}],\r\n[ "project", {"label":"Or Project","type":"select","allow-null":true,"null-label":"All Projects","remote-source":["Project","id","name","getAllProjects"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]',
'EmployeeTimesheetReport', '["client","project","date_start","date_end","status"]', 'Class','Time Management','CSV');
REPLACE INTO `UserReports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
('Attendance Report', 'View your attendance entries by date range', '[\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeAttendanceReport', '["date_start","date_end"]', 'Class','Time Management','CSV');
REPLACE INTO `UserReports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
('Time Tracking Report', 'View your working hours and attendance details for each day for a given period ', '[\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]', 'EmployeeTimeTrackReport', '["date_start","date_end"]', 'Class','Time Management','CSV');
REPLACE INTO `UserReports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
('Travel Request Report', 'View travel requests for a specified period',
'[\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}],\r\n[ "status", {"label":"Status","type":"select","source":[["NULL","All Statuses"],["Approved","Approved"],["Pending","Pending"],["Rejected","Rejected"],["Cancellation Requested","Cancellation Requested"],["Cancelled","Cancelled"]]}]\r\n]',
'TravelRequestReport',
'["date_start","date_end","status"]', 'Class', 'Travel and Expense Management','CSV');
REPLACE INTO `UserReports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
('Time Sheet Report', 'This report list all employee time sheets by employee and date range',
'[\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}],\r\n[ "status", {"label":"Status","allow-null":true,"null-label":"All Status","type":"select","source":[["Approved","Approved"],["Pending","Pending"],["Rejected","Rejected"]]}]\r\n]',
'EmployeeTimeSheetData',
'["date_start","date_end","status"]', 'Class','Time Management','CSV');
REPLACE INTO `UserReports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
('Client Project Time Report', 'View your time entries for projects under a given client',
'[\r\n[ "client", {"label":"Select Client","type":"select","allow-null":false,"remote-source":["Client","id","name"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]',
'ClientProjectTimeReport', '["client","date_start","date_end","status"]', 'Class','Time Management','PDF');
REPLACE INTO `Reports` (`name`, `details`, `parameters`, `query`, `paramOrder`, `type`,`report_group`,`output`) VALUES
('Employee Time Entry Report', 'View employee time entries by date range and project',
'[\r\n[ "employee", {"label":"Employee","type":"select2multi","allow-null":true,"null-label":"All Employees","remote-source":["Employee","id","first_name+last_name"]}],\r\n[ "client", {"label":"Select Client","type":"select","allow-null":true,"null-label":"Not Selected","remote-source":["Client","id","name"]}],\r\n[ "project", {"label":"Or Project","type":"select","allow-null":true,"null-label":"All Projects","remote-source":["Project","id","name","getAllProjects"]}],\r\n[ "date_start", {"label":"Start Date","type":"date"}],\r\n[ "date_end", {"label":"End Date","type":"date"}]\r\n]',
'EmployeeTimesheetReport', '["employee","client","project","date_start","date_end","status"]', 'Class','Time Management','CSV');
Alter table `Projects` MODIFY COLUMN `status` enum('Active','On Hold','Completed', 'Dropped') default 'Active';
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('System: Reset Module Names', '0', 'Select this to reset module names in Database','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
create table `ReportFiles` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NULL,
`name` varchar(100) NOT NULL,
`attachment` varchar(100) NOT NULL,
`created` timestamp default '0000-00-00 00:00:00',
unique key `ReportFiles_attachment` (`attachment`),
primary key (`id`)
) engine=innodb default charset=utf8;
INSERT IGNORE into ReportFiles (`name`,`attachment`,`created`) SELECT filename,name,SUBSTRING_INDEX(SUBSTRING_INDEX(name,'-',-5),'_',1) from Files where file_group ='Report';
Update Settings set value = '1' where name = 'System: Reset Module Names';
create table `PayslipTemplates` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`data` longtext NULL,
`status` enum('Show','Hide') default 'Show',
`created` timestamp default '0000-00-00 00:00:00',
`updated` timestamp default '0000-00-00 00:00:00',
primary key (`id`)
) engine=innodb default charset=utf8;
Alter table `Payroll` add column `payslipTemplate` bigint(20) NULL;
Alter table `Payroll` modify column `column_template` bigint(20) NULL;
Alter table `Employees` add column `approver1` bigint(20) default null;
Alter table `Employees` add column `approver2` bigint(20) default null;
Alter table `Employees` add column `approver3` bigint(20) default null;
create table `EmployeeApprovals` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`type` varchar(100) NOT NULL,
`element` bigint(20) NOT NULL,
`approver` bigint(20) NULL,
`level` int(11) default 0,
`status` int(11) default 0,
`active` int(11) default 0,
`created` timestamp default '0000-00-00 00:00:00',
`updated` timestamp default '0000-00-00 00:00:00',
UNIQUE key `EmployeeApprovals_type_element_level` (`type`,`element`,`level`),
INDEX `EmployeeApprovals_type_element_status_level` (`type`,`element`,`status`,`level`),
INDEX `EmployeeApprovals_type_element` (`type`,`element`),
INDEX `EmployeeApprovals_type` (`type`),
primary key (`id`)
) engine=innodb default charset=utf8;
Alter table `EmployeeExpenses` modify column `status` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled','Processing') default 'Pending';
Alter table `EmployeeTravelRecords` modify column `status` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled','Processing') default 'Pending';
Alter table `EmployeeLeaves` modify column `status` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled','Processing') default 'Pending';
Alter table `EmployeeLeaveLog` modify column `status_from` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled','Processing') default 'Pending';
Alter table `EmployeeLeaveLog` modify column `status_to` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled','Processing') default 'Pending';
create table `StatusChangeLogs` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`type` varchar(100) NOT NULL,
`element` bigint(20) NOT NULL,
`user_id` bigint(20) NULL,
`data` varchar(500) NOT NULL,
`status_from` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled','Processing') default 'Pending',
`status_to` enum('Approved','Pending','Rejected','Cancellation Requested','Cancelled','Processing') default 'Pending',
`created` timestamp default '0000-00-00 00:00:00',
INDEX `EmployeeApprovals_type_element` (`type`,`element`),
primary key (`id`)
) engine=innodb default charset=utf8;
create table `OvertimeCategories` (
`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 `EmployeeOvertime` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`employee` bigint(20) NOT NULL,
`start_time` timestamp NULL default '0000-00-00 00:00:00',
`end_time` timestamp NULL default '0000-00-00 00:00:00',
`category` bigint(20) NOT NULL,
`project` bigint(20) NULL,
`notes` text 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','Processing') default 'Pending',
CONSTRAINT `Fk_EmployeeOvertime_Employee` FOREIGN KEY (`employee`) REFERENCES `Employees` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `Fk_EmployeeOvertime_Category` FOREIGN KEY (`category`) REFERENCES `OvertimeCategories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
primary key (`id`)
) engine=innodb default charset=utf8;
ALTER table `Payroll` modify column `column_template` bigint(20) NULL;
ALTER table `CompanyStructures` add column `heads` varchar(255) NULL default NULL;
ALTER table `CustomFields` add column `display_section` varchar(50) NULL;
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Expense: Allow Indirect Admins to Approve', '0', 'Allow indirect admins to approve expense requests','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Travel: Allow Indirect Admins to Approve', '0', 'Allow indirect admins to approve travel requests','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
INSERT INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('Overtime: Allow Indirect Admins to Approve', '0', 'Allow indirect admins to approve overtime requests','["value", {"label":"Value","type":"select","source":[["1","Yes"],["0","No"]]}]');
Update `Languages` set name = 'en' where name = 'English';
Update `Languages` set name = 'fr' where name = 'French';
Update `Languages` set name = 'de' where name = 'German';
Update `Languages` set name = 'zh' where name = 'Chinese';
INSERT INTO `Languages` (`id`, `name`, `description`) VALUES
(5, 'aa', 'Afar'),
(6, 'ab', 'Abkhaz'),
(7, 'ae', 'Avestan'),
(8, 'af', 'Afrikaans'),
(9, 'ak', 'Akan'),
(10, 'am', 'Amharic'),
(11, 'an', 'Aragonese'),
(12, 'ar', 'Arabic'),
(13, 'as', 'Assamese'),
(14, 'av', 'Avaric'),
(15, 'ay', 'Aymara'),
(16, 'az', 'Azerbaijani'),
(17, 'ba', 'Bashkir'),
(18, 'be', 'Belarusian'),
(19, 'bg', 'Bulgarian'),
(20, 'bh', 'Bihari'),
(21, 'bi', 'Bislama'),
(22, 'bm', 'Bambara'),
(23, 'bn', 'Bengali'),
(24, 'bo', 'Tibetan Standard, Tibetan, Central'),
(25, 'br', 'Breton'),
(26, 'bs', 'Bosnian'),
(27, 'ca', 'Catalan; Valencian'),
(28, 'ce', 'Chechen'),
(29, 'ch', 'Chamorro'),
(30, 'co', 'Corsican'),
(31, 'cr', 'Cree'),
(32, 'cs', 'Czech'),
(33, 'cu', 'Church Slavic'),
(34, 'cv', 'Chuvash'),
(35, 'cy', 'Welsh'),
(36, 'da', 'Danish'),
(37, 'dv', 'Divehi; Dhivehi; Maldivian;'),
(38, 'dz', 'Dzongkha'),
(39, 'ee', 'Ewe'),
(40, 'el', 'Greek, Modern'),
(41, 'eo', 'Esperanto'),
(42, 'es', 'Spanish; Castilian'),
(43, 'et', 'Estonian'),
(44, 'eu', 'Basque'),
(45, 'fa', 'Persian'),
(46, 'ff', 'Fula; Fulah; Pulaar; Pular'),
(47, 'fi', 'Finnish'),
(48, 'fj', 'Fijian'),
(49, 'fo', 'Faroese'),
(50, 'fy', 'Western Frisian'),
(51, 'ga', 'Irish'),
(52, 'gd', 'Scottish Gaelic; Gaelic'),
(53, 'gl', 'Galician'),
(55, 'gu', 'Gujarati'),
(56, 'gv', 'Manx'),
(57, 'ha', 'Hausa'),
(58, 'he', 'Hebrew (modern)'),
(59, 'hi', 'Hindi'),
(60, 'ho', 'Hiri Motu'),
(61, 'hr', 'Croatian'),
(62, 'ht', 'Haitian; Haitian Creole'),
(63, 'hu', 'Hungarian'),
(64, 'hy', 'Armenian'),
(65, 'hz', 'Herero'),
(66, 'ia', 'Interlingua'),
(67, 'id', 'Indonesian'),
(68, 'ie', 'Interlingue'),
(69, 'ig', 'Igbo'),
(70, 'ii', 'Nuosu'),
(71, 'ik', 'Inupiaq'),
(72, 'io', 'Ido'),
(73, 'is', 'Icelandic'),
(74, 'it', 'Italian'),
(75, 'iu', 'Inuktitut'),
(76, 'ja', 'Japanese (ja)'),
(77, 'jv', 'Javanese (jv)'),
(78, 'ka', 'Georgian'),
(79, 'kg', 'Kongo'),
(80, 'ki', 'Kikuyu, Gikuyu'),
(81, 'kj', 'Kwanyama, Kuanyama'),
(82, 'kk', 'Kazakh'),
(83, 'kl', 'Kalaallisut, Greenlandic'),
(84, 'km', 'Khmer'),
(85, 'kn', 'Kannada'),
(86, 'ko', 'Korean'),
(87, 'kr', 'Kanuri'),
(88, 'ks', 'Kashmiri'),
(89, 'ku', 'Kurdish'),
(90, 'kv', 'Komi'),
(91, 'kw', 'Cornish'),
(92, 'ky', 'Kirghiz, Kyrgyz'),
(93, 'la', 'Latin'),
(94, 'lb', 'Luxembourgish, Letzeburgesch'),
(95, 'lg', 'Luganda'),
(96, 'li', 'Limburgish, Limburgan, Limburger'),
(97, 'ln', 'Lingala'),
(98, 'lo', 'Lao'),
(99, 'lt', 'Lithuanian'),
(100, 'lu', 'Luba-Katanga'),
(101, 'lv', 'Latvian'),
(102, 'mg', 'Malagasy'),
(103, 'mh', 'Marshallese'),
(104, 'mi', 'Maori'),
(105, 'mk', 'Macedonian'),
(106, 'ml', 'Malayalam'),
(107, 'mn', 'Mongolian'),
(108, 'mr', 'Marathi (Mara?hi)'),
(109, 'ms', 'Malay'),
(110, 'mt', 'Maltese'),
(111, 'my', 'Burmese'),
(112, 'na', 'Nauru'),
(113, 'nb', 'Norwegian Bokmål'),
(114, 'nd', 'North Ndebele'),
(115, 'ne', 'Nepali'),
(116, 'ng', 'Ndonga'),
(117, 'nl', 'Dutch'),
(118, 'nn', 'Norwegian Nynorsk'),
(119, 'no', 'Norwegian'),
(120, 'nr', 'South Ndebele'),
(121, 'nv', 'Navajo, Navaho'),
(122, 'ny', 'Chichewa; Chewa; Nyanja'),
(123, 'oc', 'Occitan'),
(124, 'oj', 'Ojibwe, Ojibwa'),
(125, 'om', 'Oromo'),
(126, 'or', 'Oriya'),
(127, 'os', 'Ossetian, Ossetic'),
(128, 'pa', 'Panjabi, Punjabi'),
(129, 'pi', 'Pali'),
(130, 'pl', 'Polish'),
(131, 'ps', 'Pashto, Pushto'),
(132, 'pt', 'Portuguese'),
(133, 'qu', 'Quechua'),
(134, 'rm', 'Romansh'),
(135, 'rn', 'Kirundi'),
(136, 'ro', 'Romanian, Moldavian, Moldovan'),
(137, 'ru', 'Russian'),
(138, 'rw', 'Kinyarwanda'),
(139, 'sa', 'Sanskrit (Sa?sk?ta)'),
(140, 'sc', 'Sardinian'),
(141, 'sd', 'Sindhi'),
(142, 'se', 'Northern Sami'),
(143, 'sg', 'Sango'),
(144, 'si', 'Sinhala, Sinhalese'),
(145, 'sk', 'Slovak'),
(146, 'sl', 'Slovene'),
(147, 'sm', 'Samoan'),
(148, 'sn', 'Shona'),
(149, 'so', 'Somali'),
(150, 'sq', 'Albanian'),
(151, 'sr', 'Serbian'),
(152, 'ss', 'Swati'),
(153, 'st', 'Southern Sotho'),
(154, 'su', 'Sundanese'),
(155, 'sv', 'Swedish'),
(156, 'sw', 'Swahili'),
(157, 'ta', 'Tamil'),
(158, 'te', 'Telugu'),
(159, 'tg', 'Tajik'),
(160, 'th', 'Thai'),
(161, 'ti', 'Tigrinya'),
(162, 'tk', 'Turkmen'),
(163, 'tl', 'Tagalog'),
(164, 'tn', 'Tswana'),
(165, 'to', 'Tonga (Tonga Islands)'),
(166, 'tr', 'Turkish'),
(167, 'ts', 'Tsonga'),
(168, 'tt', 'Tatar'),
(169, 'tw', 'Twi'),
(170, 'ty', 'Tahitian'),
(171, 'ug', 'Uighur, Uyghur'),
(172, 'uk', 'Ukrainian'),
(173, 'ur', 'Urdu'),
(174, 'uz', 'Uzbek'),
(175, 've', 'Venda'),
(176, 'vi', 'Vietnamese'),
(178, 'wa', 'Walloon'),
(179, 'wo', 'Wolof'),
(180, 'xh', 'Xhosa'),
(181, 'yi', 'Yiddish'),
(182, 'yo', 'Yoruba'),
(183, 'za', 'Zhuang, Chuang'),
(184, 'zu', 'Zulu');
create table `SupportedLanguages` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) default null,
`description` varchar(100) default null,
primary key (`id`)
) engine=innodb default charset=utf8;
INSERT INTO `SupportedLanguages` (`name`, `description`) VALUES
('en', 'English'),
('de', 'German'),
('fr', 'French'),
('pl', 'Polish'),
('it', 'Italian'),
('si', 'Sinhala'),
('zh', 'Chinese'),
('ja', 'Japanese'),
('hi', 'Hindi'),
('es', 'Spanish');
Alter table `Users` add column varchar(100) default null;
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
('System: Language', 'en', 'Current Language','["value", {"label":"Value","type":"select2","allow-null":false,"remote-source":["SupportedLanguage","name","description"]}]');
@@ -41,7 +41,7 @@ class AttendanceActionManager extends SubActionManager{
//check if dates are differnet //check if dates are differnet
if(!empty($outDate) && $inDate != $outDate){ if(!empty($outDate) && $inDate != $outDate){
return new IceResponse(IceResponse::ERROR,"Attendance entry should be within a single day"); return new IceResponse(IceResponse::ERROR,LanguageManager::tran("Attendance entry should be within a single day"));
} }
//compare dates //compare dates
@@ -102,4 +102,4 @@ class AttendanceActionManager extends SubActionManager{
} }
} }
@@ -38,6 +38,8 @@ if (!class_exists('AttendanceAdminManager')) {
$this->addCalculationHook('AttendanceUtil_getTimeWorkedHours','Total Hours from Attendance','AttendanceUtil','getTimeWorkedHours'); $this->addCalculationHook('AttendanceUtil_getTimeWorkedHours','Total Hours from Attendance','AttendanceUtil','getTimeWorkedHours');
$this->addCalculationHook('AttendanceUtil_getRegularWorkedHours','Total Regular Hours from Attendance','AttendanceUtil','getRegularWorkedHours'); $this->addCalculationHook('AttendanceUtil_getRegularWorkedHours','Total Regular Hours from Attendance','AttendanceUtil','getRegularWorkedHours');
$this->addCalculationHook('AttendanceUtil_getOverTimeWorkedHours','Total Overtime Hours from Attendance','AttendanceUtil','getOverTimeWorkedHours'); $this->addCalculationHook('AttendanceUtil_getOverTimeWorkedHours','Total Overtime Hours from Attendance','AttendanceUtil','getOverTimeWorkedHours');
$this->addCalculationHook('AttendanceUtil_getWeeklyRegularWorkedHours','Total Weekly Regular Hours from Attendance','AttendanceUtil','getWeeklyBasedRegularHours');
$this->addCalculationHook('AttendanceUtil_getWeeklyOverTimeWorkedHours','Total Weekly Overtime Hours from Attendance','AttendanceUtil','getWeeklyBasedOvertimeHours');
} }
} }
@@ -249,6 +251,80 @@ if (!class_exists('AttendanceUtil')) {
$atSum = $this->getAttendanceSummary($employeeId, $startDate, $endDate); $atSum = $this->getAttendanceSummary($employeeId, $startDate, $endDate);
return round(($atSum['o']/60)/60,2); return round(($atSum['o']/60)/60,2);
} }
public function getWeeklyBasedRegularHours($employeeId, $startDate, $endDate){
$atSum = $this->getWeeklyBasedOvertimeSummary($employeeId, $startDate, $endDate);
return round(($atSum['r']/60)/60,2);
}
public function getWeeklyBasedOvertimeHours($employeeId, $startDate, $endDate){
$atSum = $this->getWeeklyBasedOvertimeSummary($employeeId, $startDate, $endDate);
return round(($atSum['o']/60)/60,2);
}
public function getWeeklyBasedOvertimeSummary($employeeId, $startDate, $endDate){
$attendance = new Attendance();
$atTimeByWeek = array();
//Find weeks starting from sunday and ending from saturday in day period
$weeks = $this->getWeeklyDays($startDate,$endDate);
foreach($weeks as $k=>$week){
$startTime = $week[0]." 00:00:00";
$endTime = $week[count($week) - 1]." 23:59:59";
$atts = $attendance->Find("employee = ? and in_time >= ? and out_time <= ?",array($employeeId, $startTime, $endTime));
foreach($atts as $atEntry){
if($atEntry->out_time == "0000-00-00 00:00:00" || empty($atEntry->out_time)){
continue;
}
if(!isset($atTimeByWeek[$k])){
$atTimeByWeek[$k] = 0;
}
$diff = strtotime($atEntry->out_time) - strtotime($atEntry->in_time);
if($diff < 0){
$diff = 0;
}
$atTimeByWeek[$k] += $diff;
}
}
$overtimeStarts = SettingsManager::getInstance()->getSetting('Attendance: Overtime Start Hour');
$overtimeStarts = (is_numeric($overtimeStarts))?floatval($overtimeStarts)*60*60*5:0;
$regTime = 0;
$overTime = 0;
foreach($atTimeByWeek as $value){
if($value > $overtimeStarts){
$regTime += $overtimeStarts;
$overTime = $value - $overtimeStarts;
}else{
$regTime += $value;
}
}
return array('r'=>$regTime,'o'=>$overTime);
}
private function getWeeklyDays($startDate,$endDate){
$start = new DateTime($startDate);
$end = new DateTime($endDate.' 23:59');
$interval = new DateInterval('P1D');
$dateRange = new DatePeriod($start, $interval, $end);
$weekNumber = 1;
$weeks = array();
foreach ($dateRange as $date) {
$weeks[$weekNumber][] = $date->format('Y-m-d');
if ($date->format('w') == 6) {
$weekNumber++;
}
}
return $weeks;
}
} }
} }
+4 -4
View File
@@ -2,17 +2,17 @@
<div class="small-box bg-yellow"> <div class="small-box bg-yellow">
<div class="inner"> <div class="inner">
<h3> <h3>
Attendance <t>Attendance</t>
</h3> </h3>
<p id="numberOfAttendanceLastWeek"> <p id="numberOfAttendanceLastWeek">
#_numberOfAttendanceLastWeek_# Entries Last Week #_numberOfAttendanceLastWeek_# <t>Entries Last Week</t>
</p> </p>
</div> </div>
<div class="icon"> <div class="icon">
<i class="ion ion-clock"></i> <i class="ion ion-clock"></i>
</div> </div>
<a href="#_moduleLink_#" class="small-box-footer" id="attendanceLink"> <a href="#_moduleLink_#" class="small-box-footer" id="attendanceLink">
Monitor Attendance <i class="fa fa-arrow-circle-right"></i> <t>Monitor Attendance</t> <i class="fa fa-arrow-circle-right"></i>
</a> </a>
</div> </div>
</div> </div>
+3 -20
View File
@@ -28,11 +28,8 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
?><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;">
<li class="active"><a id="tabAttendance" href="#tabPageAttendance">Monitor Attendance</a></li> <li class="active"><a id="tabAttendance" href="#tabPageAttendance"><?=LanguageManager::tran('Monitor Attendance')?></a></li>
<li class=""><a id="tabAttendanceStatus" href="#tabPageAttendanceStatus">Current Clocked In Status</a></li> <li class=""><a id="tabAttendanceStatus" href="#tabPageAttendanceStatus"><?=LanguageManager::tran('Current Clocked In Status')?></a></li>
<!--
<li class=""><a id="tabAttendanceData" href="#tabPageAttendanceData">Attendance Data Update</a></li>
-->
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
@@ -52,20 +49,6 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
</div> </div>
</div> </div>
<!--
<div class="tab-pane" id="tabPageAttendanceData">
<div class="control-group" id="field__id_">
<div class="controls">
<textarea class="input-xxlarge" placeholder="Insert CSV data to submit" type="textarea" width="96%" rows="100" id="attendanceData" name="attendanceData"></textarea>
</div>
</div>
<div class="control-group">
<div class="controls">
<button onclick="return false;" class="btn">Update Attendance Data</button>
</div>
</div>
</div>
-->
</div> </div>
@@ -79,4 +62,4 @@ modJsList['tabAttendanceStatus'].setShowAddNew(false);
var modJs = modJsList['tabAttendance']; var modJs = modJsList['tabAttendance'];
</script> </script>
<?php include APP_BASE_PATH.'footer.php';?> <?php include APP_BASE_PATH.'footer.php';?>
@@ -87,6 +87,20 @@ if (!class_exists('CompanyStructure')) {
} }
} }
} }
public static function isHeadOfCompanyStructure($companyStructureId, $profileId){
$companyStructure = new CompanyStructure();
$companyStructure->Load("id = ?",array($companyStructureId));
if(isset($companyStructure->heads) && !empty($companyStructure->heads)){
$heads = json_decode($companyStructure->heads);
if(is_array($heads) && !empty($heads) && in_array($profileId, $heads)){
return true;
}
}
return false;
}
} }
} }
@@ -108,4 +122,4 @@ if (!class_exists('Timezone')) {
} }
} }
} }
+4 -4
View File
@@ -2,16 +2,16 @@
<div class="small-box bg-green"> <div class="small-box bg-green">
<div class="inner"> <div class="inner">
<h3>Company</h3> <h3><t>Company</t></h3>
<p id="numberOfCompanyStuctures"> <p id="numberOfCompanyStuctures">
#_numberOfCompanyStuctures_# Departments #_numberOfCompanyStuctures_# <t>Departments</t>
</p> </p>
</div> </div>
<div class="icon"> <div class="icon">
<i class="ion ion-shuffle"></i> <i class="ion ion-shuffle"></i>
</div> </div>
<a href="#_moduleLink_#" class="small-box-footer" id="companyLink"> <a href="#_moduleLink_#" class="small-box-footer" id="companyLink">
Manage Company <i class="fa fa-arrow-circle-right"></i> <t>Manage</t> <t>Company</t> <i class="fa fa-arrow-circle-right"></i>
</a> </a>
</div> </div>
</div> </div>
+3 -3
View File
@@ -54,8 +54,8 @@ path.link {
<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;">
<li class="active"><a id="tabCompanyStructure" href="#tabPageCompanyStructure">Company Structure</a></li> <li class="active"><a id="tabCompanyStructure" href="#tabPageCompanyStructure"><?=LanguageManager::tran('Company Structure')?></a></li>
<li><a id="tabCompanyGraph" href="#tabPageCompanyGraph">Company Graph</a></li> <li><a id="tabCompanyGraph" href="#tabPageCompanyGraph"><?=LanguageManager::tran('Company Graph')?></a></li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
@@ -93,4 +93,4 @@ modJsList['tabCompanyGraph'] = new CompanyGraphAdapter('CompanyStructure');
var modJs = modJsList['tabCompanyStructure']; var modJs = modJsList['tabCompanyStructure'];
</script> </script>
<?php include APP_BASE_PATH.'footer.php';?> <?php include APP_BASE_PATH.'footer.php';?>
+2 -1
View File
@@ -43,7 +43,8 @@ CompanyStructureAdapter.method('getFormFields', function() {
[ "type", {"label":"Type","type":"select","source":[["Company","Company"],["Head Office","Head Office"],["Regional Office","Regional Office"],["Department","Department"],["Unit","Unit"],["Sub Unit","Sub Unit"],["Other","Other"]]}], [ "type", {"label":"Type","type":"select","source":[["Company","Company"],["Head Office","Head Office"],["Regional Office","Regional Office"],["Department","Department"],["Unit","Unit"],["Sub Unit","Sub Unit"],["Other","Other"]]}],
[ "country", {"label":"Country","type":"select2","remote-source":["Country","code","name"]}], [ "country", {"label":"Country","type":"select2","remote-source":["Country","code","name"]}],
[ "timezone", {"label":"Time Zone","type":"select2","allow-null":false,"remote-source":["Timezone","name","details"]}], [ "timezone", {"label":"Time Zone","type":"select2","allow-null":false,"remote-source":["Timezone","name","details"]}],
[ "parent", {"label":"Parent Structure","type":"select","allow-null":true,"remote-source":["CompanyStructure","id","title"]}] [ "parent", {"label":"Parent Structure","type":"select","allow-null":true,"remote-source":["CompanyStructure","id","title"]}],
[ "heads", {"label":"Heads","type":"select2multi","allow-null":true,"remote-source":["Employee","id","first_name+last_name"]}]
]; ];
}); });
@@ -35,7 +35,7 @@ class EmployeesActionManager extends SubActionManager{
$ok = $employee->Save(); $ok = $employee->Save();
if(!$ok){ if(!$ok){
return new IceResponse(IceResponse::ERROR, "Error occured while activating employee"); return new IceResponse(IceResponse::ERROR, "Error occurred while activating employee");
} }
return new IceResponse(IceResponse::SUCCESS, $employee); return new IceResponse(IceResponse::SUCCESS, $employee);
@@ -161,4 +161,4 @@ class EmployeesActionManager extends SubActionManager{
} }
return $data; return $data;
} }
} }
@@ -30,6 +30,7 @@ if (!class_exists('EmployeesAdminManager')) {
public function setupModuleClassDefinitions(){ public function setupModuleClassDefinitions(){
$this->addModelClass('Employee'); $this->addModelClass('Employee');
$this->addModelClass('EmploymentStatus'); $this->addModelClass('EmploymentStatus');
$this->addModelClass('EmployeeApproval');
} }
public function getDashboardItemData(){ public function getDashboardItemData(){
@@ -288,6 +289,25 @@ if (!class_exists('EmploymentStatus')) {
} }
} }
if (!class_exists('EmployeeApproval')) {
class EmployeeApproval extends ICEHRM_Record {
var $_table = 'EmployeeApprovals';
public function getAdminAccess(){
return array("get","element","save","delete");
}
public function getManagerAccess(){
return array("get","element","save");
}
public function getUserAccess(){
return array();
}
}
}
if (!class_exists('EmployeeRestEndPoint')) { if (!class_exists('EmployeeRestEndPoint')) {
class EmployeeRestEndPoint extends RestEndPoint{ class EmployeeRestEndPoint extends RestEndPoint{
@@ -56,8 +56,7 @@
<div class="row" style="margin-left:10px;margin-top:20px;"> <div class="row" style="margin-left:10px;margin-top:20px;">
<div class="panel panel-default" style="width:97.5%;"> <div class="panel panel-default" style="width:97.5%;">
<div class="panel-heading"><h4>Personal Information</h4></div> <div class="panel-heading"><h4>Personal Information</h4></div>
<div class="panel-body"> <div class="panel-body" id="cont_personal_information">
<div class="row-fluid">
<div class="col-xs-6 col-md-3" style="font-size:16px;"> <div class="col-xs-6 col-md-3" style="font-size:16px;">
<label class="control-label col-xs-12" style="font-size:13px;">#_label_driving_license_#</label> <label class="control-label col-xs-12" style="font-size:13px;">#_label_driving_license_#</label>
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="driving_license"></label> <label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="driving_license"></label>
@@ -74,10 +73,7 @@
<label class="control-label col-xs-12" style="font-size:13px;">#_label_gender_#</label> <label class="control-label col-xs-12" style="font-size:13px;">#_label_gender_#</label>
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="gender"></label> <label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="gender"></label>
</div> </div>
</div>
<hr/>
<div class="row-fluid">
<div class="col-xs-6 col-md-3" style="font-size:16px;"> <div class="col-xs-6 col-md-3" style="font-size:16px;">
<label class="control-label col-xs-12" style="font-size:13px;">#_label_nationality_#</label> <label class="control-label col-xs-12" style="font-size:13px;">#_label_nationality_#</label>
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="nationality_Name"></label> <label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="nationality_Name"></label>
@@ -90,16 +86,14 @@
<label class="control-label col-xs-12" style="font-size:13px;">#_label_joined_date_#</label> <label class="control-label col-xs-12" style="font-size:13px;">#_label_joined_date_#</label>
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="joined_date"></label> <label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="joined_date"></label>
</div> </div>
</div>
</div> </div>
</div> </div>
</div> </div>
<div class="row" style="margin-left:10px;margin-top:20px;"> <div class="row" style="margin-left:10px;margin-top:20px;">
<div class="panel panel-default" style="width:97.5%;"> <div class="panel panel-default" style="width:97.5%;">
<div class="panel-heading"><h4>Contact Information</h4></div> <div class="panel-heading"><h4>Contact Information</h4></div>
<div class="panel-body"> <div class="panel-body" id="cont_contact_information">
<div class="row-fluid">
<div class="col-xs-6 col-md-3" style="font-size:16px;"> <div class="col-xs-6 col-md-3" style="font-size:16px;">
<label class="control-label col-xs-12" style="font-size:13px;">#_label_address1_#</label> <label class="control-label col-xs-12" style="font-size:13px;">#_label_address1_#</label>
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="address1"></label> <label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="address1"></label>
@@ -116,9 +110,6 @@
<label class="control-label col-xs-12" style="font-size:13px;">#_label_country_#</label> <label class="control-label col-xs-12" style="font-size:13px;">#_label_country_#</label>
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="country_Name"></label> <label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="country_Name"></label>
</div> </div>
</div>
<hr/>
<div class="row-fluid">
<div class="col-xs-6 col-md-3" style="font-size:16px;"> <div class="col-xs-6 col-md-3" style="font-size:16px;">
<label class="control-label col-xs-12" style="font-size:13px;">#_label_postal_code_#</label> <label class="control-label col-xs-12" style="font-size:13px;">#_label_postal_code_#</label>
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="postal_code"></label> <label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="postal_code"></label>
@@ -135,16 +126,14 @@
<label class="control-label col-xs-12" style="font-size:13px;">#_label_private_email_#</label> <label class="control-label col-xs-12" style="font-size:13px;">#_label_private_email_#</label>
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="private_email"></label> <label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="private_email"></label>
</div> </div>
</div> </div>
</div> </div>
</div>
</div> </div>
<div class="row" style="margin-left:10px;margin-top:20px;"> <div class="row" style="margin-left:10px;margin-top:20px;">
<div class="panel panel-default" style="width:97.5%;"> <div class="panel panel-default" style="width:97.5%;">
<div class="panel-heading"><h4>Job Details</h4></div> <div class="panel-heading"><h4>Job Details</h4></div>
<div class="panel-body"> <div class="panel-body" id="cont_job_details">
<div class="row-fluid">
<div class="col-xs-6 col-md-3" style="font-size:16px;"> <div class="col-xs-6 col-md-3" style="font-size:16px;">
<label class="control-label col-xs-12" style="font-size:13px;">#_label_job_title_#</label> <label class="control-label col-xs-12" style="font-size:13px;">#_label_job_title_#</label>
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="job_title_Name"></label> <label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="job_title_Name"></label>
@@ -161,56 +150,57 @@
<label class="control-label col-xs-12" style="font-size:13px;">Direct Reports</label> <label class="control-label col-xs-12" style="font-size:13px;">Direct Reports</label>
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="subordinates"></label> <label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="subordinates"></label>
</div> </div>
</div>
<hr/>
<div class="row-fluid">
<div class="col-xs-6 col-md-3" style="font-size:16px;"> <div class="col-xs-6 col-md-3" style="font-size:16px;">
<label class="control-label col-xs-12" style="font-size:13px;">#_label_department_#</label> <label class="control-label col-xs-12" style="font-size:13px;">#_label_department_#</label>
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="department_Name"></label> <label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="department_Name"></label>
</div> </div>
</div> </div>
</div> </div>
</div>
</div> </div>
<div id="customFieldsCont">
</div>
<div class="modal" id="adminUsersModel" tabindex="-1" role="dialog" aria-labelledby="messageModelLabel" aria-hidden="true"> <div class="modal" id="adminUsersModel" tabindex="-1" role="dialog" aria-labelledby="messageModelLabel" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-times"/></button> <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-times"/></button>
<h3 style="font-size: 17px;">Change User Password</h3> <h3 style="font-size: 17px;">Change User Password</h3>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<form id="adminUsersChangePwd"> <form id="adminUsersChangePwd">
<div class="control-group"> <div class="control-group">
<div class="controls"> <div class="controls">
<span class="label label-warning" id="adminUsersChangePwd_error" style="display:none;"></span> <span class="label label-warning" id="adminUsersChangePwd_error" style="display:none;"></span>
</div> </div>
</div> </div>
<div class="control-group" id="field_newpwd"> <div class="control-group" id="field_newpwd">
<label class="control-label" for="newpwd">New Password</label> <label class="control-label" for="newpwd">New Password</label>
<div class="controls"> <div class="controls">
<input class="" type="password" id="newpwd" name="newpwd" value="" class="form-control"/> <input class="" type="password" id="newpwd" name="newpwd" value="" class="form-control"/>
<span class="help-inline" id="help_newpwd"></span> <span class="help-inline" id="help_newpwd"></span>
</div>
</div>
<div class="control-group" id="field_conpwd">
<label class="control-label" for="conpwd">Confirm Password</label>
<div class="controls">
<input class="" type="password" id="conpwd" name="conpwd" value="" class="form-control"/>
<span class="help-inline" id="help_conpwd"></span>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button class="btn btn-primary" onclick="modJs.changePasswordConfirm();">Change Password</button>
<button class="btn" onclick="modJs.closeChangePassword();">Not Now</button>
</div> </div>
</div> </div>
<div class="control-group" id="field_conpwd">
<label class="control-label" for="conpwd">Confirm Password</label>
<div class="controls">
<input class="" type="password" id="conpwd" name="conpwd" value="" class="form-control"/>
<span class="help-inline" id="help_conpwd"></span>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button class="btn btn-primary" onclick="modJs.changePasswordConfirm();">Change Password</button>
<button class="btn" onclick="modJs.closeChangePassword();">Not Now</button>
</div> </div>
</div> </div>
</div>
</div>
</div><!-- End tabPageBasic --> </div><!-- End tabPageBasic -->
<div class="tab-pane" id="tabPageQualifications" style="border:1px solid #DDD;"> <div class="tab-pane" id="tabPageQualifications" style="border:1px solid #DDD;">
<div class="row" style="margin-top:20px;"> <div class="row" style="margin-top:20px;">
@@ -245,4 +235,4 @@
</div> </div>
</div><!-- End tabPageQualifications --> </div><!-- End tabPageQualifications -->
</div> </div>
</div><!-- End tab-content --> </div><!-- End tab-content -->
+4 -4
View File
@@ -3,17 +3,17 @@
<div class="small-box bg-aqua"> <div class="small-box bg-aqua">
<div class="inner"> <div class="inner">
<h3> <h3>
People <t>People</t>
</h3> </h3>
<p id="numberOfEmployees"> <p id="numberOfEmployees">
#_numberOfEmployees_# Employees #_numberOfEmployees_# <t>Employees</t>
</p> </p>
</div> </div>
<div class="icon"> <div class="icon">
<i class="ion ion-person-stalker"></i> <i class="ion ion-person-stalker"></i>
</div> </div>
<a href="#_moduleLink_#" class="small-box-footer" id="employeeLink"> <a href="#_moduleLink_#" class="small-box-footer" id="employeeLink">
Manage Employees <i class="fa fa-arrow-circle-right"></i> <t>Manage</t> <t>Employees</t> <i class="fa fa-arrow-circle-right"></i>
</a> </a>
</div> </div>
</div> </div>
+16 -16
View File
@@ -11,30 +11,30 @@ $customFields = BaseService::getInstance()->getCustomFields("Employee");
<ul class="nav nav-tabs" id="modTab" style="margin-bottom:0px;margin-left:5px;border-bottom: none;"> <ul class="nav nav-tabs" id="modTab" style="margin-bottom:0px;margin-left:5px;border-bottom: none;">
<?php if($user->user_level != "Admin"){ <?php if($user->user_level != "Admin"){
?> ?>
<li class="active"><a id="tabEmployee" href="#tabPageEmployee">Employees (Direct Reports)</a></li> <li class="active"><a id="tabEmployee" href="#tabPageEmployee"><?=LanguageManager::tran('Employees (Direct Reports)')?></a></li>
<?php }else{ ?> <?php }else{ ?>
<li class="active"><a id="tabEmployee" href="#tabPageEmployee">Employees</a></li> <li class="active"><a id="tabEmployee" href="#tabPageEmployee"><?=LanguageManager::tran('Employees')?></a></li>
<?php }?> <?php }?>
<?php if($user->user_level == "Admin"){ <?php if($user->user_level == "Admin"){
?> ?>
<li><a id="tabEmployeeSkill" href="#tabPageEmployeeSkill">Skills</a></li> <li><a id="tabEmployeeSkill" href="#tabPageEmployeeSkill"><?=LanguageManager::tran('Skills')?></a></li>
<li><a id="tabEmployeeEducation" href="#tabPageEmployeeEducation">Education</a></li> <li><a id="tabEmployeeEducation" href="#tabPageEmployeeEducation"><?=LanguageManager::tran('Education')?></a></li>
<li><a id="tabEmployeeCertification" href="#tabPageEmployeeCertification">Certifications</a></li> <li><a id="tabEmployeeCertification" href="#tabPageEmployeeCertification"><?=LanguageManager::tran('Certifications')?></a></li>
<li><a id="tabEmployeeLanguage" href="#tabPageEmployeeLanguage">Languages</a></li> <li><a id="tabEmployeeLanguage" href="#tabPageEmployeeLanguage"><?=LanguageManager::tran('Languages')?></a></li>
<li><a id="tabEmployeeDependent" href="#tabPageEmployeeDependent">Dependents</a></li> <li><a id="tabEmployeeDependent" href="#tabPageEmployeeDependent"><?=LanguageManager::tran('Dependents')?></a></li>
<li><a id="tabEmergencyContact" href="#tabPageEmergencyContact">Emergency Contacts</a></li> <li><a id="tabEmergencyContact" href="#tabPageEmergencyContact"><?=LanguageManager::tran('Emergency Contacts')?></a></li>
<?php if (!class_exists('DocumentsAdminManager')) {?> <?php if (!class_exists('DocumentsAdminManager')) {?>
<li><a id="tabEmployeeDocument" href="#tabPageEmployeeDocument">Documents</a></li> <li><a id="tabEmployeeDocument" href="#tabPageEmployeeDocument"><?=LanguageManager::tran('Documents')?></a></li>
<?php } ?> <?php } ?>
<?php }?> <?php }?>
<?php if($user->user_level == "Admin"){ <?php if($user->user_level == "Admin"){
?> ?>
<li class="dropdown"> <li class="dropdown">
<a href="#" id="terminatedEmployeeMenu" class="dropdown-toggle" data-toggle="dropdown" aria-controls="terminatedEmployeeMenu-contents">Suspended Employees <span class="caret"></span></a> <a href="#" id="terminatedEmployeeMenu" class="dropdown-toggle" data-toggle="dropdown" aria-controls="terminatedEmployeeMenu-contents"><?=LanguageManager::tran('Deactivated Employees')?> <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu" aria-labelledby="terminatedEmployeeMenu" id="terminatedEmployeeMenu-contents"> <ul class="dropdown-menu" role="menu" aria-labelledby="terminatedEmployeeMenu" id="terminatedEmployeeMenu-contents">
<li><a id="tabTerminatedEmployee" href="#tabPageTerminatedEmployee">Temporarily Suspended Employees</a></li> <li><a id="tabTerminatedEmployee" href="#tabPageTerminatedEmployee"><?=LanguageManager::tran('Temporarily Deactivated Employees')?></a></li>
<li><a id="tabArchivedEmployee" href="#tabPageArchivedEmployee">Terminated Employee Data</a></li> <li><a id="tabArchivedEmployee" href="#tabPageArchivedEmployee"><?=LanguageManager::tran('Terminated Employee Data')?></a></li>
</ul> </ul>
</li> </li>
<?php }?> <?php }?>
@@ -133,7 +133,7 @@ $customFields = BaseService::getInstance()->getCustomFields("Employee");
var modJsList = new Array(); var modJsList = new Array();
<?php if($user->user_level != "Admin"){ <?php if($user->user_level != "Admin"){
?> ?>
modJsList['tabEmployee'] = new EmployeeAdapter('Employee','Employee',{"status":"Active", "supervisor":"__myid__"}); modJsList['tabEmployee'] = new EmployeeAdapter('Employee','Employee',{"status":"Active"});
modJsList['tabEmployee'].setShowAddNew(false); modJsList['tabEmployee'].setShowAddNew(false);
<?php <?php
}else{ }else{
@@ -193,10 +193,10 @@ var modJs = modJsList['tabEmployee'];
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-times"/></button> <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-times"/></button>
<h3 style="font-size: 17px;">Employee Saved Successfully</h3> <h3 style="font-size: 17px;"><?=LanguageManager::tran('Employee Saved Successfully')?></h3>
</div> </div>
<div class="modal-body"> <div class="modal-body">
Employee needs a User to login to IceHrm. Do you want to create a user for this employee now? <br/><br/>You can do this later through Users module if required. <?=LanguageManager::tran('Employee needs a User to login to IceHrm. Do you want to create a user for this employee now?')?> <br/><br/><?=LanguageManager::tran('You can do this later through Users module if required.')?>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button class="btn btn-primary" onclick="modJs.createUser();">Yes</button> <button class="btn btn-primary" onclick="modJs.createUser();">Yes</button>
@@ -207,4 +207,4 @@ var modJs = modJsList['tabEmployee'];
</div> </div>
<?php include APP_BASE_PATH.'footer.php';?> <?php include APP_BASE_PATH.'footer.php';?>
+1 -1
View File
@@ -36,7 +36,7 @@ EmployeeAdapter.method('setFieldNameMap', function(fields) {
if(field.display == "Hidden"){ if(field.display == "Hidden"){
this.hiddenFields[field.name] = field; this.hiddenFields[field.name] = field;
}else{ }else{
if(field.display == "Table and Form"){ if(field.display == "Table and Form" || field.display == "Form"){
this.tableFields[field.name] = field; this.tableFields[field.name] = field;
}else{ }else{
this.formOnlyFields[field.name] = field; this.formOnlyFields[field.name] = field;
@@ -53,5 +53,30 @@ if (!class_exists('CustomField')) {
public function getAnonymousAccess(){ public function getAnonymousAccess(){
return array("get","element"); return array("get","element");
} }
public function validateSave($obj){
$type = $obj->type;
$baseObject = new $type();
$fields = $baseObject->getObjectKeys();
if(isset($fields[$obj->name])){
return new IceResponse(IceResponse::ERROR,"Column name already exists by default");
}
$cf = new CustomField();
if(empty($obj->id)){
$cf->Load("type = ? and name = ?",array($obj->type, $obj->name));
if($cf->name == $obj->name){
return new IceResponse(IceResponse::ERROR,"Another custom field with same name has already been added");
}
}else{
$cf->Load("type = ? and name = ? and id <> ?",array($obj->type, $obj->name, $obj->id));
if($cf->name == $obj->name){
return new IceResponse(IceResponse::ERROR,"Another custom field with same name has already been added");
}
}
return new IceResponse(IceResponse::SUCCESS,"");
}
} }
} }
+5 -10
View File
@@ -15,13 +15,8 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
?><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;">
<li class="dropdown"> <li class="active"><a id="tabEmployeeFieldName" href="#tabPageEmployeeFieldName"><?=LanguageManager::tran('Employee Field Names')?></a></li>
<a href="#" id="settingsEmployeeMenu" class="dropdown-toggle" data-toggle="dropdown" aria-controls="settingsEmployeeMenu-contents">Employee Fields <span class="caret"></span></a> <li><a id="tabEmployeeCustomField" href="#tabPageEmployeeCustomField"><?=LanguageManager::tran('Employee Custom Fields')?></a></li>
<ul class="dropdown-menu" role="menu" aria-labelledby="settingsEmployeeMenu" id="settingsEmployeeMenu-contents">
<li><a id="tabEmployeeFieldName" href="#tabPageEmployeeFieldName">Employee Field Name Mapping</a></li>
<li><a id="tabEmployeeCustomField" href="#tabPageEmployeeCustomField">Employee Custom Fields</a></li>
</ul>
</li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
@@ -51,12 +46,12 @@ modJsList['tabEmployeeFieldName'] = new FieldNameAdapter('FieldNameMapping','Emp
modJsList['tabEmployeeFieldName'].setRemoteTable(true); modJsList['tabEmployeeFieldName'].setRemoteTable(true);
modJsList['tabEmployeeFieldName'].setShowAddNew(false); modJsList['tabEmployeeFieldName'].setShowAddNew(false);
modJsList['tabEmployeeCustomField'] = new CustomFieldAdapter('CustomField','EmployeeCustomField',{"type":"Employee"}); modJsList['tabEmployeeCustomField'] = new CustomFieldAdapter('CustomField','EmployeeCustomField',{"type":"Employee"},"display_order desc");
modJsList['tabEmployeeCustomField'].setRemoteTable(true); modJsList['tabEmployeeCustomField'].setRemoteTable(true);
modJsList['tabEmployeeCustomField'].setShowAddNew(false); modJsList['tabEmployeeCustomField'].setTableType("Employee");
var modJs = modJsList['tabEmployeeFieldName']; var modJs = modJsList['tabEmployeeFieldName'];
</script> </script>
<?php include APP_BASE_PATH.'footer.php';?> <?php include APP_BASE_PATH.'footer.php';?>
+65 -6
View File
@@ -52,6 +52,7 @@ FieldNameAdapter.method('getFormFields', function() {
function CustomFieldAdapter(endPoint,tab,filter,orderBy) { function CustomFieldAdapter(endPoint,tab,filter,orderBy) {
this.initAdapter(endPoint,tab,filter,orderBy); this.initAdapter(endPoint,tab,filter,orderBy);
this.tableType = "";
} }
CustomFieldAdapter.inherits(AdapterBase); CustomFieldAdapter.inherits(AdapterBase);
@@ -62,7 +63,8 @@ CustomFieldAdapter.method('getDataMapping', function() {
return [ return [
"id", "id",
"name", "name",
"display" "display",
"display_order"
]; ];
}); });
@@ -70,17 +72,74 @@ CustomFieldAdapter.method('getHeaders', function() {
return [ return [
{ "sTitle": "ID" ,"bVisible":false}, { "sTitle": "ID" ,"bVisible":false},
{ "sTitle": "Name" }, { "sTitle": "Name" },
{ "sTitle": "Display Status"} { "sTitle": "Display Status"},
{ "sTitle": "Priority"}
]; ];
}); });
CustomFieldAdapter.method('getFormFields', function() { CustomFieldAdapter.method('getFormFields', function() {
return [ return [
[ "id", {"label":"ID","type":"hidden"}], [ "id", {"label":"ID","type":"hidden"}],
[ "type", {"label":"Type","type":"placeholder","validation":""}], //[ "type", {"label":"Type","type":"placeholder","validation":""}],
[ "name", {"label":"Name","type":"placeholder","validation":""}], [ "name", {"label":"Name","type":"text","validation":""}],
[ "data", {"label":"Data","type":"textarea","validation":""}], [ "display", {"label":"Display Status","type":"select","source":[["Form","Show"],["Hidden","Hidden"]]}],
[ "display", {"label":"Display Status","type":"select","source":[["Form","Form"],["Table and Form","Table and Form"],["Hidden","Hidden"]]}] [ "field_type", {"label":"Field Type","type":"select","source":[["text","Text Field"],["textarea","Text Area"],["select","Select"],["select2","Select2"],["select2multi","Multi Select"],["fileupload","File Upload"],["date","Date"],["datetime","Date Time"],["time","Time"]]}],
[ "field_label", {"label":"Field Label","type":"text","validation":""}],
[ "field_validation", {"label":"Validation","type":"select","validation":"none","sort":"none","source":[["","Required"],["none","None"],["number","Number"],["numberOrEmpty","Number or Empty"],["float","Decimal"],["email","Email"],["emailOrEmpty","Email or Empty"]]}],
[ "field_options", {"label":"Field Options","type":"datagroup",
"form":[
[ "label", {"label":"Label","type":"text","validation":""}],
[ "value", {"label":"Value","type":"text","validation":"none"}]
],
"html":'<div id="#_id_#" class="panel panel-default"><div class="panel-body">#_delete_##_edit_#<span style="color:#999;font-size:13px;font-weight:bold">#_label_#</span>:#_value_#</div></div>',
"validation":"none"
}],
[ "display_order", {"label":"Priority","type":"text","validation":"number"}],
[ "display_section", {"label":"Display Section","type":"text","validation":""}]
]; ];
}); });
CustomFieldAdapter.method('setTableType', function(type) {
this.tableType = type;
});
CustomFieldAdapter.method('doCustomValidation', function(params) {
var validateName= function (str) {
var name = /^[a-z][a-z0-9\._]+$/;
return str != null && name.test(str);
};
if(!validateName(params.name)){
return "Invalid name for custom field";
}
return null;
});
CustomFieldAdapter.method('forceInjectValuesBeforeSave', function(params) {
//Build data field
var data = [params.name], options = [], optionsData;
data.push({});
data[1]['label'] = params.field_label;
data[1]['type'] = params.field_type;
data[1]['validation'] = params.field_validation;
if(["select","select2","select2multi"].indexOf(params.field_type) >= 0){
optionsData = JSON.parse(params.field_options);
for(index in optionsData){
options.push([optionsData[index].value, optionsData[index].label]);
}
data[1]['source'] = options;
}
if(params.field_validation == null || params.field_validation == undefined){
params.field_validation = "";
}
params.data = JSON.stringify(data);
params.type = this.tableType;
return params;
});
+4 -5
View File
@@ -20,7 +20,6 @@ along with iCE Hrm. If not, see <http://www.gnu.org/licenses/>.
Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd] 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)
*/ */
$moduleName = 'jobs'; $moduleName = 'jobs';
define('MODULE_PATH',dirname(__FILE__)); define('MODULE_PATH',dirname(__FILE__));
include APP_BASE_PATH.'header.php'; include APP_BASE_PATH.'header.php';
@@ -28,9 +27,9 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
?><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;">
<li class="active"><a id="tabJobTitles" href="#tabPageJobTitles">Job Titles</a></li> <li class="active"><a id="tabJobTitles" href="#tabPageJobTitles"><?=LanguageManager::tran('Job Titles')?></a></li>
<li><a id="tabPayGrades" href="#tabPagePayGrades">Pay Grades</a></li> <li><a id="tabPayGrades" href="#tabPagePayGrades"><?=LanguageManager::tran('Pay Grades')?></a></li>
<li><a id="tabEmploymentStatus" href="#tabPageEmploymentStatus">Employment Status</a></li> <li><a id="tabEmploymentStatus" href="#tabPageEmploymentStatus"><?=LanguageManager::tran('Employment Status')?></a></li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
@@ -71,4 +70,4 @@ modJsList['tabEmploymentStatus'] = new EmploymentStatusAdapter('EmploymentStatus
var modJs = modJsList['tabJobTitles']; var modJs = modJsList['tabJobTitles'];
</script> </script>
<?php include APP_BASE_PATH.'footer.php';?> <?php include APP_BASE_PATH.'footer.php';?>
+3 -3
View File
@@ -28,8 +28,8 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
?><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;">
<li class="active"><a id="tabCompanyLoan" href="#tabPageCompanyLoan">Loan Types</a></li> <li class="active"><a id="tabCompanyLoan" href="#tabPageCompanyLoan"><?=LanguageManager::tran('Loan Types')?></a></li>
<li><a id="tabEmployeeCompanyLoan" href="#tabPageEmployeeCompanyLoan">Employee Loans</a></li> <li><a id="tabEmployeeCompanyLoan" href="#tabPageEmployeeCompanyLoan"><?=LanguageManager::tran('Employee Loans')?></a></li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
@@ -61,4 +61,4 @@ modJsList['tabEmployeeCompanyLoan'] = new EmployeeCompanyLoanAdapter('EmployeeCo
var modJs = modJsList['tabCompanyLoan']; var modJs = modJsList['tabCompanyLoan'];
</script> </script>
<?php include APP_BASE_PATH.'footer.php';?> <?php include APP_BASE_PATH.'footer.php';?>
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"Admin":"fa-cubes", "Admin":"fa-cubes",
"Employees":"fa-users", "Employees":"fa-users",
"Reports":"fa-file-text", "Admin Reports":"fa-file-text",
"System":"fa-cogs", "System":"fa-cogs",
"Payroll":"fa-money" "Payroll":"fa-money"
} }
@@ -52,7 +52,12 @@ if (!class_exists('Country')) {
} }
if(!empty($allowedCountries)){ if(!empty($allowedCountries)){
return parent::Find("id in (".implode(",",$allowedCountries).")" , array()); $res = parent::Find("id in (".implode(",",$allowedCountries).")" , array());
if(empty($res)){
SettingsManager::getInstance()->setSetting('System: Allowed Countries','');
}else{
return $res;
}
} }
return parent::Find($whereOrderBy, $bindarr, $pkeysArr, $extra); return parent::Find($whereOrderBy, $bindarr, $pkeysArr, $extra);
@@ -103,7 +108,12 @@ if (!class_exists('CurrencyType')) {
} }
if(!empty($allowedCountries)){ if(!empty($allowedCountries)){
return parent::Find("id in (".implode(",",$allowedCountries).")" , array()); $res = parent::Find("id in (".implode(",",$allowedCountries).")" , array());
if(empty($res)){
SettingsManager::getInstance()->setSetting('System: Allowed Currencies','');
}else{
return $res;
}
} }
return parent::Find($whereOrderBy, $bindarr, $pkeysArr, $extra); return parent::Find($whereOrderBy, $bindarr, $pkeysArr, $extra);
@@ -136,7 +146,12 @@ if (!class_exists('Nationality')) {
} }
if(!empty($allowedCountries)){ if(!empty($allowedCountries)){
return parent::Find("id in (".implode(",",$allowedCountries).")" , array()); $res = parent::Find("id in (".implode(",",$allowedCountries).")" , array());
if(empty($res)){
SettingsManager::getInstance()->setSetting('System: Allowed Currencies','');
}else{
return $res;
}
} }
return parent::Find($whereOrderBy, $bindarr, $pkeysArr, $extra); return parent::Find($whereOrderBy, $bindarr, $pkeysArr, $extra);
@@ -210,6 +225,42 @@ if (!class_exists('CalculationHook')) {
} }
} }
if (!class_exists('CustomFieldValue')) {
class CustomFieldValue extends ICEHRM_Record {
var $_table = 'CustomFieldValues';
public function getAdminAccess(){
return array("get","element","save","delete");
}
public function getUserAccess(){
return array("get","element","save","delete");
}
public function getAnonymousAccess(){
return array();
}
}
}
if (!class_exists('SupportedLanguage')) {
class SupportedLanguage extends ICEHRM_Record {
var $_table = 'SupportedLanguages';
public function getAdminAccess(){
return array("get","element","save","delete");
}
public function getUserAccess(){
return array();
}
public function getAnonymousAccess(){
return array("get","element");
}
}
}
+2 -2
View File
@@ -28,7 +28,7 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
?><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;">
<li class="active"><a id="tabModule" href="#tabPageModule">Modules</a></li> <li class="active"><a id="tabModule" href="#tabPageModule"><?=LanguageManager::tran('Modules')?></a></li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
@@ -51,4 +51,4 @@ modJsList['tabModule'].setShowAddNew(false);
var modJs = modJsList['tabModule']; var modJs = modJsList['tabModule'];
</script> </script>
<?php include APP_BASE_PATH.'footer.php';?> <?php include APP_BASE_PATH.'footer.php';?>
+4 -4
View File
@@ -3,17 +3,17 @@
<div class="small-box bg-aqua"> <div class="small-box bg-aqua">
<div class="inner"> <div class="inner">
<h3> <h3>
Permission <t>Permission</t>
</h3> </h3>
<p> <p>
Management <t>Management</t>
</p> </p>
</div> </div>
<div class="icon"> <div class="icon">
<i class="ion ion-locked"></i> <i class="ion ion-locked"></i>
</div> </div>
<a href="#_moduleLink_#" class="small-box-footer" id="permissionLink"> <a href="#_moduleLink_#" class="small-box-footer" id="permissionLink">
Manage Permissions <i class="fa fa-arrow-circle-right"></i> <t>Manage</t> <t>Permissions</t> <i class="fa fa-arrow-circle-right"></i>
</a> </a>
</div> </div>
</div> </div>
+2 -2
View File
@@ -28,7 +28,7 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
?><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;">
<li class="active"><a id="tabPermission" href="#tabPagePermission">Permissions</a></li> <li class="active"><a id="tabPermission" href="#tabPagePermission"><?=LanguageManager::tran('Permissions')?></a></li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
@@ -51,4 +51,4 @@ modJsList['tabPermission'].setShowAddNew(false);
var modJs = modJsList['tabPermission']; var modJs = modJsList['tabPermission'];
</script> </script>
<?php include APP_BASE_PATH.'footer.php';?> <?php include APP_BASE_PATH.'footer.php';?>
@@ -69,5 +69,52 @@ if (!class_exists('Project')) {
public function getUserAccess(){ public function getUserAccess(){
return array("get","element"); return array("get","element");
} }
public function getAllProjects(){
$project = new Project();
$projects = $project->Find("status = ?",'Active');
foreach($projects as $project){
$client = new Client();
$client->Load("id = ?",array($project->client));
$project->name = $project->name." (".$client->name.")";
$employeeProjects[] = $project;
}
return $employeeProjects;
}
public function getEmployeeProjects(){
$allowAllProjects = SettingsManager::getInstance()->getSetting("Projects: Make All Projects Available to Employees");
$employeeProjects = array();
if($allowAllProjects == 0){
$employeeProjectsTemp = new EmployeeProject();
$employeeProjectsTemp = $employeeProjectsTemp->Find("employee = ?",array(BaseService::getInstance()->getCurrentProfileId()));
foreach($employeeProjectsTemp as $p){
$project = new Project();
$project->Load("id = ?",array($p->project));
if($project->status == 'Active'){
$client = new Client();
$client->Load("id = ?",array($project->client));
$project->name = $project->name." (".$client->name.")";
$employeeProjects[] = $project;
}
}
}else{
$project = new Project();
$projects = $project->Find("status = ?",array('Active'));
foreach($projects as $project){
$client = new Client();
$client->Load("id = ?",array($project->client));
$project->name = $project->name." (".$client->name.")";
$employeeProjects[] = $project;
}
}
return $employeeProjects;
}
} }
} }
+4 -4
View File
@@ -2,16 +2,16 @@
<div class="small-box bg-red"> <div class="small-box bg-red">
<div class="inner"> <div class="inner">
<h3>Projects</h3> <h3><t>Projects</t></h3>
<p id="numberOfProjects"> <p id="numberOfProjects">
#_numberOfProjects_# Active Projects #_numberOfProjects_# <t>Active Projects</t>
</p> </p>
</div> </div>
<div class="icon"> <div class="icon">
<i class="ion ion-pie-graph"></i> <i class="ion ion-pie-graph"></i>
</div> </div>
<a href="#_moduleLink_#" class="small-box-footer" id="projectsLink"> <a href="#_moduleLink_#" class="small-box-footer" id="projectsLink">
Update Clients/Projects <i class="fa fa-arrow-circle-right"></i> <t>Update Clients/Projects</t> <i class="fa fa-arrow-circle-right"></i>
</a> </a>
</div> </div>
</div> </div>
+4 -4
View File
@@ -28,9 +28,9 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
?><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;">
<li class="active"><a id="tabClient" href="#tabPageClient">Clients</a></li> <li class="active"><a id="tabClient" href="#tabPageClient"><?=LanguageManager::tran('Clients')?></a></li>
<li><a id="tabProject" href="#tabPageProject">Projects</a></li> <li><a id="tabProject" href="#tabPageProject"><?=LanguageManager::tran('Projects')?></a></li>
<li><a id="tabEmployeeProject" href="#tabPageEmployeeProject">Employee Projects</a></li> <li><a id="tabEmployeeProject" href="#tabPageEmployeeProject"><?=LanguageManager::tran('Employee Projects')?></a></li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
@@ -110,4 +110,4 @@ modJsList['tabEmployeeProject'].setShowEdit(false);
var modJs = modJsList['tabClient']; var modJs = modJsList['tabClient'];
</script> </script>
<?php include APP_BASE_PATH.'footer.php';?> <?php include APP_BASE_PATH.'footer.php';?>
+5 -10
View File
@@ -95,13 +95,14 @@ ProjectAdapter.method('getHeaders', function() {
}); });
ProjectAdapter.method('getFormFields', function() { ProjectAdapter.method('getFormFields', function() {
if(this.showSave){ if(this.showSave){
return [ return [
[ "id", {"label":"ID","type":"hidden"}], [ "id", {"label":"ID","type":"hidden"}],
[ "name", {"label":"Name","type":"text"}], [ "name", {"label":"Name","type":"text"}],
[ "client", {"label":"Client","type":"select2","allow-null":true,"remote-source":["Client","id","name"]}], [ "client", {"label":"Client","type":"select2","allow-null":true,"remote-source":["Client","id","name"]}],
[ "details", {"label":"Details","type":"textarea","validation":"none"}], [ "details", {"label":"Details","type":"textarea","validation":"none"}],
[ "status", {"label":"Status","type":"select","source":[["Active","Active"],["Inactive","Inactive"]]}] [ "status", {"label":"Status","type":"select","source":[["Active","Active"],["On Hold","On Hold"],["Completed","Completed"],["Dropped","Dropped"]]}]
]; ];
}else{ }else{
return [ return [
@@ -109,7 +110,7 @@ ProjectAdapter.method('getFormFields', function() {
[ "name", {"label":"Name","type":"placeholder"}], [ "name", {"label":"Name","type":"placeholder"}],
[ "client", {"label":"Client","type":"placeholder","allow-null":true,"remote-source":["Client","id","name"]}], [ "client", {"label":"Client","type":"placeholder","allow-null":true,"remote-source":["Client","id","name"]}],
[ "details", {"label":"Details","type":"placeholder","validation":"none"}], [ "details", {"label":"Details","type":"placeholder","validation":"none"}],
[ "status", {"label":"Status","type":"placeholder","source":[["Active","Active"],["Inactive","Inactive"]]}] [ "status", {"label":"Status","type":"select","source":[["Active","Active"],["On Hold","On Hold"],["Completed","Completed"],["Dropped","Dropped"]]}]
]; ];
} }
@@ -137,8 +138,7 @@ EmployeeProjectAdapter.method('getDataMapping', function() {
return [ return [
"id", "id",
"employee", "employee",
"project", "project"
"status"
]; ];
}); });
@@ -146,9 +146,7 @@ EmployeeProjectAdapter.method('getHeaders', function() {
return [ return [
{ "sTitle": "ID" ,"bVisible":false}, { "sTitle": "ID" ,"bVisible":false},
{ "sTitle": "Employee" }, { "sTitle": "Employee" },
{ "sTitle": "Project" }, { "sTitle": "Project" }
/*{ "sTitle": "Start Date"},*/
{ "sTitle": "Status"}
]; ];
}); });
@@ -157,9 +155,6 @@ EmployeeProjectAdapter.method('getFormFields', function() {
[ "id", {"label":"ID","type":"hidden"}], [ "id", {"label":"ID","type":"hidden"}],
[ "employee", {"label":"Employee","type":"select2","remote-source":["Employee","id","first_name+last_name"]}], [ "employee", {"label":"Employee","type":"select2","remote-source":["Employee","id","first_name+last_name"]}],
[ "project", {"label":"Project","type":"select2","remote-source":["Project","id","name"]}], [ "project", {"label":"Project","type":"select2","remote-source":["Project","id","name"]}],
/*[ "date_start", {"label":"Start Date","type":"date","validation":""}],
[ "date_end", {"label":"End Date","type":"date","validation":"none"}],*/
[ "status", {"label":"Status","type":"select","source":[["Current","Current"],["Inactive","Inactive"],["Completed","Completed"]]}],
[ "details", {"label":"Details","type":"textarea","validation":"none"}] [ "details", {"label":"Details","type":"textarea","validation":"none"}]
]; ];
}); });
+7 -7
View File
@@ -28,10 +28,10 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
?><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;">
<li class="active"><a id="tabSkill" href="#tabPageSkill">Skills</a></li> <li class="active"><a id="tabSkill" href="#tabPageSkill"><?=LanguageManager::tran('Skills')?></a></li>
<li><a id="tabEducation" href="#tabPageEducation">Education</a></li> <li><a id="tabEducation" href="#tabPageEducation"><?=LanguageManager::tran('Education')?></a></li>
<li><a id="tabCertification" href="#tabPageCertification">Certifications</a></li> <li><a id="tabCertification" href="#tabPageCertification"><?=LanguageManager::tran('Certifications')?></a></li>
<li><a id="tabLanguage" href="#tabPageLanguage">Languages</a></li> <li><a id="tabLanguage" href="#tabPageLanguage"><?=LanguageManager::tran('Languages')?></a></li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
@@ -61,10 +61,10 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
</div> </div>
<div class="tab-pane" id="tabPageLanguage"> <div class="tab-pane" id="tabPageLanguage">
<div id="Language" class="reviewBlock" data-content="List" style="padding-left:5px;"> <div id="Language" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div> </div>
<div id="LanguageForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;"> <div id="LanguageForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div> </div>
</div> </div>
</div> </div>
@@ -124,4 +124,4 @@ modJsList['tabLanguage'].setShowEdit(false);
var modJs = modJsList['tabSkill']; var modJs = modJsList['tabSkill'];
</script> </script>
<?php include APP_BASE_PATH.'footer.php';?> <?php include APP_BASE_PATH.'footer.php';?>
+4 -4
View File
@@ -2,16 +2,16 @@
<div class="small-box bg-teal"> <div class="small-box bg-teal">
<div class="inner"> <div class="inner">
<h3>Reports</h3> <h3><t>Reports</t></h3>
<p> <p>
View / Download Reports <t>View / Download Reports</t>
</p> </p>
</div> </div>
<div class="icon"> <div class="icon">
<i class="ion ion-document-text"></i> <i class="ion ion-document-text"></i>
</div> </div>
<a href="#_moduleLink_#" class="small-box-footer" id="reportsLink"> <a href="#_moduleLink_#" class="small-box-footer" id="reportsLink">
Create a Report <i class="fa fa-arrow-circle-right"></i> <t>Generate a Report</t> <i class="fa fa-arrow-circle-right"></i>
</a> </a>
</div> </div>
</div> </div>
+3 -6
View File
@@ -7,7 +7,7 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
?><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;">
<li class="active"><a id="tabReport" href="#tabPageReport">Reports</a></li> <li class="active"><a id="tabReport" href="#tabPageReport"><?=LanguageManager::tran('Reports')?></a></li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
@@ -30,12 +30,9 @@ modJsList['tabReport'] = new ReportAdapter('Report','Report','','report_group');
modJsList['tabReport'].setShowAddNew(false); modJsList['tabReport'].setShowAddNew(false);
modJsList['tabReport'].setRemoteTable(true); modJsList['tabReport'].setRemoteTable(true);
/*
modJsList['tabReport'] = new ReportGenAdapter('File','File','{"file_group":"Report"}','group');
modJsList['tabReport'].setShowAddNew(false);
*/
var modJs = modJsList['tabReport']; var modJs = modJsList['tabReport'];
</script> </script>
<?php include APP_BASE_PATH.'footer.php';?> <?php include APP_BASE_PATH.'footer.php';?>
+240 -48
View File
@@ -10,15 +10,20 @@
function ReportAdapter(endPoint,tab,filter,orderBy) { function ReportAdapter(endPoint,tab,filter,orderBy) {
this.initAdapter(endPoint,tab,filter,orderBy); this.initAdapter(endPoint,tab,filter,orderBy);
this._formFileds = [ this._construct();
[ "id", {"label":"ID","type":"hidden"}],
[ "name", {"label":"Name","type":"label","validation":""}],
[ "parameters", {"label":"Parameters","type":"fieldset","validation":"none"}]
];
} }
ReportAdapter.inherits(AdapterBase); ReportAdapter.inherits(AdapterBase);
ReportAdapter.method('_construct', function() {
this._formFileds = [
[ "id", {"label":"ID","type":"hidden"}],
[ "name", {"label":"Name","type":"label","validation":""}],
[ "parameters", {"label":"Parameters","type":"fieldset","validation":"none"}]
];
this.remoteFieldsExists = false;
});
ReportAdapter.method('_initLocalFormFields', function() { ReportAdapter.method('_initLocalFormFields', function() {
this._formFileds = [ this._formFileds = [
[ "id", {"label":"ID","type":"hidden"}], [ "id", {"label":"ID","type":"hidden"}],
@@ -27,9 +32,14 @@ ReportAdapter.method('_initLocalFormFields', function() {
]; ];
}); });
ReportAdapter.method('setRemoteFieldExists', function(val) {
this.remoteFieldsExists = val;
});
ReportAdapter.method('getDataMapping', function() { ReportAdapter.method('getDataMapping', function() {
return [ return [
"id", "id",
"icon",
"name", "name",
"details", "details",
"parameters" "parameters"
@@ -39,12 +49,14 @@ ReportAdapter.method('getDataMapping', function() {
ReportAdapter.method('getHeaders', function() { ReportAdapter.method('getHeaders', function() {
return [ return [
{ "sTitle": "ID" ,"bVisible":false}, { "sTitle": "ID" ,"bVisible":false},
{ "sTitle": "Name" }, { "sTitle": "","bSortable":false,"sWidth":"22px"},
{ "sTitle": "Name","sWidth":"30%"},
{ "sTitle": "Details"}, { "sTitle": "Details"},
{ "sTitle": "Parameters","bVisible":false}, { "sTitle": "Parameters","bVisible":false},
]; ];
}); });
ReportAdapter.method('getFormFields', function() { ReportAdapter.method('getFormFields', function() {
return this._formFileds; return this._formFileds;
}); });
@@ -55,12 +67,16 @@ ReportAdapter.method('processFormFieldsWithObject', function(object) {
var len = this._formFileds.length; var len = this._formFileds.length;
var fieldIDsToDelete = []; var fieldIDsToDelete = [];
var fieldsToDelete = []; var fieldsToDelete = [];
this.remoteFieldsExists = false;
for(var i=0;i<len;i++){ for(var i=0;i<len;i++){
if(this._formFileds[i][1]['type']=="fieldset"){ if(this._formFileds[i][1]['type']=="fieldset"){
var newFields = JSON.parse(object[this._formFileds[i][0]]); var newFields = JSON.parse(object[this._formFileds[i][0]]);
fieldsToDelete.push(this._formFileds[i][0]); fieldsToDelete.push(this._formFileds[i][0]);
newFields.forEach(function(entry) { newFields.forEach(function(entry) {
that._formFileds.push(entry); that._formFileds.push(entry);
if(entry[1]['remote-source'] != undefined && entry[1]['remote-source'] != null){
that.remoteFieldsExists = true;
}
}); });
} }
@@ -76,14 +92,179 @@ ReportAdapter.method('processFormFieldsWithObject', function(object) {
that._formFileds = tempArray; that._formFileds = tempArray;
}); });
ReportAdapter.method('renderForm', function(object) { ReportAdapter.method('renderForm', function(object) {
var that = this; var that = this;
this.processFormFieldsWithObject(object); this.processFormFieldsWithObject(object);
var cb = function(){ if(this.remoteFieldsExists){
that.uber('renderForm',object); var cb = function(){
}; that.renderFormNew(object);
this.initFieldMasterData(cb); };
this.initFieldMasterData(cb);
}else{
this.initFieldMasterData();
that.renderFormNew(object);
}
this.currentReport = object;
});
ReportAdapter.method('renderFormNew', function(object) {
var that = this;
var signatureIds = [];
if(object == null || object == undefined){
this.currentId = null;
}
this.preRenderForm(object);
var formHtml = this.templates['formTemplate'];
var html = "";
var fields = this.getFormFields();
for(var i=0;i<fields.length;i++){
var metaField = this.getMetaFieldForRendering(fields[i][0]);
if(metaField == "" || metaField == undefined){
html += this.renderFormField(fields[i]);
}else{
var metaVal = object[metaField];
if(metaVal != '' && metaVal != null && metaVal != undefined && metaVal.trim() != ''){
html += this.renderFormField(JSON.parse(metaVal));
}else{
html += this.renderFormField(fields[i]);
}
}
}
formHtml = formHtml.replace(/_id_/g,this.getTableName()+"_submit");
formHtml = formHtml.replace(/_fields_/g,html);
var $tempDomObj;
var randomFormId = this.generateRandom(14);
if(!this.showFormOnPopup){
$tempDomObj = $("#"+this.getTableName()+'Form');
}else{
$tempDomObj = $('<div class="reviewBlock popupForm" data-content="Form"></div>');
$tempDomObj.attr('id',randomFormId);
}
$tempDomObj.html(formHtml);
$tempDomObj.find('.datefield').datepicker({'viewMode':2});
$tempDomObj.find('.timefield').datetimepicker({
language: 'en',
pickDate: false
});
$tempDomObj.find('.datetimefield').datetimepicker({
language: 'en'
});
$tempDomObj.find('.colorpick').colorpicker();
//$tempDomObj.find('.select2Field').select2();
$tempDomObj.find('.select2Field').each(function() {
$(this).select2().select2('val', $(this).find("option:eq(0)").val());
});
$tempDomObj.find('.select2Multi').each(function() {
$(this).select2().on("change",function(e){
var parentRow = $(this).parents(".row");
var height = parentRow.find(".select2-choices").height();
parentRow.height(parseInt(height));
});
});
$tempDomObj.find('.signatureField').each(function() {
//$(this).data('signaturePad',new SignaturePad($(this)));
signatureIds.push($(this).attr('id'));
});
for(var i=0;i<fields.length;i++){
if(fields[i][1].type == "datagroup"){
$tempDomObj.find("#"+fields[i][0]).data('field',fields[i]);
}
}
if(this.showSave == false){
$tempDomObj.find('.saveBtn').remove();
}else{
$tempDomObj.find('.saveBtn').off();
$tempDomObj.find('.saveBtn').data("modJs",this);
$tempDomObj.find('.saveBtn').on( "click", function() {
if($(this ).data('modJs').saveSuccessItemCallback != null && $(this ).data('modJs').saveSuccessItemCallback!= undefined){
$(this ).data('modJs').save($(this ).data('modJs').retriveItemsAfterSave(), $(this ).data('modJs').saveSuccessItemCallback);
}else{
$(this ).data('modJs').save();
}
return false;
});
}
if(this.showCancel== false){
$tempDomObj.find('.cancelBtn').remove();
}else{
$tempDomObj.find('.cancelBtn').off();
$tempDomObj.find('.cancelBtn').data("modJs",this);
$tempDomObj.find('.cancelBtn').on( "click", function() {
$(this ).data('modJs').cancel();
return false;
});
}
if(!this.showFormOnPopup){
$("#"+this.getTableName()+'Form').show();
$("#"+this.getTableName()).hide();
for(var i=0;i<signatureIds.length;i++){
$("#"+signatureIds[i])
.data('signaturePad',
new SignaturePad(document.getElementById(signatureIds[i])));
}
if(object != undefined && object != null){
this.fillForm(object);
}
}else{
//var tHtml = $tempDomObj.wrap('<div>').parent().html();
//this.showMessage("Edit",tHtml,null,null,true);
this.showMessage("Edit","",null,null,true);
$("#plainMessageModel .modal-body").html("");
$("#plainMessageModel .modal-body").append($tempDomObj);
for(var i=0;i<signatureIds.length;i++){
$("#"+signatureIds[i])
.data('signaturePad',
new SignaturePad(document.getElementById(signatureIds[i])));
}
if(object != undefined && object != null){
this.fillForm(object,"#"+randomFormId);
}
}
this.postRenderForm(object,$tempDomObj);
}); });
ReportAdapter.method('getActionButtonsHtml', function(id,data) { ReportAdapter.method('getActionButtonsHtml', function(id,data) {
@@ -94,40 +275,48 @@ ReportAdapter.method('getActionButtonsHtml', function(id,data) {
}); });
ReportAdapter.method('addSuccessCallBack', function(callBackData,serverData) { ReportAdapter.method('addSuccessCallBack', function(callBackData,serverData) {
//var link = '<a href="'+this.getCustomActionUrl("download",{'file':serverData})+'" target="_blank">Download Report <i class="icon-download-alt"></i> </a>';
//this.showMessage("Download Report",link);
var fileName = serverData[0]; var fileName = serverData[0];
var link; var link;
if(fileName.indexOf("https:") == 0){ if(fileName.indexOf("https:") == 0){
link = '<a href="'+fileName+'" target="_blank" style="font-size:14px;font-weight:bold;">Download Report <img src="_BASE_images/download.png"></img> </a>'; link = '<a href="'+fileName+'" target="_blank" style="font-size:14px;font-weight:bold;">Download Report <img src="_BASE_images/download.png"></img> </a>';
}else{ }else{
link = '<a href="'+modJs.getCustomActionUrl("download",{'file':fileName})+'" target="_blank" style="font-size:14px;font-weight:bold;">Download Report <img src="_BASE_images/download.png"></img> </a>'; link = '<a href="'+modJs.getCustomActionUrl("download",{'file':fileName})+'" target="_blank" style="font-size:14px;font-weight:bold;">Download Report <img src="_BASE_images/download.png"></img> </a>';
} }
link = link.replace(/_BASE_/g,this.baseUrl); link = link.replace(/_BASE_/g,this.baseUrl);
var tableHtml = link+'<br/><br/><div class="box-body table-responsive" style="overflow-x:scroll;padding: 5px;border: solid 1px #DDD;"><table id="tempReportTable" cellpadding="0" cellspacing="0" border="0" class="table table-bordered table-striped"></table></div>'; if(this.currentReport.output == "PDF"){
//Delete existing temp report table this.showMessage("Download Report",link);
$("#tempReportTable").remove();
}else{
//this.showMessage("Report",tableHtml); if(serverData[1].length == 0){
this.showMessage("Empty Report","There were no data for selected filters");
$("#Report").html(tableHtml); return;
$("#Report").show(); }
$("#ReportForm").hide();
//Prepare headers var tableHtml = link+'<br/><br/><div class="box-body table-responsive" style="overflow-x:scroll;padding: 5px;border: solid 1px #DDD;"><table id="tempReportTable" cellpadding="0" cellspacing="0" border="0" class="table table-bordered table-striped"></table></div>';
var headers = [];
for(title in serverData[1]){ //Delete existing temp report table
headers.push({ "sTitle": serverData[1][title]}); $("#tempReportTable").remove();
}
//this.showMessage("Report",tableHtml);
var data = serverData[2];
$("#"+this.table).html(tableHtml);
$("#"+this.table).show();
var dataTableParams = { $("#"+this.table+"Form").hide();
//Prepare headers
var headers = [];
for(title in serverData[1]){
headers.push({ "sTitle": serverData[1][title]});
}
var data = serverData[2];
var dataTableParams = {
"oLanguage": { "oLanguage": {
"sLengthMenu": "_MENU_ records per page" "sLengthMenu": "_MENU_ records per page"
}, },
@@ -137,17 +326,21 @@ ReportAdapter.method('addSuccessCallBack', function(callBackData,serverData) {
"iDisplayLength": 15, "iDisplayLength": 15,
"iDisplayStart": 0 "iDisplayStart": 0
}; };
$("#tempReportTable").dataTable( dataTableParams ); $("#tempReportTable").dataTable( dataTableParams );
$(".dataTables_paginate ul").addClass("pagination"); $(".dataTables_paginate ul").addClass("pagination");
$(".dataTables_length").hide(); $(".dataTables_length").hide();
$(".dataTables_filter input").addClass("form-control"); $(".dataTables_filter input").addClass("form-control");
$(".dataTables_filter input").attr("placeholder","Search"); $(".dataTables_filter input").attr("placeholder","Search");
$(".dataTables_filter label").contents().filter(function(){ $(".dataTables_filter label").contents().filter(function(){
return (this.nodeType == 3); return (this.nodeType == 3);
}).remove(); }).remove();
$('.tableActionButton').tooltip(); $('.tableActionButton').tooltip();
}
}); });
@@ -201,4 +394,3 @@ ReportGenAdapter.method('getActionButtonsHtml', function(id,data) {
html = html.replace(/_BASE_/g,this.baseUrl); html = html.replace(/_BASE_/g,this.baseUrl);
return html; return html;
}); });
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"label":"Reports", "label":"Reports",
"menu":"Reports", "menu":"Admin Reports",
"order":"1", "order":"1",
"icon":"fa-file-o", "icon":"fa-file-o",
"user_levels":["Admin","Manager"], "user_levels":["Admin","Manager"],
@@ -2,7 +2,7 @@
if(!class_exists('ReportBuilder')){ if(!class_exists('ReportBuilder')){
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilder.php'; include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilder.php';
} }
class ActiveEmployeeReport extends ReportBuilder{ class ActiveEmployeeReport extends CSVReportBuilder implements CSVReportBuilderInterface{
public function getMainQuery(){ public function getMainQuery(){
$query = "Select id, employee_id as 'Employee ID', $query = "Select id, employee_id as 'Employee ID',
@@ -2,7 +2,7 @@
if(!class_exists('ReportBuilder')){ if(!class_exists('ReportBuilder')){
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilder.php'; include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilder.php';
} }
class EmployeeAttendanceReport extends ReportBuilder{ class EmployeeAttendanceReport extends CSVReportBuilder implements CSVReportBuilderInterface{
public function getMainQuery(){ public function getMainQuery(){
$query = "SELECT $query = "SELECT
@@ -1,4 +1,7 @@
<?php <?php
if(!class_exists('ReportBuilder')){
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilder.php';
}
if(!interface_exists('ReportBuilderInterface')){ if(!interface_exists('ReportBuilderInterface')){
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilderInterface.php'; include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilderInterface.php';
} }
@@ -6,7 +9,7 @@ if(!interface_exists('ReportBuilderInterface')){
if(!class_exists('LeavesActionManager')){ if(!class_exists('LeavesActionManager')){
include_once APP_BASE_PATH.'modules/leaves/api/LeavesActionManager.php'; include_once APP_BASE_PATH.'modules/leaves/api/LeavesActionManager.php';
} }
class EmployeeLeaveEntitlementReport implements ReportBuilderInterface{ class EmployeeLeaveEntitlementReport extends ClassBasedReportBuilder implements ReportBuilderInterface{
public function getData($report,$req){ public function getData($report,$req){
$leaveActionManager = new LeavesActionManager(); $leaveActionManager = new LeavesActionManager();
@@ -2,7 +2,7 @@
if(!class_exists('ReportBuilder')){ if(!class_exists('ReportBuilder')){
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilder.php'; include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilder.php';
} }
class EmployeeLeavesReport extends ReportBuilder{ class EmployeeLeavesReport extends CSVReportBuilder implements CSVReportBuilderInterface{
public function getMainQuery(){ public function getMainQuery(){
$query = "SELECT $query = "SELECT
@@ -1,10 +1,12 @@
<?php <?php
if(!class_exists('ReportBuilder')){
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilder.php';
}
if(!interface_exists('ReportBuilderInterface')){ if(!interface_exists('ReportBuilderInterface')){
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilderInterface.php'; include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilderInterface.php';
} }
class EmployeeTimeSheetData implements ReportBuilderInterface{ class EmployeeTimeSheetData extends ClassBasedReportBuilder implements ReportBuilderInterface{
public function getData($report,$request){ public function getData($report,$request){
$employeeCache = array(); $employeeCache = array();
@@ -1,8 +1,11 @@
<?php <?php
if(!class_exists('ReportBuilder')){
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilder.php';
}
if(!interface_exists('ReportBuilderInterface')){ if(!interface_exists('ReportBuilderInterface')){
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilderInterface.php'; include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilderInterface.php';
} }
class EmployeeTimeTrackReport implements ReportBuilderInterface{ class EmployeeTimeTrackReport extends ClassBasedReportBuilder implements ReportBuilderInterface{
public function getData($report,$req){ public function getData($report,$req){
LogManager::getInstance()->info(json_encode($report)); LogManager::getInstance()->info(json_encode($report));
@@ -2,7 +2,7 @@
if(!class_exists('ReportBuilder')){ if(!class_exists('ReportBuilder')){
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilder.php'; include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilder.php';
} }
class EmployeeTimesheetReport extends ReportBuilder{ class EmployeeTimesheetReport extends CSVReportBuilder implements CSVReportBuilderInterface{
public function getMainQuery(){ public function getMainQuery(){
$query = "SELECT $query = "SELECT
@@ -28,34 +28,58 @@ FROM EmployeeTimeEntry te";
if(in_array("NULL", $employeeList) ){ if(in_array("NULL", $employeeList) ){
$employeeList = array(); $employeeList = array();
} }
if(($request['client'] != "NULL" && !empty($request['client']))) {
if(!empty($employeeList) && ($request['project'] != "NULL" && !empty($request['project']))){
$query = "where employee in (".implode(",", $employeeList).") and date_start >= ? and date_end <= ? and project = ?;"; $project = new Project();
$params = array( $projects = $project->Find("client = ?",array($request['client']));
$request['date_start'], $projectIds = array();
$request['date_end'], foreach($projects as $project){
$request['project'] $projectIds[] = $project->id;
); }
}else if(!empty($employeeList)){
$query = "where employee in (".implode(",", $employeeList).") and date_start >= ? and date_end <= ?;"; if (!empty($employeeList) && ($request['project'] != "NULL" && !empty($request['project']))) {
$params = array( $query = "where employee in (" . implode(",", $employeeList) . ") and date_start >= ? and date_end <= ? and project in (".implode(",",$projectIds).");";
$params = array(
$request['date_start'], $request['date_start'],
$request['date_end'] $request['date_end']
); );
}else if(($request['project'] != "NULL" && !empty($request['project']))){ } else {
$query = "where project = ? and date_start >= ? and date_end <= ?;"; $query = "where date_start >= ? and date_end <= ? and project in (".implode(",",$projectIds).");";
$params = array( $params = array(
$request['date_start'],
$request['date_end']
);
}
}else{
if (!empty($employeeList) && ($request['project'] != "NULL" && !empty($request['project']))) {
$query = "where employee in (" . implode(",", $employeeList) . ") and date_start >= ? and date_end <= ? and project = ?;";
$params = array(
$request['date_start'],
$request['date_end'],
$request['project']
);
} 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['project'] != "NULL" && !empty($request['project']))) {
$query = "where project = ? and date_start >= ? and date_end <= ?;";
$params = array(
$request['project'], $request['project'],
$request['date_start'], $request['date_start'],
$request['date_end'] $request['date_end']
); );
}else{ } else {
$query = "where date_start >= ? and date_end <= ?;"; $query = "where date_start >= ? and date_end <= ?;";
$params = array( $params = array(
$request['date_start'], $request['date_start'],
$request['date_end'] $request['date_end']
); );
}
} }
LogManager::getInstance()->info("Query:".$query); LogManager::getInstance()->info("Query:".$query);
@@ -2,7 +2,10 @@
if(!class_exists('ReportBuilder')){ if(!class_exists('ReportBuilder')){
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilder.php'; include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilder.php';
} }
class ExpenseReport extends ReportBuilder{ if(!class_exists('ReportBuilder')){
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilder.php';
}
class ExpenseReport extends CSVReportBuilder implements CSVReportBuilderInterface{
public function getMainQuery(){ public function getMainQuery(){
$query = "SELECT $query = "SELECT
@@ -1,4 +1,7 @@
<?php <?php
if(!class_exists('ReportBuilder')){
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilder.php';
}
if(!interface_exists('ReportBuilderInterface')){ if(!interface_exists('ReportBuilderInterface')){
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilderInterface.php'; include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilderInterface.php';
} }
@@ -6,7 +9,7 @@ if(!interface_exists('ReportBuilderInterface')){
if(!class_exists('AttendanceAdminManager')){ if(!class_exists('AttendanceAdminManager')){
include_once APP_BASE_PATH.'admin/attendance/api/AttendanceAdminManager.php'; include_once APP_BASE_PATH.'admin/attendance/api/AttendanceAdminManager.php';
} }
class OvertimeReport implements ReportBuilderInterface{ class OvertimeReport extends ClassBasedReportBuilder implements ReportBuilderInterface{
public function getData($report,$request){ public function getData($report,$request){
$employeeList = array(); $employeeList = array();
+165 -14
View File
@@ -2,15 +2,8 @@
if(!interface_exists('ReportBuilderInterface')){ if(!interface_exists('ReportBuilderInterface')){
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilderInterface.php'; include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilderInterface.php';
} }
abstract class ReportBuilder implements ReportBuilderInterface{ abstract class ReportBuilder{
public function getData($report,$request){
$query = $this->getMainQuery();
$where = $this->getWhereQuery($request);
$query.=" ".$where[0];
return $this->execute($report, $query, $where[1]);
}
protected function execute($report, $query, $parameters){ protected function execute($report, $query, $parameters){
$report->DB()->SetFetchMode(ADODB_FETCH_ASSOC); $report->DB()->SetFetchMode(ADODB_FETCH_ASSOC);
LogManager::getInstance()->debug("Query: ".$query); LogManager::getInstance()->debug("Query: ".$query);
@@ -46,12 +39,170 @@ abstract class ReportBuilder implements ReportBuilderInterface{
return $reportData; return $reportData;
} }
abstract public function getWhereQuery($request);
abstract public function getMainQuery();
public function transformData($name, $value){ public function transformData($name, $value){
return $value; return $value;
} }
}
public function createReportFile($report, $data){
$fileFirstPart = "Report_".str_replace(" ", "_", $report->name)."-".date("Y-m-d_H-i-s");
$fileName = $fileFirstPart.".csv";
$fileFullName = CLIENT_BASE_PATH.'data/'.$fileName;
$fp = fopen($fileFullName, 'w');
foreach ($data as $fields) {
fputcsv($fp, $fields);
}
fclose($fp);
return array($fileFirstPart, $fileName, $fileFullName);
}
public function saveFile($fileFirstPart, $file, $fileFullName){
$uploadedToS3 = false;
$uploadFilesToS3 = SettingsManager::getInstance()->getSetting("Files: Upload Files to S3");
$uploadFilesToS3Key = SettingsManager::getInstance()->getSetting("Files: Amazon S3 Key for File Upload");
$uploadFilesToS3Secret = SettingsManager::getInstance()->getSetting("Files: Amazone S3 Secret for File Upload");
$s3Bucket = SettingsManager::getInstance()->getSetting("Files: S3 Bucket");
$s3WebUrl = SettingsManager::getInstance()->getSetting("Files: S3 Web Url");
if($uploadFilesToS3.'' == '1' && !empty($uploadFilesToS3Key)
&& !empty($uploadFilesToS3Secret) && !empty($s3Bucket) && !empty($s3WebUrl)){
$uploadname = CLIENT_NAME."/".$file;
$s3FileSys = new S3FileSystem($uploadFilesToS3Key, $uploadFilesToS3Secret);
$res = $s3FileSys->putObject($s3Bucket, $uploadname, $fileFullName, 'authenticated-read');
if(empty($res)){
return array("ERROR",$file);
}
unlink($fileFullName);
$file_url = $s3WebUrl.$uploadname;
$file_url = $s3FileSys->generateExpiringURL($file_url);
$uploadedToS3 = true;
}
$fileObj = new File();
$fileObj->name = $fileFirstPart;
$fileObj->filename = $file;
$fileObj->file_group = "Report";
$ok = $fileObj->Save();
if(!$ok){
LogManager::getInstance()->info($fileObj->ErrorMsg());
return array("ERROR","Error generating report");
}
$reportFile = new ReportFile();
$reportFile->name = $fileObj->filename;
$reportFile->attachment = $fileObj->name;
$reportFile->created = date("Y-m-d H:i:s");
$reportFile->employee = BaseService::getInstance()->getCurrentProfileId();
$ok = $reportFile->Save();
if(!$ok){
LogManager::getInstance()->info($reportFile->ErrorMsg());
return array("ERROR","Error generating report");
}
if($uploadedToS3){
return array("SUCCESS",$file_url);
}else{
return array("SUCCESS",$file);
}
}
}
class CSVReportBuilder extends ReportBuilder{
public function getData($report,$request){
$query = $this->getMainQuery();
$where = $this->getWhereQuery($request);
if($query == null || $where == null){
return null;
}
$query.=" ".$where[0];
return $this->execute($report, $query, $where[1]);
}
}
class ClassBasedReportBuilder extends ReportBuilder{
}
class PDFReportBuilder extends ReportBuilder{
var $twig;
protected function getDefaultData(){
$defaultData = array();
$defaultData['BASE_URL'] = BASE_URL;
$defaultData['LOGO'] = UIManager::getInstance()->getCompanyLogoUrl();
$defaultData['LOGO'] = str_replace("https:","http:",$defaultData['LOGO']);
$defaultData['companyName'] = SettingsManager::getInstance()->getSetting("Company: Name");
LogManager::getInstance()->debug("Logo Url:".$defaultData['LOGO']);
return $defaultData;
}
protected function initTemplateEngine($report){
if($report->_table = "UserReports"){
$path = APP_BASE_PATH."modules/reports/customTemplates/";
}else{
$path = APP_BASE_PATH."admin/reports/customTemplates/";
}
$loader = new Twig_Loader_Filesystem($path);
$twigOptions = array();
//false
if(defined('CACHE_THEME') && CACHE_THEME){
$twigOptions = array(
);
}else{
$twigOptions = array(
"cache"=>false
);
}
$this->twig = new Twig_Environment($loader, $twigOptions);
}
public function createReportFile($report, $data){
$fileFirstPart = "Report_".str_replace(" ", "_", $report->name)."-".date("Y-m-d_H-i-s");
$fileName = $fileFirstPart.".html";
$fileFullName = CLIENT_BASE_PATH.'data/'.$fileName;
$this->initTemplateEngine($report);
$template = $this->twig->loadTemplate($this->getTemplate());
$result = $template->render($data);
$fp = fopen($fileFullName, 'w');
fwrite($fp,$result);
fclose($fp);
try{
$fileFullNamePdf = CLIENT_BASE_PATH.'data/'.$fileFirstPart.".pdf";
//Try generating the pdf
exec(WK_HTML_PATH." ".$fileFullName." ".$fileFullNamePdf, $output, $ret);
LogManager::getInstance()->debug("wkhtmltopdf:".print_r($output,true));
LogManager::getInstance()->debug("wkhtmltopdf:".print_r($ret,true));
if(file_exists($fileFullNamePdf)){
$fileName = $fileFirstPart.".pdf";
$fileFullName = $fileFullNamePdf;
}
}catch(Exception $exp){
}
return array($fileFirstPart, $fileName, $fileFullName);
}
}
@@ -1,4 +1,18 @@
<?php <?php
interface ReportBuilderInterface{ interface ReportBuilderInterface{
public function getData($report,$request); public function getData($report,$request);
public function createReportFile($report, $data);
}
interface CSVReportBuilderInterface{
public function getData($report,$request);
public function createReportFile($report, $data);
public function getMainQuery();
public function getWhereQuery($request);
}
interface PDFReportBuilderInterface{
public function getData($report,$request);
public function createReportFile($report, $data);
public function getTemplate();
} }
@@ -2,7 +2,7 @@
if(!class_exists('ReportBuilder')){ if(!class_exists('ReportBuilder')){
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilder.php'; include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilder.php';
} }
class TravelRequestReport extends ReportBuilder{ class TravelRequestReport extends CSVReportBuilder implements CSVReportBuilderInterface{
public function getMainQuery(){ public function getMainQuery(){
$query = "SELECT $query = "SELECT
@@ -7,8 +7,8 @@
_fields_ _fields_
<div class="control-group"> <div class="control-group">
<div class="controls"> <div class="controls">
<button onclick="try{modJs.save()}catch(e){};return false;" class="btn">Download</button> <button onclick="try{modJs.save()}catch(e){};return false;" class="btn"><t>Download</t></button>
<button onclick="modJs.cancel();return false;" class="btn">Cancel</button> <button onclick="modJs.cancel();return false;" class="btn"><t>Cancel</t></button>
</div> </div>
</div> </div>
</form> </form>
+34 -17
View File
@@ -1,26 +1,26 @@
<?php <?php
if (!class_exists('SalaryAdminManager')) { if (!class_exists('SalaryAdminManager')) {
class SalaryAdminManager extends AbstractModuleManager{ class SalaryAdminManager extends AbstractModuleManager{
public function initializeUserClasses(){
}
public function initializeFieldMappings(){
}
public function initializeDatabaseErrorMappings(){
public function initializeUserClasses(){ }
} public function setupModuleClassDefinitions(){
public function initializeFieldMappings(){
}
public function initializeDatabaseErrorMappings(){
}
public function setupModuleClassDefinitions(){
$this->addModelClass('SalaryComponentType'); $this->addModelClass('SalaryComponentType');
$this->addModelClass('SalaryComponent'); $this->addModelClass('SalaryComponent');
$this->addModelClass('PayrollEmployee'); $this->addModelClass('PayrollEmployee');
} }
} }
} }
if (!class_exists('SalaryComponentType')) { if (!class_exists('SalaryComponentType')) {
@@ -66,3 +66,20 @@ if (!class_exists('PayrollEmployee')) {
} }
} }
if (!class_exists('PayFrequency')) {
class PayFrequency extends ICEHRM_Record {
var $_table = 'PayFrequency';
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");
}
}
}
+1 -1
View File
@@ -3,7 +3,7 @@
$moduleName = 'salary'; $moduleName = 'salary';
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.'mod-houlejslibs.inc.php'; include APP_BASE_PATH.'modulejslibs.inc.php';
$moduleBuilder = new ModuleBuilder(); $moduleBuilder = new ModuleBuilder();
-196
View File
@@ -79,162 +79,6 @@ SalaryComponentAdapter.method('getFormFields', function() {
}); });
/**
* DeductionAdapter
*/
function DeductionAdapter(endPoint,tab,filter,orderBy) {
this.initAdapter(endPoint,tab,filter,orderBy);
}
DeductionAdapter.inherits(AdapterBase);
DeductionAdapter.method('getDataMapping', function() {
return [
"id",
"name",
"deduction_group"
];
});
DeductionAdapter.method('getHeaders', function() {
return [
{ "sTitle": "ID" ,"bVisible":false},
{ "sTitle": "Name" },
{ "sTitle": "Calculation Group"}
];
});
DeductionAdapter.method('getFormFields', function() {
var rangeAmounts = [ "rangeAmounts", {"label":"Calculation Process","type":"datagroup",
"form":[
[ "lowerCondition", {"label":"Lower Limit Condition","type":"select","source":[["No Lower Limit","No Lower Limit"],["gt","Greater than"],["gte","Greater than or Equal"]]}],
[ "lowerLimit", {"label":"Lower Limit","type":"text","validation":"float"}],
[ "upperCondition", {"label":"Upper Limit Condition","type":"select","source":[["No Upper Limit","No Upper Limit"],["lt","Less than"],["lte","Less than or Equal"]]}],
[ "upperLimit", {"label":"Upper Limit","type":"text","validation":"float"}],
[ "amount", {"label":"Value","type":"text","validation":""}]
],
"html":'<div id="#_id_#" class="panel panel-default">#_delete_##_edit_#<div class="panel-body">#_renderFunction_#</div></div>',
"validation":"none",
"custom-validate-function":function (data){
var res = {};
res['valid'] = true;
if(lowerCondition != 'No Lower Limit'){
data.lowerLimit = 0;
}
if(upperCondition != 'No Upper Limit'){
data.upperLimit = 0;
}
res['params'] = data;
return res;
},
"render":function(item){
var output = "";
var getSymbol = function(text){
var map = {};
map['gt'] = '>';
map['gte'] = '>=';
map['lt'] = '<';
map['lte'] = '<=';
return map[text];
}
if(item.lowerCondition != "No Lower Limit"){
output += item.lowerLimit + " " + getSymbol(item.lowerCondition) + " ";
}
if(item.upperCondition != "No Upper Limit"){
output += " and ";
output += getSymbol(item.upperCondition) + " " + item.upperLimit + " ";
}
if(output == ""){
return "Deduction is "+item.amount + " for all ranges";
}else{
return "If salary component "+output+ " deduction is "+item.amount;
}
return output;
}
}];
return [
[ "id", {"label":"ID","type":"hidden"}],
[ "name", {"label":"Name","type":"text","validation":""}],
[ "componentType", {"label":"Salary Component Type","type":"select2multi","allow-null":true,"remote-source":["SalaryComponentType","id","name"]}],
[ "component", {"label":"Salary Component","type":"select2multi","allow-null":true,"remote-source":["SalaryComponent","id","name"]}],
[ "payrollColumn", {"label":"Payroll Report Column","type":"select2","allow-null":true,"remote-source":["PayrollColumn","id","name"]}],
rangeAmounts,
[ "deduction_group", {"label":"Calculation Group","type":"select2","allow-null":true,"null-label":"None","remote-source":["DeductionGroup","id","name"]}]
];
});
/*
DeductionAdapter.method('doCustomValidation', function(params) {
if(params.type == "Fixed"){
return null;
}
if(params.percentage_type == "On Component Type"){
params.component = "NULL";
if(params.componentType == "NULL"){
return "Salary component type should be selected";
}
}else if(params.percentage_type == "On Component"){
params.componentType = "NULL";
if(params.component == "NULL"){
return "Salary component should be selected";
}
}
return null;
});
*/
/*
DeductionAdapter.method('postRenderForm', function(object, $tempDomObj) {
$tempDomObj.find("#field_componentType").hide();
$tempDomObj.find("#field_percentage_type").hide();
$tempDomObj.find("#field_component").hide();
$tempDomObj.find("#percentage_type").off().on('change',function(e){
if(e.val == "On Component"){
$("#componentType").hide();
$("#component").show();
}else{
$("#componentType").show();
$("#component").hide();
}
});
$tempDomObj.find("#type").off().on('change',function(e){
if(e.val == "Fixed"){
$("#componentType").hide();
$("#percentage_type").hide();
$("#component").hide();
}else{
$("#percentage_type").show();
if($("#percentage_type").select2('data').id == 'On Component'){
$("#field_componentType").hide();
$("#field_component").show();
}else{
$("#field_componentType").show();
$("#field_component").hide();
}
}
});
});
*/
/* /*
@@ -288,43 +132,3 @@ EmployeeSalaryAdapter.method('getFilters', function() {
/*
* DeductionGroupAdapter
*/
function DeductionGroupAdapter(endPoint,tab,filter,orderBy) {
this.initAdapter(endPoint,tab,filter,orderBy);
}
DeductionGroupAdapter.inherits(AdapterBase);
DeductionGroupAdapter.method('getDataMapping', function() {
return [
"id",
"name",
"description"
];
});
DeductionGroupAdapter.method('getHeaders', function() {
return [
{ "sTitle": "ID" ,"bVisible":false},
{ "sTitle": "Name" },
{ "sTitle": "Details" }
];
});
DeductionGroupAdapter.method('getFormFields', function() {
return [
[ "id", {"label":"ID","type":"hidden"}],
[ "name", {"label":"Name","type":"text","validation":""}],
[ "description", {"label":"Details","type":"textarea","validation":"none"}]
];
});
+4 -4
View File
@@ -2,16 +2,16 @@
<div class="small-box bg-green"> <div class="small-box bg-green">
<div class="inner"> <div class="inner">
<h3>Settings</h3> <h3><t>Settings</t></h3>
<p> <p>
Configure IceHrm <t>Configure</t> IceHrm
</p> </p>
</div> </div>
<div class="icon"> <div class="icon">
<i class="ion ion-settings"></i> <i class="ion ion-settings"></i>
</div> </div>
<a href="#_moduleLink_#" class="small-box-footer" id="settingsLink"> <a href="#_moduleLink_#" class="small-box-footer" id="settingsLink">
Update Settings <i class="fa fa-arrow-circle-right"></i> <t>Update</t> <t>Settings</t> <i class="fa fa-arrow-circle-right"></i>
</a> </a>
</div> </div>
</div> </div>
+3 -3
View File
@@ -34,9 +34,9 @@ $options1['setShowAddNew'] = 'false';
$moduleBuilder->addModuleOrGroup(new ModuleTab('CompanySetting','Setting','Company','SettingAdapter','{"name":["Company:"]}','name',true,$options1)); $moduleBuilder->addModuleOrGroup(new ModuleTab('CompanySetting','Setting','Company','SettingAdapter','{"name":["Company:"]}','name',true,$options1));
$moduleBuilder->addModuleOrGroup(new ModuleTab('SystemSetting','Setting','System','SettingAdapter','{"name":["System:"]}','name',false,$options1)); $moduleBuilder->addModuleOrGroup(new ModuleTab('SystemSetting','Setting','System','SettingAdapter','{"name":["System:"]}','name',false,$options1));
$moduleBuilder->addModuleOrGroup(new ModuleTab('EmailSetting','Setting','Email','SettingAdapter','{"name":["Email:"]}','name',false,$options1)); $moduleBuilder->addModuleOrGroup(new ModuleTab('EmailSetting','Setting','Email','SettingAdapter','{"name":["Email:"]}','name',false,$options1));
//$moduleBuilder->addModuleOrGroup(new ModuleTab('LeaveSetting','Setting','Leave / PTO','SettingAdapter','{"name":["Leave:"]}','name',false,$options1));
$moduleBuilder->addModuleOrGroup(new ModuleTab('LDAPSetting','Setting','LDAP','SettingAdapter','{"name":["LDAP:"]}','name',false,$options1)); $moduleBuilder->addModuleOrGroup(new ModuleTab('LDAPSetting','Setting','LDAP','SettingAdapter','{"name":["LDAP:"]}','name',false,$options1));
$moduleBuilder->addModuleOrGroup(new ModuleTab('OtherSetting','Setting','Other','SettingAdapter','{"name":["Projects:","Attendance:","Recruitment:","Notifications:","Expense:","Travel:","Api:"]}','name',false,$options1)); $moduleBuilder->addModuleOrGroup(new ModuleTab('AttendanceSetting','Setting','Attendance','SettingAdapter','{"name":["Attendance:"]}','name',false,$options1));
$moduleBuilder->addModuleOrGroup(new ModuleTab('OtherSetting','Setting','Other','SettingAdapter','{"name":["Projects:","Recruitment:","Notifications:","Expense:","Travel:","Api:","Overtime:"]}','name',false,$options1));
echo UIManager::getInstance()->renderModule($moduleBuilder); echo UIManager::getInstance()->renderModule($moduleBuilder);
?> ?>
</div> </div>
@@ -47,4 +47,4 @@ $(window).load(function() {
}); });
</script> </script>
<?php include APP_BASE_PATH.'footer.php';?> <?php include APP_BASE_PATH.'footer.php';?>
+2 -1
View File
@@ -86,6 +86,7 @@ SettingAdapter.method('loadRemoteDataForSettings', function () {
fields.push(["country", {"label": "Country", "type": "select2multi", "remote-source": ["Country", "id", "name"]}]); fields.push(["country", {"label": "Country", "type": "select2multi", "remote-source": ["Country", "id", "name"]}]);
fields.push(["currency", {"label": "Currency", "type": "select2multi", "remote-source": ["CurrencyType","id","code+name"]}]); fields.push(["currency", {"label": "Currency", "type": "select2multi", "remote-source": ["CurrencyType","id","code+name"]}]);
fields.push(["nationality", {"label": "Nationality", "type": "select2multi", "remote-source": ["Nationality","id","name"]}]); fields.push(["nationality", {"label": "Nationality", "type": "select2multi", "remote-source": ["Nationality","id","name"]}]);
fields.push(["supportedLanguage", {"label":"Value","type":"select2","allow-null":false,"remote-source":["SupportedLanguage","name","description"]}]);
for(index in fields){ for(index in fields){
field = fields[index]; field = fields[index];
@@ -107,4 +108,4 @@ SettingAdapter.method('loadRemoteDataForSettings', function () {
SettingAdapter.method('getHelpLink', function () { SettingAdapter.method('getHelpLink', function () {
return 'http://blog.icehrm.com/docs/settings/'; return 'http://blog.icehrm.com/docs/settings/';
}); });
@@ -9,8 +9,8 @@
</div> </div>
<div class="control-group"> <div class="control-group">
<div class="controls"> <div class="controls">
<button onclick="try{modJs.save()}catch(e){};return false;" class="btn">Save</button> <button onclick="try{modJs.save()}catch(e){};return false;" class="btn"><t>Save</t></button>
<button onclick="modJs.cancel();return false;" class="btn">Cancel</button> <button onclick="modJs.cancel();return false;" class="btn"><t>Cancel</t></button>
</div> </div>
</div> </div>
</form> </form>
+9 -1
View File
@@ -14,6 +14,14 @@ class TravelActionManager extends ApproveAdminActionManager{
} }
public function getModuleTabUrl(){ public function getModuleTabUrl(){
return "g=modules&n=travel&m=module_Travel_Management"; return "g=modules&n=travel&m=module_Travel_Management#tabEmployeeTravelRecord";
}
public function getModuleSubordinateTabUrl(){
return "g=modules&n=travel&m=module_Travel_Management#tabSubordinateEmployeeTravelRecord";
}
public function getModuleApprovalTabUrl(){
return "g=modules&n=travel&m=module_Travel_Management#tabEmployeeTravelRecordApproval";
} }
} }
+29 -2
View File
@@ -89,9 +89,13 @@ if (!class_exists('EmployeeTravelRecord')) {
var $notificationModuleName = "Travel Management"; var $notificationModuleName = "Travel Management";
var $notificationUnitName = "TravelRequest"; var $notificationUnitName = "TravelRequest";
var $notificationUnitPrefix = "A"; var $notificationUnitPrefix = "A";
var $notificationUnitAdminUrl = "g=admin&n=travel&m=admin_Employees"; var $notificationUnitAdminUrl = "g=modules&n=travel&m=module_Travel_Management#tabSubordinateEmployeeTravelRecord";
var $preApproveSettingName = "Travel: Pre-Approve Travel Request"; var $preApproveSettingName = "Travel: Pre-Approve Travel Request";
public function isMultiLevelApprovalsEnabled(){
return (SettingsManager::getInstance()->getSetting('Travel: Enable Multi Level Approvals') == '1');
}
public function getAdminAccess() public function getAdminAccess()
{ {
return array("get", "element", "save", "delete"); return array("get", "element", "save", "delete");
@@ -124,5 +128,28 @@ if (!class_exists('EmployeeTravelRecord')) {
); );
} }
public function getType(){
return 'EmployeeTravelRecord';
}
public function allowIndirectMapping(){
if(SettingsManager::getInstance()->getSetting('Travel: Allow Indirect Admins to Approve') == '1'){
return true;
}
return false;
}
} }
} }
if (!class_exists('EmployeeTravelRecordApproval')) {
class EmployeeTravelRecordApproval extends EmployeeTravelRecord
{
public function Find($whereOrderBy,$bindarr=false,$pkeysArr=false,$extra=array()){
return $this->findApprovals(new EmployeeTravelRecord(), $whereOrderBy,$bindarr,$pkeysArr,$extra);
}
}
}
+4 -4
View File
@@ -3,17 +3,17 @@
<div class="small-box bg-red"> <div class="small-box bg-red">
<div class="inner"> <div class="inner">
<h3> <h3>
Travel <t>Travel</t>
</h3> </h3>
<p id="numberOfTravel"> <p id="numberOfTravel">
Requests <t>Requests</t>
</p> </p>
</div> </div>
<div class="icon"> <div class="icon">
<i class="ion ion-plane"></i> <i class="ion ion-plane"></i>
</div> </div>
<a href="#_moduleLink_#" class="small-box-footer" id="travelLink"> <a href="#_moduleLink_#" class="small-box-footer" id="travelLink">
Manage Travel <i class="fa fa-arrow-circle-right"></i> <t>Manage</t> <t>Travel</t> <i class="fa fa-arrow-circle-right"></i>
</a> </a>
</div> </div>
</div> </div>
+2 -39
View File
@@ -30,7 +30,7 @@ $options = array();
$options['setRemoteTable'] = 'true'; $options['setRemoteTable'] = 'true';
$moduleBuilder = new ModuleBuilder(); $moduleBuilder = new ModuleBuilder();
$moduleBuilder->addModuleOrGroup(new ModuleTab('EmployeeTravelRecord','EmployeeTravelRecord','Travel Requests','EmployeeTravelRecordAdapter','','',true,$options)); $moduleBuilder->addModuleOrGroup(new ModuleTab('EmployeeTravelRecord','EmployeeTravelRecord','Travel Requests','EmployeeTravelRecordAdminAdapter','','',true,$options));
echo UIManager::getInstance()->renderModule($moduleBuilder); echo UIManager::getInstance()->renderModule($moduleBuilder);
@@ -38,41 +38,4 @@ $itemName = 'TravelRequest';
$moduleName = 'Travel Management'; $moduleName = 'Travel Management';
$itemNameLower = strtolower($itemName); $itemNameLower = strtolower($itemName);
$statuses = array("Approved","Pending","Rejected","Cancelled"); include APP_BASE_PATH.'footer.php';
?><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';
+6 -6
View File
@@ -110,22 +110,22 @@ EmployeeImmigrationAdapter.method('getFilters', function() {
/** /**
* EmployeeTravelRecordAdapter * EmployeeTravelRecordAdminAdapter
*/ */
function EmployeeTravelRecordAdapter(endPoint,tab,filter,orderBy) { function EmployeeTravelRecordAdminAdapter(endPoint,tab,filter,orderBy) {
this.initAdapter(endPoint,tab,filter,orderBy); this.initAdapter(endPoint,tab,filter,orderBy);
this.itemName = 'TravelRequest'; this.itemName = 'TravelRequest';
this.itemNameLower = 'travelrequest'; this.itemNameLower = 'travelrequest';
this.modulePathName = 'travel'; this.modulePathName = 'travel';
} }
EmployeeTravelRecordAdapter.inherits(ApproveAdminAdapter); EmployeeTravelRecordAdminAdapter.inherits(ApproveAdminAdapter);
EmployeeTravelRecordAdapter.method('getDataMapping', function() { EmployeeTravelRecordAdminAdapter.method('getDataMapping', function() {
return [ return [
"id", "id",
"employee", "employee",
@@ -138,7 +138,7 @@ EmployeeTravelRecordAdapter.method('getDataMapping', function() {
]; ];
}); });
EmployeeTravelRecordAdapter.method('getHeaders', function() { EmployeeTravelRecordAdminAdapter.method('getHeaders', function() {
return [ return [
{ "sTitle": "ID" ,"bVisible":false}, { "sTitle": "ID" ,"bVisible":false},
{ "sTitle": "Employee" }, { "sTitle": "Employee" },
@@ -151,7 +151,7 @@ EmployeeTravelRecordAdapter.method('getHeaders', function() {
]; ];
}); });
EmployeeTravelRecordAdapter.method('getFormFields', function() { EmployeeTravelRecordAdminAdapter.method('getFormFields', function() {
return [ return [
["id", {"label": "ID", "type": "hidden"}], ["id", {"label": "ID", "type": "hidden"}],
["employee", { ["employee", {
+4 -4
View File
@@ -2,16 +2,16 @@
<div class="small-box bg-yellow"> <div class="small-box bg-yellow">
<div class="inner"> <div class="inner">
<h3>Users</h3> <h3><t>Users</t></h3>
<p id="numberOfUsers"> <p id="numberOfUsers">
#_numberOfUsers_# Users #_numberOfUsers_# <t>Users</t>
</p> </p>
</div> </div>
<div class="icon"> <div class="icon">
<i class="ion ion-person-add"></i> <i class="ion ion-person-add"></i>
</div> </div>
<a href="#_moduleLink_#" class="small-box-footer" id="usersLink"> <a href="#_moduleLink_#" class="small-box-footer" id="usersLink">
Manage Users <i class="fa fa-arrow-circle-right"></i> <t>Manage</t> <t>Users</t> <i class="fa fa-arrow-circle-right"></i>
</a> </a>
</div> </div>
</div> </div>
+3 -3
View File
@@ -29,8 +29,8 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
?><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;">
<li class="active"><a id="tabUser" href="#tabPageUser">Users</a></li> <li class="active"><a id="tabUser" href="#tabPageUser"><?=LanguageManager::tran('Users')?></a></li>
<li class=""><a id="tabUserRole" href="#tabPageUserRole">User Roles</a></li> <li class=""><a id="tabUserRole" href="#tabPageUserRole"><?=LanguageManager::tran('User Roles')?></a></li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
@@ -63,4 +63,4 @@ modJsList['tabUserRole'] = new UserRoleAdapter('UserRole');
var modJs = modJsList['tabUser']; var modJs = modJsList['tabUser'];
</script> </script>
<?php include APP_BASE_PATH.'footer.php';?> <?php include APP_BASE_PATH.'footer.php';?>
+8 -2
View File
@@ -36,8 +36,9 @@ UserAdapter.method('getFormFields', function() {
[ "email", {"label":"Email","type":"text","validation":"email"}], [ "email", {"label":"Email","type":"text","validation":"email"}],
[ "employee", {"label":"Employee","type":"select2","allow-null":true,"remote-source":["Employee","id","first_name+last_name"]}], [ "employee", {"label":"Employee","type":"select2","allow-null":true,"remote-source":["Employee","id","first_name+last_name"]}],
[ "user_level", {"label":"User Level","type":"select","source":[["Admin","Admin"],["Manager","Manager"],["Employee","Employee"],["Other","Other"]]}], [ "user_level", {"label":"User Level","type":"select","source":[["Admin","Admin"],["Manager","Manager"],["Employee","Employee"],["Other","Other"]]}],
[ "user_roles", {"label":"User Roles","type":"select2multi","remote-source":["UserRole","id","name"]}], [ "user_roles", {"label":"User Roles","type":"select2multi","remote-source":["UserRole","id","name"]}],
[ "default_module", {"label":"Default Module","type":"select2","null-label":"No Default Module","allow-null":true,"remote-source":["Module","id","menu+label"]}] [ "lang", {"label":"Language","type":"select2","allow-null":true,"remote-source":["SupportedLanguage","name","description"]}],
[ "default_module", {"label":"Default Module","type":"select2","null-label":"No Default Module","allow-null":true,"remote-source":["Module","id","menu+label"]}]
]; ];
}); });
@@ -186,6 +187,11 @@ UserRoleAdapter.method('getHeaders', function() {
]; ];
}); });
UserRoleAdapter.method('postRenderForm', function(object, $tempDomObj) {
$tempDomObj.find("#changePasswordBtn").remove();
});
UserRoleAdapter.method('getFormFields', function() { UserRoleAdapter.method('getFormFields', function() {
return [ return [
[ "id", {"label":"ID","type":"hidden"}], [ "id", {"label":"ID","type":"hidden"}],
@@ -134,5 +134,45 @@ class AttendanceActionManager extends SubActionManager{
return new IceResponse(IceResponse::SUCCESS,$openPunch); return new IceResponse(IceResponse::SUCCESS,$openPunch);
} }
public function createPreviousAttendnaceSheet($req){
$employee = $this->baseService->getElement('Employee',$this->getCurrentProfileId(),null,true);
$timeSheet = new EmployeeAttendanceSheet();
$timeSheet->Load("id = ?",array($req->id));
if($timeSheet->id != $req->id){
return new IceResponse(IceResponse::ERROR,"Attendance Sheet not found");
}
if($timeSheet->employee != $employee->id){
return new IceResponse(IceResponse::ERROR,"You don't have permissions to add this Attendance Sheet");
}
$end = date("Y-m-d", strtotime("last Saturday", strtotime($timeSheet->date_start)));
$start = date("Y-m-d", strtotime("last Sunday", strtotime($end)));
$tempTimeSheet = new EmployeeTimeSheet();
$tempTimeSheet->Load("employee = ? and date_start = ?",array($employee->id, $start));
if($employee->id == $tempTimeSheet->employee){
return new IceResponse(IceResponse::ERROR,"Attendance Sheet already exists");
}
$newTimeSheet = new EmployeeTimeSheet();
$newTimeSheet->employee = $employee->id;
$newTimeSheet->date_start = $start;
$newTimeSheet->date_end = $end;
$newTimeSheet->status = "Pending";
$ok = $newTimeSheet->Save();
if(!$ok){
LogManager::getInstance()->info("Error creating time sheet : ".$newTimeSheet->ErrorMsg());
return new IceResponse(IceResponse::ERROR,"Error creating Attendance Sheet");
}
return new IceResponse(IceResponse::SUCCESS,"");
}
} }
+4 -4
View File
@@ -3,15 +3,15 @@
<div class="small-box bg-aqua"> <div class="small-box bg-aqua">
<div class="inner"> <div class="inner">
<h3 id="lastPunchTime"> <h3 id="lastPunchTime">
Punch In <t>Punch In</t>
</h3> </h3>
<p>or punch out</p> <p><t>or</t> <t>Punch Out</t></p>
</div> </div>
<div class="icon"> <div class="icon">
<i class="ion ion-ios7-alarm-outline"></i> <i class="ion ion-ios7-alarm-outline"></i>
</div> </div>
<a href="#_moduleLink_#" class="small-box-footer" id="atteandanceLink"> <a href="#_moduleLink_#" class="small-box-footer" id="atteandanceLink">
Record Attendance <i class="fa fa-arrow-circle-right"></i> <t>Record Attendance</t> <i class="fa fa-arrow-circle-right"></i>
</a> </a>
</div> </div>
</div> </div>
+2 -2
View File
@@ -33,7 +33,7 @@ if(empty($currentEmployeeTimeZone)){
?><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;">
<li class="active"><a id="tabAttendance" href="#tabPageAttendance">Attendance</a></li> <li class="active"><a id="tabAttendance" href="#tabPageAttendance"><?=LanguageManager::tran('Attendance')?></a></li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
@@ -74,4 +74,4 @@ var modJs = modJsList['tabAttendance'];
</div> </div>
</div> </div>
</div> </div>
<?php include APP_BASE_PATH.'footer.php';?> <?php include APP_BASE_PATH.'footer.php';?>
+209
View File
@@ -247,3 +247,212 @@ AttendanceAdapter.method('getClientGMTOffset', function () {
return std_time_offset; return std_time_offset;
}); });
function EmployeeAttendanceSheetAdapter(endPoint,tab,filter,orderBy) {
this.initAdapter(endPoint,tab,filter,orderBy);
}
EmployeeAttendanceSheetAdapter.inherits(AdapterBase);
this.currentTimesheetId = null;
this.currentTimesheet = null;
EmployeeAttendanceSheetAdapter.method('getDataMapping', function() {
return [
"id",
"date_start",
"date_end",
"total_time",
"status"
];
});
EmployeeAttendanceSheetAdapter.method('getHeaders', function() {
return [
{ "sTitle": "ID" ,"bVisible":false},
{ "sTitle": "Start Date"},
{ "sTitle": "End Date"},
{ "sTitle": "Total Time"},
{ "sTitle": "Status"}
];
});
EmployeeAttendanceSheetAdapter.method('getFormFields', function() {
return [
[ "id", {"label":"ID","type":"hidden"}],
[ "date_start", {"label":"TimeSheet Start Date","type":"date","validation":""}],
[ "date_end", {"label":"TimeSheet End Date","type":"date","validation":""}],
[ "details", {"label":"Reason","type":"textarea","validation":"none"}]
];
});
EmployeeAttendanceSheetAdapter.method('preProcessTableData', function(row) {
row[1] = Date.parse(row[1]).toString('MMM d, yyyy (dddd)');
row[2] = Date.parse(row[2]).toString('MMM d, yyyy (dddd)');
return row;
});
EmployeeAttendanceSheetAdapter.method('renderForm', function(object) {
var formHtml = this.templates['formTemplate'];
var html = "";
$("#"+this.getTableName()+'Form').html(formHtml);
$("#"+this.getTableName()+'Form').show();
$("#"+this.getTableName()).hide();
$('#attendnacesheet_start').html(Date.parse(object.date_start).toString('MMM d, yyyy (dddd)'));
$('#attendnacesheet_end').html(Date.parse(object.date_end).toString('MMM d, yyyy (dddd)'));
this.currentTimesheet = object;
this.getTimeEntries();
});
EmployeeAttendanceSheetAdapter.method('getTimeEntries', function() {
timesheetId = this.currentId;
var sourceMappingJson = JSON.stringify(modJsList['tabEmployeeTimeEntry'].getSourceMapping());
object = {"id":timesheetId,"sm":sourceMappingJson};
var reqJson = JSON.stringify(object);
var callBackData = [];
callBackData['callBackData'] = [];
callBackData['callBackSuccess'] = 'getTimeEntriesSuccessCallBack';
callBackData['callBackFail'] = 'getTimeEntriesFailCallBack';
this.customAction('getTimeEntries','modules=time_sheets',reqJson,callBackData);
});
EmployeeAttendanceSheetAdapter.method('getTimeEntriesSuccessCallBack', function(callBackData) {
var entries = callBackData;
var html = "";
var temp = '<tr><td><img class="tableActionButton" src="_BASE_images/delete.png" style="cursor:pointer;" rel="tooltip" title="Delete" onclick="modJsList[\'tabEmployeeTimeEntry\'].deleteRow(_id_);return false;"></img></td><td>_start_</td><td>_end_</td><td>_duration_</td><td>_project_</td><td>_details_</td>';
for(var i=0;i<entries.length;i++){
try{
var t = temp;
t = t.replace(/_start_/g,Date.parse(entries[i].date_start).toString('MMM d, yyyy [hh:mm tt]'));
t = t.replace(/_end_/g,Date.parse(entries[i].date_end).toString('MMM d, yyyy [hh:mm tt]'));
var mili = Date.parse(entries[i].date_end) - Date.parse(entries[i].date_start);
var minutes = Math.round(mili/60000);
var hourMinutes = (minutes % 60);
var hours = (minutes-hourMinutes)/60;
t = t.replace(/_duration_/g,"Hours ("+hours+") - Min ("+hourMinutes+")");
if(entries[i].project == 'null' || entries[i].project == null || entries[i].project == undefined){
t = t.replace(/_project_/g,"None");
}else{
t = t.replace(/_project_/g,entries[i].project);
}
t = t.replace(/_project_/g,entries[i].project);
t = t.replace(/_details_/g,entries[i].details);
t = t.replace(/_id_/g,entries[i].id);
t = t.replace(/_BASE_/g,this.baseUrl);
html += t;
}catch(e){}
}
$('.timesheet_entries_table_body').html(html);
if(modJs.getTableName() == 'SubEmployeeTimeSheetAll'){
$('#submit_sheet').hide();
$('#add_time_sheet_entry').hide();
}else{
if(this.currentElement.status == 'Approved'){
$('#submit_sheet').hide();
$('#add_time_sheet_entry').hide();
}else{
$('#submit_sheet').show();
$('#add_time_sheet_entry').show();
}
}
});
EmployeeAttendanceSheetAdapter.method('getTimeEntriesFailCallBack', function(callBackData) {
this.showMessage("Error", "Error occured while getting timesheet entries");
});
EmployeeAttendanceSheetAdapter.method('createPreviousAttendnacesheet', function(id) {
object = {"id":id};
var reqJson = JSON.stringify(object);
var callBackData = [];
callBackData['callBackData'] = [];
callBackData['callBackSuccess'] = 'createPreviousAttendnacesheetSuccessCallBack';
callBackData['callBackFail'] = 'createPreviousAttendnacesheetFailCallBack';
this.customAction('createPreviousAttendnaceSheet','modules=attendnace',reqJson,callBackData);
});
EmployeeAttendanceSheetAdapter.method('createPreviousAttendnacesheetSuccessCallBack', function(callBackData) {
$('.tooltip').css("display","none");
$('.tooltip').remove();
//this.showMessage("Success", "Previous Timesheet created");
this.get([]);
});
EmployeeAttendanceSheetAdapter.method('createPreviousAttendnacesheetFailCallBack', function(callBackData) {
this.showMessage("Error", callBackData);
});
EmployeeAttendanceSheetAdapter.method('getActionButtonsHtml', function(id,data) {
var html = '';
if(this.getTableName() == "EmployeeTimeSheetAll"){
html = '<div style="width:80px;"><img class="tableActionButton" src="_BASE_images/view.png" style="cursor:pointer;" rel="tooltip" title="Edit Timesheet Entries" onclick="modJs.edit(_id_);return false;"></img><img class="tableActionButton" src="_BASE_images/redo.png" style="cursor:pointer;margin-left:15px;" rel="tooltip" title="Create previous time sheet" onclick="modJs.createPreviousAttendnacesheet(_id_);return false;"></img></div>';
}else{
html = '<div style="width:80px;"><img class="tableActionButton" src="_BASE_images/view.png" style="cursor:pointer;" rel="tooltip" title="Edit Timesheet Entries" onclick="modJs.edit(_id_);return false;"></img></div>';
}
html = html.replace(/_id_/g,id);
html = html.replace(/_BASE_/g,this.baseUrl);
return html;
});
EmployeeAttendanceSheetAdapter.method('getCustomTableParams', function() {
var that = this;
var dataTableParams = {
"aoColumnDefs": [
{
"fnRender": function(data, cell){
return that.preProcessRemoteTableData(data, cell, 1)
} ,
"aTargets": [1]
},
{
"fnRender": function(data, cell){
return that.preProcessRemoteTableData(data, cell, 2)
} ,
"aTargets": [2]
},
{
"fnRender": that.getActionButtons,
"aTargets": [that.getDataMapping().length]
}
]
};
return dataTableParams;
});
EmployeeAttendanceSheetAdapter.method('preProcessRemoteTableData', function(data, cell, id) {
return Date.parse(cell).toString('MMM d, yyyy (dddd)');
});
+2 -2
View File
@@ -53,7 +53,7 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
ksort($dashBoardList); ksort($dashBoardList);
foreach($dashBoardList as $k=>$v){ foreach($dashBoardList as $k=>$v){
echo $v; echo LanguageManager::translateTnrText($v);
} }
?> ?>
@@ -95,4 +95,4 @@ modJs.getInitData();
*/ */
</script> </script>
<?php include APP_BASE_PATH.'footer.php';?> <?php include APP_BASE_PATH.'footer.php';?>
+2 -2
View File
@@ -28,7 +28,7 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
?><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;">
<li class="active"><a id="tabEmployeeDependent" href="#tabPageEmployeeDependent">Dependents</a></li> <li class="active"><a id="tabEmployeeDependent" href="#tabPageEmployeeDependent"><?=LanguageManager::tran('Dependents')?></a></li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
@@ -60,4 +60,4 @@ modJsList['tabEmployeeDependent'].setShowEdit(false);
var modJs = modJsList['tabEmployeeDependent']; var modJs = modJsList['tabEmployeeDependent'];
</script> </script>
<?php include APP_BASE_PATH.'footer.php';?> <?php include APP_BASE_PATH.'footer.php';?>
+2 -2
View File
@@ -28,7 +28,7 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
?><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;">
<li class="active"><a id="tabEmergencyContact" href="#tabPageEmergencyContact">Emergency Contacts</a></li> <li class="active"><a id="tabEmergencyContact" href="#tabPageEmergencyContact"><?=LanguageManager::tran('Emergency Contacts')?></a></li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
@@ -61,4 +61,4 @@ modJsList['tabEmergencyContact'].setShowEdit(false);
var modJs = modJsList['tabEmergencyContact']; var modJs = modJsList['tabEmergencyContact'];
</script> </script>
<?php include APP_BASE_PATH.'footer.php';?> <?php include APP_BASE_PATH.'footer.php';?>
@@ -24,13 +24,57 @@ Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilin
class EmployeesActionManager extends SubActionManager{ class EmployeesActionManager extends SubActionManager{
public function get($req){ public function get($req){
$profileId = $this->getCurrentProfileId(); $profileId = $this->getCurrentProfileId();
$subordinate = new Employee(); $cemp = $profileId;
$subordinatesCount = $subordinate->Count("supervisor = ? and id = ?",array($profileId, $req->id)); $obj = new Employee();
$cempObj = new Employee();
$cempObj->Load("id = ?",array($cemp));
if($obj->getUserOnlyMeAccessField() == 'id' &&
SettingsManager::getInstance()->getSetting('System: Company Structure Managers Enabled') == 1 &&
CompanyStructure::isHeadOfCompanyStructure($cempObj->department, $cemp)){
$subordinates = $obj->Find("supervisor = ?",array($cemp));
if(empty($subordinates)){
$subordinates = array();
}
$childCompaniesIds = array();
if(SettingsManager::getInstance()->getSetting('System: Child Company Structure Managers Enabled') == '1'){
$childCompaniesResp = CompanyStructure::getAllChildCompanyStructures($cempObj->department);
$childCompanies = $childCompaniesResp->getObject();
foreach($childCompanies as $cc){
$childCompaniesIds[] = $cc->id;
}
}else{
$childCompaniesIds[] = $cempObj->department;
}
if($this->user->user_level == 'Admin' || $subordinatesCount > 0){ if(!empty($childCompaniesIds)) {
$id = $req->id; $childStructureSubordinates = $obj->Find("department in (" . implode(',', $childCompaniesIds) . ") and id != ?", array($cemp));
$subordinates = array_merge($subordinates, $childStructureSubordinates);
}
foreach ($subordinates as $subordinate){
if($subordinate->id == $req->id){
$id = $req->id;
break;
}
}
}else{
$subordinate = new Employee();
$subordinatesCount = $subordinate->Count("supervisor = ? and id = ?",array($profileId, $req->id));
if($this->user->user_level == 'Admin' || $subordinatesCount > 0){
$id = $req->id;
}
} }
if(empty($id)){ if(empty($id)){
$id = $profileId; $id = $profileId;
@@ -56,7 +100,13 @@ class EmployeesActionManager extends SubActionManager{
if(!empty($employee->joined_date)){ if(!empty($employee->joined_date)){
$employee->joined_date = date("F jS, Y",strtotime($employee->joined_date)); $employee->joined_date = date("F jS, Y",strtotime($employee->joined_date));
} }
//Read custom fields
try {
$employee = BaseService::getInstance()->customFieldManager->enrichObjectCustomFields('Employee', $employee);
}catch(Exception $e){
}
if(empty($employee->id)){ if(empty($employee->id)){
return new IceResponse(IceResponse::ERROR,$employee); return new IceResponse(IceResponse::ERROR,$employee);
@@ -98,4 +148,4 @@ class EmployeesActionManager extends SubActionManager{
} }
return new IceResponse(IceResponse::SUCCESS,$user); return new IceResponse(IceResponse::SUCCESS,$user);
} }
} }
@@ -166,6 +166,18 @@
</div> </div>
<div class="row" id="customFieldsCont" style="margin-left:10px;margin-top:20px;">
<div class="panel panel-default" style="width:97.5%;">
<div class="panel-heading"><h4>Other Details</h4></div>
<div class="panel-body">
<div class="row-fluid" id="customFields">
</div>
</div>
</div>
</div>
<div class="modal" id="adminUsersModel" tabindex="-1" role="dialog" aria-labelledby="messageModelLabel" aria-hidden="true"> <div class="modal" id="adminUsersModel" tabindex="-1" role="dialog" aria-labelledby="messageModelLabel" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
+4 -4
View File
@@ -2,16 +2,16 @@
<!-- small box --> <!-- small box -->
<div class="small-box bg-red"> <div class="small-box bg-red">
<div class="inner"> <div class="inner">
<h3>My Profile</h3> <h3><t>My Profile</t></h3>
<p> <p>
Edit Details <t>Edit Details</t>
</p> </p>
</div> </div>
<div class="icon"> <div class="icon">
<i class="ion ion-ios7-person"></i> <i class="ion ion-ios7-person"></i>
</div> </div>
<a href="#_moduleLink_#" class="small-box-footer" id="myProfileLink"> <a href="#_moduleLink_#" class="small-box-footer" id="myProfileLink">
Manage Profile <i class="fa fa-arrow-circle-right"></i> <t>View/Edit Profile</t> <i class="fa fa-arrow-circle-right"></i>
</a> </a>
</div> </div>
</div> </div>
+3 -3
View File
@@ -54,8 +54,8 @@ path.link {
<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;">
<li class="active"><a id="tabEmployee" href="#tabPageEmployee">My Details</a></li> <li class="active"><a id="tabEmployee" href="#tabPageEmployee"><?=LanguageManager::tran('My Details')?></a></li>
<li><a id="tabCompanyGraph" href="#tabPageCompanyGraph">Company</a></li> <li><a id="tabCompanyGraph" href="#tabPageCompanyGraph"><?=LanguageManager::tran('Company')?></a></li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
@@ -83,4 +83,4 @@ modJsList['tabCompanyGraph'] = new CompanyGraphAdapter('CompanyStructure');
var modJs = modJsList['tabEmployee']; var modJs = modJsList['tabEmployee'];
</script> </script>
<?php include APP_BASE_PATH.'footer.php';?> <?php include APP_BASE_PATH.'footer.php';?>
+14
View File
@@ -289,6 +289,20 @@ EmployeeAdapter.method('modEmployeeGetSuccessCallBack' , function(data) {
} }
subordinates += "<br/>"; subordinates += "<br/>";
} }
//Add custom fields
if(data.customFields != undefined && data.customFields != null && Object.keys(data.customFields).length > 0) {
var ct = '<div class="col-xs-6 col-md-3" style="font-size:16px;"><label class="control-label col-xs-12" style="font-size:13px;">#_label_#</label><label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;">#_value_#</label></div>';
var customFieldHtml;
for (index in data.customFields) {
customFieldHtml = ct;
customFieldHtml = customFieldHtml.replace('#_label_#', index);
customFieldHtml = customFieldHtml.replace('#_value_#', data.customFields[index]);
$("#customFields").append($(customFieldHtml));
}
}else{
$("#customFieldsCont").remove();
}
$("#"+this.getTableName()+" #subordinates").html(subordinates); $("#"+this.getTableName()+" #subordinates").html(subordinates);
+2 -2
View File
@@ -28,7 +28,7 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
?><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;">
<li class="active"><a id="tabEmployeeCompanyLoan" href="#tabPageEmployeeCompanyLoan">Loans Taken</a></li> <li class="active"><a id="tabEmployeeCompanyLoan" href="#tabPageEmployeeCompanyLoan"><?=LanguageManager::tran('Loans Taken')?></a></li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
@@ -55,4 +55,4 @@ modJsList['tabEmployeeCompanyLoan'].setShowEdit(true);
var modJs = modJsList['tabEmployeeCompanyLoan']; var modJs = modJsList['tabEmployeeCompanyLoan'];
</script> </script>
<?php include APP_BASE_PATH.'footer.php';?> <?php include APP_BASE_PATH.'footer.php';?>
+2 -1
View File
@@ -6,5 +6,6 @@
"Company":"fa-building", "Company":"fa-building",
"Training":"fa-briefcase", "Training":"fa-briefcase",
"Travel Management":"fa-plane", "Travel Management":"fa-plane",
"Finance":"fa-money" "Finance":"fa-money",
"User Reports":"fa-file-text"
} }
@@ -47,5 +47,19 @@ if (!class_exists('EmployeeProject')) {
public function getUserOnlyMeAccess(){ public function getUserOnlyMeAccess(){
return array("element","save","delete"); return array("element","save","delete");
} }
public function executePreSaveActions($obj){
if(empty($obj->status)){
$obj->status = "Current";
}
return new IceResponse(IceResponse::SUCCESS,$obj);
}
public function executePreUpdateActions($obj){
if(empty($obj->status)){
$obj->status = "Current";
}
return new IceResponse(IceResponse::SUCCESS,$obj);
}
} }
} }
+5 -5
View File
@@ -1,15 +1,15 @@
<div class="col-lg-3 col-xs-12"> <div class="col-lg-3 col-xs-12">
<!-- small box --> <!-- small box -->
<div class="small-box bg-red"> <div class="small-box bg-aqua">
<div class="inner"> <div class="inner">
<h3>My Projects</h3> <h3><t>My Projects</t></h3>
<p>Projects Assigned</p> <p><t>Projects Assigned</t></p>
</div> </div>
<div class="icon"> <div class="icon">
<i class="ion ion-pie-graph"></i> <i class="ion ion-pie-graph"></i>
</div> </div>
<a href="#_moduleLink_#" class="small-box-footer" id="projectsLink"> <a href="#_moduleLink_#" class="small-box-footer" id="projectsLink">
More info <i class="fa fa-arrow-circle-right"></i> <t>More info</t> <i class="fa fa-arrow-circle-right"></i>
</a> </a>
</div> </div>
</div> </div>
+2 -2
View File
@@ -28,7 +28,7 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
?><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;">
<li class="active"><a id="tabEmployeeProject" href="#tabPageEmployeeProject">My Projects</a></li> <li class="active"><a id="tabEmployeeProject" href="#tabPageEmployeeProject"><?=LanguageManager::tran('My Projects')?></a></li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
@@ -61,4 +61,4 @@ modJsList['tabEmployeeProject'].setShowEdit(false);
var modJs = modJsList['tabEmployeeProject']; var modJs = modJsList['tabEmployeeProject'];
</script> </script>
<?php include APP_BASE_PATH.'footer.php';?> <?php include APP_BASE_PATH.'footer.php';?>
+2 -5
View File
@@ -31,16 +31,14 @@ EmployeeProjectAdapter.inherits(AdapterBase);
EmployeeProjectAdapter.method('getDataMapping', function() { EmployeeProjectAdapter.method('getDataMapping', function() {
return [ return [
"id", "id",
"project", "project"
"status"
]; ];
}); });
EmployeeProjectAdapter.method('getHeaders', function() { EmployeeProjectAdapter.method('getHeaders', function() {
return [ return [
{ "sTitle": "ID" ,"bVisible":false}, { "sTitle": "ID" ,"bVisible":false},
{ "sTitle": "Project" }, { "sTitle": "Project" }
{ "sTitle": "Status"}
]; ];
}); });
@@ -48,7 +46,6 @@ EmployeeProjectAdapter.method('getFormFields', function() {
return [ return [
[ "id", {"label":"ID","type":"hidden"}], [ "id", {"label":"ID","type":"hidden"}],
[ "project", {"label":"Project","type":"select2","remote-source":["Project","id","name"]}], [ "project", {"label":"Project","type":"select2","remote-source":["Project","id","name"]}],
[ "status", {"label":"Status","type":"select","source":[["Current","Current"],["Inactive","Inactive"],["Completed","Completed"]]}],
[ "details", {"label":"Details","type":"textarea","validation":"none"}] [ "details", {"label":"Details","type":"textarea","validation":"none"}]
]; ];
}); });
+5 -5
View File
@@ -28,10 +28,10 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
?><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;">
<li class="active"><a id="tabEmployeeSkill" href="#tabPageEmployeeSkill">Skills</a></li> <li class="active"><a id="tabEmployeeSkill" href="#tabPageEmployeeSkill"><?=LanguageManager::tran('Skills')?></a></li>
<li><a id="tabEmployeeEducation" href="#tabPageEmployeeEducation">Education</a></li> <li><a id="tabEmployeeEducation" href="#tabPageEmployeeEducation"><?=LanguageManager::tran('Education')?></a></li>
<li><a id="tabEmployeeCertification" href="#tabPageEmployeeCertification">Certifications</a></li> <li><a id="tabEmployeeCertification" href="#tabPageEmployeeCertification"><?=LanguageManager::tran('Certifications')?></a></li>
<li><a id="tabEmployeeLanguage" href="#tabPageEmployeeLanguage">Languages</a></li> <li><a id="tabEmployeeLanguage" href="#tabPageEmployeeLanguage"><?=LanguageManager::tran('Languages')?></a></li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
@@ -81,4 +81,4 @@ modJsList['tabEmployeeLanguage'] = new EmployeeLanguageAdapter('EmployeeLanguage
var modJs = modJsList['tabEmployeeSkill']; var modJs = modJsList['tabEmployeeSkill'];
</script> </script>
<?php include APP_BASE_PATH.'footer.php';?> <?php include APP_BASE_PATH.'footer.php';?>
+1 -1
View File
@@ -190,7 +190,7 @@ EmployeeLanguageAdapter.method('getFormFields', function() {
return [ return [
[ "id", {"label":"ID","type":"hidden"}], [ "id", {"label":"ID","type":"hidden"}],
[ "language_id", {"label":"Language","type":"select2","allow-null":false,"remote-source":["Language","id","name"]}], [ "language_id", {"label":"Language","type":"select2","allow-null":false,"remote-source":["Language","id","description"]}],
[ "reading", {"label":"Reading","type":"select","source":compArray}], [ "reading", {"label":"Reading","type":"select","source":compArray}],
[ "speaking", {"label":"Speaking","type":"select","source":compArray}], [ "speaking", {"label":"Speaking","type":"select","source":compArray}],
[ "writing", {"label":"Writing","type":"select","source":compArray}], [ "writing", {"label":"Writing","type":"select","source":compArray}],
+2 -2
View File
@@ -28,7 +28,7 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
?><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;">
<li class="active"><a id="tabEmployeeSalary" href="#tabPageEmployeeSalary">Salary</a></li> <li class="active"><a id="tabEmployeeSalary" href="#tabPageEmployeeSalary"><?=LanguageManager::tran('Salary')?></a></li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
@@ -61,4 +61,4 @@ modJsList['tabEmployeeSalary'].setShowEdit(false);
var modJs = modJsList['tabEmployeeSalary']; var modJs = modJsList['tabEmployeeSalary'];
</script> </script>
<?php include APP_BASE_PATH.'footer.php';?> <?php include APP_BASE_PATH.'footer.php';?>
@@ -145,6 +145,8 @@ if (!class_exists('EmployeeTimeSheet')) {
} }
return new IceResponse(IceResponse::SUCCESS,""); return new IceResponse(IceResponse::SUCCESS,"");
} }
} }
} }
@@ -9,8 +9,8 @@
_fields_ _fields_
<div class="control-group row"> <div class="control-group row">
<div class="controls col-sm-9"> <div class="controls col-sm-9">
<button onclick="try{modJs.save()}catch(e){};return false;" class="saveBtn btn btn-primary pull-right"><i class="fa fa-save"></i> Save</button> <button onclick="try{modJs.save()}catch(e){};return false;" class="saveBtn btn btn-primary pull-right"><i class="fa fa-save"></i> <t>Save</t></button>
<button onclick="modJs.cancel();return false;" class="cancelBtn btn pull-right" style="margin-right:5px;"><i class="fa fa-times-circle-o"></i> Cancel</button> <button onclick="modJs.cancel();return false;" class="cancelBtn btn pull-right" style="margin-right:5px;"><i class="fa fa-times-circle-o"></i> <t>Cancel</t></button>
</div> </div>
<div class="controls col-sm-3"> <div class="controls col-sm-3">
</div> </div>
+3 -3
View File
@@ -4,14 +4,14 @@
<div class="inner"> <div class="inner">
<h3>#_timeSheetHoursWorked_#</h3> <h3>#_timeSheetHoursWorked_#</h3>
<p> <p>
Hours worked Last Week <t>Hours worked Last Week</t>
</p> </p>
</div> </div>
<div class="icon"> <div class="icon">
<i class="ion ion-clock"></i> <i class="ion ion-clock"></i>
</div> </div>
<a href="#_moduleLink_#" class="small-box-footer" id="timesheetLink"> <a href="#_moduleLink_#" class="small-box-footer" id="timesheetLink">
Update Time Sheet <i class="fa fa-arrow-circle-right"></i> <t>Update Time Sheet</t> <i class="fa fa-arrow-circle-right"></i>
</a> </a>
</div> </div>
</div> </div>
+5 -25
View File
@@ -26,31 +26,13 @@ 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';
//custom code
$employeeProjects = array();
$allowAllProjects = $settingsManager->getSetting("Projects: Make All Projects Available to Employees");
if($allowAllProjects == 0){
$employeeProjects = array();
$employeeProjectsTemp = $baseService->get("EmployeeProject");
foreach($employeeProjectsTemp as $p){
$project = new Project();
$project->Load("id = ?",$p->project);
$p->name = $project->name;
$employeeProjects[] = $p;
}
}else{
$employeeProjects = $baseService->get("Project");
}
?><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;">
<li class="active"><a id="tabEmployeeTimeSheetAll" href="#tabPageEmployeeTimeSheetAll">All My TimeSheets</a></li> <li class="active"><a id="tabEmployeeTimeSheetAll" href="#tabPageEmployeeTimeSheetAll"><?=LanguageManager::tran('All My TimeSheets')?></a></li>
<li class=""><a id="tabEmployeeTimeSheetApproved" href="#tabPageEmployeeTimeSheetApproved">Approved TimeSheets</a></li> <li class=""><a id="tabEmployeeTimeSheetApproved" href="#tabPageEmployeeTimeSheetApproved"><?=LanguageManager::tran('Approved TimeSheets')?></a></li>
<li class=""><a id="tabEmployeeTimeSheetPending" href="#tabPageEmployeeTimeSheetPending">Pending TimeSheets</a></li> <li class=""><a id="tabEmployeeTimeSheetPending" href="#tabPageEmployeeTimeSheetPending"><?=LanguageManager::tran('Pending TimeSheets')?></a></li>
<li class=""><a id="tabSubEmployeeTimeSheetAll" href="#tabPageSubEmployeeTimeSheetAll">Subordinate TimeSheets</a></li> <li class=""><a id="tabSubEmployeeTimeSheetAll" href="#tabPageSubEmployeeTimeSheetAll"><?=LanguageManager::tran('Subordinate TimeSheets')?></a></li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
@@ -110,8 +92,6 @@ modJsList['tabSubEmployeeTimeSheetAll'].setRemoteTable(true);
modJsList['tabEmployeeTimeEntry'] = new EmployeeTimeEntryAdapter('EmployeeTimeEntry','EmployeeTimeEntry','',''); modJsList['tabEmployeeTimeEntry'] = new EmployeeTimeEntryAdapter('EmployeeTimeEntry','EmployeeTimeEntry','','');
modJsList['tabEmployeeTimeEntry'].setShowAddNew(false); modJsList['tabEmployeeTimeEntry'].setShowAddNew(false);
modJsList['tabEmployeeTimeEntry'].setAllProjectsAllowed(<?=$allowAllProjects?>);
modJsList['tabEmployeeTimeEntry'].setEmployeeProjects(<?=json_encode($employeeProjects)?>);
var modJs = modJsList['tabEmployeeTimeSheetAll']; var modJs = modJsList['tabEmployeeTimeSheetAll'];
@@ -160,4 +140,4 @@ var modJs = modJsList['tabEmployeeTimeSheetAll'];
</div> </div>
</div> </div>
<?php include APP_BASE_PATH.'footer.php';?> <?php include APP_BASE_PATH.'footer.php';?>
+5 -6
View File
@@ -464,13 +464,10 @@ EmployeeTimeEntryAdapter.method('getHeaders', function() {
EmployeeTimeEntryAdapter.method('getFormFields', function() { EmployeeTimeEntryAdapter.method('getFormFields', function() {
return [ return [
[ "id", {"label":"ID","type":"hidden"}], [ "id", {"label":"ID","type":"hidden"}],
[ "project", {"label":"Project","type":"select2","allow-null":true,"remote-source":["Project","id","name"]}], [ "project", {"label":"Project","type":"select2","allow-null":false,"remote-source":["Project","id","name","getEmployeeProjects"]}],
//[ "project", {"label":"Project","type":"select","source":[]}],
[ "date_select", {"label":"Date","type":"select","source":[]}], [ "date_select", {"label":"Date","type":"select","source":[]}],
[ "date_start", {"label":"Start Time","type":"time","validation":""}], [ "date_start", {"label":"Start Time","type":"time","validation":""}],
/*[ "time_start", {"label":"Start Time","type":"time"}],*/
[ "date_end", {"label":"End Time","type":"time","validation":""}], [ "date_end", {"label":"End Time","type":"time","validation":""}],
/*[ "time_end", {"label":"End Time","type":"time"}],*/
[ "details", {"label":"Details","type":"textarea","validation":""}] [ "details", {"label":"Details","type":"textarea","validation":""}]
]; ];
}); });
@@ -567,7 +564,8 @@ EmployeeTimeEntryAdapter.method('renderForm', function(object) {
$("#"+this.getTableName()+'Form .select2Field').select2(); $("#"+this.getTableName()+'Form .select2Field').select2();
$("#date_select").html(optionList); $("#date_select").html(optionList);
/*
var projectOptionList = ""; var projectOptionList = "";
projectOptionList += '<option value="NULL">None</option>'; projectOptionList += '<option value="NULL">None</option>';
if(this.allProjectsAllowed == 0){ if(this.allProjectsAllowed == 0){
@@ -581,7 +579,8 @@ EmployeeTimeEntryAdapter.method('renderForm', function(object) {
} }
$("#project").html(projectOptionList); $("#project").html(projectOptionList);
*/
if(object != undefined && object != null){ if(object != undefined && object != null){
this.fillForm(object); this.fillForm(object);
} }
@@ -17,7 +17,7 @@
</tbody> </tbody>
</table> </table>
<div class="control-group"> <div class="control-group">
<button id="add_time_sheet_entry" style="margin-left:5px;display:none;" onclick="try{modJs.openTimeEntryDialog()}catch(e){};return false;" class="btn"><span class="icon-plus-sign"></span> Add Time Entry</button> <button id="add_time_sheet_entry" style="margin-left:5px;display:none;" onclick="try{modJs.openTimeEntryDialog()}catch(e){};return false;" class="btn"><span class="icon-plus-sign"></span> <t>Add Time Entry</t></button>
<button id="submit_sheet" onclick="modJs.changeTimeSheetStatusWithId(modJs.currentId,'Submitted');return false;" class="btn" style="display:none;"><span class="icon-ok"></span> Submit Timesheet</button> <button id="submit_sheet" onclick="modJs.changeTimeSheetStatusWithId(modJs.currentId,'Submitted');return false;" class="btn" style="display:none;"><span class="icon-ok"></span> <t>Submit</t></button>
</div> </div>
</form> </form>
+1 -41
View File
@@ -14,46 +14,6 @@ class TravelActionManager extends ApproveModuleActionManager{
} }
public function getModuleTabUrl(){ public function getModuleTabUrl(){
return "g=admin&n=travel&m=admin_Employees#tabEmployeeTravelRecord"; return "g=modules&n=travel&m=module_Travel_Management#tabSubordinateEmployeeTravelRecord";
} }
} }
/*
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);
}
}
*/
+4 -4
View File
@@ -2,16 +2,16 @@
<!-- small box --> <!-- small box -->
<div class="small-box bg-aqua"> <div class="small-box bg-aqua">
<div class="inner"> <div class="inner">
<h3>My Travel</h3> <h3><t>My Travel</t></h3>
<p> <p>
Management <t>Management</t>
</p> </p>
</div> </div>
<div class="icon"> <div class="icon">
<i class="ion ion-plane"></i> <i class="ion ion-plane"></i>
</div> </div>
<a href="#_moduleLink_#" class="small-box-footer" id="mytravelLink"> <a href="#_moduleLink_#" class="small-box-footer" id="mytravelLink">
Travel Management <i class="fa fa-arrow-circle-right"></i> <t>Travel Management</t> <i class="fa fa-arrow-circle-right"></i>
</a> </a>
</div> </div>
</div> </div>
+41 -4
View File
@@ -22,15 +22,25 @@ Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilin
*/ */
$moduleName = 'travel'; $moduleName = 'travel';
$moduleMainName = "EmployeeTravelRecord"; $moduleMainName = "EmployeeTravelRecord"; // for creating module js lib
$moduleItemName = "Travel Request"; $subModuleMainName = "SubordinateEmployeeTravelRecord";
$moduleItemName = "Travel Request"; // For permissions
$itemName = $moduleItemName; // for status change popup
$itemNameLower = strtolower($moduleMainName); // for status change popup
$appModName = $moduleMainName.'Approval';
define('MODULE_PATH',dirname(__FILE__)); define('MODULE_PATH',dirname(__FILE__));
include APP_BASE_PATH.'header.php'; include APP_BASE_PATH.'header.php';
$additionalJs = array();
$additionalJs[] = BASE_URL.'admin/travel/lib.js?v='.$jsVersion;
include APP_BASE_PATH.'modulejslibs.inc.php'; include APP_BASE_PATH.'modulejslibs.inc.php';
?><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;">
<li class="active"><a id="tab<?=$moduleMainName?>" href="#tabPage<?=$moduleMainName?>">Travel Requests</a></li> <li class="active"><a id="tab<?=$moduleMainName?>" href="#tabPage<?=$moduleMainName?>"><?=LanguageManager::tran('Travel Requests')?></a></li>
<li class=""><a id="tab<?=$subModuleMainName?>" href="#tabPage<?=$subModuleMainName?>"><?=LanguageManager::tran('Subordinate Travel Requests')?></a></li>
<li class=""><a id="tab<?=$appModName?>" href="#tabPage<?=$appModName?>"><?=LanguageManager::tran('Travel Request Approval')?></a></li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
@@ -40,6 +50,22 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
</div> </div>
<div id="<?=$moduleMainName?>Form" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;"> <div id="<?=$moduleMainName?>Form" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
</div>
<div class="tab-pane" id="tabPage<?=$subModuleMainName?>">
<div id="<?=$subModuleMainName?>" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="<?=$subModuleMainName?>Form" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
</div>
<div class="tab-pane" id="tabPage<?=$appModName?>">
<div id="<?=$appModName?>" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="<?=$appModName?>Form" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div> </div>
</div> </div>
</div> </div>
@@ -60,7 +86,18 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
modJsList['tab<?=$moduleMainName?>'].setShowEdit(false); modJsList['tab<?=$moduleMainName?>'].setShowEdit(false);
<?php }?> <?php }?>
modJsList['tab<?=$appModName?>'] = new <?=$moduleMainName?>ApproverAdapter('<?=$appModName?>', '<?=$appModName?>');
modJsList['tab<?=$appModName?>'].setShowAddNew(false);
modJsList['tab<?=$appModName?>'].setShowDelete(false);
modJsList['tab<?=$appModName?>'].setShowEdit(false);
modJsList['tab<?=$subModuleMainName?>'] = new <?=$subModuleMainName?>Adapter('<?=$moduleMainName?>','<?=$subModuleMainName?>');
modJsList['tab<?=$subModuleMainName?>'].setRemoteTable(true);
modJsList['tab<?=$subModuleMainName?>'].setShowAddNew(false);
modJsList['tab<?=$subModuleMainName?>'].setShowDelete(false);
modJsList['tab<?=$subModuleMainName?>'].setShowEdit(true);
var modJs = modJsList['tab<?=$moduleMainName?>']; var modJs = modJsList['tab<?=$moduleMainName?>'];
</script> </script>
<?php include APP_BASE_PATH.'footer.php';?> <?php include APP_BASE_PATH.'footer.php';?>
+75 -3
View File
@@ -51,11 +51,14 @@ EmployeeImmigrationAdapter.method('getFormFields', function() {
function EmployeeTravelRecordAdapter(endPoint) { function EmployeeTravelRecordAdapter(endPoint,tab,filter,orderBy) {
this.initAdapter(endPoint); this.initAdapter(endPoint,tab,filter,orderBy);
this.itemName = 'Travel';
this.itemNameLower = 'employeetravelrecord';
this.modulePathName = 'travel';
} }
EmployeeTravelRecordAdapter.inherits(AdapterBase); EmployeeTravelRecordAdapter.inherits(ApproveModuleAdapter);
@@ -103,6 +106,7 @@ EmployeeTravelRecordAdapter.method('getFormFields', function() {
]; ];
}); });
/*
EmployeeTravelRecordAdapter.method('getActionButtonsHtml', function(id,data) { 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 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 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>';
@@ -155,4 +159,72 @@ EmployeeTravelRecordAdapter.method('cancelSuccessCallBack', function(callBackDat
EmployeeTravelRecordAdapter.method('cancelFailCallBack', function(callBackData) { EmployeeTravelRecordAdapter.method('cancelFailCallBack', function(callBackData) {
this.showMessage("Error Occurred while cancelling Travel request", callBackData); this.showMessage("Error Occurred while cancelling Travel request", callBackData);
}); });
*/
/*
EmployeeTravelRecordApproverAdapter
*/
function EmployeeTravelRecordApproverAdapter(endPoint,tab,filter,orderBy) {
this.initAdapter(endPoint,tab,filter,orderBy);
this.itemName = 'Travel';
this.itemNameLower = 'employeetravelrecord';
this.modulePathName = 'travel';
}
EmployeeTravelRecordApproverAdapter.inherits(EmployeeTravelRecordAdminAdapter);
EmployeeTravelRecordApproverAdapter.method('getActionButtonsHtml', function(id,data) {
var statusChangeButton = '<img class="tableActionButton" src="_BASE_images/run.png" style="cursor:pointer;" rel="tooltip" title="Change Status" onclick="modJs.openStatus(_id_, \'_cstatus_\');return false;"></img>';
var viewLogsButton = '<img class="tableActionButton" src="_BASE_images/log.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="View Logs" onclick="modJs.getLogs(_id_);return false;"></img>';
var html = '<div style="width:80px;">_status__logs_</div>';
html = html.replace('_logs_',viewLogsButton);
if(data[this.getStatusFieldPosition()] == 'Processing'){
html = html.replace('_status_',statusChangeButton);
}else{
html = html.replace('_status_','');
}
html = html.replace(/_id_/g,id);
html = html.replace(/_BASE_/g,this.baseUrl);
html = html.replace(/_cstatus_/g,data[this.getStatusFieldPosition()]);
return html;
});
EmployeeTravelRecordApproverAdapter.method('getStatusOptionsData', function(currentStatus) {
var data = {};
if(currentStatus != 'Processing'){
}else{
data["Approved"] = "Approved";
data["Rejected"] = "Rejected";
}
return data;
});
EmployeeTravelRecordApproverAdapter.method('getStatusOptions', function(currentStatus) {
return this.generateOptions(this.getStatusOptionsData(currentStatus));
});
/*
SubordinateExpenseModuleAdapter
*/
function SubordinateEmployeeTravelRecordAdapter(endPoint,tab,filter,orderBy) {
this.initAdapter(endPoint,tab,filter,orderBy);
this.itemName = 'Travel';
this.itemNameLower = 'employeetravelrecord';
this.modulePathName = 'travel';
}
SubordinateEmployeeTravelRecordAdapter.inherits(EmployeeTravelRecordAdminAdapter);
+4 -2
View File
@@ -1,8 +1,10 @@
<phpdox xmlns="http://phpdox.net/config"> <phpdox xmlns="http://phpdox.net/config">
<project name="ice-framework" source="src" workdir="build/phpdox"> <project name="icehrm" source="./build/app" workdir="./build/phpdox">
<collector publiconly="false"> <collector publiconly="false">
<include mask="*.php" /> <include mask="*.php" />
<exclude mask="**/lib/**"/> <exclude mask="**/lib/**"/>
<exclude mask="**/adodb512/**"/>
<exclude mask="**/composer/**"/>
</collector> </collector>
<generator output="build"> <generator output="build">
@@ -11,4 +13,4 @@
</build> </build>
</generator> </generator>
</project> </project>
</phpdox> </phpdox>
Loaded 100 of 882 files, more files were not shown because too many files have changed in this diff. Show more