Updates from pro v19

This commit is contained in:
Gamonoid
2016-11-25 17:21:30 +01:00
parent e6b4245334
commit ed739aa4e1
26 changed files with 1187 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
<?php
class OvertimeActionManager extends ApproveModuleActionManager{
public function getModelClass(){
return "EmployeeOvertime";
}
public function getItemName(){
return "Overtime Request";
}
public function getModuleName(){
return "Overtime Management";
}
public function getModuleTabUrl(){
return "g=modules&n=overtime&m=module_Time_Management#SubordinateEmployeeOvertime";
}
}

View File

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

View File

@@ -0,0 +1,94 @@
<?php
/*
This file is part of iCE Hrm.
iCE Hrm is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
iCE Hrm is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with iCE Hrm. If not, see <http://www.gnu.org/licenses/>.
------------------------------------------------------------------
Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
*/
$moduleName = 'overtime';
$moduleMainName = "EmployeeOvertime"; // for creating module js lib
$subModuleMainName = "SubordinateEmployeeOvertime";
$moduleItemName = "Overtime Request"; // For permissions
$itemName = $moduleItemName; // for status change popup
$itemNameLower = strtolower($moduleMainName); // for status change popup
$appModName = $moduleMainName.'Approval';
define('MODULE_PATH',dirname(__FILE__));
include APP_BASE_PATH.'header.php';
$additionalJs = array();
$additionalJs[] = BASE_URL.'admin/overtime/lib.js?v='.$jsVersion;
include APP_BASE_PATH.'modulejslibs.inc.php';
?><div class="span9">
<ul class="nav nav-tabs" id="modTab" style="margin-bottom:0px;margin-left:5px;border-bottom: none;">
<li class="active"><a id="tab<?=$moduleMainName?>" href="#tabPage<?=$moduleMainName?>"><?=LanguageManager::tran('Overtime Requests')?></a></li>
<li class=""><a id="tab<?=$subModuleMainName?>" href="#tabPage<?=$subModuleMainName?>"><?=LanguageManager::tran('Subordinate Overtime Requests')?></a></li>
<li class=""><a id="tab<?=$appModName?>" href="#tabPage<?=$appModName?>"><?=LanguageManager::tran('Overtime Request Approval')?></a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tabPage<?=$moduleMainName?>">
<div id="<?=$moduleMainName?>" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="<?=$moduleMainName?>Form" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
</div>
<div class="tab-pane" id="tabPage<?=$subModuleMainName?>">
<div id="<?=$subModuleMainName?>" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="<?=$subModuleMainName?>Form" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
</div>
<div class="tab-pane" id="tabPage<?=$appModName?>">
<div id="<?=$appModName?>" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="<?=$appModName?>Form" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
</div>
</div>
</div>
<script>
var modJsList = new Array();
modJsList['tab<?=$moduleMainName?>'] = new <?=$moduleMainName?>Adapter('<?=$moduleMainName?>','<?=$moduleMainName?>');
modJsList['tab<?=$appModName?>'] = new <?=$moduleMainName?>ApproverAdapter('<?=$appModName?>', '<?=$appModName?>');
modJsList['tab<?=$appModName?>'].setShowAddNew(false);
modJsList['tab<?=$appModName?>'].setShowDelete(false);
modJsList['tab<?=$appModName?>'].setShowEdit(false);
modJsList['tab<?=$subModuleMainName?>'] = new <?=$subModuleMainName?>Adapter('<?=$moduleMainName?>','<?=$subModuleMainName?>');
modJsList['tab<?=$subModuleMainName?>'].setRemoteTable(true);
modJsList['tab<?=$subModuleMainName?>'].setShowAddNew(false);
modJsList['tab<?=$subModuleMainName?>'].setShowDelete(false);
modJsList['tab<?=$subModuleMainName?>'].setShowEdit(true);
var modJs = modJsList['tab<?=$moduleMainName?>'];
</script>
<?php include APP_BASE_PATH.'footer.php';?>

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

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

View File

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