mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-21 09:38:48 +02: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);
|
return $oObj->DisplayModifyForm( $oPage, $aExtraParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function DisplayStimulusForm(WebPage $oPage, $sStimulus)
|
public function DisplayStimulusForm(WebPage $oPage, $sStimulus, $aPrefillFormParam = null)
|
||||||
{
|
{
|
||||||
$sClass = get_class($this);
|
$sClass = get_class($this);
|
||||||
$iKey = $this->GetKey();
|
$iKey = $this->GetKey();
|
||||||
@@ -2422,6 +2422,12 @@ EOF
|
|||||||
$oPage->add("<h1>$sActionDetails</h1>\n");
|
$oPage->add("<h1>$sActionDetails</h1>\n");
|
||||||
$sTargetState = $aTransitions[$sStimulus]['target_state'];
|
$sTargetState = $aTransitions[$sStimulus]['target_state'];
|
||||||
$aExpectedAttributes = $this->GetTransitionAttributes($sStimulus /*, current 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');
|
$sButtonsPosition = MetaModel::GetConfig()->Get('buttons_position');
|
||||||
if ($sButtonsPosition == 'bottom')
|
if ($sButtonsPosition == 'bottom')
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1485,8 +1485,7 @@ EOF
|
|||||||
'stimulus' => $sStimulus,
|
'stimulus' => $sStimulus,
|
||||||
'origin' => 'console'
|
'origin' => 'console'
|
||||||
);
|
);
|
||||||
$oObj->PrefillForm('state_change', $aPrefillFormParam);
|
$oObj->DisplayStimulusForm($oP, $sStimulus, $aPrefillFormParam);
|
||||||
$oObj->DisplayStimulusForm($oP, $sStimulus);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user