From bc4b36fda62276f4de6caee50b9950fc3ef57ec4 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Tue, 4 Aug 2020 11:36:09 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B03233=20-=20Remove=20"display=5Ftemplate"?= =?UTF-8?q?=20from=20object=20details=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/cmdbabstract.class.inc.php | 51 +++++++++----------------- 1 file changed, 17 insertions(+), 34 deletions(-) diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index 94cb50da3..921ab0014 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -1036,45 +1036,28 @@ EOF $iKey = $this->GetKey(); $sMode = static::ENUM_OBJECT_MODE_VIEW; - $sTemplate = Utils::ReadFromFile(MetaModel::GetDisplayTemplate($sClass)); - if (!empty($sTemplate)) - { - $oTemplate = new DisplayTemplate($sTemplate); - // Note: to preserve backward compatibility with home-made templates, the placeholder '$pkey$' has been preserved - // but the preferred method is to use '$id$' - $oTemplate->Render($oPage, array( - 'class_name' => MetaModel::GetName($sClass), - 'class' => $sClass, - 'pkey' => $iKey, - 'id' => $iKey, - 'name' => $this->GetName(), - )); - } - else - { - // Object's details - // template not found display the object using the *old style* - $oPage->add(<<add(<<
HTML - ); - $this->DisplayBareHeader($oPage, $bEditMode); - /** @var \iTopWebPage $oPage */ - $oPage->AddTabContainer(OBJECT_PROPERTIES_TAB); - $oPage->SetCurrentTabContainer(OBJECT_PROPERTIES_TAB); - $oPage->SetCurrentTab('UI:PropertiesTab'); - $this->DisplayBareProperties($oPage, $bEditMode); - $this->DisplayBareRelations($oPage, $bEditMode); - //$oPage->SetCurrentTab('UI:HistoryTab'); - //$this->DisplayBareHistory($oPage, $bEditMode); - $oPage->AddAjaxTab('UI:HistoryTab', - utils::GetAbsoluteUrlAppRoot().'pages/ajax.render.php?operation=history&class='.$sClass.'&id='.$iKey); - $oPage->add(<<DisplayBareHeader($oPage, $bEditMode); + /** @var \iTopWebPage $oPage */ + $oPage->AddTabContainer(OBJECT_PROPERTIES_TAB); + $oPage->SetCurrentTabContainer(OBJECT_PROPERTIES_TAB); + $oPage->SetCurrentTab('UI:PropertiesTab'); + $this->DisplayBareProperties($oPage, $bEditMode); + $this->DisplayBareRelations($oPage, $bEditMode); + //$oPage->SetCurrentTab('UI:HistoryTab'); + //$this->DisplayBareHistory($oPage, $bEditMode); + $oPage->AddAjaxTab('UI:HistoryTab', + utils::GetAbsoluteUrlAppRoot().'pages/ajax.render.php?operation=history&class='.$sClass.'&id='.$iKey); + $oPage->add(<< HTML - ); - } + ); } /**