diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index 00ff98d70..d9cc79603 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -126,7 +126,7 @@ abstract class cmdbAbstractObject extends CMDBObject $oHistoryFilter = new DBObjectSearch('CMDBChangeOp'); $oHistoryFilter->AddCondition('objkey', $this->GetKey()); $oHistoryFilter->AddCondition('objclass', get_class($this)); - $oBlock = new HistoryBlock($oHistoryFilter, 'tab', false); + $oBlock = new HistoryBlock($oHistoryFilter, 'table', false); $oBlock->Display($oPage, -1); } diff --git a/application/displayblock.class.inc.php b/application/displayblock.class.inc.php index 74d9d2d90..765a10d44 100644 --- a/application/displayblock.class.inc.php +++ b/application/displayblock.class.inc.php @@ -718,7 +718,7 @@ class HistoryBlock extends DisplayBlock $sHtml .= "\n"; switch($this->m_sStyle) { - default: + case 'toggle': // First the latest change that the user is allowed to see do { @@ -728,50 +728,59 @@ class HistoryBlock extends DisplayBlock if (is_object($oLatestChangeOp)) { - global $oContext; // User Context.. should be statis instead of global... + $oContext = new UserContext(); // There is one change in the list... only when the object has been created ! $sDate = $oLatestChangeOp->GetAsHTML('date'); $oChange = $oContext->GetObject('CMDBChange', $oLatestChangeOp->Get('change')); $sUserInfo = $oChange->GetAsHTML('userinfo'); - $oSet->Rewind(); // Reset the pointer to the beginning of the set - //$sHtml .= $oPage->GetStartCollapsibleSection(Dict::Format('UI:History:LastModified_On_By', $sDate, $sUserInfo)); - //$sHtml .= cmdbAbstractObject::GetDisplaySet($oPage, $oSet); - $aChanges = array(); - while($oChangeOp = $oSet->Fetch()) - { - $sChangeDescription = $oChangeOp->GetDescription(); - if ($sChangeDescription != '') - { - // The change is visible for the current user - $changeId = $oChangeOp->Get('change'); - $aChanges[$changeId]['date'] = $oChangeOp->Get('date'); - $aChanges[$changeId]['userinfo'] = $oChangeOp->Get('userinfo'); - if (!isset($aChanges[$changeId]['log'])) - { - $aChanges[$changeId]['log'] = array(); - } - $aChanges[$changeId]['log'][] = $sChangeDescription; - } - } - $aAttribs = array('date' => array('label' => Dict::S('UI:History:Date'), 'description' => Dict::S('UI:History:Date+')), - 'userinfo' => array('label' => Dict::S('UI:History:User'), 'description' => Dict::S('UI:History:User+')), - 'log' => array('label' => Dict::S('UI:History:Changes'), 'description' => Dict::S('UI:History:Changes+')), - ); - $aValues = array(); - foreach($aChanges as $aChange) - { - $aValues[] = array('date' => $aChange['date'], 'userinfo' => $aChange['userinfo'], 'log' => "