mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-14 07:54:10 +01:00
Form prefill: add possibility to change attributes flag on the fly
SVN:trunk[6000]
This commit is contained in:
@@ -2380,7 +2380,7 @@ EOF
|
||||
return $oObj->DisplayModifyForm( $oPage, $aExtraParams);
|
||||
}
|
||||
|
||||
public function DisplayStimulusForm(WebPage $oPage, $sStimulus)
|
||||
public function DisplayStimulusForm(WebPage $oPage, $sStimulus, $aPrefillFormParam = null)
|
||||
{
|
||||
$sClass = get_class($this);
|
||||
$iKey = $this->GetKey();
|
||||
@@ -2422,6 +2422,12 @@ EOF
|
||||
$oPage->add("<h1>$sActionDetails</h1>\n");
|
||||
$sTargetState = $aTransitions[$sStimulus]['target_state'];
|
||||
$aExpectedAttributes = $this->GetTransitionAttributes($sStimulus /*, current state*/);
|
||||
if ($aPrefillFormParam != null)
|
||||
{
|
||||
$aPrefillFormParam['expected_attributes'] = $aExpectedAttributes;
|
||||
$this->PrefillForm('state_change', $aPrefillFormParam);
|
||||
$aExpectedAttributes = $aPrefillFormParam['expected_attributes'];
|
||||
}
|
||||
$sButtonsPosition = MetaModel::GetConfig()->Get('buttons_position');
|
||||
if ($sButtonsPosition == 'bottom')
|
||||
{
|
||||
|
||||
@@ -1485,8 +1485,7 @@ EOF
|
||||
'stimulus' => $sStimulus,
|
||||
'origin' => 'console'
|
||||
);
|
||||
$oObj->PrefillForm('state_change', $aPrefillFormParam);
|
||||
$oObj->DisplayStimulusForm($oP, $sStimulus);
|
||||
$oObj->DisplayStimulusForm($oP, $sStimulus, $aPrefillFormParam);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user