mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
Localization: cleanup in the DataModel + aligned some API (e.g. GetStateLabel)
SVN:trunk[348]
This commit is contained in:
35
pages/UI.php
35
pages/UI.php
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
try
|
||||
try
|
||||
{
|
||||
require_once('../application/application.inc.php');
|
||||
require_once('../application/itopwebpage.class.inc.php');
|
||||
@@ -358,8 +358,7 @@ try
|
||||
$oP->add("<h2>Creation of a new $sClassLabel</h2>");
|
||||
if (!empty($sStateCode))
|
||||
{
|
||||
$aStates = MetaModel::EnumStates($sClass);
|
||||
$sStateLabel = $aStates[$sStateCode]['label'];
|
||||
$sStateLabel = MetaModel::GetStateLabel($sClass, $sStateCode);
|
||||
}
|
||||
$aWizardSteps = $oWizard->GetWizardStructure();
|
||||
|
||||
@@ -475,7 +474,7 @@ try
|
||||
{
|
||||
$rawValue = utils::ReadPostedParam("attr_$sAttCode", null);
|
||||
if (!is_null($rawValue))
|
||||
{
|
||||
{
|
||||
$aAttributes[$sAttCode] = trim($rawValue);
|
||||
$previousValue = $oObj->Get($sAttCode);
|
||||
if ($previousValue !== $aAttributes[$sAttCode])
|
||||
@@ -880,18 +879,18 @@ try
|
||||
$aStimuli = MetaModel::EnumStimuli($sClass);
|
||||
if (!isset($aTransitions[$sStimulus]))
|
||||
{
|
||||
$oP->add("<p><strong>Error:</strong> Invalid stimulus: '$sStimulus' on object: {$oObj->GetName()} in state {$oObj->GetState()}.</p>\n");
|
||||
$oP->add("<p><strong>Error:</strong> Invalid stimulus: '$sStimulus' on object: {$oObj->GetName()} in state {$oObj->GetStateLabel()}.</p>\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
$sActionLabel = $aStimuli[$sStimulus]->Get('label');
|
||||
$sActionDetails = $aStimuli[$sStimulus]->Get('description');
|
||||
$sActionLabel = $aStimuli[$sStimulus]->GetLabel();
|
||||
$sActionDetails = $aStimuli[$sStimulus]->GetDescription();
|
||||
$aTransition = $aTransitions[$sStimulus];
|
||||
$sTargetState = $aTransition['target_state'];
|
||||
$aTargetStates = MetaModel::EnumStates($sClass);
|
||||
$oP->add("<div class=\"page_header\">\n");
|
||||
$oP->add("<h1>$sActionLabel - <span class=\"hilite\">{$oObj->GetName()}</span></h1>\n");
|
||||
//$oP->add("<p>Applying '$sActionLabel' on object: {$oObj->GetName()} in state {$oObj->GetState()} to target state: $sTargetState.</p>\n");
|
||||
//$oP->add("<p>Applying '$sActionLabel' on object: {$oObj->GetName()} in state {$oObj->GetStateLabel()} to target state: $sTargetState.</p>\n");
|
||||
$oP->add("</div>\n");
|
||||
$oObj->DisplayBareDetails($oP);
|
||||
$aTargetState = $aTargetStates[$sTargetState];
|
||||
@@ -958,7 +957,7 @@ try
|
||||
$aStimuli = MetaModel::EnumStimuli($sClass);
|
||||
if (!isset($aTransitions[$sStimulus]))
|
||||
{
|
||||
$oP->add("<p><strong>Error:</strong> Invalid stimulus: '$sStimulus' on object: {$oObj->GetName()} in state {$oObj->GetState()}.</p>\n");
|
||||
$oP->add("<p><strong>Error:</strong> Invalid stimulus: '$sStimulus' on object: {$oObj->GetName()} in state {$oObj->GetStateLabel()}.</p>\n");
|
||||
}
|
||||
else if (!utils::IsTransactionValid($sTransactionId))
|
||||
{
|
||||
@@ -966,15 +965,15 @@ try
|
||||
}
|
||||
else
|
||||
{
|
||||
$sActionLabel = $aStimuli[$sStimulus]->Get('label');
|
||||
$sActionDetails = $aStimuli[$sStimulus]->Get('description');
|
||||
$sActionLabel = $aStimuli[$sStimulus]->GetLabel();
|
||||
$sActionDetails = $aStimuli[$sStimulus]->GetDescription();
|
||||
$aTransition = $aTransitions[$sStimulus];
|
||||
$sTargetState = $aTransition['target_state'];
|
||||
$aTargetStates = MetaModel::EnumStates($sClass);
|
||||
$oP->add("<div class=\"page_header\">\n");
|
||||
$oP->add("<h1>$sActionLabel - <span class=\"hilite\">{$oObj->GetName()}</span></h1>\n");
|
||||
$oP->add("<p>$sActionDetails</p>\n");
|
||||
$oP->add("<p>Applying '$sActionLabel' on object: {$oObj->GetName()} in state {$oObj->GetState()} to target state: $sTargetState.</p>\n");
|
||||
$oP->add("<p>Applying '$sActionLabel' on object: {$oObj->GetName()} in state {$oObj->GetStateLabel()} to target state: $sTargetState.</p>\n");
|
||||
$oP->add("</div>\n");
|
||||
$aTargetState = $aTargetStates[$sTargetState];
|
||||
//print_r($aTransitions[$sStimulus]);
|
||||
@@ -1144,20 +1143,20 @@ try
|
||||
}
|
||||
}
|
||||
////MetaModel::ShowQueryTrace();
|
||||
$oP->output();
|
||||
}
|
||||
$oP->output();
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
require_once('../setup/setuppage.class.inc.php');
|
||||
$oP = new SetupWebPage('iTop - fatal error');
|
||||
require_once('../setup/setuppage.class.inc.php');
|
||||
$oP = new SetupWebPage('iTop - fatal error');
|
||||
$oP->add("<h1>Fatal Error, iTop cannot continue</h1>\n");
|
||||
$oP->error("Error: '".$e->getMessage()."'");
|
||||
$oP->output();
|
||||
}
|
||||
catch(CoreException $e)
|
||||
{
|
||||
require_once('../setup/setuppage.class.inc.php');
|
||||
$oP = new SetupWebPage('iTop - fatal error');
|
||||
require_once('../setup/setuppage.class.inc.php');
|
||||
$oP = new SetupWebPage('iTop - fatal error');
|
||||
$oP->add("<h1>Fatal Error, iTop cannot continue</h1>\n");
|
||||
$oP->error("Error: '".$e->getHtmlDesc()."'");
|
||||
$oP->output();
|
||||
|
||||
Reference in New Issue
Block a user