mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Allow binary data to be imported/synchronised with the synchro_import.php
This commit is contained in:
committed by
Molkobain
parent
c9d02826a0
commit
cbef9bb267
@@ -435,6 +435,7 @@ try
|
||||
|
||||
$aIsDateToTransform = array();
|
||||
$aDateToTransformReport = array();
|
||||
$aIsBinaryToTransform = array();
|
||||
foreach ($aInputColumns as $iFieldId => $sInputColumn)
|
||||
{
|
||||
if (array_key_exists($sInputColumn, $aDateColumns))
|
||||
@@ -456,6 +457,7 @@ try
|
||||
{
|
||||
throw new ExchangeException("Unknown column '$sInputColumn' (class: '$sClass')");
|
||||
}
|
||||
$aIsBinaryToTransform[$iFieldId] = $aColumns[$sInputColumn] === 'LONGBLOB';
|
||||
}
|
||||
if (!isset($iPrimaryKeyCol))
|
||||
{
|
||||
@@ -535,6 +537,10 @@ try
|
||||
$aValues[] = $sDate;
|
||||
}
|
||||
}
|
||||
elseif ($aIsBinaryToTransform[$iCol])
|
||||
{
|
||||
$aValues[] = base64_decode($value);
|
||||
}
|
||||
else
|
||||
{
|
||||
$aValues[] = $value;
|
||||
@@ -600,6 +606,10 @@ try
|
||||
$aValuePairs[] = "`$sCol` = ".CMDBSource::Quote($sDate);
|
||||
}
|
||||
}
|
||||
elseif ($aIsBinaryToTransform[$iCol])
|
||||
{
|
||||
$aValuePairs[] = "`$sCol` = FROM_BASE64(".CMDBSource::Quote($aRow[$iCol], true).")";
|
||||
}
|
||||
else
|
||||
{
|
||||
$aValuePairs[] = "`$sCol` = ".CMDBSource::Quote($aRow[$iCol]);
|
||||
|
||||
Reference in New Issue
Block a user