v19.0.OS (#35)
* Updates from pro v19 * Update travis * Update db script * Update docs * change build script
This commit is contained in:
@@ -102,4 +102,4 @@ class AttendanceActionManager extends SubActionManager{
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -15,4 +15,4 @@
|
||||
<t>Monitor Attendance</t> <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -62,4 +62,4 @@ modJsList['tabAttendanceStatus'].setShowAddNew(false);
|
||||
var modJs = modJsList['tabAttendance'];
|
||||
|
||||
</script>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
@@ -14,4 +14,4 @@
|
||||
<t>Manage</t> <t>Company</t> <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -93,4 +93,4 @@ modJsList['tabCompanyGraph'] = new CompanyGraphAdapter('CompanyStructure');
|
||||
var modJs = modJsList['tabCompanyStructure'];
|
||||
|
||||
</script>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
@@ -17,7 +17,7 @@ along with iCE Hrm. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
------------------------------------------------------------------
|
||||
|
||||
Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
|
||||
Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
|
||||
Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
|
||||
*/
|
||||
|
||||
@@ -26,73 +26,120 @@ define('MODULE_PATH',dirname(__FILE__));
|
||||
include APP_BASE_PATH.'header.php';
|
||||
include APP_BASE_PATH.'modulejslibs.inc.php';
|
||||
|
||||
|
||||
if (!class_exists('BillingActionManager')) {
|
||||
include APP_BASE_PATH.'admin/billing/api/BillingActionManager.php';
|
||||
}
|
||||
$billingActionManager = new BillingActionManager();
|
||||
|
||||
$invoices = $billingActionManager->getInvoices(null)->getData();
|
||||
if(!empty($invoices)){
|
||||
$invoices = json_decode(json_encode($invoices));
|
||||
}
|
||||
$numOfUnpaidInvoices = 0;
|
||||
foreach($invoices as $inv){
|
||||
if($inv->status == "Sent"){
|
||||
$numOfUnpaidInvoices++;
|
||||
}
|
||||
}
|
||||
|
||||
?><div class="span9">
|
||||
<div class="row">
|
||||
<?php
|
||||
$moduleManagers = BaseService::getInstance()->getModuleManagers();
|
||||
$dashBoardList = array();
|
||||
foreach($moduleManagers as $moduleManagerObj){
|
||||
|
||||
//Check if this is not an admin module
|
||||
if($moduleManagerObj->getModuleType() != 'admin'){
|
||||
continue;
|
||||
}
|
||||
|
||||
$allowed = BaseService::getInstance()->isModuleAllowedForUser($moduleManagerObj);
|
||||
|
||||
if(!$allowed){
|
||||
continue;
|
||||
}
|
||||
|
||||
$item = $moduleManagerObj->getDashboardItem();
|
||||
if(!empty($item)) {
|
||||
$index = $moduleManagerObj->getDashboardItemIndex();
|
||||
$dashBoardList[$index] = $item;
|
||||
}
|
||||
}
|
||||
|
||||
ksort($dashBoardList);
|
||||
|
||||
foreach($dashBoardList as $k=>$v){
|
||||
echo LanguageManager::translateTnrText($v);
|
||||
}
|
||||
?>
|
||||
<div class="row">
|
||||
<?php if($numOfUnpaidInvoices == 1){?>
|
||||
<div class="callout callout-warning lead" style="font-size: 14px;">
|
||||
<h4>You have a pending invoice</h4>
|
||||
<p style="font-weight: bold;">
|
||||
You have a pending invoice. Please make you complete the payment so we can provide a better service.
|
||||
<br/>
|
||||
<br/>
|
||||
<a href="<?=CLIENT_BASE_URL?>?g=admin&n=billing&m=admin_System#tabInvoice" class="btn btn-success btm-xs"><i class="fa fa-checkout"></i> Make a Payment</a>
|
||||
</p>
|
||||
</div>
|
||||
<div id="iceannon">
|
||||
<div class="callout callout-danger lead" style="font-size: 14px;font-weight: bold;">
|
||||
<h4>Why not upgrade to IceHrm Pro Version</h4>
|
||||
<p>
|
||||
IceHrm Pro is the feature rich upgrade to IceHrm open source version. It comes with improved modules for
|
||||
employee management, leave management and number of other features over open source version.
|
||||
Hit this <a href="http://icehrm.com/#compare" class="btn btn-primary btn-xs target="_blank">link</a> to do a full one to one comparison.
|
||||
<?php }else if($numOfUnpaidInvoices > 1){?>
|
||||
<div class="callout callout-danger lead" style="font-size: 14px;">
|
||||
<h4>You have <?=$numOfUnpaidInvoices?> pending invoices</h4>
|
||||
<p style="font-weight: bold;">
|
||||
You have <?=$numOfUnpaidInvoices?> pending invoice. None of your employees are currently allowed to login. Please make sure you complete payments to all the invoices to restore your service.
|
||||
Please logout and login after completing the payment to get your service restored.
|
||||
<br/>
|
||||
<br/>
|
||||
<a href="<?=CLIENT_BASE_URL?>?g=admin&n=billing&m=admin_System#tabInvoice" class="btn btn-success btm-xs"><i class="fa fa-checkout"></i> Make a Payment</a>
|
||||
</p>
|
||||
</div>
|
||||
<?php }?>
|
||||
|
||||
Also you can learn more about IceHrm Pro <a href="http://blog.icehrm.com/docs/icehrm-pro/" class="btn btn-primary btn-xs" target="_blank">here</a>
|
||||
<?php if(SessionUtils::getSessionObject('account_locked') == "1"){?>
|
||||
<div class="callout callout-danger lead" style="font-size: 14px;">
|
||||
<h4>Your Trial Has Expired</h4>
|
||||
<p style="font-weight: bold;">
|
||||
Your Icehrm Trial has expired. Please upgrade subscription to continue. If not upgraded your account will be deleted with in few days.
|
||||
<br/>
|
||||
<br/>
|
||||
<a href="http://icehrm.com/modules.php" class="btn btn-success btm-xs" target="_blank"><i class="fa fa-checkout"></i> Buy IceHrm Pro</a>
|
||||
<a href="<?=CLIENT_BASE_URL?>?g=admin&n=billing&m=admin_System" class="btn btn-success btm-xs"><i class="fa fa-checkout"></i> Upgrade Subscription</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<?php }?>
|
||||
|
||||
<?php
|
||||
$moduleManagers = BaseService::getInstance()->getModuleManagers();
|
||||
$dashBoardList = array();
|
||||
foreach($moduleManagers as $moduleManagerObj){
|
||||
|
||||
//Check if this is not an admin module
|
||||
if($moduleManagerObj->getModuleType() != 'admin'){
|
||||
continue;
|
||||
}
|
||||
|
||||
$allowed = BaseService::getInstance()->isModuleAllowedForUser($moduleManagerObj);
|
||||
|
||||
if(!$allowed){
|
||||
continue;
|
||||
}
|
||||
|
||||
$item = $moduleManagerObj->getDashboardItem();
|
||||
if(!empty($item)) {
|
||||
$index = $moduleManagerObj->getDashboardItemIndex();
|
||||
$dashBoardList[$index] = $item;
|
||||
}
|
||||
}
|
||||
|
||||
ksort($dashBoardList);
|
||||
|
||||
foreach($dashBoardList as $k=>$v){
|
||||
echo LanguageManager::translateTnrText($v);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<script>
|
||||
var modJsList = new Array();
|
||||
var modJsList = new Array();
|
||||
|
||||
modJsList['tabDashboard'] = new DashboardAdapter('Dashboard','Dashboard');
|
||||
modJsList['tabDashboard'] = new DashboardAdapter('Dashboard','Dashboard');
|
||||
|
||||
var modJs = modJsList['tabDashboard'];
|
||||
var modJs = modJsList['tabDashboard'];
|
||||
|
||||
$(document).ready(function() {
|
||||
try {
|
||||
$.ajax({
|
||||
url: "https://icehrm-public.s3.amazonaws.com/icehrmnews.html",
|
||||
success: function (result) {
|
||||
$('#iceannon').html(result);
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
}
|
||||
/*
|
||||
$("#employeeLink").attr("href",modJs.getCustomUrl('?g=admin&n=employees&m=admin_Admin'));
|
||||
$("#companyLink").attr("href",modJs.getCustomUrl('?g=admin&n=company_structure&m=admin_Admin'));
|
||||
$("#usersLink").attr("href",modJs.getCustomUrl('?g=admin&n=users&m=admin_System'));
|
||||
$("#projectsLink").attr("href",modJs.getCustomUrl('?g=admin&n=projects&m=admin_Admin'));
|
||||
$("#attendanceLink").attr("href",modJs.getCustomUrl('?g=admin&n=attendance&m=admin_Admin'));
|
||||
$("#leaveLink").attr("href",modJs.getCustomUrl('?g=admin&n=leaves&m=admin_Admin'));
|
||||
$("#reportsLink").attr("href",modJs.getCustomUrl('?g=admin&n=reports&m=admin_Reports'));
|
||||
$("#settingsLink").attr("href",modJs.getCustomUrl('?g=admin&n=settings&m=admin_System'));
|
||||
$("#jobsLink").attr("href",modJs.getCustomUrl('?g=admin&n=jobpositions&m=admin_Recruitment'));
|
||||
$("#candidatesLink").attr("href",modJs.getCustomUrl('?g=admin&n=candidates&m=admin_Recruitment'));
|
||||
$("#trainingLink").attr("href",modJs.getCustomUrl('?g=admin&n=training&m=admin_Admin'));
|
||||
$("#travelLink").attr("href",modJs.getCustomUrl('?g=admin&n=travel&m=admin_Employees'));
|
||||
$("#documentLink").attr("href",modJs.getCustomUrl('?g=admin&n=documents&m=admin_Employees'));
|
||||
$("#expenseLink").attr("href",modJs.getCustomUrl('?g=admin&n=expenses&m=admin_Employees'));
|
||||
$("#permissionLink").attr("href",modJs.getCustomUrl('?g=admin&n=permissions&m=admin_System'));
|
||||
$("#upgradeLink").attr("href",modJs.getCustomUrl('?g=admin&n=billing&m=admin_System'));
|
||||
|
||||
modJs.getInitData();
|
||||
*/
|
||||
|
||||
});
|
||||
</script>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
@@ -102,12 +102,13 @@ class EmployeesActionManager extends SubActionManager{
|
||||
|
||||
$ok = $archived->Save();
|
||||
if(!$ok){
|
||||
return new IceResponse(IceResponse::ERROR, "Error occured while archiving employee");
|
||||
return new IceResponse(IceResponse::ERROR, "Error occurred while archiving employee");
|
||||
}
|
||||
|
||||
|
||||
$ok = $employee->Delete();
|
||||
if(!$ok){
|
||||
return new IceResponse(IceResponse::ERROR, "Error occured while deleting employee");
|
||||
return new IceResponse(IceResponse::ERROR, "Error occurred while deleting employee");
|
||||
}
|
||||
|
||||
return new IceResponse(IceResponse::SUCCESS, $archived);
|
||||
|
||||
@@ -16,10 +16,6 @@ if (!class_exists('EmployeesAdminManager')) {
|
||||
$empRestEndPoint->process('get',$pathParams);
|
||||
});
|
||||
|
||||
\NoahBuscher\Macaw\Macaw::get(REST_API_PATH.'employees', function() {
|
||||
$empRestEndPoint = new EmployeesRestEndPoint();
|
||||
$empRestEndPoint->process('get',NULL);
|
||||
});
|
||||
}
|
||||
|
||||
public function initializeDatabaseErrorMappings(){
|
||||
@@ -231,11 +227,11 @@ if (!class_exists('Employee')) {
|
||||
}
|
||||
|
||||
public static function cleanEmployeeData($obj){
|
||||
unset($obj->keysToIgnore);
|
||||
unset($obj->historyFieldsToTrack);
|
||||
unset($obj->historyUpdateList);
|
||||
unset($obj->oldObjOrig);
|
||||
unset($obj->oldObj);
|
||||
unset($obj->oldObj);
|
||||
return $obj;
|
||||
}
|
||||
|
||||
@@ -312,48 +308,39 @@ if (!class_exists('EmployeeApproval')) {
|
||||
if (!class_exists('EmployeeRestEndPoint')) {
|
||||
class EmployeeRestEndPoint extends RestEndPoint{
|
||||
public function get($parameter){
|
||||
|
||||
if(empty($parameter)){
|
||||
return new IceResponse(IceResponse::ERROR, "Employee ID not provided");
|
||||
}
|
||||
|
||||
$accessTokenValidation = $this->validateAccessToken();
|
||||
if($accessTokenValidation->getStatus() == IceResponse::ERROR){
|
||||
return $accessTokenValidation;
|
||||
if($parameter === 'list'){
|
||||
$emp = new Employee();
|
||||
$emps = $emp->Find("1=1");
|
||||
$newEmps = array();
|
||||
foreach($emps as $emp){
|
||||
$employee = new stdClass();
|
||||
$employee->id = $emp->id;
|
||||
$employee->employee_id = $emp->employee_id;
|
||||
$employee->first_name = $emp->first_name;
|
||||
$employee->middle_name = $emp->middle_name;
|
||||
$employee->last_name = $emp->last_name;
|
||||
$newEmps[] = $employee;
|
||||
|
||||
}
|
||||
return new IceResponse(IceResponse::SUCCESS, $newEmps);
|
||||
}else{
|
||||
$mapping = '{"nationality":["Nationality","id","name"],"ethnicity":["Ethnicity","id","name"],"immigration_status":["ImmigrationStatus","id","name"],"employment_status":["EmploymentStatus","id","name"],"job_title":["JobTitle","id","name"],"pay_grade":["PayGrade","id","name"],"country":["Country","code","name"],"province":["Province","id","name"],"department":["CompanyStructure","id","title"],"supervisor":["Employee","id","first_name+last_name"]}';
|
||||
$emp = BaseService::getInstance()->getElement('Employee',$parameter,$mapping,true);
|
||||
if(!empty($emp)){
|
||||
$emp = Employee::cleanEmployeeData($emp);
|
||||
return new IceResponse(IceResponse::SUCCESS,$emp);
|
||||
}
|
||||
return new IceResponse(IceResponse::ERROR, "Employee not found" ,404);
|
||||
}
|
||||
|
||||
$mapping = '{"nationality":["Nationality","id","name"],"ethnicity":["Ethnicity","id","name"],"immigration_status":["ImmigrationStatus","id","name"],"employment_status":["EmploymentStatus","id","name"],"job_title":["JobTitle","id","name"],"pay_grade":["PayGrade","id","name"],"country":["Country","code","name"],"province":["Province","id","name"],"department":["CompanyStructure","id","title"],"supervisor":["Employee","id","first_name+last_name"]}';
|
||||
$employeeResp = BaseService::getInstance()->getElement('Employee',$parameter,$mapping,true);
|
||||
if($employeeResp->getStatus() == IceResponse::SUCCESS){
|
||||
$emp = $employeeResp->getObject();
|
||||
$emp = Employee::cleanEmployeeData($emp);
|
||||
return new IceResponse(IceResponse::SUCCESS,$emp);
|
||||
}
|
||||
return $employeeResp;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (!class_exists('EmployeesRestEndPoint')) {
|
||||
class EmployeesRestEndPoint extends RestEndPoint{
|
||||
public function get($parameter){
|
||||
|
||||
$accessTokenValidation = $this->validateAccessToken();
|
||||
if($accessTokenValidation->getStatus() == IceResponse::ERROR){
|
||||
return $accessTokenValidation;
|
||||
}
|
||||
|
||||
$emp = new Employee();
|
||||
$emps = $emp->Find("1=1");
|
||||
$newEmps = array();
|
||||
foreach($emps as $emp){
|
||||
$newEmps[] = Employee::cleanEmployeeData($emp);
|
||||
}
|
||||
return new IceResponse(IceResponse::SUCCESS, $newEmps);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,30 +4,30 @@
|
||||
<div class="col-xs-12" style="text-align: center;">
|
||||
<img id="profile_image__id_" src="" class="img-polaroid img-thumbnail" style="max-width: 140px;max-height: 140px;">
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-10">
|
||||
<div class="row-fluid">
|
||||
<div class="col-xs-12 col-md-10">
|
||||
<div class="row-fluid">
|
||||
<div class="col-md-12"><h2 id="name"></h2></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<div class="col-md-12">
|
||||
<p>
|
||||
<i class="fa fa-phone"></i> <span id="mobile_phone"></span>
|
||||
<i class="fa fa-envelope"></i> <span id="work_email"></span>
|
||||
</p>
|
||||
<p>
|
||||
<i class="fa fa-phone"></i> <span id="mobile_phone"></span>
|
||||
<i class="fa fa-envelope"></i> <span id="work_email"></span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<div class="col-xs-12" style="font-size:18px;border-bottom: 1px solid #DDD;margin-bottom: 10px;padding-bottom: 10px;">
|
||||
<div class="row-fluid">
|
||||
<div class="col-xs-12" style="font-size:18px;border-bottom: 1px solid #DDD;margin-bottom: 10px;padding-bottom: 10px;">
|
||||
<button id="employeeProfileEditInfo" class="btn btn-small btn-success" onclick="modJs.edit(_id_);" style="margin-right:10px;"><i class="fa fa-edit"></i> Edit Info</button>
|
||||
<button id="employeeUploadProfileImage" onclick="showUploadDialog('profile_image__id_','Upload Profile Image','profile_image',_id_,'profile_image__id_','src','url','image');return false;" class="btn btn-small btn-primary" type="button" style="margin-right:10px;"><i class="fa fa-upload"></i> Upload Profile Image</button>
|
||||
<button id="employeeDeleteProfileImage" onclick="modJs.deleteProfileImage(_id_);return false;" class="btn btn-small btn-warning" type="button" style="margin-right:10px;"><i class="fa fa-times"></i> Delete Profile Image</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row-fluid" style="border-top: 1px;">
|
||||
</div>
|
||||
|
||||
<div class="row-fluid" style="border-top: 1px;">
|
||||
<div class="col-xs-6 col-md-4" style="font-size:16px;">
|
||||
<label class="control-label col-xs-12" style="font-size:13px;font-size:13px;">#_label_employee_id_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="employee_id"></label>
|
||||
@@ -40,19 +40,20 @@
|
||||
<label class="control-label col-xs-12" style="font-size:13px;">#_label_ssn_num_#</label>
|
||||
<label class="control-label col-xs-12 iceLabel" style="font-size:13px;font-weight: bold;" id="ssn_num"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<ul class="nav nav-tabs" id="subModTab" style="margin-bottom:0px;margin-left:5px;border-bottom: none;">
|
||||
<li class="active"><a id="tabBasic" href="#tabPageBasic">Basic Information</a></li>
|
||||
<li class=""><a id="tabQualifications" href="#tabPageQualifications">Qualifications</a></li>
|
||||
<li class=""><a id="tabFamily" href="#tabPageFamily">Family</a></li>
|
||||
<li class=""><a id="tabDocuments" href="#tabPageDocuments">Documents</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="tabPageBasic" style="border:1px solid #DDD;">
|
||||
<div class="tab-pane sub-tab active" id="tabPageBasic">
|
||||
<div class="row" style="margin-left:10px;margin-top:20px;">
|
||||
<div class="panel panel-default" style="width:97.5%;">
|
||||
<div class="panel-heading"><h4>Personal Information</h4></div>
|
||||
@@ -202,31 +203,45 @@
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- End tabPageBasic -->
|
||||
<div class="tab-pane" id="tabPageQualifications" style="border:1px solid #DDD;">
|
||||
<div class="tab-pane sub-tab" id="tabPageQualifications">
|
||||
<div class="row" style="margin-top:20px;">
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-3 sub-column">
|
||||
<div id="EmployeeSkillSubTab" class="" data-content="List" style="padding-left:5px;">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-3 sub-column">
|
||||
<div id="EmployeeEducationSubTab" class="" data-content="List" style="padding-left:5px;">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-3 sub-column">
|
||||
<div id="EmployeeCertificationSubTab" class="" data-content="List" style="padding-left:5px;">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-3 sub-column">
|
||||
<div id="EmployeeLanguageSubTab" class="" data-content="List" style="padding-left:5px;">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- End tabPageQualifications -->
|
||||
</div>
|
||||
<div class="tab-pane" id="tabPageDocuments" style="border:1px solid #DDD;">
|
||||
<div class="tab-pane sub-tab" id="tabPageFamily">
|
||||
<div class="row" style="margin-top:20px;">
|
||||
<div class="col-md-6 sub-column">
|
||||
<div id="EmployeeEmergencyContactSubTab" class="" data-content="List" style="padding-left:5px;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 sub-column">
|
||||
<div id="EmployeeDependentSubTab" class="" data-content="List" style="padding-left:5px;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane sub-tab" id="tabPageDocuments">
|
||||
<div class="row" style="margin-top:20px;">
|
||||
<div class="col-md-12">
|
||||
<div id="EmployeeDocumentSubTab" class="" data-content="List" style="padding-left:5px;">
|
||||
@@ -235,4 +250,4 @@
|
||||
</div>
|
||||
</div><!-- End tabPageQualifications -->
|
||||
</div>
|
||||
</div><!-- End tab-content -->
|
||||
</div><!-- End tab-content -->
|
||||
@@ -16,4 +16,4 @@
|
||||
<t>Manage</t> <t>Employees</t> <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -197,6 +197,9 @@ EmployeeAdapter.method('getFormFields', function() {
|
||||
[ "department", {"label":"Department","type":"select2","remote-source":["CompanyStructure","id","title"]}],
|
||||
[ "supervisor", {"label":"Direct Supervisor","type":"select2","allow-null":true,"remote-source":["Employee","id","first_name+last_name"]}],
|
||||
[ "indirect_supervisors", {"label":"Indirect Supervisors","type":"select2multi","allow-null":true,"remote-source":["Employee","id","first_name+last_name"]}],
|
||||
[ "approver1", {"label":"First Level Approver","type":"select2","allow-null":true,"remote-source":["Employee","id","first_name+last_name"]}],
|
||||
[ "approver2", {"label":"Second Level Approver","type":"select2","allow-null":true,"remote-source":["Employee","id","first_name+last_name"]}],
|
||||
[ "approver3", {"label":"Third Level Approver","type":"select2","allow-null":true,"remote-source":["Employee","id","first_name+last_name"]}],
|
||||
[ "notes", {"label":"Notes","type":"datagroup",
|
||||
"form":[
|
||||
[ "note", {"label":"Note","type":"textarea","validation":""}]
|
||||
@@ -413,7 +416,7 @@ EmployeeAdapter.method('renderEmployee', function(data) {
|
||||
}
|
||||
}
|
||||
|
||||
html = html.replace(/#_.+_#/i,"");
|
||||
html = html.replace(/#_.+_#/gi,"");
|
||||
html = html.replace(/_id_/g,data.id);
|
||||
|
||||
$("#"+this.getTableName()).html(html);
|
||||
@@ -506,6 +509,12 @@ EmployeeAdapter.method('renderEmployee', function(data) {
|
||||
modJs.subModJsList['tabEmployeeLanguageSubTab'] = new EmployeeSubLanguageAdapter('EmployeeLanguage','EmployeeLanguageSubTab',{"employee":data.id});
|
||||
modJs.subModJsList['tabEmployeeLanguageSubTab'].parent = this;
|
||||
|
||||
modJs.subModJsList['tabEmployeeDependentSubTab'] = new EmployeeSubDependentAdapter('EmployeeDependent','EmployeeDependentSubTab',{"employee":data.id});
|
||||
modJs.subModJsList['tabEmployeeDependentSubTab'].parent = this;
|
||||
|
||||
modJs.subModJsList['tabEmployeeEmergencyContactSubTab'] = new EmployeeSubEmergencyContactAdapter('EmergencyContact','EmployeeEmergencyContactSubTab',{"employee":data.id});
|
||||
modJs.subModJsList['tabEmployeeEmergencyContactSubTab'].parent = this;
|
||||
|
||||
if(this.isModuleInstalled("admin","documents")) {
|
||||
modJs.subModJsList['tabEmployeeDocumentSubTab'] = new EmployeeSubDocumentAdapter('EmployeeDocument', 'EmployeeDocumentSubTab', {"employee": data.id});
|
||||
modJs.subModJsList['tabEmployeeDocumentSubTab'].parent = this;
|
||||
@@ -547,6 +556,16 @@ EmployeeAdapter.method('renderEmployee', function(data) {
|
||||
modJs.subModJsList['tabEmployeeLanguageSubTab'].setShowCancel(false);
|
||||
modJs.subModJsList['tabEmployeeLanguageSubTab'].get([]);
|
||||
|
||||
modJs.subModJsList['tabEmployeeDependentSubTab'].setShowFormOnPopup(true);
|
||||
modJs.subModJsList['tabEmployeeDependentSubTab'].setShowAddNew(false);
|
||||
modJs.subModJsList['tabEmployeeDependentSubTab'].setShowCancel(false);
|
||||
modJs.subModJsList['tabEmployeeDependentSubTab'].get([]);
|
||||
|
||||
modJs.subModJsList['tabEmployeeEmergencyContactSubTab'].setShowFormOnPopup(true);
|
||||
modJs.subModJsList['tabEmployeeEmergencyContactSubTab'].setShowAddNew(false);
|
||||
modJs.subModJsList['tabEmployeeEmergencyContactSubTab'].setShowCancel(false);
|
||||
modJs.subModJsList['tabEmployeeEmergencyContactSubTab'].get([]);
|
||||
|
||||
if(this.isModuleInstalled("admin","documents")) {
|
||||
modJs.subModJsList['tabEmployeeDocumentSubTab'].setShowFormOnPopup(true);
|
||||
modJs.subModJsList['tabEmployeeDocumentSubTab'].setShowAddNew(false);
|
||||
@@ -1372,7 +1391,7 @@ EmployeeSubSkillsAdapter.method('getSubHeaderTitle', function() {
|
||||
});
|
||||
|
||||
EmployeeSubSkillsAdapter.method('getSubItemHtml', function(item, itemDelete, itemEdit) {
|
||||
var itemHtml = $('<a href="#" class="list-group-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'+item[2]+itemDelete+itemEdit+'</h5><p class="list-group-item-text">'+nl2br(item[3])+'</p></a>');
|
||||
var itemHtml = $('<div class="list-group-item sub-tab-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'+item[2]+itemDelete+itemEdit+'</h5><p class="list-group-item-text">'+nl2br(item[3])+'</p></div>');
|
||||
return itemHtml;
|
||||
});
|
||||
|
||||
@@ -1451,8 +1470,8 @@ EmployeeSubEducationAdapter.method('getSubItemHtml', function(item, itemDelete,
|
||||
try{
|
||||
end = Date.parse(item[5]).toString('MMM d, yyyy');
|
||||
}catch(e){}
|
||||
//var itemHtml = $('<a href="#" class="list-group-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'+item[2]+itemDelete+itemEdit+'</h5><p class="list-group-item-text">'+nl2br(item[3])+'</p></a>');
|
||||
var itemHtml = $('<a href="#" class="list-group-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'+item[2]+itemDelete+itemEdit+'</h5><p class="list-group-item-text"><i class="fa fa-calendar"></i> Start: <b>'+start+'</b></p><p class="list-group-item-text">'+'<i class="fa fa-calendar"></i> Completed: <b>'+end+'</b></p><p class="list-group-item-text">'+'<i class="fa fa-building-o"></i> Institute: <b>'+item[3]+'</b></p></a>');
|
||||
//var itemHtml = $('<div class="list-group-item sub-tab-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'+item[2]+itemDelete+itemEdit+'</h5><p class="list-group-item-text">'+nl2br(item[3])+'</p></div>');
|
||||
var itemHtml = $('<div class="list-group-item sub-tab-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'+item[2]+itemDelete+itemEdit+'</h5><p class="list-group-item-text"><i class="fa fa-calendar"></i> Start: <b>'+start+'</b></p><p class="list-group-item-text">'+'<i class="fa fa-calendar"></i> Completed: <b>'+end+'</b></p><p class="list-group-item-text">'+'<i class="fa fa-building-o"></i> Institute: <b>'+item[3]+'</b></p></div>');
|
||||
return itemHtml;
|
||||
});
|
||||
|
||||
@@ -1529,7 +1548,7 @@ EmployeeSubCertificationAdapter.method('getSubItemHtml', function(item, itemDele
|
||||
try{
|
||||
end = Date.parse(item[5]).toString('MMM d, yyyy');
|
||||
}catch(e){}
|
||||
var itemHtml = $('<a href="#" class="list-group-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'+item[2]+itemDelete+itemEdit+'</h5><p class="list-group-item-text"><i class="fa fa-calendar"></i> Granted On: <b>'+start+'</b></p><p class="list-group-item-text">'+'<i class="fa fa-calendar"></i> Valid Thru: <b>'+end+'</b></p><p class="list-group-item-text">'+'<i class="fa fa-building-o"></i> Institute: <b>'+item[3]+'</b></p></a>');
|
||||
var itemHtml = $('<div class="list-group-item sub-tab-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'+item[2]+itemDelete+itemEdit+'</h5><p class="list-group-item-text"><i class="fa fa-calendar"></i> Granted On: <b>'+start+'</b></p><p class="list-group-item-text">'+'<i class="fa fa-calendar"></i> Valid Thru: <b>'+end+'</b></p><p class="list-group-item-text">'+'<i class="fa fa-building-o"></i> Institute: <b>'+item[3]+'</b></p></div>');
|
||||
return itemHtml;
|
||||
});
|
||||
|
||||
@@ -1607,7 +1626,7 @@ EmployeeSubLanguageAdapter.method('getSubHeaderTitle', function() {
|
||||
});
|
||||
|
||||
EmployeeSubLanguageAdapter.method('getSubItemHtml', function(item, itemDelete, itemEdit) {
|
||||
var itemHtml = $('<a href="#" class="list-group-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'+item[2]+itemDelete+itemEdit+'</h5><p class="list-group-item-text"><i class="fa fa-asterisk"></i> Reading: <b>'+item[3]+'</b></p><p class="list-group-item-text">'+'<i class="fa fa-asterisk"></i> Speaking: <b>'+ item[4] +'</b></p><p class="list-group-item-text">'+'<i class="fa fa-asterisk"></i> Writing: <b>'+item[5]+'</b></p><p class="list-group-item-text">'+'<i class="fa fa-asterisk"></i> Understanding: <b>'+item[6]+'</b></p></a>');
|
||||
var itemHtml = $('<div class="list-group-item sub-tab-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'+item[2]+itemDelete+itemEdit+'</h5><p class="list-group-item-text"><i class="fa fa-asterisk"></i> Reading: <b>'+item[3]+'</b></p><p class="list-group-item-text">'+'<i class="fa fa-asterisk"></i> Speaking: <b>'+ item[4] +'</b></p><p class="list-group-item-text">'+'<i class="fa fa-asterisk"></i> Writing: <b>'+item[5]+'</b></p><p class="list-group-item-text">'+'<i class="fa fa-asterisk"></i> Understanding: <b>'+item[6]+'</b></p></div>');
|
||||
return itemHtml;
|
||||
});
|
||||
|
||||
@@ -1619,6 +1638,154 @@ EmployeeSubLanguageAdapter.method('isSubProfileTable', function() {
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* @class EmployeeSubDependentAdapter
|
||||
* @param endPoint
|
||||
* @param tab
|
||||
* @param filter
|
||||
* @param orderBy
|
||||
* @returns
|
||||
*/
|
||||
|
||||
function EmployeeSubDependentAdapter(endPoint,tab,filter,orderBy) {
|
||||
this.initAdapter(endPoint,tab,filter,orderBy);
|
||||
}
|
||||
|
||||
EmployeeSubDependentAdapter.inherits(SubAdapterBase);
|
||||
|
||||
|
||||
|
||||
EmployeeSubDependentAdapter.method('getDataMapping', function() {
|
||||
return [
|
||||
"id",
|
||||
"employee",
|
||||
"name",
|
||||
"relationship",
|
||||
"dob",
|
||||
"id_number"
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
EmployeeSubDependentAdapter.method('getHeaders', function() {
|
||||
return [
|
||||
{ "sTitle": "ID" ,"bVisible":false},
|
||||
{ "sTitle": "Employee" },
|
||||
{ "sTitle": "Name" },
|
||||
{ "sTitle": "Relationship"},
|
||||
{ "sTitle": "Date of Birth"},
|
||||
{ "sTitle": "Id Number"}
|
||||
];
|
||||
});
|
||||
|
||||
EmployeeSubDependentAdapter.method('getFormFields', function() {
|
||||
return [
|
||||
[ "id", {"label":"ID","type":"hidden"}],
|
||||
[ "employee", {"label":"Employee","type":"hidden"}],
|
||||
[ "name", {"label":"Name","type":"text","validation":""}],
|
||||
[ "relationship", {"label":"Relationship","type":"select","source":[["Child","Child"],["Spouse","Spouse"],["Parent","Parent"],["Other","Other"]]}],
|
||||
[ "dob", {"label":"Date of Birth","type":"date","validation":""}],
|
||||
[ "id_number", {"label":"Id Number","type":"text","validation":"none"}]
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
EmployeeSubDependentAdapter.method('forceInjectValuesBeforeSave', function(params) {
|
||||
params['employee'] = this.parent.currentId;
|
||||
return params;
|
||||
});
|
||||
|
||||
EmployeeSubDependentAdapter.method('getSubHeaderTitle', function() {
|
||||
var addBtn = '<button class="btn btn-small btn-success" onclick="modJs.subModJsList[\'tab'+this.tab+'\'].renderForm();" style="margin-right:10px;"><i class="fa fa-plus"></i></button>';
|
||||
return addBtn + "Dependents";
|
||||
});
|
||||
|
||||
EmployeeSubDependentAdapter.method('getSubItemHtml', function(item, itemDelete, itemEdit) {
|
||||
|
||||
|
||||
var itemHtml = $('<div class="list-group-item sub-tab-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'+item[2]+itemDelete+itemEdit+'</h5><p class="list-group-item-text"><i class="fa fa-users"></i> Relationship: <b>'+item[3]+'</b></p><p class="list-group-item-text">'+'<i class="fa fa-user"></i> Name: <b>'+item[2]+'</b></p></div>');
|
||||
return itemHtml;
|
||||
});
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @class EmployeeSubEmergencyContactAdapter
|
||||
* @param endPoint
|
||||
* @param tab
|
||||
* @param filter
|
||||
* @param orderBy
|
||||
* @returns
|
||||
*/
|
||||
|
||||
function EmployeeSubEmergencyContactAdapter(endPoint,tab,filter,orderBy) {
|
||||
this.initAdapter(endPoint,tab,filter,orderBy);
|
||||
}
|
||||
|
||||
EmployeeSubEmergencyContactAdapter.inherits(SubAdapterBase);
|
||||
|
||||
|
||||
|
||||
EmployeeSubEmergencyContactAdapter.method('getDataMapping', function() {
|
||||
return [
|
||||
"id",
|
||||
"employee",
|
||||
"name",
|
||||
"relationship",
|
||||
"home_phone",
|
||||
"work_phone",
|
||||
"mobile_phone"
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
EmployeeSubEmergencyContactAdapter.method('getHeaders', function() {
|
||||
return [
|
||||
{ "sTitle": "ID" ,"bVisible":false},
|
||||
{ "sTitle": "Employee" },
|
||||
{ "sTitle": "Name" },
|
||||
{ "sTitle": "Relationship"},
|
||||
{ "sTitle": "Home Phone"},
|
||||
{ "sTitle": "Work Phone"},
|
||||
{ "sTitle": "Mobile Phone"}
|
||||
];
|
||||
});
|
||||
|
||||
EmployeeSubEmergencyContactAdapter.method('getFormFields', function() {
|
||||
return [
|
||||
[ "id", {"label":"ID","type":"hidden"}],
|
||||
[ "employee", {"label":"Employee","type":"hidden"}],
|
||||
[ "name", {"label":"Name","type":"text","validation":""}],
|
||||
[ "relationship", {"label":"Relationship","type":"text","validation":"none"}],
|
||||
[ "home_phone", {"label":"Home Phone","type":"text","validation":"none"}],
|
||||
[ "work_phone", {"label":"Work Phone","type":"text","validation":"none"}],
|
||||
[ "mobile_phone", {"label":"Mobile Phone","type":"text","validation":"none"}]
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
EmployeeSubEmergencyContactAdapter.method('forceInjectValuesBeforeSave', function(params) {
|
||||
params['employee'] = this.parent.currentId;
|
||||
return params;
|
||||
});
|
||||
|
||||
EmployeeSubEmergencyContactAdapter.method('getSubHeaderTitle', function() {
|
||||
var addBtn = '<button class="btn btn-small btn-success" onclick="modJs.subModJsList[\'tab'+this.tab+'\'].renderForm();" style="margin-right:10px;"><i class="fa fa-plus"></i></button>';
|
||||
return addBtn + "Emergency Contacts";
|
||||
});
|
||||
|
||||
EmployeeSubEmergencyContactAdapter.method('getSubItemHtml', function(item, itemDelete, itemEdit) {
|
||||
|
||||
|
||||
var itemHtml = $('<div class="list-group-item sub-tab-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'+item[2]+itemDelete+itemEdit+'</h5><p class="list-group-item-text"><i class="fa fa-users"></i> Relationship: <b>'+item[3]+'</b></p><p class="list-group-item-text">'+'<i class="fa fa-user"></i> Name: <b>'+item[2]+'</b></p><p class="list-group-item-text"><i class="fa fa-phone"></i> Home Phone: <b>'+item[4]+'</b></p><p class="list-group-item-text"><i class="fa fa-phone"></i> Mobile Phone: <b>'+item[6]+'</b></p></div>');
|
||||
return itemHtml;
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @class EmployeeSubDocumentAdapter
|
||||
@@ -1692,10 +1859,15 @@ EmployeeSubDocumentAdapter.method('getSubItemHtml', function(item, itemDelete, i
|
||||
try{
|
||||
expire = Date.parse(item[5]).toString('MMM d, yyyy');
|
||||
}catch(e){}
|
||||
var itemHtml = $('<a href="#" class="list-group-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'+item[2]+itemDelete+itemEdit+'</h5><p class="list-group-item-text">'+nl2br(item[3])+'</p><p class="list-group-item-text">'+'<i class="fa fa-calendar"></i> Expire On: <b>'+expire+'</b></p></a>');
|
||||
|
||||
var downloadButton = '<button id="#_id_#_download" onclick="download(\''+item[7]+'\');return false;" type="button" style="position: absolute;bottom: 5px;right: 70px;font-size: 13px;" tooltip="Download"><li class="fa fa-cloud-download"></li></button>';
|
||||
|
||||
var itemHtml = $('<div class="list-group-item sub-tab-item"><h5 class="list-group-item-heading" style="font-weight:bold;">'+item[2]+downloadButton+itemDelete+itemEdit+'</h5><p class="list-group-item-text">'+nl2br(item[3])+'</p><p class="list-group-item-text">'+'<i class="fa fa-calendar"></i> Expire On: <b>'+expire+'</b></p></div>');
|
||||
return itemHtml;
|
||||
});
|
||||
|
||||
|
||||
|
||||
EmployeeSubDocumentAdapter.method('isSubProfileTable', function() {
|
||||
if(this.user.user_level == "Admin"){
|
||||
return false;
|
||||
|
||||
@@ -79,4 +79,4 @@ if (!class_exists('CustomField')) {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -54,4 +54,4 @@ modJsList['tabEmployeeCustomField'].setTableType("Employee");
|
||||
var modJs = modJsList['tabEmployeeFieldName'];
|
||||
|
||||
</script>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
@@ -70,4 +70,4 @@ modJsList['tabEmploymentStatus'] = new EmploymentStatusAdapter('EmploymentStatus
|
||||
var modJs = modJsList['tabJobTitles'];
|
||||
|
||||
</script>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
@@ -61,4 +61,4 @@ modJsList['tabEmployeeCompanyLoan'] = new EmployeeCompanyLoanAdapter('EmployeeCo
|
||||
var modJs = modJsList['tabCompanyLoan'];
|
||||
|
||||
</script>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
@@ -3,5 +3,6 @@
|
||||
"Employees":"fa-users",
|
||||
"Admin Reports":"fa-file-text",
|
||||
"System":"fa-cogs",
|
||||
"Insights":"fa-bar-chart-o",
|
||||
"Payroll":"fa-money"
|
||||
}
|
||||
|
||||
27
ext/admin/overtime/api/OvertimeActionManager.php
Normal file
27
ext/admin/overtime/api/OvertimeActionManager.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
class OvertimeActionManager extends ApproveAdminActionManager{
|
||||
|
||||
public function getModelClass(){
|
||||
return "EmployeeOvertime";
|
||||
}
|
||||
|
||||
public function getItemName(){
|
||||
return "Overtime Request";
|
||||
}
|
||||
|
||||
public function getModuleName(){
|
||||
return "Overtime Management";
|
||||
}
|
||||
|
||||
public function getModuleTabUrl(){
|
||||
return "g=modules&n=overtime&m=module_Time_Management#tabEmployeeOvertime";
|
||||
}
|
||||
|
||||
public function getModuleSubordinateTabUrl(){
|
||||
return "g=modules&n=overtime&m=module_Time_Management#tabSubordinateEmployeeOvertime";
|
||||
}
|
||||
|
||||
public function getModuleApprovalTabUrl(){
|
||||
return "g=modules&n=overtime&m=module_Time_Management#tabEmployeeOvertimeApproval";
|
||||
}
|
||||
}
|
||||
123
ext/admin/overtime/api/OvertimeAdminManager.php
Normal file
123
ext/admin/overtime/api/OvertimeAdminManager.php
Normal file
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
if (!class_exists('OvertimeAdminManager')) {
|
||||
|
||||
class OvertimeAdminManager extends AbstractModuleManager{
|
||||
|
||||
public function initializeUserClasses(){
|
||||
if(defined('MODULE_TYPE') && MODULE_TYPE != 'admin'){
|
||||
$this->addUserClass("EmployeeOvertime");
|
||||
}
|
||||
}
|
||||
|
||||
public function initializeFieldMappings(){
|
||||
|
||||
}
|
||||
|
||||
public function initializeDatabaseErrorMappings(){
|
||||
|
||||
}
|
||||
|
||||
public function setupModuleClassDefinitions(){
|
||||
|
||||
$this->addModelClass('OvertimeCategory');
|
||||
$this->addModelClass('EmployeeOvertime');
|
||||
$this->addModelClass('EmployeeOvertimeApproval');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!class_exists('OvertimeCategory')) {
|
||||
class OvertimeCategory extends ICEHRM_Record {
|
||||
var $_table = 'OvertimeCategories';
|
||||
|
||||
public function getAdminAccess(){
|
||||
return array("get","element","save","delete");
|
||||
}
|
||||
|
||||
public function getManagerAccess(){
|
||||
return array("get","element","save","delete");
|
||||
}
|
||||
|
||||
public function getUserAccess(){
|
||||
return array("get");
|
||||
}
|
||||
|
||||
public function getUserOnlyMeAccess(){
|
||||
return array("get","element");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!class_exists('EmployeeOvertime')) {
|
||||
class EmployeeOvertime extends ApproveModel
|
||||
{
|
||||
var $_table = 'EmployeeOvertime';
|
||||
|
||||
var $notificationModuleName = "Overtime Management";
|
||||
var $notificationUnitName = "OvertimeRequest";
|
||||
var $notificationUnitPrefix = "An";
|
||||
var $notificationUnitAdminUrl = "g=modules&n=overtime&m=module_Time_Management#tabSubordinateEmployeeOvertime";
|
||||
var $preApproveSettingName = "Attendance: Pre-Approve Overtime Request";
|
||||
|
||||
public function isMultiLevelApprovalsEnabled(){
|
||||
return (SettingsManager::getInstance()->getSetting('Overtime: Enable Multi Level Approvals') == '1');
|
||||
}
|
||||
|
||||
public function getAdminAccess()
|
||||
{
|
||||
return array("get", "element", "save", "delete");
|
||||
}
|
||||
|
||||
public function getManagerAccess()
|
||||
{
|
||||
return array("get", "element", "save", "delete");
|
||||
}
|
||||
|
||||
public function getUserAccess()
|
||||
{
|
||||
return array("get");
|
||||
}
|
||||
|
||||
public function getUserOnlyMeAccess()
|
||||
{
|
||||
return array("element", "save", "delete");
|
||||
}
|
||||
|
||||
public function fieldsNeedToBeApproved()
|
||||
{
|
||||
return array(
|
||||
"start_time",
|
||||
"end_time"
|
||||
);
|
||||
}
|
||||
|
||||
public function getType(){
|
||||
return 'EmployeeOvertime';
|
||||
}
|
||||
|
||||
public function allowIndirectMapping(){
|
||||
if(SettingsManager::getInstance()->getSetting('Overtime: Allow Indirect Admins to Approve') == '1'){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!class_exists('EmployeeOvertimeApproval')) {
|
||||
|
||||
class EmployeeOvertimeApproval extends EmployeeOvertime
|
||||
{
|
||||
|
||||
public function Find($whereOrderBy,$bindarr=false,$pkeysArr=false,$extra=array()){
|
||||
return $this->findApprovals(new EmployeeOvertime(), $whereOrderBy,$bindarr,$pkeysArr,$extra);
|
||||
}
|
||||
}
|
||||
}
|
||||
42
ext/admin/overtime/index.php
Normal file
42
ext/admin/overtime/index.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/*
|
||||
This file is part of iCE Hrm.
|
||||
|
||||
iCE Hrm is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
iCE Hrm is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with iCE Hrm. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
------------------------------------------------------------------
|
||||
|
||||
Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
|
||||
Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
|
||||
*/
|
||||
|
||||
$moduleName = 'travel';
|
||||
define('MODULE_PATH',dirname(__FILE__));
|
||||
include APP_BASE_PATH.'header.php';
|
||||
include APP_BASE_PATH.'modulejslibs.inc.php';
|
||||
|
||||
$options = array();
|
||||
$options['setRemoteTable'] = 'true';
|
||||
|
||||
$moduleBuilder = new ModuleBuilder();
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab('OvertimeCategory','OvertimeCategory','Overtime Categories','OvertimeCategoryAdapter','','',true,$options));
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab('EmployeeOvertime','EmployeeOvertime','Overtime Requests','EmployeeOvertimeAdminAdapter','','',false,$options));
|
||||
echo UIManager::getInstance()->renderModule($moduleBuilder);
|
||||
|
||||
|
||||
$itemName = 'OvertimeRequest';
|
||||
$moduleName = 'Time Management';
|
||||
$itemNameLower = strtolower($itemName);
|
||||
|
||||
include APP_BASE_PATH.'footer.php';
|
||||
99
ext/admin/overtime/lib.js
Normal file
99
ext/admin/overtime/lib.js
Normal file
@@ -0,0 +1,99 @@
|
||||
/**
|
||||
* Author: Thilina Hasantha
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* OvertimeCategoryAdapter
|
||||
*/
|
||||
|
||||
function OvertimeCategoryAdapter(endPoint) {
|
||||
this.initAdapter(endPoint);
|
||||
}
|
||||
|
||||
OvertimeCategoryAdapter.inherits(AdapterBase);
|
||||
|
||||
|
||||
|
||||
OvertimeCategoryAdapter.method('getDataMapping', function() {
|
||||
return [
|
||||
"id",
|
||||
"name"
|
||||
];
|
||||
});
|
||||
|
||||
OvertimeCategoryAdapter.method('getHeaders', function() {
|
||||
return [
|
||||
{ "sTitle": "ID" ,"bVisible":false},
|
||||
{ "sTitle": "Name" }
|
||||
];
|
||||
});
|
||||
|
||||
OvertimeCategoryAdapter.method('getFormFields', function() {
|
||||
return [
|
||||
[ "id", {"label":"ID","type":"hidden"}],
|
||||
[ "name", {"label":"Name","type":"text","validation":""}]
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* EmployeeOvertimeAdminAdapter
|
||||
*/
|
||||
|
||||
|
||||
function EmployeeOvertimeAdminAdapter(endPoint,tab,filter,orderBy) {
|
||||
this.initAdapter(endPoint,tab,filter,orderBy);
|
||||
this.itemName = 'OvertimeRequest';
|
||||
this.itemNameLower = 'overtimerequest';
|
||||
this.modulePathName = 'overtime';
|
||||
}
|
||||
|
||||
EmployeeOvertimeAdminAdapter.inherits(ApproveAdminAdapter);
|
||||
|
||||
|
||||
|
||||
EmployeeOvertimeAdminAdapter.method('getDataMapping', function() {
|
||||
return [
|
||||
"id",
|
||||
"employee",
|
||||
"category",
|
||||
"start_time",
|
||||
"end_time",
|
||||
"project",
|
||||
"status"
|
||||
];
|
||||
});
|
||||
|
||||
EmployeeOvertimeAdminAdapter.method('getHeaders', function() {
|
||||
return [
|
||||
{ "sTitle": "ID" ,"bVisible":false},
|
||||
{ "sTitle": "Employee" },
|
||||
{ "sTitle": "Category" },
|
||||
{ "sTitle": "Start Time" },
|
||||
{ "sTitle": "End Time"},
|
||||
{ "sTitle": "Project"},
|
||||
{ "sTitle": "Status"}
|
||||
];
|
||||
});
|
||||
|
||||
EmployeeOvertimeAdminAdapter.method('getFormFields', function() {
|
||||
return [
|
||||
["id", {"label": "ID", "type": "hidden"}],
|
||||
["employee", {
|
||||
"label": "Employee",
|
||||
"type": "select2",
|
||||
"sort": "none",
|
||||
"allow-null": false,
|
||||
"remote-source": ["Employee", "id", "first_name+last_name", "getActiveSubordinateEmployees"]
|
||||
}],
|
||||
["category", {"label": "Category", "type": "select2", "allow-null":false, "remote-source": ["OvertimeCategory", "id", "name"]}],
|
||||
["start_time", {"label": "Start Time", "type": "datetime", "validation": ""}],
|
||||
["end_time", {"label": "End Time", "type": "datetime", "validation": ""}],
|
||||
["project", {"label": "Project", "type": "select2", "allow-null":true,"null=label":"none","remote-source": ["Project", "id", "name"]}],
|
||||
["notes", {"label": "Notes", "type": "textarea", "validation": "none"}]
|
||||
];
|
||||
});
|
||||
|
||||
12
ext/admin/overtime/meta.json
Normal file
12
ext/admin/overtime/meta.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"label":"Overtime Administration",
|
||||
"menu":"Employees",
|
||||
"order":"94",
|
||||
"icon":"fa-align-center",
|
||||
"user_levels":["Admin","Manager"],
|
||||
"dashboardPosition":13,
|
||||
|
||||
"permissions":
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -16,4 +16,4 @@
|
||||
<t>Manage</t> <t>Permissions</t> <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -51,4 +51,4 @@ modJsList['tabPermission'].setShowAddNew(false);
|
||||
var modJs = modJsList['tabPermission'];
|
||||
|
||||
</script>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
@@ -14,4 +14,4 @@
|
||||
<t>Update Clients/Projects</t> <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -110,4 +110,4 @@ modJsList['tabEmployeeProject'].setShowEdit(false);
|
||||
var modJs = modJsList['tabClient'];
|
||||
|
||||
</script>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
@@ -124,4 +124,4 @@ modJsList['tabLanguage'].setShowEdit(false);
|
||||
var modJs = modJsList['tabSkill'];
|
||||
|
||||
</script>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
@@ -14,4 +14,4 @@
|
||||
<t>Generate a Report</t> <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -35,4 +35,4 @@ modJsList['tabReport'].setRemoteTable(true);
|
||||
var modJs = modJsList['tabReport'];
|
||||
|
||||
</script>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
66
ext/admin/reports/reportClasses/OvertimeRequestReport.php
Normal file
66
ext/admin/reports/reportClasses/OvertimeRequestReport.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
if(!class_exists('ReportBuilder')){
|
||||
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilder.php';
|
||||
}
|
||||
class OvertimeRequestReport extends CSVReportBuilder implements CSVReportBuilderInterface{
|
||||
|
||||
public function getMainQuery(){
|
||||
$query = "SELECT
|
||||
(SELECT `employee_id` from Employees where id = at.employee) as 'Employee',
|
||||
(SELECT concat(`first_name`,' ',`middle_name`,' ', `last_name`) from Employees where id = at.employee) as 'Employee',
|
||||
(SELECT `name` from OvertimeCategories where id = at.category) as 'Category',
|
||||
(SELECT `name` from Projects where id = at.project) as 'Project',
|
||||
start_time as 'Start Time',
|
||||
end_time as 'End Time',
|
||||
notes as 'Notes',
|
||||
status as 'Status'
|
||||
FROM EmployeeOvertime at";
|
||||
|
||||
return $query;
|
||||
|
||||
}
|
||||
|
||||
public function getWhereQuery($request){
|
||||
|
||||
$employeeList = array();
|
||||
if(!empty($request['employee'])){
|
||||
$employeeList = json_decode($request['employee'],true);
|
||||
}
|
||||
|
||||
if(in_array("NULL", $employeeList) ){
|
||||
$employeeList = array();
|
||||
}
|
||||
|
||||
if(!empty($employeeList)){
|
||||
$query = "where employee in (".implode(",", $employeeList).") and start_time >= ? and end_time <= ?";
|
||||
$params = array(
|
||||
$request['date_start']." 00:00:00",
|
||||
$request['date_end']." 23:59:59",
|
||||
);
|
||||
}else{
|
||||
$query = "where start_time >= ? and end_time <= ?";
|
||||
$params = array(
|
||||
$request['date_start']." 00:00:00",
|
||||
$request['date_end']." 23:59:59",
|
||||
);
|
||||
}
|
||||
|
||||
if(!empty($request['category']) && $request['category'] != "NULL"){
|
||||
$query.= " and category = ?";
|
||||
$params[] = $request['category'];
|
||||
}
|
||||
|
||||
if(!empty($request['project']) && $request['project'] != "NULL"){
|
||||
$query.= " and project = ?";
|
||||
$params[] = $request['project'];
|
||||
}
|
||||
|
||||
$query.=" order by start_time desc;";
|
||||
|
||||
LogManager::getInstance()->info("Query:".$query);
|
||||
LogManager::getInstance()->info("Params:".json_encode($params));
|
||||
|
||||
return array($query, $params);
|
||||
}
|
||||
}
|
||||
@@ -205,4 +205,4 @@ class PDFReportBuilder extends ReportBuilder{
|
||||
}
|
||||
return array($fileFirstPart, $fileName, $fileFullName);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,4 +11,4 @@
|
||||
<button onclick="modJs.cancel();return false;" class="btn"><t>Cancel</t></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</form>
|
||||
@@ -14,4 +14,4 @@ $moduleBuilder->addModuleOrGroup(new ModuleTab('EmployeeSalary','EmployeeSalary'
|
||||
|
||||
echo UIManager::getInstance()->renderModule($moduleBuilder);
|
||||
|
||||
include APP_BASE_PATH.'footer.php';
|
||||
include APP_BASE_PATH.'footer.php';
|
||||
|
||||
@@ -37,6 +37,8 @@ class SettingsInitialize extends AbstractInitialize{
|
||||
}
|
||||
}
|
||||
|
||||
BaseService::getInstance()->getMigrationManager()->ensureMigrations();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,4 +14,4 @@
|
||||
<t>Update</t> <t>Settings</t> <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -34,7 +34,10 @@ $options1['setShowAddNew'] = 'false';
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab('CompanySetting','Setting','Company','SettingAdapter','{"name":["Company:"]}','name',true,$options1));
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab('SystemSetting','Setting','System','SettingAdapter','{"name":["System:"]}','name',false,$options1));
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab('EmailSetting','Setting','Email','SettingAdapter','{"name":["Email:"]}','name',false,$options1));
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab('LDAPSetting','Setting','LDAP','SettingAdapter','{"name":["LDAP:"]}','name',false,$options1));
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab('LeaveSetting','Setting','Leave / PTO','SettingAdapter','{"name":["Leave:"]}','name',false,$options1));
|
||||
if(!defined('LDAP_ENABLED') || LDAP_ENABLED == true){
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab('LDAPSetting','Setting','LDAP','SettingAdapter','{"name":["LDAP:"]}','name',false,$options1));
|
||||
}
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab('AttendanceSetting','Setting','Attendance','SettingAdapter','{"name":["Attendance:"]}','name',false,$options1));
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab('OtherSetting','Setting','Other','SettingAdapter','{"name":["Projects:","Recruitment:","Notifications:","Expense:","Travel:","Api:","Overtime:"]}','name',false,$options1));
|
||||
echo UIManager::getInstance()->renderModule($moduleBuilder);
|
||||
@@ -47,4 +50,4 @@ $(window).load(function() {
|
||||
});
|
||||
|
||||
</script>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
@@ -108,4 +108,4 @@ SettingAdapter.method('loadRemoteDataForSettings', function () {
|
||||
|
||||
SettingAdapter.method('getHelpLink', function () {
|
||||
return 'http://blog.icehrm.com/docs/settings/';
|
||||
});
|
||||
});
|
||||
@@ -13,4 +13,4 @@
|
||||
<button onclick="modJs.cancel();return false;" class="btn"><t>Cancel</t></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</form>
|
||||
@@ -152,4 +152,4 @@ if (!class_exists('EmployeeTravelRecordApproval')) {
|
||||
return $this->findApprovals(new EmployeeTravelRecord(), $whereOrderBy,$bindarr,$pkeysArr,$extra);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,4 +16,4 @@
|
||||
<t>Manage</t> <t>Travel</t> <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -38,4 +38,4 @@ $itemName = 'TravelRequest';
|
||||
$moduleName = 'Travel Management';
|
||||
$itemNameLower = strtolower($itemName);
|
||||
|
||||
include APP_BASE_PATH.'footer.php';
|
||||
include APP_BASE_PATH.'footer.php';
|
||||
@@ -14,4 +14,4 @@
|
||||
<t>Manage</t> <t>Users</t> <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -63,4 +63,4 @@ modJsList['tabUserRole'] = new UserRoleAdapter('UserRole');
|
||||
var modJs = modJsList['tabUser'];
|
||||
|
||||
</script>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
Reference in New Issue
Block a user