+HTML
+ );
+ $oP->AddUiBlock(TitleUIBlockFactory::MakeForPage(Dict::Format('UI:StimulusModify_N_ObjectsOf_Class', $sActionLabel, count($aSelectObject), $sClass)));
+ if (!empty($sActionDetails)) {
+ $oP->AddUiBlock(TitleUIBlockFactory::MakeForPage($sActionDetails));
+ }
+
+
$aExpectedAttributes = MetaModel::GetTransitionAttributes($sClass, $sStimulus, $sState);
$aDetails = array();
@@ -1286,40 +1317,43 @@ EOF
$iFieldIndex++;
}
}
- $sButtonsPosition = MetaModel::GetConfig()->Get('buttons_position');
- if ($sButtonsPosition == 'bottom')
- {
- // bottom: Displays the ticket details BEFORE the actions
- $oP->add('
');
- $oObj->DisplayBareProperties($oP);
- $oP->add('
');
+ $oFormContainer = new UIContentBlock(null, ['ibo-wizard-container']);
+ $oP->AddUiBlock($oFormContainer);
+ $oForm = new Combodo\iTop\Application\UI\Base\Component\Form\Form($sFormId);
+ $oFormContainer->AddSubBlock($oForm);
+ $oForm->SetOnSubmitJsCode("return OnSubmit('{$sFormId}');")
+ ->AddSubBlock(InputUIBlockFactory::MakeForHidden('class', $sClass))
+ ->AddSubBlock(InputUIBlockFactory::MakeForHidden('operation', 'bulk_apply_stimulus'))
+ ->AddSubBlock(InputUIBlockFactory::MakeForHidden('stimulus', $sStimulus))
+ ->AddSubBlock(InputUIBlockFactory::MakeForHidden('preview_mode', 1))
+ ->AddSubBlock(InputUIBlockFactory::MakeForHidden('filter', utils::HtmlEntities($sFilter)))
+ ->AddSubBlock(InputUIBlockFactory::MakeForHidden('state', $sState))
+ ->AddSubBlock(InputUIBlockFactory::MakeForHidden('selectObject', implode(',',$aSelectObject)))
+ ->AddSubBlock(InputUIBlockFactory::MakeForHidden('transaction_id', utils::GetNewTransactionId()));
+
+ $aContextInputBlocks = $oAppContext->GetForUIForm();
+ foreach ($aContextInputBlocks as $oContextInputBlock){
+ $oForm->AddSubBlock($oContextInputBlock);
}
- $oP->add("
\n");
- $oP->add("
\n");
- $oP->add("
\n");
- if ($sButtonsPosition != 'bottom')
- {
- // top or both: Displays the ticket details AFTER the actions
- $oP->add('
');
- $oObj->DisplayBareProperties($oP);
- $oP->add('
');
- }
+ $oCancelButton = ButtonUIBlockFactory::MakeForCancel(Dict::S('UI:Button:Cancel'), 'cancel', 'cancel');
+ $oCancelButton->SetOnClickJsCode("window.location.href='$sURL'");
+ $oForm->AddSubBlock($oCancelButton);
+
+ $oSubmitButton = ButtonUIBlockFactory::MakeForPrimaryAction($sActionLabel, 'submit', 'submit', true);
+ $oForm->AddSubBlock($oSubmitButton);
+
+ $oP->add(<<
+
+HTML
+ );
+
$iFieldsCount = count($aFieldsMap);
$sJsonFieldsMap = json_encode($aFieldsMap);
@@ -1381,9 +1415,6 @@ EOF
$sActionDetails = $aStimuli[$sStimulus]->GetDescription();
$oP->set_title(Dict::Format('UI:StimulusModify_N_ObjectsOf_Class', $sActionLabel, count($aObjects), $sClass));
- $oP->add('');
$oSet = DBObjectSet::FromArray($sClass, $aObjects);
@@ -1469,10 +1500,22 @@ EOF
'errors' => $sError,
);
}
- $oP->Table($aHeaders, $aRows);
+ $oBlock = PanelUIBlockFactory::MakeForClass($sClass, Dict::Format('UI:StimulusModify_N_ObjectsOf_Class', $sActionLabel, count($aObjects), $sClass));
+ $oBlock->SetIcon(MetaModel::GetClassIcon($sClass, false));
+
+
+ $oDataTable = DataTableUIBlockFactory::MakeForStaticData('', $aHeaders,$aRows);
+ $oBlock->AddSubBlock($oDataTable);
+ $oP->AddUiBlock($oBlock);
+
// Back to the list
$sURL = "./UI.php?operation=search&filter=".urlencode($sFilter)."&".$oAppContext->GetForLink();
- $oP->add('