mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Archives: clean breadcrumb entry if attempting to navigate to the details of an archived object (while not being in archive mode)
SVN:trunk[4704]
This commit is contained in:
25
pages/UI.php
25
pages/UI.php
@@ -168,6 +168,22 @@ function DisplayMessages($sMessageKey, WebPage $oPage)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper to update the breadrumb for the current object
|
||||
* @param DBObject $oObj
|
||||
* @param WebPage $oPage
|
||||
*/
|
||||
function SetObjectBreadCrumbEntry(DBObject $oObj, WebPage $oPage)
|
||||
{
|
||||
$sClass = get_class($oObj); // get the leaf class
|
||||
$sIcon = MetaModel::GetClassIcon($sClass, false);
|
||||
if ($sIcon == '')
|
||||
{
|
||||
$sIcon = utils::GetAbsoluteUrlAppRoot().'images/breadcrumb_object.png';
|
||||
}
|
||||
$oPage->SetBreadCrumbEntry("ui-details-$sClass-".$oObj->GetKey(), $oObj->Get('friendlyname'), MetaModel::GetName($sClass).': '.$oObj->Get('friendlyname'), '', $sIcon);
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the result of a search request
|
||||
* @param $oP WebPage Web page for the output
|
||||
@@ -396,6 +412,7 @@ try
|
||||
}
|
||||
else
|
||||
{
|
||||
SetObjectBreadCrumbEntry($oObj, $oP);
|
||||
$oP->P(Dict::S('UI:ObjectArchived'));
|
||||
}
|
||||
}
|
||||
@@ -419,13 +436,7 @@ try
|
||||
}
|
||||
if (!is_null($oObj))
|
||||
{
|
||||
$sClass = get_class($oObj); // get the leaf class
|
||||
$sIcon = MetaModel::GetClassIcon($sClass, false);
|
||||
if ($sIcon == '')
|
||||
{
|
||||
$sIcon = utils::GetAbsoluteUrlAppRoot().'images/breadcrumb_object.png';
|
||||
}
|
||||
$oP->SetBreadCrumbEntry("ui-details-$sClass-$id", $oObj->Get('friendlyname'), MetaModel::GetName($sClass).': '.$oObj->Get('friendlyname'), '', $sIcon);
|
||||
SetObjectBreadCrumbEntry($oObj, $oP);
|
||||
DisplayDetails($oP, $sClass, $oObj, $id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user