mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
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:
@@ -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))
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user