Initial checkin v13.0
This commit is contained in:
144
ext/admin/metadata/api/MetadataAdminManager.php
Normal file
144
ext/admin/metadata/api/MetadataAdminManager.php
Normal file
@@ -0,0 +1,144 @@
|
||||
<?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');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
42
ext/admin/metadata/index.php
Normal file
42
ext/admin/metadata/index.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/*
|
||||
This file is part of Ice Framework.
|
||||
|
||||
Ice Framework 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 Framework 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 Framework. 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 = 'metadata';
|
||||
define('MODULE_PATH',dirname(__FILE__));
|
||||
include APP_BASE_PATH.'header.php';
|
||||
include APP_BASE_PATH.'modulejslibs.inc.php';
|
||||
|
||||
$moduleBuilder = new ModuleBuilder();
|
||||
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab('Country','Country','Countries','CountryAdapter','','',true));
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab('Province','Province','Provinces','ProvinceAdapter','',''));
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab('CurrencyType','CurrencyType','Currency Types','CurrencyTypeAdapter','',''));
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab('Nationality','Nationality','Nationality','NationalityAdapter','',''));
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab('Nationality','Nationality','Nationality','NationalityAdapter','',''));
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab('Ethnicity','Ethnicity','Ethnicity','EthnicityAdapter','',''));
|
||||
$moduleBuilder->addModuleOrGroup(new ModuleTab('ImmigrationStatus','ImmigrationStatus','Immigration Status','ImmigrationStatusAdapter','',''));
|
||||
|
||||
|
||||
echo UIManager::getInstance()->renderModule($moduleBuilder);
|
||||
|
||||
include APP_BASE_PATH.'footer.php';
|
||||
158
ext/admin/metadata/lib.js
Normal file
158
ext/admin/metadata/lib.js
Normal file
@@ -0,0 +1,158 @@
|
||||
/**
|
||||
* Author: Thilina Hasantha
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* CountryAdapter
|
||||
*/
|
||||
|
||||
function CountryAdapter(endPoint) {
|
||||
this.initAdapter(endPoint);
|
||||
}
|
||||
|
||||
CountryAdapter.inherits(AdapterBase);
|
||||
|
||||
|
||||
|
||||
CountryAdapter.method('getDataMapping', function() {
|
||||
return [
|
||||
"id",
|
||||
"code",
|
||||
"name"
|
||||
];
|
||||
});
|
||||
|
||||
CountryAdapter.method('getHeaders', function() {
|
||||
return [
|
||||
{ "sTitle": "ID" ,"bVisible":false},
|
||||
{ "sTitle": "Code" },
|
||||
{ "sTitle": "Name"}
|
||||
];
|
||||
});
|
||||
|
||||
CountryAdapter.method('getFormFields', function() {
|
||||
return [
|
||||
[ "id", {"label":"ID","type":"hidden"}],
|
||||
[ "code", {"label":"Code","type":"text","validation":""}],
|
||||
[ "name", {"label":"Name","type":"text","validation":""}]
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* ProvinceAdapter
|
||||
*/
|
||||
|
||||
function ProvinceAdapter(endPoint) {
|
||||
this.initAdapter(endPoint);
|
||||
}
|
||||
|
||||
ProvinceAdapter.inherits(AdapterBase);
|
||||
|
||||
|
||||
|
||||
ProvinceAdapter.method('getDataMapping', function() {
|
||||
return [
|
||||
"id",
|
||||
"code",
|
||||
"name",
|
||||
"country"
|
||||
];
|
||||
});
|
||||
|
||||
ProvinceAdapter.method('getHeaders', function() {
|
||||
return [
|
||||
{ "sTitle": "ID" ,"bVisible":false},
|
||||
{ "sTitle": "Code" },
|
||||
{ "sTitle": "Name"},
|
||||
{ "sTitle": "Country"},
|
||||
];
|
||||
});
|
||||
|
||||
ProvinceAdapter.method('getFormFields', function() {
|
||||
return [
|
||||
[ "id", {"label":"ID","type":"hidden"}],
|
||||
[ "code", {"label":"Code","type":"text","validation":""}],
|
||||
[ "name", {"label":"Name","type":"text","validation":""}],
|
||||
[ "country", {"label":"Country","type":"select2","remote-source":["Country","code","name"]}]
|
||||
];
|
||||
});
|
||||
|
||||
ProvinceAdapter.method('getFilters', function() {
|
||||
return [
|
||||
[ "country", {"label":"Country","type":"select2","remote-source":["Country","code","name"]}]
|
||||
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* CurrencyTypeAdapter
|
||||
*/
|
||||
|
||||
function CurrencyTypeAdapter(endPoint) {
|
||||
this.initAdapter(endPoint);
|
||||
}
|
||||
|
||||
CurrencyTypeAdapter.inherits(AdapterBase);
|
||||
|
||||
|
||||
|
||||
CurrencyTypeAdapter.method('getDataMapping', function() {
|
||||
return [
|
||||
"id",
|
||||
"code",
|
||||
"name"
|
||||
];
|
||||
});
|
||||
|
||||
CurrencyTypeAdapter.method('getHeaders', function() {
|
||||
return [
|
||||
{ "sTitle": "ID" ,"bVisible":false},
|
||||
{ "sTitle": "Code" },
|
||||
{ "sTitle": "Name"}
|
||||
];
|
||||
});
|
||||
|
||||
CurrencyTypeAdapter.method('getFormFields', function() {
|
||||
return [
|
||||
[ "id", {"label":"ID","type":"hidden"}],
|
||||
[ "code", {"label":"Code","type":"text","validation":""}],
|
||||
[ "name", {"label":"Name","type":"text","validation":""}]
|
||||
];
|
||||
});
|
||||
|
||||
/**
|
||||
* NationalityAdapter
|
||||
*/
|
||||
|
||||
function NationalityAdapter(endPoint) {
|
||||
this.initAdapter(endPoint);
|
||||
}
|
||||
|
||||
NationalityAdapter.inherits(IdNameAdapter);
|
||||
|
||||
/**
|
||||
* ImmigrationStatusAdapter
|
||||
*/
|
||||
|
||||
function ImmigrationStatusAdapter(endPoint) {
|
||||
this.initAdapter(endPoint);
|
||||
}
|
||||
|
||||
ImmigrationStatusAdapter.inherits(IdNameAdapter);
|
||||
|
||||
|
||||
/**
|
||||
* EthnicityAdapter
|
||||
*/
|
||||
|
||||
function EthnicityAdapter(endPoint) {
|
||||
this.initAdapter(endPoint);
|
||||
}
|
||||
|
||||
EthnicityAdapter.inherits(IdNameAdapter);
|
||||
|
||||
|
||||
|
||||
11
ext/admin/metadata/meta.json
Normal file
11
ext/admin/metadata/meta.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"label":"Manage Metadata",
|
||||
"menu":"System",
|
||||
"order":"6",
|
||||
"icon":"fa-sort-alpha-asc",
|
||||
"user_levels":["Admin"],
|
||||
|
||||
"permissions":
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user