Custom fields: check data against the form prior to recording (do not rely solely on the HTML form)

SVN:trunk[3963]
This commit is contained in:
Romain Quetiez
2016-03-22 09:02:03 +00:00
parent 2150682a92
commit ea31d71d16
2 changed files with 20 additions and 14 deletions

View File

@@ -59,21 +59,21 @@ class ormCustomFieldsValue
public function GetAsHTML($bLocalize = true)
{
$oAttDef = MetaModel::GetAttributeDef(get_class($this->oHostObject), $this->sAttCode);
$oHandler = $oAttDef->GetHandler($this->oHostObject, $this);
$oHandler = $oAttDef->GetHandler($this->oHostObject, $this->GetValues());
return $oHandler->GetAsHTML($this->aCurrentValues, $bLocalize);
}
public function GetAsXML($bLocalize = true)
{
$oAttDef = MetaModel::GetAttributeDef(get_class($this->oHostObject), $this->sAttCode);
$oHandler = $oAttDef->GetHandler($this->oHostObject, $this);
$oHandler = $oAttDef->GetHandler($this->oHostObject, $this->GetValues());
return $oHandler->GetAsXML($this->aCurrentValues, $bLocalize);
}
public function GetAsCSV($sSeparator = ',', $sTextQualifier = '"', $bLocalize = true)
{
$oAttDef = MetaModel::GetAttributeDef(get_class($this->oHostObject), $this->sAttCode);
$oHandler = $oAttDef->GetHandler($this->oHostObject, $this);
$oHandler = $oAttDef->GetHandler($this->oHostObject, $this->GetValues());
return $oHandler->GetAsCSV($this->aCurrentValues, $sSeparator = ',', $sTextQualifier = '"', $bLocalize = true);
}
@@ -86,7 +86,7 @@ class ormCustomFieldsValue
public function GetForTemplate($sVerb, $bLocalize = true)
{
$oAttDef = MetaModel::GetAttributeDef(get_class($this->oHostObject), $this->sAttCode);
$oHandler = $oAttDef->GetHandler($this->oHostObject, $this);
$oHandler = $oAttDef->GetHandler($this->oHostObject, $this->GetValues());
return 'template...verb='.$sVerb.' sur "'.json_encode($this->aCurrentValues).'"';
}