Initial checkin v13.0
This commit is contained in:
35
ext/admin/modules/api/ModulesAdminManager.php
Normal file
35
ext/admin/modules/api/ModulesAdminManager.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
if (!class_exists('ModulesAdminManager')) {
|
||||
class ModulesAdminManager extends AbstractModuleManager{
|
||||
|
||||
public function initializeUserClasses(){
|
||||
|
||||
}
|
||||
|
||||
public function initializeFieldMappings(){
|
||||
|
||||
}
|
||||
|
||||
public function initializeDatabaseErrorMappings(){
|
||||
|
||||
}
|
||||
|
||||
public function setupModuleClassDefinitions(){
|
||||
$this->addModelClass('Module');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (!class_exists('Module')) {
|
||||
class Module extends ICEHRM_Record {
|
||||
public function getAdminAccess(){
|
||||
return array("get","element","save","delete");
|
||||
}
|
||||
|
||||
public function getUserAccess(){
|
||||
return array();
|
||||
}
|
||||
var $_table = 'Modules';
|
||||
}
|
||||
}
|
||||
54
ext/admin/modules/index.php
Normal file
54
ext/admin/modules/index.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?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 = 'Modules';
|
||||
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="tabModule" href="#tabPageModule">Modules</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="tabPageModule">
|
||||
<div id="Module" class="reviewBlock" data-content="List" style="padding-left:5px;">
|
||||
|
||||
</div>
|
||||
<div id="ModuleForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
var modJsList = new Array();
|
||||
|
||||
modJsList['moduleModule'] = new ModuleAdapter('Module','Module');
|
||||
modJsList['moduleModule'].setShowAddNew(false);
|
||||
var modJs = modJsList['moduleModule'];
|
||||
|
||||
</script>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
78
ext/admin/modules/lib.js
Normal file
78
ext/admin/modules/lib.js
Normal file
@@ -0,0 +1,78 @@
|
||||
/**
|
||||
* Author: Thilina Hasantha
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* ModuleAdapter
|
||||
*/
|
||||
|
||||
function ModuleAdapter(endPoint) {
|
||||
this.initAdapter(endPoint);
|
||||
}
|
||||
|
||||
ModuleAdapter.inherits(AdapterBase);
|
||||
|
||||
|
||||
|
||||
ModuleAdapter.method('getDataMapping', function() {
|
||||
return [
|
||||
"id",
|
||||
"label",
|
||||
"menu",
|
||||
"mod_group",
|
||||
"mod_order",
|
||||
"status",
|
||||
"version",
|
||||
"update_path"
|
||||
];
|
||||
});
|
||||
|
||||
ModuleAdapter.method('getHeaders', function() {
|
||||
return [
|
||||
{ "sTitle": "ID" ,"bVisible":false},
|
||||
{ "sTitle": "Name" },
|
||||
{ "sTitle": "Menu" ,"bVisible":false},
|
||||
{ "sTitle": "Group"},
|
||||
{ "sTitle": "Order"},
|
||||
{ "sTitle": "Status"},
|
||||
{ "sTitle": "Version","bVisible":false},
|
||||
{ "sTitle": "Path" ,"bVisible":false}
|
||||
];
|
||||
});
|
||||
|
||||
ModuleAdapter.method('getFormFields', function() {
|
||||
return [
|
||||
[ "id", {"label":"ID","type":"hidden"}],
|
||||
[ "label", {"label":"Label","type":"text","validation":""}],
|
||||
[ "status", {"label":"Status","type":"select","source":[["Enabled","Enabled"],["Disabled","Disabled"]]}],
|
||||
[ "user_levels", {"label":"User Levels","type":"select2multi","source":[["Admin","Admin"],["Manager","Manager"],["Employee","Employee"],["Other","Other"]]}]
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
ModuleAdapter.method('getActionButtonsHtml', function(id,data) {
|
||||
|
||||
|
||||
var nonEditableFields = {};
|
||||
nonEditableFields["admin_Company Structure"] = 1;
|
||||
nonEditableFields["admin_Employees"] = 1;
|
||||
nonEditableFields["admin_Jobs"] = 1;
|
||||
nonEditableFields["admin_Leaves"] = 1;
|
||||
nonEditableFields["admin_Manage Modules"] = 1;
|
||||
nonEditableFields["admin_Projects"] = 1;
|
||||
nonEditableFields["admin_Qualifications"] = 1;
|
||||
nonEditableFields["admin_Settings"] = 1;
|
||||
nonEditableFields["admin_Users"] = 1;
|
||||
nonEditableFields["admin_Upgrade"] = 1;
|
||||
|
||||
nonEditableFields["user_Basic Information"] = 1;
|
||||
|
||||
if(nonEditableFields[data[3]+"_"+data[1]] == 1){
|
||||
return "";
|
||||
}
|
||||
var html = '<div style="width:80px;"><img class="tableActionButton" src="_BASE_images/edit.png" style="cursor:pointer;" rel="tooltip" title="Edit" onclick="modJs.edit(_id_);return false;"></img></div>';
|
||||
html = html.replace(/_id_/g,id);
|
||||
html = html.replace(/_BASE_/g,this.baseUrl);
|
||||
return html;
|
||||
});
|
||||
11
ext/admin/modules/meta.json
Normal file
11
ext/admin/modules/meta.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"label":"Manage Modules",
|
||||
"menu":"System",
|
||||
"order":"3",
|
||||
"icon":"fa-folder-open",
|
||||
"user_levels":["Admin"],
|
||||
|
||||
"permissions":
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user