License updated to GPLv3

🧲 New features
Custom user role permissions
Employee edit form updated
Employee daily task list
Attendance and employee distribution charts on dashboard
Improvements to company structure and company assets module
Improved tables for displaying data in several modules
Faster data loading (specially for employee module)
Initials based profile pictures
Re-designed login page
Re-designed user profile page
Improvements to filtering
New REST endpoints for employee qualifications

🐛 Bug fixes
Fixed, issue with managers being able to create performance reviews for employees who are not their direct reports
Fixed, issues related to using full profile image instead of using smaller version of profile image
Changing third gender to other
Improvements and fixes for internal frontend data caching
This commit is contained in:
Thilina Pituwala
2020-10-31 19:02:37 +01:00
parent 86b8345505
commit b1df0037db
29343 changed files with 867614 additions and 2191082 deletions

View File

@@ -13,20 +13,20 @@ $photoAttendance = \Classes\SettingsManager::getInstance()->getSetting('Attendan
$mapAttendance = \Classes\SettingsManager::getInstance()->getSetting('Attendance: Request Attendance Location on Mobile');
?><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="tabAttendance" href="#tabPageAttendance"><?=t('Monitor Attendance')?></a></li>
<ul class="nav nav-tabs" id="modTab" style="margin-bottom:0px;margin-left:5px;border-bottom: none;">
<li class="active"><a id="tabAttendance" href="#tabPageAttendance"><?=t('Monitor Attendance')?></a></li>
<li class=""><a id="tabAttendanceStatus" href="#tabPageAttendanceStatus"><?=t('Current Clocked In Status')?></a></li>
</ul>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tabPageAttendance">
<div id="Attendance" class="reviewBlock" data-content="List" style="padding-left:5px;">
<div class="tab-content">
<div class="tab-pane active" id="tabPageAttendance">
<div id="Attendance" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="AttendanceForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
<div id="AttendanceForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
</div>
</div>
</div>
<div class="tab-pane" id="tabPageAttendanceStatus">
<div id="AttendanceStatus" class="reviewBlock" data-content="List" style="padding-left:5px;">
@@ -36,20 +36,20 @@ $mapAttendance = \Classes\SettingsManager::getInstance()->getSetting('Attendance
</div>
</div>
</div>
</div>
</div>
<div class="modal" id="attendancePhotoModel" tabindex="-1" role="dialog" aria-labelledby="messageModelLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-times"/></button>
<h3 style="font-size: 17px;">Attendance Details</h3>
</div>
<div class="modal-body">
<div class="row" style="background: #f3f4f5; padding: 10px;text-align: center;">
<h4 id="attendnaceCanvasEmp"></h4>
</div>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><li class="fa fa-times"/></button>
<h3 style="font-size: 17px;">Attendance Details</h3>
</div>
<div class="modal-body">
<div class="row" style="background: #f3f4f5; padding: 10px;text-align: center;">
<h4 id="attendnaceCanvasEmp"></h4>
</div>
<div class="row" style="background: #f3f4f5; padding: 10px;">
<div id="attendnaceCanvasPunchInTimeWraper" class="col-sm-6" style="text-align: center;">
<b>In: </b><span id="attendnaceCanvasPunchInTime"></span>
@@ -62,14 +62,14 @@ $mapAttendance = \Classes\SettingsManager::getInstance()->getSetting('Attendance
IP Address: <span id="punchOutIp"></span>
</div>
</div>
<div id="attendancePhoto" class="row" style="background: #f3f4f5; padding: 10px;display:none;">
<div id="attendnaceCanvasInWrapper" class="col-sm-6" style="text-align: center;">
<div id="attendancePhoto" class="row" style="background: #f3f4f5; padding: 10px;display:none;">
<div id="attendnaceCanvasInWrapper" class="col-sm-6" style="text-align: center;">
</div>
<div id="attendnaceCanvasOutWrapper" class="col-sm-6" style="text-align: center;">
</div>
<div id="attendnaceCanvasOutWrapper" class="col-sm-6" style="text-align: center;">
</div>
</div>
</div>
</div>
<div id="attendanceMap" class="row" style="background: #f3f4f5; padding: 10px;display:none;">
<div id="attendnaceMapCanvasInWrapper" class="col-sm-6" style="text-align: center;">
@@ -85,21 +85,21 @@ $mapAttendance = \Classes\SettingsManager::getInstance()->getSetting('Attendance
<span>Location: <span id="punchOutLocation"></span></span>
</div>
</div>
</div>
<div class="modal-footer">
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
var modJsList = new Array();
modJsList['tabAttendance'] = new AttendanceAdapter('Attendance','Attendance','','in_time desc');
modJsList['tabAttendance'].setRemoteTable(true);
modJsList['tabAttendance'].setPhotoAttendance(<?=$photoAttendance == '1' || $mapAttendance == '1'?>);
modJsList['tabAttendanceStatus'] = new AttendanceStatusAdapter('AttendanceStatus','AttendanceStatus','','');
modJsList['tabAttendanceStatus'].setShowAddNew(false);
var modJs = modJsList['tabAttendance'];
var modJsList = new Array();
modJsList['tabAttendance'] = new AttendanceAdapter('Attendance','Attendance','','in_time desc');
modJsList['tabAttendance'].setRemoteTable(true);
modJsList['tabAttendance'].setPhotoAttendance(<?=$photoAttendance == '1' || $mapAttendance == '1'?>);
modJsList['tabAttendanceStatus'] = new AttendanceStatusAdapter('AttendanceStatus','AttendanceStatus','','');
modJsList['tabAttendanceStatus'].setShowAddNew(false);
var modJs = modJsList['tabAttendance'];
</script>
<?php include APP_BASE_PATH.'footer.php';?>

View File

@@ -0,0 +1,44 @@
ICEHRM END USER LICENSE AGREEMENT
NOTICE TO ALL USERS: BY PURCHASING THE MODULE, YOU (EITHER AN INDIVIDUAL OR A SINGLE ENTITY) CONSENT TO BE BOUND BY AND BECOME A PARTY TO THIS AGREEMENT.
All references to "Software" herein shall be deemed to include the software license with which you will be provided by Gamonoid Media Pvt Ltd, as part of the Software.
1. LICENSE GRANT. Subject to the payment of the applicable licence fees, and subject to the terms and conditions of this Agreement, ICEHRM hereby grants to you a non-exclusive, non-transferable right to use one copy of the specified version of the Software and the accompanying documentation (the "Documentation") for the term of this Agreement solely for your own internal business purposes. You may install one copy of the Software for production use.
.
2. USE. The Software is licensed as a single product; it may not be used on more than one ICEHRM Server at a time. The Software is "in use" on a Server when its installed on a Server. You shall not, nor permit any third party to copy (other than as expressly permitted herein). You shall not rent, lease or lend the Software to any other person, nor transfer or sub-licence your licence rights to any other person.
3. TERM. This Agreement is effective until terminated as set forth herein. This Agreement will terminate automatically if you fail to comply with any of the conditions, limitations or other requirements described herein. Upon any termination of this Agreement, you must immediately destroy all copies of the Software and the Documentation. You may terminate this Agreement at any point by destroying all copies of the Software and the Documentation.
4. SUPPORT. Gamonoid Media Pvt Ltd will provide you support according to the support agreement subscribed by the company.
5. OWNERSHIP RIGHTS. The Software is protected by copyright laws. ICEHRM and Gamonoid Media Pvt Ltd own and retain all right, title and interest in and to the Software, including all copyrights, patents, trademarks and other intellectual property rights therein. Your possession, installation, or use of the Software does not transfer to you any title to the intellectual property in the Software, and you will not acquire any rights to the Software except as expressly set forth in this Agreement.
6. LIMITED WARRANTY. You may not rent, lease, loan or resell the Software. You may not permit third parties to benefit from the use or functionality of the Software via a timesharing, service bureau or other arrangement, except to the extent such use is specified in the applicable list price or product packaging for the Software. You may not transfer any of the rights granted to you under this Agreement. You may not modify, or create derivative works based upon, the Software in whole or in part. You may not copy the Software or Documentation except as expressly permitted in Section 1 above. You may not remove any proprietary notices or labels on the Software. All rights not expressly set forth hereunder are reserved by ICEHRM. ICEHRM reserves the right to periodically conduct audits upon advance written notice to verify compliance with the terms of this Agreement.
7. WARRANTY and DISCLAIMER.
(i) Gamonoid Media Pvt Ltd. warrants that for 30 days from first download or installation the Software will perform substantially in accordance with the functionality described in the Documentation (http://blog.icehrm.com) when operated properly and in the manner specified in the Documentation.
(ii) You accept all responsibility for the selection of this Software to meet your requirements.
(iii) Gamonoid Media Pvt Ltd. does not warrant that the Software and/or the Documentation will be suitable for such requirements nor that any use will be uninterrupted and error free.
(iv) The warranty in (i) shall not apply if you (a) make or cause to be made any modifications to this Software, (b) use the Software in a manner for which it was not intended or (c) use the Software other than as permitted under this Agreement.
(vii) The warranties and conditions stated in this Agreement are in lieu of all other conditions, warranties or other terms concerning the supply or purported supply of, failure to supply or delay in supplying the Software or the Documentation which might but for this paragraph (vii) have effect between the ICEHRM and you or would otherwise be implied into or incorporated into this Agreement or any collateral contract, whether by statute, common law or otherwise, all of which are hereby excluded (including, without limitation, the implied conditions, warranties or other terms as to satisfactory quality, fitness for purpose or as to the use of reasonable skill and care).
8. LIMITATION of LIABILITY. Gamonoid Media Pvt Ltd. shall have no liability (whether in contract, tort, restitution or otherwise) for any of the following losses or damage (whether such losses or damage were foreseen, foreseeable, known or otherwise):
- Loss of revenue;
- Loss of actual or anticipated profits (including for loss of profits on contracts);
- Loss of the use of money;
- Loss of anticipated savings;
- Loss of business;
- Loss of opportunity;
- Loss of goodwill;
- Loss of reputation;
- Loss of, damage to or corruption of data;
or
Any indirect or consequential loss or damage howsoever caused (including, for the avoidance of doubt, where such loss or damage is of the type specified in paragraph (ii), (a) to (ii), (i).
The ICEHRM liability (whether in contract, tort, restitution or otherwise) arising out of or in connection with the supply of the Software shall in no circumstances exceed a sum equal to the amount equally paid by you for the Software.
The construction and interpretation of this Agreement shall be governed in accordance with the laws of Sri Lanka. The parties hereby submit to the jurisdiction of the courts of Sri Lanka save that ICEHRM as claimant shall be entitled to initiate proceedings in any court of competent jurisdiction.
This Agreement contains the entire understanding of the parties with respect to the subject matter hereof and supersedes all and any prior understandings, undertakings and promises between you and ICEHRM, whether oral or in writing, which have been given or may be implied from anything written or said in negotiations between us or our representatives prior to this Agreement and all prior agreements between the parties relating to the matters aforesaid shall cease to have effect as from the Effective Date.

View File

@@ -0,0 +1,7 @@
This module is licensed under IceHrm Commercial License, which can be found in LICENSE.txt.
You are allowed to make any modification required to these module, but only allowed to use
the module in one production server (even with modifications).
Installation
------------
Copy this module into <icehrm path>/admin/ directory

View File

@@ -0,0 +1,57 @@
<?php
$moduleName = 'charts';
$moduleGroup = 'admin';
define('MODULE_PATH',dirname(__FILE__));
include APP_BASE_PATH.'header.php';
include APP_BASE_PATH.'modulejslibs.inc.php';
?>
<link href="<?=BASE_URL.'js/nvd3/src/nv.d3.css?v='.$jsVersion?>" rel="stylesheet" type="text/css">
<script src="<?=BASE_URL.'js/nvd3/lib/d3.v3.js?v='.$jsVersion?>"></script>
<script src="<?=BASE_URL.'js/nvd3/nv.d3.js?v='.$jsVersion?>"></script>
<script src="<?=BASE_URL.'js/nvd3/src/tooltip.js?v='.$jsVersion?>"></script>
<script src="<?=BASE_URL.'js/nvd3/src/utils.js?v='.$jsVersion?>"></script>
<script src="<?=BASE_URL.'js/nvd3/src/models/legend.js?v='.$jsVersion?>"></script>
<script src="<?=BASE_URL.'js/nvd3/src/models/axis.js?v='.$jsVersion?>"></script>
<script src="<?=BASE_URL.'js/nvd3/src/models/multiBar.js?v='.$jsVersion?>"></script>
<script src="<?=BASE_URL.'js/nvd3/src/models/discreteBar.js?v='.$jsVersion?>"></script>
<script src="<?=BASE_URL.'js/nvd3/src/models/discreteBarChart.js?v='.$jsVersion?>"></script>
<script src="<?=BASE_URL.'js/nvd3/stream_layers.js?v='.$jsVersion?>"></script>
<style type="text/css">
svg .tooltip { opacity: 1; }
</style>
<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="tabAttendanceGraph" href="#tabPageAttendanceGraph"><?=t('Attendance Graph')?></a></li>
<li><a id="tabTimeUtilizationGraph" href="#tabPageTimeUtilizationGraph"><?=t('Hours in Office vs Hours Worked Graph')?></a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active reviewBlock with-3d-shadow with-transitions" id="tabPageAttendanceGraph" style="height: 500px;position: relative;">
<svg></svg>
</div>
<div class="tab-pane reviewBlock with-3d-shadow with-transitions" id="tabPageTimeUtilizationGraph" style="height: 500px;position: relative;">
<svg></svg>
</div>
</div>
</div>
<script>
var modJsList = new Array();
modJsList['tabAttendanceGraph'] = new AttendanceGraphAdapter('AttendanceGraph');
modJsList['tabAttendanceGraph'].setShowAddNew(false);
modJsList['tabTimeUtilizationGraph'] = new TimeUtilizationGraphAdapter('TimeUtilizationGraph');
modJsList['tabTimeUtilizationGraph'].setShowAddNew(false);
var modJs = modJsList['tabAttendanceGraph'];
</script>
<?php include APP_BASE_PATH.'footer.php';?>

View File

@@ -0,0 +1,13 @@
{
"label": "Time and Attendance",
"menu": "Insights",
"order": "1",
"icon": "fa-user-clock",
"user_levels": [
"Admin",
"Manager"
],
"permissions": [],
"model_namespace": "\\Charts\\Common\\Model",
"manager": "\\Charts\\Admin\\Api\\ChartsAdminManager"
}

View File

@@ -4,6 +4,9 @@
Developer: Thilina Hasantha (http://lk.linkedin.com/in/thilinah | https://github.com/thilinah)
*/
use Classes\PermissionManager;
use Company\Common\Model\CompanyStructure;
$moduleName = 'company_structure';
$moduleGroup = 'admin';
define('MODULE_PATH',dirname(__FILE__));
@@ -44,12 +47,9 @@ path.link {
<div class="tab-content">
<div class="tab-pane active" id="tabPageCompanyStructure">
<div id="CompanyStructure" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="CompanyStructureForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
<div id="CompanyStructureTable" class="reviewBlock" data-content="List" style="padding-left:5px;"></div>
<div id="CompanyStructureForm"></div>
<div id="CompanyStructureFilterForm"></div>
</div>
<div class="tab-pane reviewBlock" id="tabPageCompanyGraph" style="overflow-x: scroll;">
@@ -57,24 +57,15 @@ path.link {
</div>
</div>
<?php
$moduleData = [
'user_level' => $user->user_level,
'permissions' => [
'CompanyStructure' => PermissionManager::checkGeneralAccess(new CompanyStructure()),
]
];
?>
<script>
var modJsList = new Array();
modJsList['tabCompanyStructure'] = new CompanyStructureAdapter('CompanyStructure');
<?php if(isset($modulePermissions['perm']['Add Company Structure']) && $modulePermissions['perm']['Add Company Structure'] == "No"){?>
modJsList['tabCompanyStructure'].setShowAddNew(false);
<?php }?>
<?php if(isset($modulePermissions['perm']['Delete Company Structure']) && $modulePermissions['perm']['Delete Company Structure'] == "No"){?>
modJsList['tabCompanyStructure'].setShowDelete(false);
<?php }?>
<?php if(isset($modulePermissions['perm']['Edit Company Structure']) && $modulePermissions['perm']['Edit Company Structure'] == "No"){?>
modJsList['tabCompanyStructure'].setShowEdit(false);
<?php }?>
modJsList['tabCompanyGraph'] = new CompanyGraphAdapter('CompanyStructure');
var modJs = modJsList['tabCompanyStructure'];
initAdminCompanyStructure(<?=json_encode($moduleData)?>);
</script>
<?php include APP_BASE_PATH.'footer.php';?>

View File

@@ -4,56 +4,89 @@
Developer: Thilina Hasantha (http://lk.linkedin.com/in/thilinah | https://github.com/thilinah)
*/
use Classes\BaseService;
use Classes\LanguageManager;
$moduleName = 'dashboard';
$moduleGroup = 'admin';
define('MODULE_PATH',dirname(__FILE__));
include APP_BASE_PATH.'header.php';
include APP_BASE_PATH.'modulejslibs.inc.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);
$dashboardList1 =[];
$dashboardList2 =[];
foreach($dashBoardList as $k=>$v){
if (count($dashboardList1) === 4 ) {
$dashboardList2[] = $v;
} else {
$dashboardList1[] = $v;
}
}
?><div class="span9">
<div class="row">
<?php
$moduleManagers = \Classes\BaseService::getInstance()->getModuleManagers();
$dashBoardList = array();
foreach($moduleManagers as $moduleManagerObj){
//Check if this is not an admin module
if($moduleManagerObj->getModuleType() != 'admin'){
continue;
}
$allowed = \Classes\BaseService::getInstance()->isModuleAllowedForUser($moduleManagerObj);
if(!$allowed){
continue;
}
$item = $moduleManagerObj->getDashboardItem();
if(!empty($item)) {
$index = $moduleManagerObj->getDashboardItemIndex();
$dashBoardList[$index] = $item;
}
foreach($dashboardList1 as $v){
echo LanguageManager::translateTnrText($v);
}
ksort($dashBoardList);
foreach($dashBoardList as $k=>$v){
echo \Classes\LanguageManager::translateTnrText($v);
?>
</div>
<div class="row">
<div class="col-lg-4 col-xs-12">
<div id="EmployeeOnlineOfflineChartLoader" style="width:100%;"></div>
<div id="EmployeeOnlineOfflineChart" style="display:none;box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.24);border: none;margin-bottom: 20px;"></div>
</div>
<div class="col-lg-4 col-xs-12">
<div id="EmployeeDistributionChartLoader" style="width:100%;"></div>
<div id="EmployeeDistributionChart" style="display:none;box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.24);border: none;margin-bottom: 20px;"></div>
</div>
<div class="col-lg-4 col-xs-12">
<div id="TaskListLoader" style="width:100%;"></div>
<div id="TaskListWrap" style="display: none;box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.24);border: none;margin-bottom: 20px; padding:25px;">
<h4>Tasks to Attend</h4>
<div id="TaskList" style="margin-left: 10px; margin-top: 30px;"></div>
</div>
</div>
</div>
<div class="row">
<?php
foreach($dashboardList2 as $v){
echo LanguageManager::translateTnrText($v);
}
?>
</div>
</div>
<script>
var modJsList = new Array();
var modJsList = [];
modJsList['tabDashboard'] = new DashboardAdapter('Dashboard','Dashboard');
var modJs = modJsList['tabDashboard'];
<?php if($user->user_level == "Admin") { ?>
$(document).ready(function () {
$('.span9 .row').prepend(window.atob('PGRpdiBjbGFzcz0iY2FsbG91dCBjYWxsb3V0LXdhcm5pbmcgbGVhZCIgc3R5bGU9ImZvbnQtc2l6ZTogMTRweDttYXJnaW4tdG9wOiA5MHB4OyI+CiAgICAgICAgICAgIDxoND5Zb3UgYXJlIGN1cnJlbnRseSB1c2luZyBJY2VIcm0gT3BlbnNvdXJjZSBWZXJzaW9uPC9oND4KICAgICAgICAgICAgPHAgc3R5bGU9ImZvbnQtd2VpZ2h0OiBib2xkOyI+CiAgICAgICAgICAgICAgICBXZSBoYXZlIGEgbG90IG1vcmUgZmVhdHVyZXMgdG8gb2ZmZXIuIEluY2x1ZGluZyBvdXIgaGlnaGx5IGN1c3RvbWl6YWJsZSBsZWF2ZSBtYW5hZ2VtZW50LCByZWNydWl0bWVudCBtb2R1bGVzIGFuZCBtYW55IG1vcmUgYWR2YW5jZWQgZmVhdHVyZXMgaW4gSWNlSHJtUHJvJiMxNzQ7CiAgICAgICAgICAgICAgICA8YnIvPgogICAgICAgICAgICAgICAgPGJyLz4KICAgICAgICAgICAgICAgIDxhIHRhcmdldD0iX2JsYW5rIiBocmVmPSJodHRwczovL2ljZWhybS5jb20vcHVyY2hhc2UtaWNlaHJtcHJvIiBjbGFzcz0iYnRuIGJ0bi1zdWNjZXNzIGJ0bS14cyI+PGkgY2xhc3M9ImZhIGZhLWNoZWNrb3V0Ij48L2k+IE1vcmUgYWJvdXQgSWNlSHJtUHJvJiMxNzQ7PC9hPgogICAgICAgICAgICA8L3A+CiAgICAgICAgPC9kaXY+'));
});
<?php } ?>
</script>
<?php include APP_BASE_PATH.'footer.php';?>

View File

@@ -1,5 +1,14 @@
<?php
use Classes\PermissionManager;
use Dependents\Common\Model\EmployeeDependent;
use EmergencyContacts\Common\Model\EmergencyContact;
use Employees\Common\Model\Employee;
use Qualifications\Common\Model\EmployeeCertification;
use Qualifications\Common\Model\EmployeeEducation;
use Qualifications\Common\Model\EmployeeLanguage;
use Qualifications\Common\Model\EmployeeSkill;
$moduleName = 'employees';
$moduleGroup = 'admin';
define('MODULE_PATH',dirname(__FILE__));
@@ -10,126 +19,84 @@ $customFields = \Classes\BaseService::getInstance()->getCustomFields("Employee")
?><div class="span9">
<ul class="nav nav-tabs" id="modTab" style="margin-bottom:0px;margin-left:5px;border-bottom: none;">
<?php if($user->user_level != "Admin"){
?>
<li class="active"><a id="tabEmployee" href="#tabPageEmployee"><?=t('Employees (Direct Reports)')?></a></li>
<?php }else{ ?>
<li class="active"><a id="tabEmployee" href="#tabPageEmployee"><?=t('Employees')?></a></li>
<?php }?>
<?php if ($user->user_level == "Admin") { ?>
<li class="active"><a id="tabEmployee" href="#tabPageEmployee"><?=t('Employees')?></a></li>
<li><a id="tabEmployeeSkill" href="#tabPageEmployeeSkill"><?=t('Skills')?></a></li>
<li><a id="tabEmployeeEducation" href="#tabPageEmployeeEducation"><?=t('Education')?></a></li>
<li><a id="tabEmployeeCertification" href="#tabPageEmployeeCertification"><?=t('Certifications')?></a></li>
<li><a id="tabEmployeeLanguage" href="#tabPageEmployeeLanguage"><?=t('Languages')?></a></li>
<li><a id="tabEmployeeDependent" href="#tabPageEmployeeDependent"><?=t('Dependents')?></a></li>
<li><a id="tabEmergencyContact" href="#tabPageEmergencyContact"><?=t('Emergency Contacts')?></a></li>
<?php if (class_exists('\\Documents\\Admin\\Api\\DocumentsAdminManager')) {?>
<li><a id="tabEmployeeDocument" href="#tabPageEmployeeDocument"><?=t('Documents')?></a></li>
<?php } ?>
<?php }?>
<?php if ($user->user_level == "Admin"){ ?>
<li class="dropdown">
<a href="#" id="terminatedEmployeeMenu" class="dropdown-toggle" data-toggle="dropdown" aria-controls="terminatedEmployeeMenu-contents"><?=t('Deactivated Employees')?> <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu" aria-labelledby="terminatedEmployeeMenu" id="terminatedEmployeeMenu-contents">
<li><a id="tabTerminatedEmployee" href="#tabPageTerminatedEmployee"><?=t('Temporarily Deactivated Employees')?></a></li>
<li><a id="tabArchivedEmployee" href="#tabPageArchivedEmployee"><?=t('Terminated Employee Data')?></a></li>
</ul>
</li>
<?php } ?>
<li><a id="tabEmergencyContact" href="#tabPageEmergencyContact"><?=t('Contacts')?></a></li>
<li><a id="tabTerminatedEmployee" href="#tabPageTerminatedEmployee"><?=t('Deactivated')?></a></li>
<li><a id="tabArchivedEmployee" href="#tabPageArchivedEmployee"><?=t('Archived')?></a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tabPageEmployee">
<div id="Employee" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="EmployeeForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
<div id="EmployeeTable" class="reviewBlock" data-content="List" style="padding-left:5px;"></div>
<div id="EmployeeForm"></div>
<div id="EmployeeFilterForm"></div>
</div>
<div class="tab-pane" id="tabPageEmployeeSkill">
<div id="EmployeeSkill" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="EmployeeSkillForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
<div id="EmployeeSkillTable" class="reviewBlock" data-content="List" style="padding-left:5px;"></div>
<div id="EmployeeSkillForm"></div>
<div id="EmployeeSkillFilterForm"></div>
</div>
<div class="tab-pane" id="tabPageEmployeeEducation">
<div id="EmployeeEducation" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="EmployeeEducationForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
<div id="EmployeeEducationTable" class="reviewBlock" data-content="List" style="padding-left:5px;"></div>
<div id="EmployeeEducationForm"></div>
<div id="EmployeeEducationFilterForm"></div>
</div>
<div class="tab-pane" id="tabPageEmployeeCertification">
<div id="EmployeeCertification" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="EmployeeCertificationForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
<div id="EmployeeCertificationTable" class="reviewBlock" data-content="List" style="padding-left:5px;"></div>
<div id="EmployeeCertificationForm"></div>
<div id="EmployeeCertificationFilterForm"></div>
</div>
<div class="tab-pane" id="tabPageEmployeeLanguage">
<div id="EmployeeLanguage" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="EmployeeLanguageForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
<div id="EmployeeLanguageTable" class="reviewBlock" data-content="List" style="padding-left:5px;"></div>
<div id="EmployeeLanguageForm"></div>
<div id="EmployeeLanguageFilterForm"></div>
</div>
<div class="tab-pane" id="tabPageEmployeeDependent">
<div id="EmployeeDependent" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="EmployeeDependentForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
<div id="EmployeeDependentTable" class="reviewBlock" data-content="List" style="padding-left:5px;"></div>
<div id="EmployeeDependentForm"></div>
<div id="EmployeeDependentFilterForm"></div>
</div>
<div class="tab-pane" id="tabPageEmergencyContact">
<div id="EmergencyContact" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="EmergencyContactForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
<div id="EmergencyContactTable" class="reviewBlock" data-content="List" style="padding-left:5px;"></div>
<div id="EmergencyContactForm"></div>
<div id="EmergencyContactFilterForm"></div>
</div>
<div class="tab-pane" id="tabPageArchivedEmployee">
<div id="ArchivedEmployee" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="ArchivedEmployeeForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
<div id="ArchivedEmployeeTable" class="reviewBlock" data-content="List" style="padding-left:5px;"></div>
<div id="ArchivedEmployeeForm"></div>
<div id="ArchivedEmployeeFilterForm"></div>
</div>
<div class="tab-pane" id="tabPageTerminatedEmployee">
<div id="TerminatedEmployee" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="TerminatedEmployeeForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
<div id="TerminatedEmployeeTable" class="reviewBlock" data-content="List" style="padding-left:5px;"></div>
<div id="TerminatedEmployeeForm"></div>
<div id="TerminatedEmployeeFilterForm"></div>
</div>
<?php if (class_exists('\\Documents\\Admin\\Api\\DocumentsAdminManager')) {?>
<div class="tab-pane" id="tabPageEmployeeDocument">
<div id="EmployeeDocument" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="EmployeeDocumentForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
</div>
<?php } ?>
</div>
</div>
<div id="dataGroup"></div>
<?php
$moduleData = [
'user_level' => $user->user_level,
'customFields' => $customFields,
'permissions' => [
'Employee' => PermissionManager::checkGeneralAccess(new Employee()),
'EmployeeSkill' => PermissionManager::checkGeneralAccess(new EmployeeSkill()),
'EmployeeEducation' => PermissionManager::checkGeneralAccess(new EmployeeEducation()),
'EmployeeCertification' => PermissionManager::checkGeneralAccess(new EmployeeCertification()),
'EmployeeLanguage' => PermissionManager::checkGeneralAccess(new EmployeeLanguage()),
'EmployeeDependent' => PermissionManager::checkGeneralAccess(new EmployeeDependent()),
'EmergencyContact' => PermissionManager::checkGeneralAccess(new EmergencyContact()),
]];
?>
<script>
var modJsList = new Array();
var modJsList = [];
<?php if($user->user_level != "Admin"){ ?>
modJsList['tabEmployee'] = new EmployeeAdapter('Employee','Employee',{"status":"Active"});
modJsList['tabEmployee'].setShowAddNew(false);
@@ -137,6 +104,12 @@ modJsList['tabEmployee'].setShowDelete(false);
<?php }else{ ?>
modJsList['tabEmployee'] = new EmployeeAdapter('Employee','Employee',{"status":"Active"});
<?php } ?>
modJsList['tabEmployee'].setObjectTypeName('Employee');
modJsList['tabEmployee'].setModalType(EmployeeAdapter.MODAL_TYPE_STEPS);
modJsList['tabEmployee'].setDataPipe(new IceDataPipe(modJsList['tabEmployee']));
modJsList['tabEmployee'].setAccess(<?=json_encode($moduleData['permissions']['Employee'])?>);
modJsList['tabEmployee'].enableLocalStorage();
$(document).ready(() => modJsList['tabEmployee'].initForm());
modJsList['tabEmployee'].setRemoteTable(true);
modJsList['tabEmployee'].setFieldNameMap(<?=json_encode($fieldNameMap)?>);
@@ -144,45 +117,66 @@ modJsList['tabEmployee'].setCustomFields(<?=json_encode($customFields)?>);
modJsList['tabEmployeeSkill'] = new EmployeeSkillAdapter('EmployeeSkill');
modJsList['tabEmployeeSkill'].setRemoteTable(true);
modJsList['tabEmployeeSkill'].setObjectTypeName('Employee Skill');
modJsList['tabEmployeeSkill'].setDataPipe(new IceDataPipe(modJsList['tabEmployeeSkill']));
modJsList['tabEmployeeSkill'].setAccess(<?=json_encode($moduleData['permissions']['EmployeeSkill'])?>);
modJsList['tabEmployeeEducation'] = new EmployeeEducationAdapter('EmployeeEducation');
modJsList['tabEmployeeEducation'].setRemoteTable(true);
modJsList['tabEmployeeEducation'].setObjectTypeName('Employee Education');
modJsList['tabEmployeeEducation'].setDataPipe(new IceDataPipe(modJsList['tabEmployeeEducation']));
modJsList['tabEmployeeEducation'].setAccess(<?=json_encode($moduleData['permissions']['EmployeeEducation'])?>);
modJsList['tabEmployeeCertification'] = new EmployeeCertificationAdapter('EmployeeCertification');
modJsList['tabEmployeeCertification'].setRemoteTable(true);
modJsList['tabEmployeeCertification'].setObjectTypeName('Employee Certification');
modJsList['tabEmployeeCertification'].setDataPipe(new IceDataPipe(modJsList['tabEmployeeCertification']));
modJsList['tabEmployeeCertification'].setAccess(<?=json_encode($moduleData['permissions']['EmployeeCertification'])?>);
modJsList['tabEmployeeLanguage'] = new EmployeeLanguageAdapter('EmployeeLanguage');
modJsList['tabEmployeeLanguage'].setRemoteTable(true);
modJsList['tabEmployeeLanguage'].setObjectTypeName('Employee Language');
modJsList['tabEmployeeLanguage'].setDataPipe(new IceDataPipe(modJsList['tabEmployeeLanguage']));
modJsList['tabEmployeeLanguage'].setAccess(<?=json_encode($moduleData['permissions']['EmployeeLanguage'])?>);
modJsList['tabEmployeeDependent'] = new EmployeeDependentAdapter('EmployeeDependent');
modJsList['tabEmployeeDependent'].setRemoteTable(true);
modJsList['tabEmployeeDependent'].setObjectTypeName('Employee Dependent');
modJsList['tabEmployeeDependent'].setDataPipe(new IceDataPipe(modJsList['tabEmployeeDependent']));
modJsList['tabEmployeeDependent'].setAccess(<?=json_encode($moduleData['permissions']['EmployeeDependent'])?>);
modJsList['tabEmergencyContact'] = new EmergencyContactAdapter('EmergencyContact');
modJsList['tabEmergencyContact'].setRemoteTable(true);
modJsList['tabEmergencyContact'].setObjectTypeName('Emergency Contact');
modJsList['tabEmergencyContact'].setDataPipe(new IceDataPipe(modJsList['tabEmergencyContact']));
modJsList['tabEmergencyContact'].setAccess(<?=json_encode($moduleData['permissions']['EmergencyContact'])?>);
modJsList['tabEmployeeImmigration'] = new EmployeeImmigrationAdapter('EmployeeImmigration');
modJsList['tabEmployeeImmigration'].setRemoteTable(true);
//modJsList['tabEmployeeImmigration'] = new EmployeeImmigrationAdapter('EmployeeImmigration');
//modJsList['tabEmployeeImmigration'].setRemoteTable(true);
//modJsList['tabEmployeeImmigration'].setObjectTypeName('Employee Dependent');
//modJsList['tabEmployeeImmigration'].setDataPipe(new IceDataPipe(modJsList['tabEmployeeDependent']));
//modJsList['tabEmployeeImmigration'].setAccess(<?//=json_encode($moduleData['permissions']['EmployeeDependent'])?>//);
modJsList['tabArchivedEmployee'] = new ArchivedEmployeeAdapter('ArchivedEmployee');
modJsList['tabArchivedEmployee'].setRemoteTable(true);
modJsList['tabArchivedEmployee'].setShowAddNew(false);
modJsList['tabArchivedEmployee'].setShowEdit(false);
modJsList['tabArchivedEmployee'].setObjectTypeName('Archived Employee');
modJsList['tabArchivedEmployee'].setDataPipe(new IceDataPipe(modJsList['tabArchivedEmployee']));
modJsList['tabArchivedEmployee'].setAccess(<?=json_encode($moduleData['permissions']['Employee'])?>);
modJsList['tabTerminatedEmployee'] = new TerminatedEmployeeAdapter('Employee','TerminatedEmployee',{"status":"Terminated"});
modJsList['tabTerminatedEmployee'].setRemoteTable(true);
modJsList['tabTerminatedEmployee'].setShowAddNew(false);
modJsList['tabTerminatedEmployee'].setShowEdit(false);
modJsList['tabTerminatedEmployee'].setObjectTypeName('Deactivated Employees');
modJsList['tabTerminatedEmployee'].setDataPipe(new IceDataPipe(modJsList['tabTerminatedEmployee']));
modJsList['tabTerminatedEmployee'].setAccess(<?=json_encode($moduleData['permissions']['Employee'])?>);
<?php if (class_exists('\\Documents\\Admin\\Api\\DocumentsAdminManager')) {?>
modJsList['tabEmployeeDocument'] = new EmployeeDocumentAdapter('EmployeeDocument','EmployeeDocument');
modJsList['tabTerminatedEmployee'].setRemoteTable(true);
<?php } ?>
var modJs = modJsList['tabEmployee'];
</script>
<div class="modal" id="createUserModel" tabindex="-1" role="dialog" aria-labelledby="messageModelLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">

View File

@@ -1,5 +1,5 @@
{
"label": "Employee Custom Fields",
"label": "Employee Fields",
"menu": "Admin",
"order": "83",
"icon": "fa-ruler-horizontal",

View File

@@ -3,6 +3,12 @@
Copyright (c) 2018 [Glacies UG, Berlin, Germany] (http://glacies.de)
Developer: Thilina Hasantha (http://lk.linkedin.com/in/thilinah | https://github.com/thilinah)
*/
use Classes\PermissionManager;
use Employees\Common\Model\EmploymentStatus;
use Jobs\Common\Model\JobTitle;
use Jobs\Common\Model\PayGrade;
$moduleName = 'jobs';
$moduleGroup = 'admin';
define('MODULE_PATH',dirname(__FILE__));
@@ -11,47 +17,42 @@ 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="tabJobTitles" href="#tabPageJobTitles"><?=t('Job Titles')?></a></li>
<li><a id="tabPayGrades" href="#tabPagePayGrades"><?=t('Pay Grades')?></a></li>
<li class="active"><a id="tabJobTitle" href="#tabPageJobTitles"><?=t('Job Titles')?></a></li>
<li><a id="tabPayGrade" href="#tabPagePayGrades"><?=t('Pay Grades')?></a></li>
<li><a id="tabEmploymentStatus" href="#tabPageEmploymentStatus"><?=t('Employment Status')?></a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tabPageJobTitles">
<div id="JobTitle" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="JobTitleForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
<div id="JobTitleTable" class="reviewBlock" data-content="List" style="padding-left:5px;"></div>
<div id="JobTitleForm"></div>
<div id="JobTitleFilterForm"></div>
</div>
<div class="tab-pane" id="tabPagePayGrades">
<div id="PayGrade" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="PayGradeForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
<div id="PayGradeTable" class="reviewBlock" data-content="List" style="padding-left:5px;"></div>
<div id="PayGradeForm"></div>
<div id="PayGradeFilterForm"></div>
</div>
<div class="tab-pane" id="tabPageEmploymentStatus">
<div id="EmploymentStatus" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="EmploymentStatusForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
<div id="EmploymentStatusTable" class="reviewBlock" data-content="List" style="padding-left:5px;"></div>
<div id="EmploymentStatusForm"></div>
<div id="EmploymentStatusFilterForm"></div>
</div>
</div>
</div>
<div id="dataGroup"></div>
<?php
$moduleData = [
'user_level' => $user->user_level,
'permissions' => [
'JobTitle' => PermissionManager::checkGeneralAccess(new JobTitle()),
'PayGrade' => PermissionManager::checkGeneralAccess(new PayGrade()),
'EmploymentStatus' => PermissionManager::checkGeneralAccess(new EmploymentStatus()),
]
];
?>
<script>
var modJsList = new Array();
modJsList['tabJobTitles'] = new JobTitleAdapter('JobTitle');
modJsList['tabPayGrades'] = new PayGradeAdapter('PayGrade');
modJsList['tabEmploymentStatus'] = new EmploymentStatusAdapter('EmploymentStatus');
var modJs = modJsList['tabJobTitles'];
initAdminJobs(<?=json_encode($moduleData)?>);
</script>
<?php include APP_BASE_PATH.'footer.php';?>

View File

@@ -4,6 +4,12 @@
Developer: Thilina Hasantha (http://lk.linkedin.com/in/thilinah | https://github.com/thilinah)
*/
use Classes\PermissionManager;
use Qualifications\Common\Model\Certification;
use Qualifications\Common\Model\Education;
use Qualifications\Common\Model\Language;
use Qualifications\Common\Model\Skill;
$moduleName = 'qualifications';
$moduleGroup = 'admin';
define('MODULE_PATH',dirname(__FILE__));
@@ -20,92 +26,40 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
<div class="tab-content">
<div class="tab-pane active" id="tabPageSkill">
<div id="Skill" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="SkillForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
<div id="SkillTable" class="reviewBlock" data-content="List" style="padding-left:5px;"></div>
<div id="SkillForm"></div>
<div id="SkillFilterForm"></div>
</div>
<div class="tab-pane" id="tabPageEducation">
<div id="Education" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="EducationForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
<div id="EducationTable" class="reviewBlock" data-content="List" style="padding-left:5px;"></div>
<div id="EducationForm"></div>
<div id="EducationFilterForm"></div>
</div>
<div class="tab-pane" id="tabPageCertification">
<div id="Certification" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="CertificationForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
<div id="CertificationTable" class="reviewBlock" data-content="List" style="padding-left:5px;"></div>
<div id="CertificationForm"></div>
<div id="CertificationFilterForm"></div>
</div>
<div class="tab-pane" id="tabPageLanguage">
<div id="Language" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="LanguageForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
<div id="LanguageTable" class="reviewBlock" data-content="List" style="padding-left:5px;"></div>
<div id="LanguageForm"></div>
<div id="LanguageFilterForm"></div>
</div>
</div>
</div>
<div id="dataGroup"></div>
<?php
$moduleData = [
'user_level' => $user->user_level,
'permissions' => [
'Skill' => PermissionManager::checkGeneralAccess(new Skill()),
'Education' => PermissionManager::checkGeneralAccess(new Education()),
'Certification' => PermissionManager::checkGeneralAccess(new Certification()),
'Language' => PermissionManager::checkGeneralAccess(new Language()),
]
];
?>
<script>
var modJsList = new Array();
modJsList['tabSkill'] = new SkillAdapter('Skill');
<?php if(isset($modulePermissions['perm']['Add Skills']) && $modulePermissions['perm']['Add Skills'] == "No"){?>
modJsList['tabSkill'].setShowAddNew(false);
<?php }?>
<?php if(isset($modulePermissions['perm']['Delete Skills']) && $modulePermissions['perm']['Delete Skills'] == "No"){?>
modJsList['tabSkill'].setShowDelete(false);
<?php }?>
<?php if(isset($modulePermissions['perm']['Edit Skills']) && $modulePermissions['perm']['Edit Skills'] == "No"){?>
modJsList['tabSkill'].setShowEdit(false);
<?php }?>
modJsList['tabEducation'] = new EducationAdapter('Education');
<?php if(isset($modulePermissions['perm']['Add Education']) && $modulePermissions['perm']['Add Education'] == "No"){?>
modJsList['tabEducation'].setShowAddNew(false);
<?php }?>
<?php if(isset($modulePermissions['perm']['Delete Education']) && $modulePermissions['perm']['Delete Education'] == "No"){?>
modJsList['tabEducation'].setShowDelete(false);
<?php }?>
<?php if(isset($modulePermissions['perm']['Edit Education']) && $modulePermissions['perm']['Edit Education'] == "No"){?>
modJsList['tabEducation'].setShowEdit(false);
<?php }?>
modJsList['tabCertification'] = new CertificationAdapter('Certification');
<?php if(isset($modulePermissions['perm']['Add Certifications']) && $modulePermissions['perm']['Add Certifications'] == "No"){?>
modJsList['tabCertification'].setShowAddNew(false);
<?php }?>
<?php if(isset($modulePermissions['perm']['Delete Certifications']) && $modulePermissions['perm']['Delete Certifications'] == "No"){?>
modJsList['tabCertification'].setShowDelete(false);
<?php }?>
<?php if(isset($modulePermissions['perm']['Edit Certifications']) && $modulePermissions['perm']['Edit Certifications'] == "No"){?>
modJsList['tabCertification'].setShowEdit(false);
<?php }?>
modJsList['tabLanguage'] = new LanguageAdapter('Language');
<?php if(isset($modulePermissions['perm']['Add Languages']) && $modulePermissions['perm']['Add Languages'] == "No"){?>
modJsList['tabLanguage'].setShowAddNew(false);
<?php }?>
<?php if(isset($modulePermissions['perm']['Delete Languages']) && $modulePermissions['perm']['Delete Languages'] == "No"){?>
modJsList['tabLanguage'].setShowDelete(false);
<?php }?>
<?php if(isset($modulePermissions['perm']['Edit Languages']) && $modulePermissions['perm']['Edit Languages'] == "No"){?>
modJsList['tabLanguage'].setShowEdit(false);
<?php }?>
var modJs = modJsList['tabSkill'];
initAdminQualifications(<?=json_encode($moduleData)?>);
</script>
<?php include APP_BASE_PATH.'footer.php';?>

View File

@@ -4,12 +4,20 @@
Developer: Thilina Hasantha (http://lk.linkedin.com/in/thilinah | https://github.com/thilinah)
*/
use Classes\PermissionManager;
use Users\Common\Model\UserRole;
$moduleName = 'users';
$moduleGroup = 'admin';
define('MODULE_PATH',dirname(__FILE__));
include APP_BASE_PATH.'header.php';
include APP_BASE_PATH.'modulejslibs.inc.php';
$csrf = \Classes\BaseService::getInstance()->generateCsrf('User');
$modelClasses = array_keys(\Classes\BaseService::getInstance()->getModelClassMap());
$modelClasses = array_map(function($item) {
return [ $item, $item ];
}, $modelClasses);
?><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="tabUser" href="#tabPageUser"><?=t('Users')?></a></li>
@@ -26,16 +34,21 @@ $csrf = \Classes\BaseService::getInstance()->generateCsrf('User');
</div>
</div>
<div class="tab-pane" id="tabPageUserRole">
<div id="UserRole" class="reviewBlock" data-content="List" style="padding-left:5px;">
</div>
<div id="UserRoleForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
</div>
<div id="UserRoleTable" class="reviewBlock" data-content="List" style="padding-left:5px;"></div>
<div id="UserRoleForm"></div>
<div id="UserRoleFilterForm"></div>
</div>
</div>
</div>
<div id="dataGroup"></div>
<?php
$moduleData = [
'user_level' => $user->user_level,
'permissions' => [
'UserRole' => PermissionManager::checkGeneralAccess(new UserRole()),
]];
?>
<script>
var modJsList = [];
modJsList['tabUser'] = new UserAdapter('User');
@@ -45,7 +58,13 @@ modJsList['tabUser'].setRemoteTable(true);;
modJsList['tabUser'].newInitObject = JSON.parse(Base64.decode('<?=$_GET['object']?>'));
<?php }?>
modJsList['tabUserRole'] = new UserRoleAdapter('UserRole');
modJsList['tabUserRole'].setTables(<?=json_encode($modelClasses)?>);
modJsList['tabUserRole'].setObjectTypeName('User Role');
modJsList['tabUserRole'].setDataPipe(new IceDataPipe(modJsList['tabUserRole']));
modJsList['tabUserRole'].setAccess(<?=json_encode($moduleData['permissions']['UserRole'])?>);
var modJs = modJsList['tabUser'];
</script>
<div id="UserRoleFormReact"></div>
<div id="dataGroup"></div>
<?php include APP_BASE_PATH.'footer.php';?>