------------------ ### Features * Advanced Employee Management Module is now included in IceHrm Open Source Edition * LDAP Module which was only available in IceHrm Enterprise is now included in open source also * Initial implementation of icehrm REST Api for reading employee details * Improvements to data filtering * Multiple tabs for settings module * Overtime reports - now its possible to calculate overtime for employees.compatible with US overtime rules * Logout the user if tried accessing an unauthorized module * Setting for updating module names ### Fixes * Fix issue: classes should be loaded even the module is disabled * Deleting the only Admin user is not allowed * Fixes for handling non UTF-8 * Fix for non-mandatory select boxes are shown as mandatory
216 lines
5.0 KiB
PHP
216 lines
5.0 KiB
PHP
<?php
|
|
if (!class_exists('MetadataAdminManager')) {
|
|
|
|
class MetadataAdminManager extends AbstractModuleManager{
|
|
|
|
public function initializeUserClasses(){
|
|
|
|
}
|
|
|
|
public function initializeFieldMappings(){
|
|
|
|
}
|
|
|
|
public function initializeDatabaseErrorMappings(){
|
|
|
|
}
|
|
|
|
public function setupModuleClassDefinitions(){
|
|
$this->addModelClass('Country');
|
|
$this->addModelClass('Province');
|
|
$this->addModelClass('CurrencyType');
|
|
$this->addModelClass('Nationality');
|
|
$this->addModelClass('ImmigrationStatus');
|
|
$this->addModelClass('Ethnicity');
|
|
$this->addModelClass('CalculationHook');
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
if (!class_exists('Country')) {
|
|
class Country extends ICEHRM_Record {
|
|
var $_table = 'Country';
|
|
|
|
public function getAdminAccess(){
|
|
return array("get","element","save","delete");
|
|
}
|
|
|
|
public function getUserAccess(){
|
|
return array();
|
|
}
|
|
|
|
public function getAnonymousAccess(){
|
|
return array("get","element");
|
|
}
|
|
|
|
function Find($whereOrderBy,$bindarr=false,$pkeysArr=false,$extra=array()){
|
|
$allowedCountriesStr = SettingsManager::getInstance()->getSetting('System: Allowed Countries');
|
|
$allowedCountries = array();
|
|
if(!empty($allowedCountriesStr)){
|
|
$allowedCountries = json_decode($allowedCountriesStr,true);
|
|
}
|
|
|
|
if(!empty($allowedCountries)){
|
|
return parent::Find("id in (".implode(",",$allowedCountries).")" , array());
|
|
}
|
|
|
|
return parent::Find($whereOrderBy, $bindarr, $pkeysArr, $extra);
|
|
}
|
|
}
|
|
}
|
|
|
|
if (!class_exists('Province')) {
|
|
class Province extends ICEHRM_Record {
|
|
var $_table = 'Province';
|
|
|
|
public function getAdminAccess(){
|
|
return array("get","element","save","delete");
|
|
}
|
|
|
|
public function getUserAccess(){
|
|
return array();
|
|
}
|
|
|
|
public function getAnonymousAccess(){
|
|
return array("get","element");
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
if (!class_exists('CurrencyType')) {
|
|
class CurrencyType extends ICEHRM_Record {
|
|
var $_table = 'CurrencyTypes';
|
|
|
|
public function getAdminAccess(){
|
|
return array("get","element","save","delete");
|
|
}
|
|
|
|
public function getUserAccess(){
|
|
return array();
|
|
}
|
|
|
|
public function getAnonymousAccess(){
|
|
return array("get","element");
|
|
}
|
|
|
|
function Find($whereOrderBy,$bindarr=false,$pkeysArr=false,$extra=array()){
|
|
$allowedCountriesStr = SettingsManager::getInstance()->getSetting('System: Allowed Currencies');
|
|
$allowedCountries = array();
|
|
if(!empty($allowedCountriesStr)){
|
|
$allowedCountries = json_decode($allowedCountriesStr,true);
|
|
}
|
|
|
|
if(!empty($allowedCountries)){
|
|
return parent::Find("id in (".implode(",",$allowedCountries).")" , array());
|
|
}
|
|
|
|
return parent::Find($whereOrderBy, $bindarr, $pkeysArr, $extra);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
if (!class_exists('Nationality')) {
|
|
class Nationality extends ICEHRM_Record {
|
|
var $_table = 'Nationality';
|
|
|
|
public function getAdminAccess(){
|
|
return array("get","element","save","delete");
|
|
}
|
|
|
|
public function getUserAccess(){
|
|
return array();
|
|
}
|
|
|
|
public function getAnonymousAccess(){
|
|
return array("get","element");
|
|
}
|
|
|
|
function Find($whereOrderBy,$bindarr=false,$pkeysArr=false,$extra=array()){
|
|
$allowedCountriesStr = SettingsManager::getInstance()->getSetting('System: Allowed Nationality');
|
|
$allowedCountries = array();
|
|
if(!empty($allowedCountriesStr)){
|
|
$allowedCountries = json_decode($allowedCountriesStr,true);
|
|
}
|
|
|
|
if(!empty($allowedCountries)){
|
|
return parent::Find("id in (".implode(",",$allowedCountries).")" , array());
|
|
}
|
|
|
|
return parent::Find($whereOrderBy, $bindarr, $pkeysArr, $extra);
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
if (!class_exists('ImmigrationStatus')) {
|
|
class ImmigrationStatus extends ICEHRM_Record {
|
|
var $_table = 'ImmigrationStatus';
|
|
|
|
public function getAdminAccess(){
|
|
return array("get","element","save","delete");
|
|
}
|
|
|
|
public function getUserAccess(){
|
|
return array();
|
|
}
|
|
|
|
public function getAnonymousAccess(){
|
|
return array("get","element");
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
if (!class_exists('Ethnicity')) {
|
|
class Ethnicity extends ICEHRM_Record {
|
|
var $_table = 'Ethnicity';
|
|
|
|
public function getAdminAccess(){
|
|
return array("get","element","save","delete");
|
|
}
|
|
|
|
public function getUserAccess(){
|
|
return array();
|
|
}
|
|
|
|
public function getAnonymousAccess(){
|
|
return array("get","element");
|
|
}
|
|
}
|
|
}
|
|
|
|
if (!class_exists('CalculationHook')) {
|
|
class CalculationHook extends ICEHRM_Record {
|
|
var $_table = 'CalculationHooks';
|
|
|
|
public function getAdminAccess(){
|
|
return array("get","element","save","delete");
|
|
}
|
|
|
|
public function getUserAccess(){
|
|
return array();
|
|
}
|
|
|
|
public function getAnonymousAccess(){
|
|
return array("get","element");
|
|
}
|
|
|
|
function Find($whereOrderBy,$bindarr=false,$pkeysArr=false,$extra=array()){
|
|
return BaseService::getInstance()->getCalculationHooks();
|
|
}
|
|
|
|
function Load($where=null,$bindarr=false){
|
|
return BaseService::getInstance()->getCalculationHook($bindarr[0]);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|