Procházet zdrojové kódy

Exports: Friendly names to be escaped and delimited in CSV (bug more exposed now that the export allows field selection)

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3680 a333f486-631f-4898-b8df-5754b55c2be0
romainq před 9 roky
rodič
revize
d527d1c79d
1 změnil soubory, kde provedl 8 přidání a 0 odebrání
  1. 8 0
      core/attributedef.class.inc.php

+ 8 - 0
core/attributedef.class.inc.php

@@ -5386,6 +5386,14 @@ class AttributeFriendlyName extends AttributeComputedFieldVoid
 		return Str::pure2html((string)$sValue);
 	}
 
+	public function GetAsCSV($sValue, $sSeparator = ',', $sTextQualifier = '"', $oHostObject = null, $bLocalize = true)
+	{
+		$sFrom = array("\r\n", $sTextQualifier);
+		$sTo = array("\n", $sTextQualifier.$sTextQualifier);
+		$sEscaped = str_replace($sFrom, $sTo, (string)$sValue);
+		return $sTextQualifier.$sEscaped.$sTextQualifier;
+	}
+
 	// Do not display friendly names in the history of change
 	public function DescribeChangeAsHTML($sOldValue, $sNewValue, $sLabel = null)
 	{