mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
Fixed bugs on CSV import (was not working fine when exporting/importing incident tickets)
SVN:trunk[316]
This commit is contained in:
@@ -130,6 +130,7 @@ abstract class AttributeDefinition
|
||||
public function IsExternalField() {return false;}
|
||||
public function IsWritable() {return false;}
|
||||
public function IsNullAllowed() {return true;}
|
||||
public function GetNullValue() {return null;}
|
||||
public function GetCode() {return $this->m_sCode;}
|
||||
public function GetLabel() {return $this->Get("label");}
|
||||
public function GetDescription() {return $this->Get("description");}
|
||||
@@ -328,7 +329,6 @@ class AttributeDBFieldVoid extends AttributeDefinition
|
||||
public function IsNullAllowed() {return false;}
|
||||
|
||||
protected function ScalarToSQL($value) {return $value;} // format value as a valuable SQL literal (quoted outside)
|
||||
protected function SQLToScalar($value) {return $value;} // take the result of a fetch... and make it a PHP variable
|
||||
|
||||
public function GetSQLExpressions()
|
||||
{
|
||||
@@ -483,12 +483,6 @@ class AttributeInteger extends AttributeDBField
|
||||
assert(is_numeric($value));
|
||||
return $value; // supposed to be an int
|
||||
}
|
||||
public function SQLToScalar($value)
|
||||
{
|
||||
// Use cast (int) or intval() ?
|
||||
return (int)$value;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -525,11 +519,6 @@ class AttributeBoolean extends AttributeInteger
|
||||
if ($value) return 1;
|
||||
return 0;
|
||||
}
|
||||
public function SQLToScalar($value)
|
||||
{
|
||||
// Use cast (int) or intval() ?
|
||||
return (int)$value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -610,10 +599,6 @@ class AttributeString extends AttributeDBField
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
public function SQLToScalar($value)
|
||||
{
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function GetAsCSV($sValue, $sSeparator = ',', $sTextQualifier = '"')
|
||||
{
|
||||
@@ -986,10 +971,6 @@ class AttributeDate extends AttributeDBField
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
public function SQLToScalar($value)
|
||||
{
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function GetAsHTML($value)
|
||||
{
|
||||
@@ -1047,6 +1028,7 @@ class AttributeExternalKey extends AttributeDBFieldVoid
|
||||
|
||||
public function GetDefaultValue() {return 0;}
|
||||
public function IsNullAllowed() {return $this->Get("is_null_allowed");}
|
||||
public function GetNullValue() {return 0;}
|
||||
|
||||
public function GetBasicFilterOperators()
|
||||
{
|
||||
@@ -1093,6 +1075,11 @@ class AttributeExternalKey extends AttributeDBFieldVoid
|
||||
{
|
||||
return $this->Get("on_target_delete");
|
||||
}
|
||||
|
||||
public function MakeRealValue($proposedValue)
|
||||
{
|
||||
return (int)$proposedValue;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1226,11 +1213,6 @@ class AttributeExternalField extends AttributeDefinition
|
||||
$oExtAttDef = $this->GetExtAttDef();
|
||||
return $oExtAttDef->ScalarToSQL($value);
|
||||
}
|
||||
public function SQLToScalar($value)
|
||||
{
|
||||
$oExtAttDef = $this->GetExtAttDef();
|
||||
return $oExtAttDef->SQLToScalar($value);
|
||||
}
|
||||
|
||||
|
||||
// Do not overload GetSQLExpression here because this is handled in the joins
|
||||
|
||||
Reference in New Issue
Block a user