Browse Source

Export/XML: new option to include link sets (default: no)

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3696 a333f486-631f-4898-b8df-5754b55c2be0
romainq 9 years ago
parent
commit
dbfadb8d27

+ 13 - 2
core/xmlbulkexport.class.inc.php

@@ -41,11 +41,15 @@ class XMLBulkExport extends BulkExport
 		switch($sPartId)
 		{
 			case 'xml_options':
-				$sChecked = (utils::ReadParam('no_localize', 0) == 1) ? ' checked ' : '';
+				$sNoLocalizeChecked = (utils::ReadParam('no_localize', 0) == 1) ? ' checked ' : '';
+				$sLinksetChecked = (utils::ReadParam('linksets', 0) == 1) ? ' checked ' : '';
 				$oP->add('<fieldset><legend>'.Dict::S('Core:BulkExport:XMLOptions').'</legend>');
 				$oP->add('<table>');
 				$oP->add('<tr>');
-				$oP->add('<td><input type="checkbox" id="xml_no_localize" name="no_localize" value="1"'.$sChecked.'><label for="xml_no_localize"> '.Dict::S('Core:BulkExport:OptionNoLocalize').'</label></td>');
+				$oP->add('<td><input type="checkbox" id="xml_no_localize" name="no_localize" value="1"'.$sNoLocalizeChecked.'><label for="xml_no_localize"> '.Dict::S('Core:BulkExport:OptionNoLocalize').'</label></td>');
+				$oP->add('</tr>');
+				$oP->add('<tr>');
+				$oP->add('<td><input type="checkbox" id="xml_linksets" name="linksets" value="1"'.$sLinksetChecked.'><label for="xml_linksets"> '.Dict::S('Core:BulkExport:OptionLinkSets').'</label></td>');
 				$oP->add('</tr>');
 				$oP->add('</table>');
 				$oP->add('</fieldset>');
@@ -61,6 +65,7 @@ class XMLBulkExport extends BulkExport
 		parent::ReadParameters();
 	
 		$this->aStatusInfo['localize'] = (utils::ReadParam('no_localize', 0) != 1);
+		$this->aStatusInfo['linksets'] = (utils::ReadParam('linksets', 0) == 1);
 	}
 	
 	protected function GetSampleData($oObj, $sAttCode)
