/*
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 = '
';
var viewLogsButton = '
';
var html = '