IceHrm v18.0
This commit is contained in:
@@ -87,6 +87,20 @@ if (!class_exists('CompanyStructure')) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function isHeadOfCompanyStructure($companyStructureId, $profileId){
|
||||
$companyStructure = new CompanyStructure();
|
||||
$companyStructure->Load("id = ?",array($companyStructureId));
|
||||
|
||||
if(isset($companyStructure->heads) && !empty($companyStructure->heads)){
|
||||
$heads = json_decode($companyStructure->heads);
|
||||
if(is_array($heads) && !empty($heads) && in_array($profileId, $heads)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,4 +122,4 @@ if (!class_exists('Timezone')) {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
|
||||
<div class="small-box bg-green">
|
||||
<div class="inner">
|
||||
<h3>Company</h3>
|
||||
<h3><t>Company</t></h3>
|
||||
<p id="numberOfCompanyStuctures">
|
||||
#_numberOfCompanyStuctures_# Departments
|
||||
#_numberOfCompanyStuctures_# <t>Departments</t>
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-shuffle"></i>
|
||||
</div>
|
||||
<a href="#_moduleLink_#" class="small-box-footer" id="companyLink">
|
||||
Manage Company <i class="fa fa-arrow-circle-right"></i>
|
||||
<t>Manage</t> <t>Company</t> <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -54,8 +54,8 @@ path.link {
|
||||
<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="tabCompanyStructure" href="#tabPageCompanyStructure">Company Structure</a></li>
|
||||
<li><a id="tabCompanyGraph" href="#tabPageCompanyGraph">Company Graph</a></li>
|
||||
<li class="active"><a id="tabCompanyStructure" href="#tabPageCompanyStructure"><?=LanguageManager::tran('Company Structure')?></a></li>
|
||||
<li><a id="tabCompanyGraph" href="#tabPageCompanyGraph"><?=LanguageManager::tran('Company Graph')?></a></li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
@@ -93,4 +93,4 @@ modJsList['tabCompanyGraph'] = new CompanyGraphAdapter('CompanyStructure');
|
||||
var modJs = modJsList['tabCompanyStructure'];
|
||||
|
||||
</script>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
<?php include APP_BASE_PATH.'footer.php';?>
|
||||
|
||||
@@ -43,7 +43,8 @@ CompanyStructureAdapter.method('getFormFields', function() {
|
||||
[ "type", {"label":"Type","type":"select","source":[["Company","Company"],["Head Office","Head Office"],["Regional Office","Regional Office"],["Department","Department"],["Unit","Unit"],["Sub Unit","Sub Unit"],["Other","Other"]]}],
|
||||
[ "country", {"label":"Country","type":"select2","remote-source":["Country","code","name"]}],
|
||||
[ "timezone", {"label":"Time Zone","type":"select2","allow-null":false,"remote-source":["Timezone","name","details"]}],
|
||||
[ "parent", {"label":"Parent Structure","type":"select","allow-null":true,"remote-source":["CompanyStructure","id","title"]}]
|
||||
[ "parent", {"label":"Parent Structure","type":"select","allow-null":true,"remote-source":["CompanyStructure","id","title"]}],
|
||||
[ "heads", {"label":"Heads","type":"select2multi","allow-null":true,"remote-source":["Employee","id","first_name+last_name"]}]
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user