Customer portal : Updated object form manager to check if an AttributeType has the necessary API to be used in a form (instead of the temporary array enumerating available types)

SVN:trunk[4184]
This commit is contained in:
Guillaume Lajarige
2016-06-03 14:51:37 +00:00
parent b24c2b8455
commit 7ebb0c40f3
2 changed files with 3 additions and 3 deletions

View File

@@ -266,7 +266,7 @@ class ObjectController extends AbstractController
public function CreateFromFactoryAction(Request $oRequest, Application $oApp, $sObjectClass, $sObjectId, $sEncodedMethodName)
{
$sMethodName = base64_decode($sEncodedMethodName);
// Checking that the factory method is valid
if (!is_callable($sMethodName))
{

View File

@@ -435,8 +435,8 @@ class ObjectFormManager extends FormManager
{
$oAttDef = MetaModel::GetAttributeDef(get_class($this->oObject), $sAttCode);
// TODO : Make AttributeDefinition::MakeFormField() for all kind of fields
if (in_array(get_class($oAttDef), array('AttributeString', 'AttributeEmailAddress', 'AttributeText', 'AttributeLongText', 'AttributeCaseLog', 'AttributeHTML', 'AttributeFriendlyName', 'AttributeEnum', 'AttributeExternalKey', 'AttributeExternalField', 'AttributeHierarchicalKey', 'AttributeCustomFields', 'AttributeLinkedSet', 'AttributeLinkedSetIndirect', 'AttributeDate', 'AttributeDateTime', 'AttributeDuration', 'AttributeSubItem')))
// Failsafe for AttributeType that would not have MakeFormField and therefore could not be used in a form
if (is_callable(get_class($oAttDef) . '::MakeFormField'))
{
$oField = $oAttDef->MakeFormField($this->oObject);