@@ -135,6 +140,12 @@ class XMLBulkExport extends BulkExport
 				}
 				foreach(MetaModel::ListAttributeDefs($sClassName) as $sAttCode=>$oAttDef)
 				{
+					if ($oAttDef->IsLinkSet() && !$this->aStatusInfo['linksets'])
+					{
+						// Skip link sets
+						continue;
+					}
+
 					if (is_null($oObj))
 					{
 						$sData .= "<$sAttCode>null</$sAttCode>\n";

+ 1 - 0
dictionaries/da.dictionary.itop.core.php

@@ -2478,6 +2478,7 @@ Operators:<br/>
 	'Core:BulkExport:SpreadsheetFormat' => 'Spreadsheet HTML format (*.html)~~',
 	'Core:BulkExport:SpreadsheetOptions' => 'Spreadsheet Options~~',
 	'Core:BulkExport:OptionNoLocalize' => 'Do not localize the values (for Enumerated fields)~~',
+	'Core:BulkExport:OptionLinkSets' => 'Include linked objects~~',
 	'Core:BulkExport:ScopeDefinition' => 'Definition of the objects to export~~',
 	'Core:BulkExportLabelOQLExpression' => 'OQL Query:~~',
 	'Core:BulkExportLabelPhrasebookEntry' => 'Query Phrasebook Entry:~~',

+ 1 - 0
dictionaries/de.dictionary.itop.core.php

@@ -590,6 +590,7 @@ Operatoren:<br/>
 	'Core:BulkExport:SpreadsheetFormat' => 'Spreadsheet HTML (*.html)',
 	'Core:BulkExport:SpreadsheetOptions' => 'Spreadsheet-Optionen',
 	'Core:BulkExport:OptionNoLocalize' => 'Werte von Aufzählungsfeldern nicht lokalisieren',
+	'Core:BulkExport:OptionLinkSets' => 'Include linked objects~~',
 	'Core:BulkExport:ScopeDefinition' => 'Definition der zu exportierenden Objekte',
 	'Core:BulkExportLabelOQLExpression' => 'OQL-Abfrage',
 	'Core:BulkExportLabelPhrasebookEntry' => 'Query-Bibliotheks-Eintrag:',

+ 1 - 0
dictionaries/dictionary.itop.core.php

@@ -842,6 +842,7 @@ Dict::Add('EN US', 'English', 'English', array(
 	'Core:BulkExport:SpreadsheetFormat' => 'Spreadsheet HTML format (*.html)',
 	'Core:BulkExport:SpreadsheetOptions' => 'Spreadsheet Options',
 	'Core:BulkExport:OptionNoLocalize' => 'Do not localize the values (for Enumerated fields)',
+	'Core:BulkExport:OptionLinkSets' => 'Include linked objects',
 	'Core:BulkExport:ScopeDefinition' => 'Definition of the objects to export',
 	'Core:BulkExportLabelOQLExpression' => 'OQL Query:',
 	'Core:BulkExportLabelPhrasebookEntry' => 'Query Phrasebook Entry:',

+ 1 - 0
dictionaries/es_cr.dictionary.itop.core.php

@@ -836,6 +836,7 @@ Dict::Add('ES CR', 'Spanish', 'Español, Castellano', array(
 	'Core:BulkExport:SpreadsheetFormat' => 'Spreadsheet HTML format (*.html)~~',
 	'Core:BulkExport:SpreadsheetOptions' => 'Spreadsheet Options~~',
 	'Core:BulkExport:OptionNoLocalize' => 'Do not localize the values (for Enumerated fields)~~',
+	'Core:BulkExport:OptionLinkSets' => 'Include linked objects~~',
 	'Core:BulkExport:ScopeDefinition' => 'Definition of the objects to export~~',
 	'Core:BulkExportLabelOQLExpression' => 'OQL Query:~~',
 	'Core:BulkExportLabelPhrasebookEntry' => 'Query Phrasebook Entry:~~',

+ 1 - 0
dictionaries/fr.dictionary.itop.core.php

@@ -700,6 +700,7 @@ Opérateurs :<br/>
 	'Core:BulkExport:SpreadsheetFormat' => 'Format HTML pour Excel (*.html)',
 	'Core:BulkExport:SpreadsheetOptions' => 'Options du format HTML pour Excel',
 	'Core:BulkExport:OptionNoLocalize' => 'Ne pas traduire les valeurs (pour les champs de type "Enum")',
+	'Core:BulkExport:OptionLinkSets' => 'Inclure les objets liés',
 	'Core:BulkExport:ScopeDefinition' => 'Définition des objets à exporter',
 	'Core:BulkExportLabelOQLExpression' => 'Requête OQL:',
 	'Core:BulkExportLabelPhrasebookEntry' => 'Entrée du livre des requêtes:',

+ 1 - 0
dictionaries/hu.dictionary.itop.core.php

@@ -593,6 +593,7 @@ Operators:<br/>
 	'Core:BulkExport:SpreadsheetFormat' => 'Spreadsheet HTML format (*.html)~~',
 	'Core:BulkExport:SpreadsheetOptions' => 'Spreadsheet Options~~',
 	'Core:BulkExport:OptionNoLocalize' => 'Do not localize the values (for Enumerated fields)~~',
+	'Core:BulkExport:OptionLinkSets' => 'Include linked objects~~',
 	'Core:BulkExport:ScopeDefinition' => 'Definition of the objects to export~~',
 	'Core:BulkExportLabelOQLExpression' => 'OQL Query:~~',
 	'Core:BulkExportLabelPhrasebookEntry' => 'Query Phrasebook Entry:~~',

+ 1 - 0
dictionaries/it.dictionary.itop.core.php

@@ -825,6 +825,7 @@ Dict::Add('IT IT', 'Italian', 'Italiano', array(
 	'Core:BulkExport:SpreadsheetFormat' => 'Spreadsheet HTML format (*.html)~~',
 	'Core:BulkExport:SpreadsheetOptions' => 'Spreadsheet Options~~',
 	'Core:BulkExport:OptionNoLocalize' => 'Do not localize the values (for Enumerated fields)~~',
+	'Core:BulkExport:OptionLinkSets' => 'Include linked objects~~',
 	'Core:BulkExport:ScopeDefinition' => 'Definition of the objects to export~~',
 	'Core:BulkExportLabelOQLExpression' => 'OQL Query:~~',
 	'Core:BulkExportLabelPhrasebookEntry' => 'Query Phrasebook Entry:~~',

+ 1 - 0
dictionaries/ja.dictionary.itop.core.php

@@ -614,6 +614,7 @@ Operators:<br/>
 	'Core:BulkExport:XMLOptions' => 'XML Options~~',
 	'Core:BulkExport:SpreadsheetFormat' => 'Spreadsheet HTML format (*.html)~~',
 	'Core:BulkExport:SpreadsheetOptions' => 'Spreadsheet Options~~',
+	'Core:BulkExport:OptionLinkSets' => 'Include linked objects~~',
 	'Core:BulkExport:OptionNoLocalize' => 'Do not localize the values (for Enumerated fields)~~',
 	'Core:BulkExport:ScopeDefinition' => 'Definition of the objects to export~~',
 	'Core:BulkExportLabelOQLExpression' => 'OQL Query:~~',

+ 1 - 0
dictionaries/nl.dictionary.itop.core.php

@@ -844,6 +844,7 @@ Dict::Add('NL NL', 'Dutch', 'Nederlands', array(
 	'Core:BulkExport:XMLOptions' => 'XML Options~~',
 	'Core:BulkExport:SpreadsheetFormat' => 'Spreadsheet HTML format (*.html)~~',
 	'Core:BulkExport:SpreadsheetOptions' => 'Spreadsheet Options~~',
+	'Core:BulkExport:OptionLinkSets' => 'Include linked objects~~',
 	'Core:BulkExport:OptionNoLocalize' => 'Do not localize the values (for Enumerated fields)~~',
 	'Core:BulkExport:ScopeDefinition' => 'Definition of the objects to export~~',
 	'Core:BulkExportLabelOQLExpression' => 'OQL Query:~~',

+ 1 - 0
dictionaries/pt_br.dictionary.itop.core.php

@@ -837,6 +837,7 @@ Dict::Add('PT BR', 'Brazilian', 'Brazilian', array(
 	'Core:BulkExport:XMLOptions' => 'XML Options~~',
 	'Core:BulkExport:SpreadsheetFormat' => 'Spreadsheet HTML format (*.html)~~',
 	'Core:BulkExport:SpreadsheetOptions' => 'Spreadsheet Options~~',
+	'Core:BulkExport:OptionLinkSets' => 'Include linked objects~~',
 	'Core:BulkExport:OptionNoLocalize' => 'Do not localize the values (for Enumerated fields)~~',
 	'Core:BulkExport:ScopeDefinition' => 'Definition of the objects to export~~',
 	'Core:BulkExportLabelOQLExpression' => 'OQL Query:~~',

+ 1 - 0
dictionaries/ru.dictionary.itop.core.php

@@ -832,6 +832,7 @@ Dict::Add('RU RU', 'Russian', 'Русский', array(
 	'Core:BulkExport:XMLOptions' => 'XML Options~~',
 	'Core:BulkExport:SpreadsheetFormat' => 'Spreadsheet HTML format (*.html)~~',
 	'Core:BulkExport:SpreadsheetOptions' => 'Spreadsheet Options~~',
+	'Core:BulkExport:OptionLinkSets' => 'Include linked objects~~',
 	'Core:BulkExport:OptionNoLocalize' => 'Do not localize the values (for Enumerated fields)~~',
 	'Core:BulkExport:ScopeDefinition' => 'Definition of the objects to export~~',
 	'Core:BulkExportLabelOQLExpression' => 'OQL Query:~~',

+ 1 - 0
dictionaries/tr.dictionary.itop.core.php

@@ -764,6 +764,7 @@ Operators:<br/>
 	'Core:BulkExport:XMLOptions' => 'XML Options~~',
 	'Core:BulkExport:SpreadsheetFormat' => 'Spreadsheet HTML format (*.html)~~',
 	'Core:BulkExport:SpreadsheetOptions' => 'Spreadsheet Options~~',
+	'Core:BulkExport:OptionLinkSets' => 'Include linked objects~~',
 	'Core:BulkExport:OptionNoLocalize' => 'Do not localize the values (for Enumerated fields)~~',
 	'Core:BulkExport:ScopeDefinition' => 'Definition of the objects to export~~',
 	'Core:BulkExportLabelOQLExpression' => 'OQL Query:~~',

+ 1 - 0
dictionaries/zh.dictionary.itop.core.php

@@ -763,6 +763,7 @@ Operators:<br/>
 	'Core:BulkExport:XMLOptions' => 'XML Options~~',
 	'Core:BulkExport:SpreadsheetFormat' => 'Spreadsheet HTML format (*.html)~~',
 	'Core:BulkExport:SpreadsheetOptions' => 'Spreadsheet Options~~',
+	'Core:BulkExport:OptionLinkSets' => 'Include linked objects~~',
 	'Core:BulkExport:OptionNoLocalize' => 'Do not localize the values (for Enumerated fields)~~',
 	'Core:BulkExport:ScopeDefinition' => 'Definition of the objects to export~~',
 	'Core:BulkExportLabelOQLExpression' => 'OQL Query:~~',