Initial checkin v13.0
This commit is contained in:
51
ext/modules/loans/api/LoansModulesManager.php
Normal file
51
ext/modules/loans/api/LoansModulesManager.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
if (!class_exists('LoansModulesManager')) {
|
||||
|
||||
class LoansModulesManager extends AbstractModuleManager{
|
||||
|
||||
public function initializeUserClasses(){
|
||||
if(defined('MODULE_TYPE') && MODULE_TYPE != 'admin'){
|
||||
$this->addUserClass("EmployeeCompanyLoan");
|
||||
}
|
||||
}
|
||||
|
||||
public function initializeFieldMappings(){
|
||||
|
||||
}
|
||||
|
||||
public function initializeDatabaseErrorMappings(){
|
||||
|
||||
}
|
||||
|
||||
public function setupModuleClassDefinitions(){
|
||||
|
||||
$this->addModelClass('EmployeeCompanyLoan');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!class_exists('EmployeeCompanyLoan')) {
|
||||
|
||||
class EmployeeCompanyLoan extends ICEHRM_Record {
|
||||
var $_table = 'EmployeeCompanyLoans';
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
58
ext/modules/loans/index.php
Normal file
58
ext/modules/loans/index.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?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 = 'loans';
|
||||
define('MODULE_PATH',dirname(__FILE__));
|
||||
include APP_BASE_PATH.'header.php';
|
||||
include APP_BASE_PATH.'modulejslibs.inc.php';
|
||||
?><div class="span9">
|
||||
|
||||
<ul class="nav nav-tabs" id="modTab" style="margin-bottom:0px;margin-left:5px;border-bottom: none;">
|
||||
<li class="active"><a id="tabEmployeeCompanyLoan" href="#tabPageEmployeeCompanyLoan">Loans Taken</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="tabPageEmployeeCompanyLoan">
|
||||
<div id="EmployeeCompanyLoan" class="reviewBlock" data-content="List" style="padding-left:5px;">
|
||||
|
||||
</div>
|
||||
<div id="EmployeeCompanyLoanForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
var modJsList = new Array();
|
||||
|
||||
modJsList['tabEmployeeCompanyLoan'] = new EmployeeCompanyLoanAdapter('EmployeeCompanyLoan','EmployeeCompanyLoan');
|
||||
modJsList['tabEmployeeCompanyLoan'].setShowAddNew(false);
|
||||
modJsList['tabEmployeeCompanyLoan'].setShowSave(false);
|
||||
modJsList['tabEmployeeCompanyLoan'].setShowDelete(false);
|
||||
modJsList['tabEmployeeCompanyLoan'].setShowEdit(true);
|
||||
|
||||
var modJs = modJsList['tabEmployeeCompanyLoan'];
|
||||
|
||||
</script>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
91
ext/modules/loans/lib.js
Normal file
91
ext/modules/loans/lib.js
Normal file
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
This file is part of iCE Hrm.
|
||||
|
||||
iCE Hrm is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
iCE Hrm is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with iCE Hrm. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
------------------------------------------------------------------
|
||||
|
||||
Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
|
||||
Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
|
||||
*/
|
||||
|
||||
function EmployeeCompanyLoanAdapter(endPoint) {
|
||||
this.initAdapter(endPoint);
|
||||
}
|
||||
|
||||
EmployeeCompanyLoanAdapter.inherits(AdapterBase);
|
||||
|
||||
|
||||
|
||||
EmployeeCompanyLoanAdapter.method('getDataMapping', function() {
|
||||
return [
|
||||
"id",
|
||||
"loan",
|
||||
"start_date",
|
||||
"period_months",
|
||||
"currency",
|
||||
"amount",
|
||||
"status"
|
||||
];
|
||||
});
|
||||
|
||||
EmployeeCompanyLoanAdapter.method('getHeaders', function() {
|
||||
return [
|
||||
{ "sTitle": "ID" ,"bVisible":false},
|
||||
{ "sTitle": "Loan Type" },
|
||||
{ "sTitle": "Loan Start Date"},
|
||||
{ "sTitle": "Loan Period (Months)"},
|
||||
{ "sTitle": "Currency"},
|
||||
{ "sTitle": "Amount"},
|
||||
{ "sTitle": "Status"}
|
||||
];
|
||||
});
|
||||
|
||||
EmployeeCompanyLoanAdapter.method('getFormFields', function() {
|
||||
return [
|
||||
[ "id", {"label":"ID","type":"hidden"}],
|
||||
[ "loan", {"label":"Loan Type","type":"placeholder","remote-source":["CompanyLoan","id","name"]}],
|
||||
[ "start_date", {"label":"Loan Start Date","type":"placeholder","validation":""}],
|
||||
[ "last_installment_date", {"label":"Last Installment Date","type":"placeholder","validation":"none"}],
|
||||
[ "period_months", {"label":"Loan Period (Months)","type":"placeholder","validation":"number"}],
|
||||
[ "currency", {"label":"Currency","type":"placeholder","remote-source":["CurrencyType","id","name"]}],
|
||||
[ "amount", {"label":"Loan Amount","type":"placeholder","validation":"float"}],
|
||||
[ "monthly_installment", {"label":"Monthly Installment","type":"placeholder","validation":"float"}],
|
||||
[ "status", {"label":"Status","type":"placeholder","source":[["Approved","Approved"],["Paid","Paid"],["Suspended","Suspended"]]}],
|
||||
[ "details", {"label":"Details","type":"placeholder","validation":"none"}]
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
EmployeeCompanyLoanAdapter.method('getActionButtonsHtml', function(id,data) {
|
||||
var editButton = '<img class="tableActionButton" src="_BASE_images/view.png" style="cursor:pointer;" rel="tooltip" title="View" onclick="modJs.edit(_id_);return false;"></img>';
|
||||
var deleteButton = '<img class="tableActionButton" src="_BASE_images/delete.png" style="margin-left:15px;cursor:pointer;" rel="tooltip" title="Delete" onclick="modJs.deleteRow(_id_);return false;"></img>';
|
||||
var html = '<div style="width:80px;">_edit__delete_</div>';
|
||||
|
||||
if(this.showDelete){
|
||||
html = html.replace('_delete_',deleteButton);
|
||||
}else{
|
||||
html = html.replace('_delete_','');
|
||||
}
|
||||
|
||||
if(this.showEdit){
|
||||
html = html.replace('_edit_',editButton);
|
||||
}else{
|
||||
html = html.replace('_edit_','');
|
||||
}
|
||||
|
||||
html = html.replace(/_id_/g,id);
|
||||
html = html.replace(/_BASE_/g,this.baseUrl);
|
||||
return html;
|
||||
});
|
||||
11
ext/modules/loans/meta.json
Normal file
11
ext/modules/loans/meta.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"label":"Loans",
|
||||
"menu":"Loans",
|
||||
"order":"1",
|
||||
"icon":"fa-shield",
|
||||
"user_levels":["Admin","Manager","Employee"],
|
||||
|
||||
"permissions":
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user