Sync changes v29.0.0 from IceHrmPro (https://icehrm.com/purchase-icehrmpro)
This commit is contained in:
@@ -4,48 +4,48 @@
|
||||
Developer: Thilina Hasantha (http://lk.linkedin.com/in/thilinah | https://github.com/thilinah)
|
||||
*/
|
||||
|
||||
use Classes\PermissionManager;
|
||||
use Clients\Common\Model\Client;
|
||||
|
||||
$moduleName = 'clients';
|
||||
$moduleGroup = 'admin';
|
||||
define('MODULE_PATH',dirname(__FILE__));
|
||||
include APP_BASE_PATH.'header.php';
|
||||
include APP_BASE_PATH.'modulejslibs.inc.php';
|
||||
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="tabClient" href="#tabPageClient"><?=t('Clients')?></a></li>
|
||||
</ul>
|
||||
<ul class="nav nav-tabs" id="modTab" style="margin-bottom:0px;margin-left:5px;border-bottom: none;">
|
||||
<li class="active"><a id="tabClient" href="#tabPageClient"><?= t('Clients') ?></a></li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="tabPageClient">
|
||||
<div id="Client" class="reviewBlock" data-content="List" style="padding-left:5px;">
|
||||
|
||||
</div>
|
||||
<div id="ClientForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="tabPageClient">
|
||||
<div id="ClientTable" class="reviewBlock" data-content="List" style="padding-left:5px;"></div>
|
||||
<div id="ClientForm"></div>
|
||||
<div id="ClientFilterForm"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
var modJsList = [];
|
||||
<?php
|
||||
$moduleData = [
|
||||
'user_level' => $user->user_level,
|
||||
'permissions' => [
|
||||
'Client' => PermissionManager::checkGeneralAccess(new Client()),
|
||||
]
|
||||
];
|
||||
?>
|
||||
<script>
|
||||
var data = <?= json_encode($moduleData) ?>;
|
||||
var modJsList = [];
|
||||
|
||||
modJsList['tabClient'] = new ClientAdapter('Client','Client');
|
||||
modJsList['tabClient'] = new ClientAdapter('Client');
|
||||
|
||||
<?php if(isset($modulePermissions['perm']['Add Clients']) && $modulePermissions['perm']['Add Clients'] == "No"){?>
|
||||
modJsList['tabClient'].setShowAddNew(false);
|
||||
<?php }?>
|
||||
modJsList.tabClient.setObjectTypeName('Client');
|
||||
modJsList.tabClient.setAccess(data.permissions.Client);
|
||||
modJsList.tabClient.setDataPipe(new IceDataPipe(modJsList.tabClient));
|
||||
modJsList.tabClient.setRemoteTable(true);
|
||||
|
||||
<?php if(isset($modulePermissions['perm']['Delete Clients']) && $modulePermissions['perm']['Delete Clients'] == "No"){?>
|
||||
modJsList['tabClient'].setShowDelete(false);
|
||||
<?php }?>
|
||||
|
||||
<?php if(isset($modulePermissions['perm']['Edit Clients']) && $modulePermissions['perm']['Edit Clients'] == "No"){?>
|
||||
modJsList['tabClient'].setShowSave(false);
|
||||
<?php }?>
|
||||
|
||||
|
||||
var modJs = modJsList['tabClient'];
|
||||
|
||||
</script>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
var modJs = modJsList['tabClient'];
|
||||
</script>
|
||||
<?php include APP_BASE_PATH . 'footer.php'; ?>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
Developer: Thilina Hasantha (http://lk.linkedin.com/in/thilinah | https://github.com/thilinah)
|
||||
*/
|
||||
|
||||
use Classes\BaseService;
|
||||
use Classes\PermissionManager;
|
||||
use Company\Common\Model\CompanyStructure;
|
||||
|
||||
@@ -60,6 +61,7 @@ path.link {
|
||||
<?php
|
||||
$moduleData = [
|
||||
'user_level' => $user->user_level,
|
||||
'customFields' => BaseService::getInstance()->getCustomFields("CompanyStructure"),
|
||||
'permissions' => [
|
||||
'CompanyStructure' => PermissionManager::checkGeneralAccess(new CompanyStructure()),
|
||||
]
|
||||
|
||||
42
core/admin/custom_fields/index.php
Normal file
42
core/admin/custom_fields/index.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
use Classes\BaseService;
|
||||
use Classes\PermissionManager;
|
||||
use FieldNames\Common\Model\CustomField;
|
||||
|
||||
$moduleName = 'assets';
|
||||
$moduleGroup = 'admin';
|
||||
define('MODULE_PATH',dirname(__FILE__));
|
||||
include APP_BASE_PATH.'header.php';
|
||||
include APP_BASE_PATH.'modulejslibs.inc.php';
|
||||
$modelClasses = BaseService::getInstance()->getCustomFieldClassMap();
|
||||
?><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="tabCustomField" href="#tabPageCustomField"><?=t('Custom Fields')?></a></li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="tabPageCustomField">
|
||||
<div id="CustomFieldTable" class="reviewBlock" data-content="List"></div>
|
||||
<div id="CustomFieldForm"></div>
|
||||
<div id="CustomFieldFilterForm"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="dataGroup"></div>
|
||||
<?php
|
||||
$moduleData = [
|
||||
'user_level' => $user->user_level,
|
||||
'types' => $modelClasses,
|
||||
'permissions' => [
|
||||
'CustomField' => PermissionManager::checkGeneralAccess(new CustomField()),
|
||||
]
|
||||
];
|
||||
?>
|
||||
<script>
|
||||
initAdminCustomFields(<?=json_encode($moduleData)?>);
|
||||
</script>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
|
||||
12
core/admin/custom_fields/meta.json
Normal file
12
core/admin/custom_fields/meta.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"label": "Custom Fields",
|
||||
"menu": "Admin",
|
||||
"order": "892",
|
||||
"icon": "fa-code",
|
||||
"user_levels": [
|
||||
"Admin"
|
||||
],
|
||||
"permissions": [],
|
||||
"model_namespace": "\\FieldNames\\Common\\Model",
|
||||
"manager": "\\CustomField\\Admin\\Api\\CustomFieldAdminManager"
|
||||
}
|
||||
@@ -13,41 +13,25 @@ include APP_BASE_PATH.'modulejslibs.inc.php';
|
||||
|
||||
<ul class="nav nav-tabs" id="modTab" style="margin-bottom:0px;margin-left:5px;border-bottom: none;">
|
||||
<li class="active"><a id="tabEmployeeFieldName" href="#tabPageEmployeeFieldName"><?=t('Employee Field Names')?></a></li>
|
||||
<li><a id="tabEmployeeCustomField" href="#tabPageEmployeeCustomField"><?=t('Employee Custom Fields')?></a></li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="tabPageEmployeeFieldName">
|
||||
<div id="EmployeeFieldName" class="reviewBlock" data-content="List" style="padding-left:5px;">
|
||||
|
||||
</div>
|
||||
<div id="EmployeeFieldNameForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane" id="tabPageEmployeeCustomField">
|
||||
<div id="EmployeeCustomField" class="reviewBlock" data-content="List" style="padding-left:5px;">
|
||||
|
||||
</div>
|
||||
<div id="EmployeeCustomFieldForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
var modJsList = new Array();
|
||||
var modJsList = [];
|
||||
|
||||
modJsList['tabEmployeeFieldName'] = new FieldNameAdapter('FieldNameMapping','EmployeeFieldName',{"type":"Employee"});
|
||||
modJsList['tabEmployeeFieldName'].setRemoteTable(true);
|
||||
modJsList['tabEmployeeFieldName'].setShowDelete(false);
|
||||
modJsList['tabEmployeeFieldName'].setShowAddNew(false);
|
||||
|
||||
modJsList['tabEmployeeCustomField'] = new CustomFieldAdapter('CustomField','EmployeeCustomField',{"type":"Employee"},"display_order desc");
|
||||
modJsList['tabEmployeeCustomField'].setRemoteTable(true);
|
||||
modJsList['tabEmployeeCustomField'].setTableType("Employee");
|
||||
|
||||
|
||||
var modJs = modJsList['tabEmployeeFieldName'];
|
||||
|
||||
|
||||
@@ -4,71 +4,65 @@
|
||||
Developer: Thilina Hasantha (http://lk.linkedin.com/in/thilinah | https://github.com/thilinah)
|
||||
*/
|
||||
|
||||
use Classes\PermissionManager;
|
||||
use Projects\Common\Model\Project;
|
||||
use Projects\Common\Model\EmployeeProject;
|
||||
|
||||
$moduleName = 'projects';
|
||||
$moduleGroup = 'admin';
|
||||
define('MODULE_PATH',dirname(__FILE__));
|
||||
include APP_BASE_PATH.'header.php';
|
||||
include APP_BASE_PATH.'modulejslibs.inc.php';
|
||||
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="tabProject" href="#tabPageProject"><?=t('Projects')?></a></li>
|
||||
<li><a id="tabEmployeeProject" href="#tabPageEmployeeProject"><?=t('Employee Projects')?></a></li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="tabPageProject">
|
||||
<div id="Project" class="reviewBlock" data-content="List" style="padding-left:5px;">
|
||||
<ul class="nav nav-tabs" id="modTab" style="margin-bottom:0px;margin-left:5px;border-bottom: none;">
|
||||
<li class="active"><a id="tabProject" href="#tabPageProject"><?= t('Projects') ?></a></li>
|
||||
<li><a id="tabEmployeeProject" href="#tabPageEmployeeProject"><?= t('Employee Projects') ?></a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
<div id="ProjectForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane" id="tabPageEmployeeProject">
|
||||
<div id="EmployeeProject" class="reviewBlock" data-content="List" style="padding-left:5px;">
|
||||
|
||||
</div>
|
||||
<div id="EmployeeProjectForm" class="reviewBlock" data-content="Form" style="padding-left:5px;display:none;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="tabPageProject">
|
||||
<div id="ProjectTable" class="reviewBlock" data-content="List" style="padding-left:5px;"></div>
|
||||
<div id="ProjectForm"></div>
|
||||
<div id="ProjectFilterForm"></div>
|
||||
</div>
|
||||
<div class="tab-pane" id="tabPageEmployeeProject">
|
||||
<div id="EmployeeProjectTable" class="reviewBlock" data-content="List" style="padding-left:5px;"></div>
|
||||
<div id="EmployeeProjectForm"></div>
|
||||
<div id="EmployeeProjectFilterForm"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php
|
||||
$moduleData = [
|
||||
'user_level' => $user->user_level,
|
||||
'permissions' => [
|
||||
'Project' => PermissionManager::checkGeneralAccess(new Project()),
|
||||
'EmployeeProject' => PermissionManager::checkGeneralAccess(new EmployeeProject()),
|
||||
]
|
||||
];
|
||||
?>
|
||||
<script>
|
||||
var modJsList = [];
|
||||
var modJsList = [];
|
||||
var data = <?= json_encode($moduleData) ?>;
|
||||
modJsList['tabProject'] = new ProjectAdapter('Project', 'Project');
|
||||
modJsList.tabProject.setObjectTypeName('Project');
|
||||
modJsList.tabProject.setAccess(data.permissions.Project);
|
||||
modJsList.tabProject.setDataPipe(new IceDataPipe(modJsList.tabProject));
|
||||
modJsList.tabProject.setRemoteTable(true);
|
||||
|
||||
modJsList['tabProject'] = new ProjectAdapter('Project','Project');
|
||||
|
||||
<?php if(isset($modulePermissions['perm']['Add Projects']) && $modulePermissions['perm']['Add Projects'] == "No"){?>
|
||||
modJsList['tabProject'].setShowAddNew(false);
|
||||
<?php }?>
|
||||
|
||||
<?php if(isset($modulePermissions['perm']['Delete Projects']) && $modulePermissions['perm']['Delete Projects'] == "No"){?>
|
||||
modJsList['tabProject'].setShowDelete(false);
|
||||
<?php }?>
|
||||
|
||||
<?php if(isset($modulePermissions['perm']['Edit Projects']) && $modulePermissions['perm']['Edit Projects'] == "No"){?>
|
||||
modJsList['tabProject'].setShowSave(false);
|
||||
<?php }?>
|
||||
modJsList['tabEmployeeProject'] = new EmployeeProjectAdapter('EmployeeProject', 'EmployeeProject');
|
||||
|
||||
|
||||
modJsList['tabEmployeeProject'] = new EmployeeProjectAdapter('EmployeeProject','EmployeeProject');
|
||||
modJsList['tabEmployeeProject'].setRemoteTable(true);
|
||||
modJsList.tabEmployeeProject.setObjectTypeName('Employee Project');
|
||||
modJsList.tabEmployeeProject.setAccess(data.permissions.EmployeeProject);
|
||||
modJsList.tabEmployeeProject.setDataPipe(new IceDataPipe(modJsList.tabEmployeeProject));
|
||||
modJsList.tabEmployeeProject.setRemoteTable(true);
|
||||
|
||||
<?php if(isset($modulePermissions['perm']['Add Projects']) && $modulePermissions['perm']['Add Projects'] == "No"){?>
|
||||
modJsList['tabEmployeeProject'].setShowAddNew(false);
|
||||
<?php }?>
|
||||
<?php if(isset($modulePermissions['perm']['Delete Projects']) && $modulePermissions['perm']['Delete Projects'] == "No"){?>
|
||||
modJsList['tabEmployeeProject'].setShowDelete(false);
|
||||
<?php }?>
|
||||
<?php if(isset($modulePermissions['perm']['Edit Projects']) && $modulePermissions['perm']['Edit Projects'] == "No"){?>
|
||||
modJsList['tabEmployeeProject'].setShowEdit(false);
|
||||
<?php }?>
|
||||
|
||||
|
||||
var modJs = modJsList['tabProject'];
|
||||
var modJs = modJsList['tabProject'];
|
||||
|
||||
</script>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
<?php include APP_BASE_PATH . 'footer.php'; ?>
|
||||
|
||||
@@ -19,28 +19,42 @@ $options1 = array();
|
||||
$options1['setShowAddNew'] = 'false';
|
||||
$options1['setRemoteTable'] = 'true';
|
||||
|
||||
$notCloud = !defined('IS_CLOUD') || IS_CLOUD == false;
|
||||
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab(
|
||||
'CompanySetting','Setting','Company','SettingAdapter','{"category":"Company"}','name',true,$options1
|
||||
));
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab(
|
||||
'SystemSetting','Setting','System','SettingAdapter','{"category":"System"}','name',false,$options1
|
||||
));
|
||||
if (!defined('CLOUD_INSTALLATION')) {
|
||||
if ( $notCloud ) {
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab(
|
||||
'EmailSetting', 'Setting', 'Email', 'SettingAdapter', '{"category":"Email"}', 'name', false, $options1
|
||||
));
|
||||
}
|
||||
if(!defined('LEAVE_ENABLED') || LDAP_ENABLED == true) {
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab(
|
||||
'LeaveSetting', 'Setting', 'Leave', 'SettingAdapter', '{"category":"Leave"}', 'name', false, $options1
|
||||
));
|
||||
}
|
||||
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab(
|
||||
'LeaveSetting','Setting','Leave / PTO','SettingAdapter','{"category":"Leave"}','name',false,$options1
|
||||
'AttendanceSetting','Setting','Attendance','SettingAdapter','{"category":"Attendance"}','name',false,$options1
|
||||
));
|
||||
|
||||
if(!defined('LDAP_ENABLED') || LDAP_ENABLED == true){
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab(
|
||||
'LDAPSetting','Setting','LDAP','SettingAdapter','{"category":"LDAP"}','name',false,$options1
|
||||
));
|
||||
}
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab(
|
||||
'AttendanceSetting','Setting','Attendance','SettingAdapter','{"category":"Attendance"}','name',false,$options1
|
||||
));
|
||||
|
||||
if(!defined('SAML_ENABLED') || SAML_ENABLED == true){
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab(
|
||||
'SAMLSetting','Setting','SAML','SettingAdapter','{"category":"SAML"}','name',false,$options1
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab(
|
||||
'OtherSetting','Setting','Other','SettingAdapter','{"category":["Projects","Recruitment","Notifications","Expense","Travel","Api","Overtime"]}','name',false,$options1
|
||||
));
|
||||
|
||||
@@ -31,22 +31,6 @@ $moduleBuilder->addModuleOrGroup(new \Classes\ModuleBuilder\ModuleTab(
|
||||
$travelRequestOptions
|
||||
));
|
||||
|
||||
if ($user->user_level === 'Admin') {
|
||||
$travelCustomFieldOptions = [];
|
||||
$travelCustomFieldOptions['setRemoteTable'] = 'true';
|
||||
$travelCustomFieldOptions['setTableType'] = '\'EmployeeTravelRecord\'';
|
||||
|
||||
$moduleBuilder->addModuleOrGroup(new \Classes\ModuleBuilder\ModuleTab(
|
||||
'TravelCustomField',
|
||||
'CustomField',
|
||||
'Custom Fields',
|
||||
'CustomFieldAdapter',
|
||||
'{"type":"EmployeeTravelRecord"}',
|
||||
'',
|
||||
false,
|
||||
$travelCustomFieldOptions
|
||||
));
|
||||
}
|
||||
|
||||
echo \Classes\UIManager::getInstance()->renderModule($moduleBuilder);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user