mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-20 15:52:24 +02:00
N°848 Portal: Option to display LinkedSet as opened in a form
SVN:trunk[4691]
This commit is contained in:
@@ -286,9 +286,7 @@ class ObjectFormManager extends FormManager
|
||||
$sObjectClass = get_class($this->oObject);
|
||||
|
||||
$aFieldsAtts = array();
|
||||
$aMandatoryAtts = array();
|
||||
$aReadonlyAtts = array();
|
||||
$aHiddenAtts = array();
|
||||
$aFieldsExtraData = array();
|
||||
|
||||
if ($this->oForm !== null)
|
||||
{
|
||||
@@ -387,6 +385,12 @@ class ObjectFormManager extends FormManager
|
||||
$oFieldNode->setAttribute('data-form-path', $oForm->GetId());
|
||||
}
|
||||
|
||||
// Checking if field should be displayed opened (For linked set)
|
||||
if($oFieldNode->hasAttribute('data-field-opened') && ($oFieldNode->getAttribute('data-field-opened') === 'true') )
|
||||
{
|
||||
$aFieldsExtraData[$sFieldId]['opened'] = true;
|
||||
}
|
||||
|
||||
// Settings field flags from the data-field-flags attribute
|
||||
foreach (explode(' ', $sFieldFlags) as $sFieldFlag)
|
||||
{
|
||||
@@ -606,9 +610,9 @@ class ObjectFormManager extends FormManager
|
||||
|
||||
// Specific operation on field
|
||||
// - LinkedSet
|
||||
// - Overriding attributes to display
|
||||
if (in_array(get_class($oField), array('Combodo\\iTop\\Form\\Field\\LinkedSetField')))
|
||||
{
|
||||
// - Overriding attributes to display
|
||||
if ($this->oApp !== null)
|
||||
{
|
||||
// Note : This snippet is inspired from AttributeLinkedSet::MakeFormField()
|
||||
@@ -628,6 +632,11 @@ class ObjectFormManager extends FormManager
|
||||
}
|
||||
$oField->SetAttributesToDisplay($aAttributesToDisplay);
|
||||
}
|
||||
// - Displaying as opened
|
||||
if(array_key_exists($sAttCode, $aFieldsExtraData) && array_key_exists('opened', $aFieldsExtraData[$sAttCode]))
|
||||
{
|
||||
$oField->SetDisplayOpened(true);
|
||||
}
|
||||
}
|
||||
|
||||
$oForm->AddField($oField);
|
||||
|
||||
Reference in New Issue
Block a user