mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Localization: first step (class Dict and handling of Metamodel)
SVN:trunk[338]
This commit is contained in:
@@ -132,8 +132,10 @@ abstract class AttributeDefinition
|
||||
public function IsNullAllowed() {return true;}
|
||||
public function GetNullValue() {return null;}
|
||||
public function GetCode() {return $this->m_sCode;}
|
||||
public function GetLabel() {return $this->Get("label");}
|
||||
public function GetDescription() {return $this->Get("description");}
|
||||
public function GetLabel() {return Dict::S('Class:'.$this->m_sHostClass.'/Attribute:'.$this->m_sCode, $this->m_sCode);}
|
||||
public function Obsolete_GetLabel() {return $this->Get("label");}
|
||||
public function GetDescription() {return Dict::S('Class:'.$this->m_sHostClass.'/Attribute:'.$this->m_sCode.'+', '');}
|
||||
public function Obsolete_GetDescription() {return $this->Get("description");}
|
||||
public function GetValuesDef() {return null;}
|
||||
public function GetPrerequisiteAttributes() {return array();}
|
||||
//public function IsSearchableStd() {return $this->Get("search_std");}
|
||||
@@ -828,6 +830,17 @@ class AttributeEnum extends AttributeString
|
||||
// later, we could imagine a detailed description in the title
|
||||
return "<span title=\"\">".parent::GetAsHtml($sLabel)."</span>";
|
||||
}
|
||||
|
||||
public function GetAllowedValues($aArgs = array(), $sBeginsWith = '')
|
||||
{
|
||||
$aRawValues = parent::GetAllowedValues($aArgs, $sBeginsWith);
|
||||
$aLocalizedValues = array();
|
||||
foreach ($aRawValues as $sKey => $sValue)
|
||||
{
|
||||
$aLocalizedValues[$sKey] = Dict::S('Class:'.$this->GetHostClass().'/Attribute:'.$this->GetCode().'/Value:'.$sKey, $sKey);
|
||||
}
|
||||
return $aLocalizedValues;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,6 +17,8 @@ require_once('coreexception.class.inc.php');
|
||||
|
||||
require_once('config.class.inc.php');
|
||||
|
||||
require_once('dict.class.inc.php');
|
||||
|
||||
require_once('attributedef.class.inc.php');
|
||||
require_once('filterdef.class.inc.php');
|
||||
require_once('stimulus.class.inc.php');
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
require_once('coreexception.class.inc.php');
|
||||
/**
|
||||
* Config
|
||||
* configuration data
|
||||
* configuration data (this class cannot not be localized, because it is responsible for loading the dictionaries)
|
||||
*
|
||||
* @package iTopORM
|
||||
* @author Romain Quetiez <romainquetiez@yahoo.fr>
|
||||
@@ -30,6 +30,7 @@ class Config
|
||||
protected $m_aAppModules;
|
||||
protected $m_aDataModels;
|
||||
protected $m_aAddons;
|
||||
protected $m_aDictionaries;
|
||||
|
||||
protected $m_sDBHost;
|
||||
protected $m_sDBUser;
|
||||
@@ -59,13 +60,19 @@ class Config
|
||||
* @var boolean Whether or not a secure connection is required for using the application
|
||||
*/
|
||||
protected $m_bSecureConnectionRequired;
|
||||
|
||||
|
||||
/**
|
||||
* @var string Langage code, default if the user language is undefined
|
||||
*/
|
||||
protected $m_sDefaultLanguage;
|
||||
|
||||
public function __construct($sConfigFile, $bLoadConfig = true)
|
||||
{
|
||||
$this->m_sFile = $sConfigFile;
|
||||
$this->m_aAppModules = array();
|
||||
$this->m_aDataModels = array();
|
||||
$this->m_aAddons = array();
|
||||
$this->m_aDictionaries = array();
|
||||
|
||||
$this->m_sDBHost = '';
|
||||
$this->m_sDBUser = '';
|
||||
@@ -77,6 +84,7 @@ class Config
|
||||
$this->m_iStandardReloadInterval = DEFAULT_STANDARD_RELOAD_INTERVAL;
|
||||
$this->m_iFastReloadInterval = DEFAULT_FAST_RELOAD_INTERVAL;
|
||||
$this->m_bSecureConnectionRequired = DEFAULT_SECURE_CONNECTION_REQUIRED;
|
||||
$this->m_sDefaultLanguage = 'EN US';
|
||||
if ($bLoadConfig)
|
||||
{
|
||||
$this->Load($sConfigFile);
|
||||
@@ -144,9 +152,14 @@ class Config
|
||||
{
|
||||
$MyModules['addons']['user rights'] = '../addons/userrights/userrightsnull.class.inc.php';
|
||||
}
|
||||
if (!array_key_exists('dictionaries', $MyModules))
|
||||
{
|
||||
throw new ConfigException('Missing item in configuration file', array('file' => $sConfigFile, 'expected' => '$MyModules[\'dictionaries\']'));
|
||||
}
|
||||
$this->m_aAppModules = $MyModules['application'];
|
||||
$this->m_aDataModels = $MyModules['business'];
|
||||
$this->m_aAddons = $MyModules['addons'];
|
||||
$this->m_aDictionaries = $MyModules['dictionaries'];
|
||||
|
||||
$this->m_sDBHost = trim($MySettings['db_host']);
|
||||
$this->m_sDBUser = trim($MySettings['db_user']);
|
||||
@@ -159,6 +172,8 @@ class Config
|
||||
$this->m_iStandardReloadInterval = isset($MySettings['standard_reload_interval']) ? trim($MySettings['standard_reload_interval']) : DEFAULT_STANDARD_RELOAD_INTERVAL;
|
||||
$this->m_iFastReloadInterval = isset($MySettings['fast_reload_interval']) ? trim($MySettings['fast_reload_interval']) : DEFAULT_FAST_RELOAD_INTERVAL;
|
||||
$this->m_bSecureConnectionRequired = isset($MySettings['secure_connection_required']) ? trim($MySettings['secure_connection_required']) : DEFAULT_SECURE_CONNECTION_REQUIRED;
|
||||
|
||||
$this->m_sDefaultLanguage = isset($MySettings['default_language']) ? trim($MySettings['default_language']) : 'EN US';
|
||||
}
|
||||
|
||||
protected function Verify()
|
||||
@@ -175,6 +190,10 @@ class Config
|
||||
{
|
||||
$this->CheckFile('addon module', $sToInclude);
|
||||
}
|
||||
foreach ($this->m_aDictionaries as $sModule => $sToInclude)
|
||||
{
|
||||
$this->CheckFile('dictionary', $sToInclude);
|
||||
}
|
||||
}
|
||||
|
||||
public function GetAppModules()
|
||||
@@ -192,6 +211,11 @@ class Config
|
||||
return $this->m_aAddons;
|
||||
}
|
||||
|
||||
public function GetDictionaries()
|
||||
{
|
||||
return $this->m_aDictionaries;
|
||||
}
|
||||
|
||||
public function GetDBHost()
|
||||
{
|
||||
return $this->m_sDBHost;
|
||||
@@ -242,6 +266,11 @@ class Config
|
||||
return $this->m_bSecureConnectionRequired;
|
||||
}
|
||||
|
||||
public function GetDefaultLanguage()
|
||||
{
|
||||
return $this->m_sDefaultLanguage;
|
||||
}
|
||||
|
||||
public function SetDBHost($sDBHost)
|
||||
{
|
||||
$this->m_sDBHost = $sDBHost;
|
||||
@@ -292,6 +321,11 @@ class Config
|
||||
$this->m_bSecureConnectionRequired = $bSecureConnectionRequired;
|
||||
}
|
||||
|
||||
public function SetDefaultLanguage($sLanguageCode)
|
||||
{
|
||||
$this->m_sDefaultLanguage = $sLanguageCode;
|
||||
}
|
||||
|
||||
public function FileIsWritable()
|
||||
{
|
||||
return is_writable($this->m_sFile);
|
||||
@@ -334,6 +368,7 @@ class Config
|
||||
fwrite($hFile, "\t'standard_reload_interval' => {$this->m_iStandardReloadInterval},\n");
|
||||
fwrite($hFile, "\t'fast_reload_interval' => {$this->m_iFastReloadInterval},\n");
|
||||
fwrite($hFile, "\t'secure_connection_required' => ".($this->m_bSecureConnectionRequired ? 'true' : 'false').",\n");
|
||||
fwrite($hFile, "\t'default_language' => '{$this->m_sDefaultLanguage}',\n");
|
||||
fwrite($hFile, ");\n");
|
||||
|
||||
fwrite($hFile, "\n/**\n");
|
||||
@@ -362,7 +397,13 @@ class Config
|
||||
fwrite($hFile, "\t'addons' => array (\n");
|
||||
fwrite($hFile, "\t\t'user rights' => '../addons/userrights/userrightsprofile.class.inc.php',\n");
|
||||
fwrite($hFile, "\t\t// other modules to come later\n");
|
||||
fwrite($hFile, "\t)\n");
|
||||
fwrite($hFile, "\t),\n");
|
||||
fwrite($hFile, "\t'dictionaries' => array (\n");
|
||||
fwrite($hFile, "\t\t'../dictionaries/dictionary.itop.model.php',\n");
|
||||
fwrite($hFile, "\t\t'../dictionaries/dictionary.itop.core.php',\n");
|
||||
fwrite($hFile, "\t\t'../dictionaries/dictionary.itop.ui.php',\n");
|
||||
fwrite($hFile, "\t\t// to be continued...\n");
|
||||
fwrite($hFile, "\t),\n");
|
||||
fwrite($hFile, ");\n");
|
||||
fwrite($hFile, '?'.'>'); // Avoid perturbing the syntax highlighting !
|
||||
return fclose($hFile);
|
||||
|
||||
181
core/dict.class.inc.php
Normal file
181
core/dict.class.inc.php
Normal file
@@ -0,0 +1,181 @@
|
||||
<?php
|
||||
/**
|
||||
* Dict
|
||||
* Handles Localizable data
|
||||
*
|
||||
* @package iTopORM
|
||||
* @author Romain Quetiez <romainquetiez@yahoo.fr>
|
||||
* @author Denis Flaven <denisflave@free.fr>
|
||||
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
|
||||
* @link www.itop.com
|
||||
* @since 1.0
|
||||
* @version 1.1.1.1 $
|
||||
*/
|
||||
|
||||
|
||||
class DictException extends CoreException
|
||||
{
|
||||
}
|
||||
|
||||
class DictExceptionUnknownLanguage extends DictException
|
||||
{
|
||||
public function __construct($sLanguageCode)
|
||||
{
|
||||
$aContext = array();
|
||||
$aContext['language_code'] = $sLanguageCode;
|
||||
parent::__construct('Unknown localization language', $aContext);
|
||||
}
|
||||
}
|
||||
|
||||
class DictExceptionMissingString extends DictException
|
||||
{
|
||||
public function __construct($sLanguageCode, $sStringCode)
|
||||
{
|
||||
$aContext = array();
|
||||
$aContext['language_code'] = $sLanguageCode;
|
||||
$aContext['string_code'] = $sStringCode;
|
||||
parent::__construct('Missing localized string', $aContext);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
define('DICT_ERR_STRING', 1); // when a string is missing, return the identifier
|
||||
define('DICT_ERR_EXCEPTION', 2); // when a string is missing, throw an exception
|
||||
//define('DICT_ERR_LOG', 3); // when a string is missing, log an error
|
||||
|
||||
|
||||
class Dict
|
||||
{
|
||||
protected static $m_iErrorMode = DICT_ERR_STRING;
|
||||
protected static $m_sCurrentLanguage = 'EN US';
|
||||
|
||||
protected static $m_aLanguages = array(); // array( code => array( 'description' => '...', 'localized_description' => '...') ...)
|
||||
protected static $m_aData = array();
|
||||
|
||||
|
||||
public static function SetLanguage($sLanguageCode)
|
||||
{
|
||||
if (!array_key_exists($sLanguageCode, self::$m_aLanguages))
|
||||
{
|
||||
throw new DictExceptionUnknownLanguage($sLanguageCode);
|
||||
}
|
||||
self::$m_sCurrentLanguage = $sLanguageCode;
|
||||
}
|
||||
|
||||
|
||||
//returns a hash array( code => array( 'description' => '...', 'localized_description' => '...') ...)
|
||||
public static function GetLanguages()
|
||||
{
|
||||
return self::$m_aLanguages;
|
||||
}
|
||||
|
||||
// iErrorMode from {DICT_ERR_STRING, DICT_ERR_EXCEPTION}
|
||||
public static function SetErrorMode($iErrorMode)
|
||||
{
|
||||
self::$m_iErrorMode = $iErrorMode;
|
||||
}
|
||||
|
||||
|
||||
public static function S($sStringCode, $sDefault = null)
|
||||
{
|
||||
$aCurrentDictionary = self::$m_aData[self::$m_sCurrentLanguage];
|
||||
if (!array_key_exists($sStringCode, $aCurrentDictionary))
|
||||
{
|
||||
switch (self::$m_iErrorMode)
|
||||
{
|
||||
case DICT_ERR_STRING:
|
||||
if (is_null($sDefault))
|
||||
{
|
||||
return $sStringCode;
|
||||
}
|
||||
else
|
||||
{
|
||||
return $sDefault;
|
||||
}
|
||||
break;
|
||||
|
||||
case DICT_ERR_EXCEPTION:
|
||||
default:
|
||||
throw new DictExceptionMissingString(self::$m_sCurrentLanguage, $sStringCode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $aCurrentDictionary[$sStringCode];
|
||||
}
|
||||
|
||||
|
||||
public static function Format($sFormatCode /*, ... arguments ....*/)
|
||||
{
|
||||
$sLocalizedFormat = self::S($sFormatCode);
|
||||
|
||||
$aArguments = func_get_args();
|
||||
array_shift($aArguments);
|
||||
return vsprintf($sFormat, $aArguments);
|
||||
}
|
||||
|
||||
|
||||
// sLanguageCode: Code identifying the language i.e. FR-FR
|
||||
// sEnglishLanguageDesc: Description of the language code, in English. i.e. French (France)
|
||||
// sLocalizedLanguageDesc: Description of the language code, in its own language. i.e. Français (France)
|
||||
// aEntries: Hash array of dictionnary entries
|
||||
public static function Add($sLanguageCode, $sEnglishLanguageDesc, $sLocalizedLanguageDesc, $aEntries)
|
||||
{
|
||||
if (!array_key_exists($sLanguageCode, self::$m_aLanguages))
|
||||
{
|
||||
self::$m_aLanguages[$sLanguageCode] = array($sEnglishLanguageDesc, $sLocalizedLanguageDesc);
|
||||
self::$m_aData[$sLanguageCode] = array();
|
||||
}
|
||||
self::$m_aData[$sLanguageCode] = array_merge(self::$m_aData[$sLanguageCode], $aEntries);
|
||||
}
|
||||
|
||||
public static function MakeStats($sLanguageCode, $sLanguageRef = 'EN US')
|
||||
{
|
||||
$aMissing = array(); // Strings missing for the target language
|
||||
$aUnexpected = array(); // Strings defined for the target language, but not found in the reference dictionary
|
||||
$aNotTranslated = array(); // Strings having the same value in both dictionaries
|
||||
$aOK = array(); // Strings having different values in both dictionaries
|
||||
|
||||
foreach (self::$m_aData[$sLanguageRef] as $sStringCode => $sValue)
|
||||
{
|
||||
if (!array_key_exists($sStringCode, self::$m_aData[$sLanguageCode]))
|
||||
{
|
||||
$aMissing[$sStringCode] = $sValue;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (self::$m_aData[$sLanguageCode] as $sStringCode => $sValue)
|
||||
{
|
||||
if (!array_key_exists($sStringCode, self::$m_aData[$sLanguageRef]))
|
||||
{
|
||||
$aUnexpected[$sStringCode] = $sValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
// The value exists in the reference
|
||||
$sRefValue = self::$m_aData[$sLanguageRef][$sStringCode];
|
||||
if ($sValue == $sRefValue)
|
||||
{
|
||||
$aNotTranslated[$sStringCode] = $sValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
$aOK[$sStringCode] = $sValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
return array($aMissing, $aUnexpected, $aNotTranslated, $aOK);
|
||||
}
|
||||
|
||||
public static function Dump()
|
||||
{
|
||||
MyHelpers::var_dump_html(self::$m_aData);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Dans les templates, les chaines localizables seront remplacées par un tag <itopstring>code_de_la_chaine</itopstring>
|
||||
Modifier les profils utilisateurs pour stocker le langage de l'utilisateur.
|
||||
*/
|
||||
|
||||
|
||||
?>
|
||||
@@ -194,7 +194,13 @@ abstract class MetaModel
|
||||
|
||||
final static public function GetName($sClass)
|
||||
{
|
||||
self::_check_subclass($sClass);
|
||||
self::_check_subclass($sClass);
|
||||
$sStringCode = 'Class:'.$sClass;
|
||||
return Dict::S($sStringCode, $sClass);
|
||||
}
|
||||
final static public function Obsolete_GetName($sClass)
|
||||
{
|
||||
self::_check_subclass($sClass);
|
||||
return self::$m_aClassParams[$sClass]["name"];
|
||||
}
|
||||
final static public function GetCategory($sClass)
|
||||
@@ -208,6 +214,12 @@ abstract class MetaModel
|
||||
return (strpos(self::$m_aClassParams[$sClass]["category"], $sCategory) !== false);
|
||||
}
|
||||
final static public function GetClassDescription($sClass)
|
||||
{
|
||||
self::_check_subclass($sClass);
|
||||
$sStringCode = 'Class:'.$sClass.'+';
|
||||
return Dict::S($sStringCode, '');
|
||||
}
|
||||
final static public function Obsolete_GetClassDescription($sClass)
|
||||
{
|
||||
self::_check_subclass($sClass);
|
||||
return self::$m_aClassParams[$sClass]["description"];
|
||||
@@ -1130,6 +1142,11 @@ abstract class MetaModel
|
||||
{
|
||||
$sTargetClass = self::GetCallersPHPClass("Init");
|
||||
self::$m_aStimuli[$sTargetClass][$sStimulusCode] = $oStimulus;
|
||||
|
||||
// I wanted to simplify the syntax of the declaration of objects in the biz model
|
||||
// Therefore, the reference to the host class is set there
|
||||
$oStimulus->SetHostClass($sTargetClass);
|
||||
$oStimulus->SetCode($sStimulusCode);
|
||||
}
|
||||
|
||||
public static function Init_DefineTransition($sStateCode, $sStimulusCode, $aTransitionDef)
|
||||
@@ -2089,6 +2106,83 @@ abstract class MetaModel
|
||||
return $aDataDump;
|
||||
}
|
||||
|
||||
public static function MakeDictionaryTemplate()
|
||||
{
|
||||
$sRes = '';
|
||||
|
||||
foreach (Dict::GetLanguages() as $sLanguageCode => $aLanguageData)
|
||||
{
|
||||
list($aMissing, $aUnexpected, $aNotTranslated, $aOK) = Dict::MakeStats($sLanguageCode, 'EN US');
|
||||
echo "<p>Stats for language: $sLanguageCode</p>\n";
|
||||
echo "<ul><li>Missing:".count($aMissing)."</li><li>Unexpected:".count($aUnexpected)."</li><li>NotTranslated:".count($aNotTranslated)."</li><li>OK:".count($aOK)."</li></ul>\n";
|
||||
}
|
||||
$sRes .= "// Dictionnay conventions\n";
|
||||
$sRes .= htmlentities("// Class:<class_name>\n");
|
||||
$sRes .= htmlentities("// Class:<class_name>+\n");
|
||||
$sRes .= htmlentities("// Class:<class_name>/Attribute:<attribute_code>\n");
|
||||
$sRes .= htmlentities("// Class:<class_name>/Attribute:<attribute_code>+\n");
|
||||
$sRes .= htmlentities("// Class:<class_name>/Attribute:<attribute_code>/Value:<value>\n");
|
||||
$sRes .= htmlentities("// Class:<class_name>/Attribute:<attribute_code>/Value:<value>+\n");
|
||||
$sRes .= htmlentities("// Class:<class_name>/Stimulus:<stimulus_code>\n");
|
||||
$sRes .= htmlentities("// Class:<class_name>/Stimulus:<stimulus_code>+\n");
|
||||
$sRes .= "\n";
|
||||
|
||||
// Note: I did not use EnumCategories(), because a given class maybe found in several categories
|
||||
// Need to invent the "module", to characterize the origins of a class
|
||||
$aModules = array('bizmodel', 'core/cmdb', 'gui' , 'application', 'addon/userrights');
|
||||
|
||||
$sRes .= "//////////////////////////////////////////////////////////////////////\n";
|
||||
$sRes .= "// Note: The classes have been grouped by categories: ".implode(', ', $aModules)."\n";
|
||||
$sRes .= "//////////////////////////////////////////////////////////////////////\n";
|
||||
|
||||
foreach ($aModules as $sCategory)
|
||||
{
|
||||
$sRes .= "//////////////////////////////////////////////////////////////////////\n";
|
||||
$sRes .= "// Classes in '<em>$sCategory</em>'\n";
|
||||
$sRes .= "//////////////////////////////////////////////////////////////////////\n";
|
||||
$sRes .= "//\n";
|
||||
$sRes .= "\n";
|
||||
foreach (self::GetClasses($sCategory) as $sClass)
|
||||
{
|
||||
if (self::IsAbstract($sClass)) continue;
|
||||
|
||||
$sRes .= "//\n";
|
||||
$sRes .= "// Class: $sClass\n";
|
||||
$sRes .= "//\n";
|
||||
$sRes .= "\n";
|
||||
$sRes .= "Dict::Add('EN US', 'English', 'English', array(\n";
|
||||
$sRes .= " 'Class:$sClass' => '".self::GetName($sClass)."',\n";
|
||||
$sRes .= " 'Class:$sClass+' => '".self::GetClassDescription($sClass)."',\n";
|
||||
foreach(self::ListAttributeDefs($sClass) as $sAttCode => $oAttDef)
|
||||
{
|
||||
// Skip this attribute if not originaly defined in this class
|
||||
if (self::$m_aAttribOrigins[$sClass][$sAttCode] != $sClass) continue;
|
||||
|
||||
$sRes .= " 'Class:$sClass/Attribute:$sAttCode' => '".$oAttDef->GetLabel()."',\n";
|
||||
$sRes .= " 'Class:$sClass/Attribute:$sAttCode+' => '".$oAttDef->GetDescription()."',\n";
|
||||
if ($oAttDef instanceof AttributeEnum)
|
||||
{
|
||||
foreach ($oAttDef->GetAllowedValues() as $sKey => $value)
|
||||
{
|
||||
$sValue = str_replace("'", "\\'", $value);
|
||||
$sRes .= " 'Class:$sClass/Attribute:$sAttCode/Value:$sKey' => '$sValue',\n";
|
||||
$sRes .= " 'Class:$sClass/Attribute:$sAttCode/Value:$sKey+' => '$sValue',\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach(self::EnumStimuli($sClass) as $sStimulusCode => $oStimulus)
|
||||
{
|
||||
$sRes .= " 'Class:$sClass/Stimulus:$sStimulusCode' => '".$oStimulus->Get('label')."',\n";
|
||||
$sRes .= " 'Class:$sClass/Stimulus:$sStimulusCode+' => '".$oStimulus->Get('description')."',\n";
|
||||
}
|
||||
|
||||
$sRes .= "));\n";
|
||||
$sRes .= "\n";
|
||||
}
|
||||
}
|
||||
return $sRes;
|
||||
}
|
||||
|
||||
public static function DBCheckFormat()
|
||||
{
|
||||
$aErrors = array();
|
||||
@@ -2625,6 +2719,12 @@ abstract class MetaModel
|
||||
{
|
||||
self::Plugin($sConfigFile, 'addons', $sToInclude);
|
||||
}
|
||||
foreach ($oConfig->GetDictionaries() as $sModule => $sToInclude)
|
||||
{
|
||||
self::Plugin($sConfigFile, 'dictionaries', $sToInclude);
|
||||
}
|
||||
// Set the language... after the dictionaries have been loaded!
|
||||
Dict::SetLanguage($oConfig->GetDefaultLanguage());
|
||||
|
||||
$sServer = $oConfig->GetDBHost();
|
||||
$sUser = $oConfig->GetDBUser();
|
||||
|
||||
@@ -12,16 +12,42 @@
|
||||
* @version 1.1.1.1 $
|
||||
*/
|
||||
|
||||
// #@# Really dirty !!!
|
||||
// #@# TO BE CLEANED -> ALIGN WITH OTHER METAMODEL DECLARATIONS
|
||||
|
||||
class ObjectStimulus
|
||||
{
|
||||
private $m_aParams = array();
|
||||
private $m_sHostClass = null;
|
||||
private $m_sCode = null;
|
||||
|
||||
public function __construct($aParams)
|
||||
{
|
||||
$this->m_aParams = $aParams;
|
||||
// obsolete: $this->m_aParams = $aParams;
|
||||
$this->m_aParams['label'] = 'foo';
|
||||
$this->m_aParams['description'] = 'foo';
|
||||
$this->ConsistencyCheck();
|
||||
}
|
||||
|
||||
public function SetHostClass($sHostClass)
|
||||
{
|
||||
$this->m_sHostClass = $sHostClass;
|
||||
}
|
||||
public function GetHostClass()
|
||||
{
|
||||
return $this->m_sHostClass;
|
||||
}
|
||||
public function SetCode($sCode)
|
||||
{
|
||||
$this->m_sCode = $sCode;
|
||||
$this->m_aParams['label'] = Dict::S('Class:'.$this->m_sHostClass.'/Stimulus:'.$this->m_sCode, $this->m_sCode);
|
||||
$this->m_aParams['description'] = Dict::S('Class:'.$this->m_sHostClass.'/Stimulus:'.$this->m_sCode.'+', '');
|
||||
}
|
||||
public function GetCode()
|
||||
{
|
||||
return $this->m_sCode;
|
||||
}
|
||||
|
||||
public function Get($sParamName) {return $this->m_aParams[$sParamName];}
|
||||
|
||||
// Note: I could factorize this code with the parameter management made for the AttributeDef class
|
||||
|
||||
354
dictionaries/dictionary.itop.core.php
Normal file
354
dictionaries/dictionary.itop.core.php
Normal file
@@ -0,0 +1,354 @@
|
||||
<?php
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Classes in 'core/cmdb'
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
||||
//
|
||||
// Class: CMDBChange
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:CMDBChange' => 'change',
|
||||
'Class:CMDBChange+' => 'Changes tracking',
|
||||
'Class:CMDBChange/Attribute:date' => 'date',
|
||||
'Class:CMDBChange/Attribute:date+' => 'date and time at which the changes have been recorded',
|
||||
'Class:CMDBChange/Attribute:userinfo' => 'misc. info',
|
||||
'Class:CMDBChange/Attribute:userinfo+' => 'caller\'s defined information',
|
||||
));
|
||||
|
||||
//
|
||||
// Class: CMDBChangeOp
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:CMDBChangeOp' => 'change operation',
|
||||
'Class:CMDBChangeOp+' => 'Change operations tracking',
|
||||
'Class:CMDBChangeOp/Attribute:change' => 'change',
|
||||
'Class:CMDBChangeOp/Attribute:change+' => 'change',
|
||||
'Class:CMDBChangeOp/Attribute:date' => 'date',
|
||||
'Class:CMDBChangeOp/Attribute:date+' => 'date and time of the change',
|
||||
'Class:CMDBChangeOp/Attribute:userinfo' => 'user',
|
||||
'Class:CMDBChangeOp/Attribute:userinfo+' => 'who made this change',
|
||||
'Class:CMDBChangeOp/Attribute:objclass' => 'object class',
|
||||
'Class:CMDBChangeOp/Attribute:objclass+' => 'object class',
|
||||
'Class:CMDBChangeOp/Attribute:objkey' => 'object id',
|
||||
'Class:CMDBChangeOp/Attribute:objkey+' => 'object id',
|
||||
'Class:CMDBChangeOp/Attribute:finalclass' => 'Class',
|
||||
'Class:CMDBChangeOp/Attribute:finalclass+' => 'Real (final) object class',
|
||||
));
|
||||
|
||||
//
|
||||
// Class: CMDBChangeOpCreate
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:CMDBChangeOpCreate' => 'object creation',
|
||||
'Class:CMDBChangeOpCreate+' => 'Object creation tracking',
|
||||
));
|
||||
|
||||
//
|
||||
// Class: CMDBChangeOpDelete
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:CMDBChangeOpDelete' => 'object deletion',
|
||||
'Class:CMDBChangeOpDelete+' => 'Object deletion tracking',
|
||||
));
|
||||
|
||||
//
|
||||
// Class: CMDBChangeOpSetAttribute
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:CMDBChangeOpSetAttribute' => 'object change',
|
||||
'Class:CMDBChangeOpSetAttribute+' => 'Object properties change tracking',
|
||||
'Class:CMDBChangeOpSetAttribute/Attribute:attcode' => 'Attribute',
|
||||
'Class:CMDBChangeOpSetAttribute/Attribute:attcode+' => 'code of the modified property',
|
||||
));
|
||||
|
||||
//
|
||||
// Class: CMDBChangeOpSetAttributeScalar
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:CMDBChangeOpSetAttributeScalar' => 'property change',
|
||||
'Class:CMDBChangeOpSetAttributeScalar+' => 'Object scalar properties change tracking',
|
||||
'Class:CMDBChangeOpSetAttributeScalar/Attribute:oldvalue' => 'Previous value',
|
||||
'Class:CMDBChangeOpSetAttributeScalar/Attribute:oldvalue+' => 'previous value of the attribute',
|
||||
'Class:CMDBChangeOpSetAttributeScalar/Attribute:newvalue' => 'New value',
|
||||
'Class:CMDBChangeOpSetAttributeScalar/Attribute:newvalue+' => 'new value of the attribute',
|
||||
));
|
||||
|
||||
//
|
||||
// Class: CMDBChangeOpSetAttributeBlob
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:CMDBChangeOpSetAttributeBlob' => 'data change',
|
||||
'Class:CMDBChangeOpSetAttributeBlob+' => 'data change tracking',
|
||||
'Class:CMDBChangeOpSetAttributeBlob/Attribute:prevdata' => 'Previous data',
|
||||
'Class:CMDBChangeOpSetAttributeBlob/Attribute:prevdata+' => 'previous contents of the attribute',
|
||||
));
|
||||
|
||||
//
|
||||
// Class: CMDBChangeOpSetAttributeText
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:CMDBChangeOpSetAttributeText' => 'text change',
|
||||
'Class:CMDBChangeOpSetAttributeText+' => 'text change tracking',
|
||||
'Class:CMDBChangeOpSetAttributeText/Attribute:prevdata' => 'Previous data',
|
||||
'Class:CMDBChangeOpSetAttributeText/Attribute:prevdata+' => 'previous contents of the attribute',
|
||||
));
|
||||
|
||||
//
|
||||
// Class: Event
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:Event' => 'Log Event',
|
||||
'Class:Event+' => 'An application internal event',
|
||||
'Class:Event/Attribute:message' => 'message',
|
||||
'Class:Event/Attribute:message+' => 'short description of the event',
|
||||
'Class:Event/Attribute:date' => 'date',
|
||||
'Class:Event/Attribute:date+' => 'date and time at which the changes have been recorded',
|
||||
'Class:Event/Attribute:userinfo' => 'user info',
|
||||
'Class:Event/Attribute:userinfo+' => 'identification of the user that was doing the action that triggered this event',
|
||||
'Class:Event/Attribute:finalclass' => 'Class',
|
||||
'Class:Event/Attribute:finalclass+' => 'Real (final) object class',
|
||||
));
|
||||
|
||||
//
|
||||
// Class: EventNotification
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:EventNotification' => 'Notification event',
|
||||
'Class:EventNotification+' => 'Trace of a notification that has been sent',
|
||||
'Class:EventNotification/Attribute:trigger_id' => 'Trigger',
|
||||
'Class:EventNotification/Attribute:trigger_id+' => 'user account',
|
||||
'Class:EventNotification/Attribute:action_id' => 'user',
|
||||
'Class:EventNotification/Attribute:action_id+' => 'user account',
|
||||
'Class:EventNotification/Attribute:object_id' => 'Object id',
|
||||
'Class:EventNotification/Attribute:object_id+' => 'object id (class defined by the trigger ?)',
|
||||
));
|
||||
|
||||
//
|
||||
// Class: EventNotificationEmail
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:EventNotificationEmail' => 'Email emission event',
|
||||
'Class:EventNotificationEmail+' => 'Trace of an email that has been sent',
|
||||
'Class:EventNotificationEmail/Attribute:to' => 'TO',
|
||||
'Class:EventNotificationEmail/Attribute:to+' => 'TO',
|
||||
'Class:EventNotificationEmail/Attribute:cc' => 'CC',
|
||||
'Class:EventNotificationEmail/Attribute:cc+' => 'CC',
|
||||
'Class:EventNotificationEmail/Attribute:bcc' => 'BCC',
|
||||
'Class:EventNotificationEmail/Attribute:bcc+' => 'BCC',
|
||||
'Class:EventNotificationEmail/Attribute:from' => 'From',
|
||||
'Class:EventNotificationEmail/Attribute:from+' => 'Sender of the message',
|
||||
'Class:EventNotificationEmail/Attribute:subject' => 'Subject',
|
||||
'Class:EventNotificationEmail/Attribute:subject+' => 'Subject',
|
||||
'Class:EventNotificationEmail/Attribute:body' => 'Body',
|
||||
'Class:EventNotificationEmail/Attribute:body+' => 'Body',
|
||||
));
|
||||
|
||||
//
|
||||
// Class: EventIssue
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:EventIssue' => 'Issue event',
|
||||
'Class:EventIssue+' => 'Trace of an issue (warning, error, etc.)',
|
||||
'Class:EventIssue/Attribute:issue' => 'Issue',
|
||||
'Class:EventIssue/Attribute:issue+' => 'What happened',
|
||||
'Class:EventIssue/Attribute:impact' => 'Impact',
|
||||
'Class:EventIssue/Attribute:impact+' => 'What are the consequences',
|
||||
'Class:EventIssue/Attribute:page' => 'Page',
|
||||
'Class:EventIssue/Attribute:page+' => 'HTTP entry point',
|
||||
'Class:EventIssue/Attribute:arguments_post' => 'Posted arguments',
|
||||
'Class:EventIssue/Attribute:arguments_post+' => 'HTTP POST arguments',
|
||||
'Class:EventIssue/Attribute:arguments_get' => 'URL arguments',
|
||||
'Class:EventIssue/Attribute:arguments_get+' => 'HTTP GET arguments',
|
||||
'Class:EventIssue/Attribute:callstack' => 'Callstack',
|
||||
'Class:EventIssue/Attribute:callstack+' => 'Call stack',
|
||||
'Class:EventIssue/Attribute:data' => 'Data',
|
||||
'Class:EventIssue/Attribute:data+' => 'More information',
|
||||
));
|
||||
|
||||
//
|
||||
// Class: EventWebService
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:EventWebService' => 'Web service event',
|
||||
'Class:EventWebService+' => 'Trace of an web service call',
|
||||
'Class:EventWebService/Attribute:verb' => 'Verb',
|
||||
'Class:EventWebService/Attribute:verb+' => 'Name of the operation',
|
||||
'Class:EventWebService/Attribute:result' => 'Result',
|
||||
'Class:EventWebService/Attribute:result+' => 'Overall success/failure',
|
||||
'Class:EventWebService/Attribute:log_info' => 'Info log',
|
||||
'Class:EventWebService/Attribute:log_info+' => 'Result info log',
|
||||
'Class:EventWebService/Attribute:log_warning' => 'Warning log',
|
||||
'Class:EventWebService/Attribute:log_warning+' => 'Result warning log',
|
||||
'Class:EventWebService/Attribute:log_error' => 'Error log',
|
||||
'Class:EventWebService/Attribute:log_error+' => 'Result error log',
|
||||
'Class:EventWebService/Attribute:data' => 'Data',
|
||||
'Class:EventWebService/Attribute:data+' => 'Result data',
|
||||
));
|
||||
|
||||
//
|
||||
// Class: Action
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:Action' => 'action',
|
||||
'Class:Action+' => 'Custom action',
|
||||
'Class:Action/Attribute:name' => 'Name',
|
||||
'Class:Action/Attribute:name+' => 'label',
|
||||
'Class:Action/Attribute:description' => 'Description',
|
||||
'Class:Action/Attribute:description+' => 'one line description',
|
||||
'Class:Action/Attribute:status' => 'Status',
|
||||
'Class:Action/Attribute:status+' => 'In production or ?',
|
||||
'Class:Action/Attribute:status/Value:test' => 'Being tested',
|
||||
'Class:Action/Attribute:status/Value:test+' => 'Being tested',
|
||||
'Class:Action/Attribute:status/Value:enabled' => 'In production',
|
||||
'Class:Action/Attribute:status/Value:enabled+' => 'In production',
|
||||
'Class:Action/Attribute:status/Value:disabled' => 'Inactive',
|
||||
'Class:Action/Attribute:status/Value:disabled+' => 'Inactive',
|
||||
'Class:Action/Attribute:related_triggers' => 'Related Triggers',
|
||||
'Class:Action/Attribute:related_triggers+' => 'Triggers linked to this action',
|
||||
'Class:Action/Attribute:finalclass' => 'Class',
|
||||
'Class:Action/Attribute:finalclass+' => 'Real (final) object class',
|
||||
));
|
||||
|
||||
//
|
||||
// Class: ActionNotification
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:ActionNotification' => 'notification',
|
||||
'Class:ActionNotification+' => 'Notification (abstract)',
|
||||
));
|
||||
|
||||
//
|
||||
// Class: ActionEmail
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:ActionEmail' => 'email notification',
|
||||
'Class:ActionEmail+' => 'Action: Email notification',
|
||||
'Class:ActionEmail/Attribute:test_recipient' => 'Test recipient',
|
||||
'Class:ActionEmail/Attribute:test_recipient+' => 'Detination in case status is set to "Test"',
|
||||
'Class:ActionEmail/Attribute:from' => 'From',
|
||||
'Class:ActionEmail/Attribute:from+' => 'Will be sent into the email header',
|
||||
'Class:ActionEmail/Attribute:reply_to' => 'Reply to',
|
||||
'Class:ActionEmail/Attribute:reply_to+' => 'Will be sent into the email header',
|
||||
'Class:ActionEmail/Attribute:to' => 'To',
|
||||
'Class:ActionEmail/Attribute:to+' => 'Destination of the email',
|
||||
'Class:ActionEmail/Attribute:cc' => 'Cc',
|
||||
'Class:ActionEmail/Attribute:cc+' => 'Carbon Copy',
|
||||
'Class:ActionEmail/Attribute:bcc' => 'bcc',
|
||||
'Class:ActionEmail/Attribute:bcc+' => 'Blind Carbon Copy',
|
||||
'Class:ActionEmail/Attribute:subject' => 'subject',
|
||||
'Class:ActionEmail/Attribute:subject+' => 'Title of the email',
|
||||
'Class:ActionEmail/Attribute:body' => 'body',
|
||||
'Class:ActionEmail/Attribute:body+' => 'Contents of the email',
|
||||
'Class:ActionEmail/Attribute:importance' => 'importance',
|
||||
'Class:ActionEmail/Attribute:importance+' => 'Importance flag',
|
||||
'Class:ActionEmail/Attribute:importance/Value:low' => 'low',
|
||||
'Class:ActionEmail/Attribute:importance/Value:low+' => 'low',
|
||||
'Class:ActionEmail/Attribute:importance/Value:normal' => 'normal',
|
||||
'Class:ActionEmail/Attribute:importance/Value:normal+' => 'normal',
|
||||
'Class:ActionEmail/Attribute:importance/Value:high' => 'high',
|
||||
'Class:ActionEmail/Attribute:importance/Value:high+' => 'high',
|
||||
));
|
||||
|
||||
//
|
||||
// Class: Trigger
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:Trigger' => 'trigger',
|
||||
'Class:Trigger+' => 'Custom event handler',
|
||||
'Class:Trigger/Attribute:description' => 'Description',
|
||||
'Class:Trigger/Attribute:description+' => 'one line description',
|
||||
'Class:Trigger/Attribute:linked_actions' => 'Triggered actions',
|
||||
'Class:Trigger/Attribute:linked_actions+' => 'Actions performed when the trigger is activated',
|
||||
'Class:Trigger/Attribute:finalclass' => 'Class',
|
||||
'Class:Trigger/Attribute:finalclass+' => 'Real (final) object class',
|
||||
));
|
||||
|
||||
//
|
||||
// Class: TriggerOnObject
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:TriggerOnObject' => 'Trigger on a class of objects',
|
||||
'Class:TriggerOnObject+' => 'Trigger on a given class of objects',
|
||||
'Class:TriggerOnObject/Attribute:target_class' => 'Target class',
|
||||
'Class:TriggerOnObject/Attribute:target_class+' => 'label',
|
||||
));
|
||||
|
||||
//
|
||||
// Class: TriggerOnStateChange
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:TriggerOnStateChange' => 'Trigger on object state change',
|
||||
'Class:TriggerOnStateChange+' => 'Trigger on object state change',
|
||||
'Class:TriggerOnStateChange/Attribute:state' => 'State',
|
||||
'Class:TriggerOnStateChange/Attribute:state+' => 'label',
|
||||
));
|
||||
|
||||
//
|
||||
// Class: TriggerOnStateEnter
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:TriggerOnStateEnter' => 'Trigger on object entering a state',
|
||||
'Class:TriggerOnStateEnter+' => 'Trigger on object state change - entering',
|
||||
));
|
||||
|
||||
//
|
||||
// Class: TriggerOnStateLeave
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:TriggerOnStateLeave' => 'Trigger on object leaving a state',
|
||||
'Class:TriggerOnStateLeave+' => 'Trigger on object state change - leaving',
|
||||
));
|
||||
|
||||
//
|
||||
// Class: TriggerOnObjectCreate
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:TriggerOnObjectCreate' => 'Trigger on object creation',
|
||||
'Class:TriggerOnObjectCreate+' => 'Trigger on object creation of [a child class of] the given class',
|
||||
));
|
||||
|
||||
//
|
||||
// Class: lnkTriggerAction
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:lnkTriggerAction' => 'Actions-Trigger',
|
||||
'Class:lnkTriggerAction+' => 'Link between a trigger and an action',
|
||||
'Class:lnkTriggerAction/Attribute:action_id' => 'Action',
|
||||
'Class:lnkTriggerAction/Attribute:action_id+' => 'The action to be executed',
|
||||
'Class:lnkTriggerAction/Attribute:action_name' => 'Action Name',
|
||||
'Class:lnkTriggerAction/Attribute:action_name+' => 'Name of the action',
|
||||
'Class:lnkTriggerAction/Attribute:trigger_id' => 'Trigger',
|
||||
'Class:lnkTriggerAction/Attribute:trigger_id+' => 'Trigger',
|
||||
'Class:lnkTriggerAction/Attribute:trigger_name' => 'Trigger Name',
|
||||
'Class:lnkTriggerAction/Attribute:trigger_name+' => 'Name of the trigger',
|
||||
'Class:lnkTriggerAction/Attribute:order' => 'Order',
|
||||
'Class:lnkTriggerAction/Attribute:order+' => 'Actions execution order',
|
||||
));
|
||||
|
||||
|
||||
?>
|
||||
1383
dictionaries/dictionary.itop.model.php
Normal file
1383
dictionaries/dictionary.itop.model.php
Normal file
File diff suppressed because it is too large
Load Diff
266
dictionaries/dictionary.itop.ui.php
Normal file
266
dictionaries/dictionary.itop.ui.php
Normal file
@@ -0,0 +1,266 @@
|
||||
<?php
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Classes in 'gui'
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
||||
|
||||
//
|
||||
// Class: menuNode
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:menuNode' => 'menuNode',
|
||||
'Class:menuNode+' => 'Main menu configuration elements',
|
||||
'Class:menuNode/Attribute:name' => 'Menu Name',
|
||||
'Class:menuNode/Attribute:name+' => 'Short name for this menu',
|
||||
'Class:menuNode/Attribute:label' => 'Menu Description',
|
||||
'Class:menuNode/Attribute:label+' => 'Long description for this menu',
|
||||
'Class:menuNode/Attribute:hyperlink' => 'Hyperlink',
|
||||
'Class:menuNode/Attribute:hyperlink+' => 'Hyperlink to the page',
|
||||
'Class:menuNode/Attribute:icon_path' => 'Menu Icon',
|
||||
'Class:menuNode/Attribute:icon_path+' => 'Path to the icon o the menu',
|
||||
'Class:menuNode/Attribute:template' => 'Template',
|
||||
'Class:menuNode/Attribute:template+' => 'HTML template for the view',
|
||||
'Class:menuNode/Attribute:type' => 'Type',
|
||||
'Class:menuNode/Attribute:type+' => 'Type of menu',
|
||||
'Class:menuNode/Attribute:type/Value:application' => 'application',
|
||||
'Class:menuNode/Attribute:type/Value:application+' => 'application',
|
||||
'Class:menuNode/Attribute:type/Value:user' => 'user',
|
||||
'Class:menuNode/Attribute:type/Value:user+' => 'user',
|
||||
'Class:menuNode/Attribute:type/Value:administrator' => 'administrator',
|
||||
'Class:menuNode/Attribute:type/Value:administrator+' => 'administrator',
|
||||
'Class:menuNode/Attribute:rank' => 'Display rank',
|
||||
'Class:menuNode/Attribute:rank+' => 'Sort order for displaying the menu',
|
||||
'Class:menuNode/Attribute:parent_id' => 'Parent Menu Item',
|
||||
'Class:menuNode/Attribute:parent_id+' => 'Parent Menu Item',
|
||||
'Class:menuNode/Attribute:parent_name' => 'Parent Menu Item',
|
||||
'Class:menuNode/Attribute:parent_name+' => 'Parent Menu Item',
|
||||
'Class:menuNode/Attribute:user_id' => 'Owner of the menu',
|
||||
'Class:menuNode/Attribute:user_id+' => 'User who owns this menu (for user defined menus)',
|
||||
));
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Classes in 'application'
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
||||
//
|
||||
// Class: AuditCategory
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:AuditCategory' => 'AuditCategory',
|
||||
'Class:AuditCategory+' => 'A section inside the overall audit',
|
||||
'Class:AuditCategory/Attribute:name' => 'Category Name',
|
||||
'Class:AuditCategory/Attribute:name+' => 'Short name for this category',
|
||||
'Class:AuditCategory/Attribute:description' => 'Audit Category Description',
|
||||
'Class:AuditCategory/Attribute:description+' => 'Long description for this audit category',
|
||||
'Class:AuditCategory/Attribute:definition_set' => 'Definition Set',
|
||||
'Class:AuditCategory/Attribute:definition_set+' => 'SibusQL expression defining the set of objects to audit',
|
||||
));
|
||||
|
||||
//
|
||||
// Class: AuditRule
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:AuditRule' => 'AuditRule',
|
||||
'Class:AuditRule+' => 'A rule to check for a given Audit category',
|
||||
'Class:AuditRule/Attribute:name' => 'Rule Name',
|
||||
'Class:AuditRule/Attribute:name+' => 'Short name for this rule',
|
||||
'Class:AuditRule/Attribute:description' => 'Audit Rule Description',
|
||||
'Class:AuditRule/Attribute:description+' => 'Long description for this audit rule',
|
||||
'Class:AuditRule/Attribute:query' => 'Query to Run',
|
||||
'Class:AuditRule/Attribute:query+' => 'The SibusQL expression to run',
|
||||
'Class:AuditRule/Attribute:valid_flag' => 'Valid objects?',
|
||||
'Class:AuditRule/Attribute:valid_flag+' => 'True if the rule returns the valid objects, false otherwise',
|
||||
'Class:AuditRule/Attribute:valid_flag/Value:true' => 'true',
|
||||
'Class:AuditRule/Attribute:valid_flag/Value:true+' => 'true',
|
||||
'Class:AuditRule/Attribute:valid_flag/Value:false' => 'false',
|
||||
'Class:AuditRule/Attribute:valid_flag/Value:false+' => 'false',
|
||||
'Class:AuditRule/Attribute:category_id' => 'Category',
|
||||
'Class:AuditRule/Attribute:category_id+' => 'The category for this rule',
|
||||
'Class:AuditRule/Attribute:category_name' => 'Category',
|
||||
'Class:AuditRule/Attribute:category_name+' => 'Name of the category for this rule',
|
||||
));
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Classes in 'addon/userrights'
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
||||
//
|
||||
// Class: URP_Users
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:URP_Users' => 'user',
|
||||
'Class:URP_Users+' => 'users and credentials',
|
||||
'Class:URP_Users/Attribute:userid' => 'Contact (person)',
|
||||
'Class:URP_Users/Attribute:userid+' => 'Personal details from the business data',
|
||||
'Class:URP_Users/Attribute:last_name' => 'Last name',
|
||||
'Class:URP_Users/Attribute:last_name+' => 'Name of the corresponding contact',
|
||||
'Class:URP_Users/Attribute:first_name' => 'First name',
|
||||
'Class:URP_Users/Attribute:first_name+' => 'First name of the corresponding contact',
|
||||
'Class:URP_Users/Attribute:email' => 'Email',
|
||||
'Class:URP_Users/Attribute:email+' => 'Email of the corresponding contact',
|
||||
'Class:URP_Users/Attribute:login' => 'Login',
|
||||
'Class:URP_Users/Attribute:login+' => 'user identification string',
|
||||
'Class:URP_Users/Attribute:password' => 'Password',
|
||||
'Class:URP_Users/Attribute:password+' => 'user authentication string',
|
||||
'Class:URP_Users/Attribute:profiles' => 'Profiles',
|
||||
'Class:URP_Users/Attribute:profiles+' => 'roles, granting rights for that person',
|
||||
));
|
||||
|
||||
//
|
||||
// Class: URP_Profiles
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:URP_Profiles' => 'profile',
|
||||
'Class:URP_Profiles+' => 'usage profiles',
|
||||
'Class:URP_Profiles/Attribute:name' => 'Name',
|
||||
'Class:URP_Profiles/Attribute:name+' => 'label',
|
||||
'Class:URP_Profiles/Attribute:description' => 'Description',
|
||||
'Class:URP_Profiles/Attribute:description+' => 'one line description',
|
||||
'Class:URP_Profiles/Attribute:users' => 'Users',
|
||||
'Class:URP_Profiles/Attribute:users+' => 'persons having this role',
|
||||
));
|
||||
|
||||
//
|
||||
// Class: URP_Dimensions
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:URP_Dimensions' => 'dimension',
|
||||
'Class:URP_Dimensions+' => 'application dimension (defining silos)',
|
||||
'Class:URP_Dimensions/Attribute:name' => 'Name',
|
||||
'Class:URP_Dimensions/Attribute:name+' => 'label',
|
||||
'Class:URP_Dimensions/Attribute:description' => 'Description',
|
||||
'Class:URP_Dimensions/Attribute:description+' => 'one line description',
|
||||
'Class:URP_Dimensions/Attribute:type' => 'Type',
|
||||
'Class:URP_Dimensions/Attribute:type+' => 'class name or data type (projection unit)',
|
||||
));
|
||||
|
||||
//
|
||||
// Class: URP_UserProfile
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:URP_UserProfile' => 'User to profile',
|
||||
'Class:URP_UserProfile+' => 'user profiles',
|
||||
'Class:URP_UserProfile/Attribute:userid' => 'User',
|
||||
'Class:URP_UserProfile/Attribute:userid+' => 'user account',
|
||||
'Class:URP_UserProfile/Attribute:userlogin' => 'Login',
|
||||
'Class:URP_UserProfile/Attribute:userlogin+' => 'User\'s login',
|
||||
'Class:URP_UserProfile/Attribute:profileid' => 'Profile',
|
||||
'Class:URP_UserProfile/Attribute:profileid+' => 'usage profile',
|
||||
'Class:URP_UserProfile/Attribute:profile' => 'Profile',
|
||||
'Class:URP_UserProfile/Attribute:profile+' => 'Profile name',
|
||||
'Class:URP_UserProfile/Attribute:reason' => 'Reason',
|
||||
'Class:URP_UserProfile/Attribute:reason+' => 'explain why this person may have this role',
|
||||
));
|
||||
|
||||
//
|
||||
// Class: URP_ProfileProjection
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:URP_ProfileProjection' => 'profile_projection',
|
||||
'Class:URP_ProfileProjection+' => 'profile projections',
|
||||
'Class:URP_ProfileProjection/Attribute:dimensionid' => 'Dimension',
|
||||
'Class:URP_ProfileProjection/Attribute:dimensionid+' => 'application dimension',
|
||||
'Class:URP_ProfileProjection/Attribute:dimension' => 'Dimension',
|
||||
'Class:URP_ProfileProjection/Attribute:dimension+' => 'application dimension',
|
||||
'Class:URP_ProfileProjection/Attribute:profileid' => 'Profile',
|
||||
'Class:URP_ProfileProjection/Attribute:profileid+' => 'usage profile',
|
||||
'Class:URP_ProfileProjection/Attribute:profile' => 'Profile',
|
||||
'Class:URP_ProfileProjection/Attribute:profile+' => 'Profile name',
|
||||
'Class:URP_ProfileProjection/Attribute:value' => 'Value expression',
|
||||
'Class:URP_ProfileProjection/Attribute:value+' => 'OQL expression (using $user) | constant | | +attribute code',
|
||||
'Class:URP_ProfileProjection/Attribute:attribute' => 'Attribute',
|
||||
'Class:URP_ProfileProjection/Attribute:attribute+' => 'Target attribute code (optional)',
|
||||
));
|
||||
|
||||
//
|
||||
// Class: URP_ClassProjection
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:URP_ClassProjection' => 'class_projection',
|
||||
'Class:URP_ClassProjection+' => 'class projections',
|
||||
'Class:URP_ClassProjection/Attribute:dimensionid' => 'Dimension',
|
||||
'Class:URP_ClassProjection/Attribute:dimensionid+' => 'application dimension',
|
||||
'Class:URP_ClassProjection/Attribute:dimension' => 'Dimension',
|
||||
'Class:URP_ClassProjection/Attribute:dimension+' => 'application dimension',
|
||||
'Class:URP_ClassProjection/Attribute:class' => 'Class',
|
||||
'Class:URP_ClassProjection/Attribute:class+' => 'Target class',
|
||||
'Class:URP_ClassProjection/Attribute:value' => 'Value expression',
|
||||
'Class:URP_ClassProjection/Attribute:value+' => 'OQL expression (using $this) | constant | | +attribute code',
|
||||
'Class:URP_ClassProjection/Attribute:attribute' => 'Attribute',
|
||||
'Class:URP_ClassProjection/Attribute:attribute+' => 'Target attribute code (optional)',
|
||||
));
|
||||
|
||||
//
|
||||
// Class: URP_ActionGrant
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:URP_ActionGrant' => 'action_permission',
|
||||
'Class:URP_ActionGrant+' => 'permissions on classes',
|
||||
'Class:URP_ActionGrant/Attribute:profileid' => 'Profile',
|
||||
'Class:URP_ActionGrant/Attribute:profileid+' => 'usage profile',
|
||||
'Class:URP_ActionGrant/Attribute:profile' => 'Profile',
|
||||
'Class:URP_ActionGrant/Attribute:profile+' => 'usage profile',
|
||||
'Class:URP_ActionGrant/Attribute:class' => 'Class',
|
||||
'Class:URP_ActionGrant/Attribute:class+' => 'Target class',
|
||||
'Class:URP_ActionGrant/Attribute:permission' => 'Permission',
|
||||
'Class:URP_ActionGrant/Attribute:permission+' => 'allowed or not allowed?',
|
||||
'Class:URP_ActionGrant/Attribute:permission/Value:yes' => 'yes',
|
||||
'Class:URP_ActionGrant/Attribute:permission/Value:yes+' => 'yes',
|
||||
'Class:URP_ActionGrant/Attribute:permission/Value:no' => 'no',
|
||||
'Class:URP_ActionGrant/Attribute:permission/Value:no+' => 'no',
|
||||
'Class:URP_ActionGrant/Attribute:action' => 'Action',
|
||||
'Class:URP_ActionGrant/Attribute:action+' => 'operations to perform on the given class',
|
||||
));
|
||||
|
||||
//
|
||||
// Class: URP_StimulusGrant
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:URP_StimulusGrant' => 'stimulus_permission',
|
||||
'Class:URP_StimulusGrant+' => 'permissions on stimilus in the life cycle of the object',
|
||||
'Class:URP_StimulusGrant/Attribute:profileid' => 'Profile',
|
||||
'Class:URP_StimulusGrant/Attribute:profileid+' => 'usage profile',
|
||||
'Class:URP_StimulusGrant/Attribute:profile' => 'Profile',
|
||||
'Class:URP_StimulusGrant/Attribute:profile+' => 'usage profile',
|
||||
'Class:URP_StimulusGrant/Attribute:class' => 'Class',
|
||||
'Class:URP_StimulusGrant/Attribute:class+' => 'Target class',
|
||||
'Class:URP_StimulusGrant/Attribute:permission' => 'Permission',
|
||||
'Class:URP_StimulusGrant/Attribute:permission+' => 'allowed or not allowed?',
|
||||
'Class:URP_StimulusGrant/Attribute:permission/Value:yes' => 'yes',
|
||||
'Class:URP_StimulusGrant/Attribute:permission/Value:yes+' => 'yes',
|
||||
'Class:URP_StimulusGrant/Attribute:permission/Value:no' => 'no',
|
||||
'Class:URP_StimulusGrant/Attribute:permission/Value:no+' => 'no',
|
||||
'Class:URP_StimulusGrant/Attribute:stimulus' => 'Stimulus',
|
||||
'Class:URP_StimulusGrant/Attribute:stimulus+' => 'stimulus code',
|
||||
));
|
||||
|
||||
//
|
||||
// Class: URP_AttributeGrant
|
||||
//
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:URP_AttributeGrant' => 'attribute_permission',
|
||||
'Class:URP_AttributeGrant+' => 'permissions at the attributes level',
|
||||
'Class:URP_AttributeGrant/Attribute:actiongrantid' => 'Action grant',
|
||||
'Class:URP_AttributeGrant/Attribute:actiongrantid+' => 'action grant',
|
||||
'Class:URP_AttributeGrant/Attribute:attcode' => 'Attribute',
|
||||
'Class:URP_AttributeGrant/Attribute:attcode+' => 'attribute code',
|
||||
));
|
||||
|
||||
|
||||
?>
|
||||
@@ -263,6 +263,7 @@ function printMenu($sConfigFile)
|
||||
echo "<h4>Target database: $sConfigFile</h4>\n";
|
||||
echo "<p>$sClassCount classes referenced in the model</p>\n";
|
||||
echo "<ul>";
|
||||
echo " <li><a href=\"$sUrl&todo=checkdictionary\">Dictionary</a></li>";
|
||||
echo " <li><a href=\"$sUrl&todo=checkmodel\">Biz model consistency</a></li>";
|
||||
echo " <li><a href=\"$sUrl&todo=showzlists\">Show ZLists</a></li>";
|
||||
echo " <li><a href=\"$sUrl&todo=showbizmodel\">Browse business model</a></li>";
|
||||
@@ -471,6 +472,12 @@ else
|
||||
printMenu($sConfigFile);
|
||||
echo $sRes;
|
||||
break;
|
||||
case "checkdictionary":
|
||||
echo "Dictionary template...</br>\n";
|
||||
echo "<pre>\n";
|
||||
echo MetaModel::MakeDictionaryTemplate();
|
||||
echo "</pre>\n";
|
||||
break;
|
||||
case "checkmodel":
|
||||
echo "Check definitions...</br>\n";
|
||||
MetaModel::CheckDefinitions();
|
||||
|
||||
Reference in New Issue
Block a user