Przeglądaj źródła

#722 Document preview disappeared since 2.0 (not in 1.x)

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@2732 a333f486-631f-4898-b8df-5754b55c2be0
romainq 12 lat temu
rodzic
commit
15e6434ce8

+ 4 - 4
datamodels/1.x/itop-config-mgmt-1.0.0/datamodel.itop-config-mgmt.xml

@@ -1277,14 +1277,14 @@
           <type>Overload-cmdbAbstractObject</type>
           <code><![CDATA[	public function DisplayBareProperties(WebPage $oPage, $bEditMode = false, $sPrefix = '', $aExtraParams = array())
 	{
+		parent::DisplayBareProperties($oPage, $bEditMode, $sPrefix, $aExtraParams);
 		if (!$bEditMode)
 		{
-			$oPage->SetCurrentTab(Dict::S('Class:Document:PreviewTab'));
+			$oPage->add('<fieldset>');
+			$oPage->add('<legend>'.Dict::S('Class:Document:PreviewTab').'</legend>');
 			$oPage->add($this->DisplayDocumentInline($oPage, 'contents'));
-			$oPage->SetCurrentTab(Dict::S('UI:PropertiesTab'));
+			$oPage->add('</fieldset>');
 		}
-		parent::DisplayBareProperties($oPage, $bEditMode, $sPrefix, $aExtraParams);
-		
 	}]]></code>
         </method>
       </methods>

+ 1 - 1
datamodels/1.x/itop-config-mgmt-1.0.0/fr.dict.itop-config-mgmt.php

@@ -553,7 +553,7 @@ Dict::Add('FR FR', 'French', 'Français', array(
 	'Class:Document/Attribute:service_list+' => 'Services liés à ce document',
 	'Class:Document/Attribute:ticket_list' => 'Tickets',
 	'Class:Document/Attribute:ticket_list+' => 'Tickets liés à ce document',
-	'Class:Document:PreviewTab' => 'Entrevue',
+	'Class:Document:PreviewTab' => 'Aperçu',
 	'Class:Subnet/Name' => '%1$s / %2$s',
 	'Class:Software' => 'Logiciel',
 	'Class:Software+' => '',

+ 23 - 1
datamodels/2.x/itop-config-mgmt/datamodel.itop-config-mgmt.xml

@@ -970,7 +970,29 @@
       <fields>
         <field id="file" xsi:type="AttributeBlob"/>
       </fields>
-      <methods/>
+      <methods>
+        <method id="DisplayBareRelations">
+          <static>false</static>
+          <access>public</access>
+          <type>Overload-cmdbAbstractObject</type>
+        <comment><![CDATA[/**
+	 * Overload the display of the properties to add a tab (the first one)
+	 * with the preview of the document
+	 */
+	]]></comment>
+          <code><![CDATA[public function DisplayBareProperties(WebPage $oPage, $bEditMode = false, $sPrefix = '', $aExtraParams = array())
+	{
+		parent::DisplayBareProperties($oPage, $bEditMode, $sPrefix, $aExtraParams);
+		if (!$bEditMode)
+		{
+			$oPage->add('<fieldset>');
+			$oPage->add('<legend>'.Dict::S('Class:Document:PreviewTab').'</legend>');
+			$oPage->add($this->DisplayDocumentInline($oPage, 'file'));
+			$oPage->add('</fieldset>');
+		}
+	}]]></code>
+        </method>
+      </methods>
       <presentation>
         <details>
           <items>

+ 1 - 0
datamodels/2.x/itop-config-mgmt/de.dict.itop-config-mgmt.php

@@ -1098,5 +1098,6 @@ Dict::Add('DE DE', 'German', 'Deutsch', array(
 	'Menu:Software+' => '',
 	'UI_WelcomeMenu_AllConfigItems' => 'Zusammenfassung',
 	'Menu:ConfigManagement:Typology' => 'Typologie-Konfiguration',
+	'Class:Document:PreviewTab' => 'Vorschau',
 ));
 ?>

+ 1 - 0
datamodels/2.x/itop-config-mgmt/en.dict.itop-config-mgmt.php

@@ -1793,5 +1793,6 @@ Dict::Add('EN US', 'English', 'English', array(
 'Class:Subnet/Tab:FreeIPs' => 'Free IPs',
 'Class:Subnet/Tab:FreeIPs-count' => 'Free IPs: %1$s',
 'Class:Subnet/Tab:FreeIPs-explain' => 'Here is an extract of 10 free IP addresses',
+'Class:Document:PreviewTab' => 'Preview',
 ));
 ?>

+ 1 - 1
datamodels/2.x/itop-config-mgmt/es_cr.dict.itop-config-mgmt.php

@@ -1781,6 +1781,6 @@ Dict::Add('ES CR', 'Spanish', 'Español, Castellano', array(
 'Server:otherinfo' => 'Otra Información',
 'Person:info' => 'Información General',
 'Person:notifiy' => 'Notificación',
-
+'Class:Document:PreviewTab' => ' Visualización',
 ));
 ?>

+ 1 - 0
datamodels/2.x/itop-config-mgmt/fr.dict.itop-config-mgmt.php

@@ -1773,5 +1773,6 @@ Dict::Add('FR FR', 'French', 'Français', array(
 'Class:Subnet/Tab:FreeIPs' => 'IP disponibles',
 'Class:Subnet/Tab:FreeIPs-count' => 'IP disponibles: %1$s',
 'Class:Subnet/Tab:FreeIPs-explain' => 'Voici un échantillon de dix addresses IP disponibles',
+'Class:Document:PreviewTab' => 'Aperçu',
 ));
 ?>

+ 1 - 0
datamodels/2.x/itop-config-mgmt/ja.dict.itop-config-mgmt.php

@@ -1091,5 +1091,6 @@ Dict::Add('JA JP', 'Japanese', '日本語', array(
 	'Server:otherinfo' => '他の情報',
 	'Person:info' => '情報',
 	'Person:notifiy' => '通知',
+	'Class:Document:PreviewTab' => 'プレビュー', //  'Preview',  # 'Preview'
 ));
 ?>

+ 1 - 0
datamodels/2.x/itop-config-mgmt/ru.dict.itop-config-mgmt.php

@@ -1097,5 +1097,6 @@ Dict::Add('RU RU', 'Russian', 'Русский', array(
 	'Menu:Software+' => '',
 	'UI_WelcomeMenu_AllConfigItems' => 'Общее~~',
 	'Menu:ConfigManagement:Typology' => 'Конфигурация топологии~~',
+	'Class:Document:PreviewTab' => 'Предпросмотр',
 ));
 ?>