form for dashboard

This commit is contained in:
Benjamin Dalsass
2025-12-17 16:36:05 +01:00
parent c898df461f
commit fb3cbcd779
10 changed files with 48 additions and 14 deletions

View File

@@ -1120,6 +1120,7 @@ abstract class Controller extends AbstractController
} else {
// Display turbo response
$this->DisplayTurboAjaxPage(['current_form' => $oForm->createView()]);
}

View File

@@ -186,6 +186,7 @@ class iTopWebPage extends NiceWebPage implements iTabbedPage
$this->LinkScriptFromAppRoot('js/forms/custom-elements/oql.js');
$this->LinkScriptFromAppRoot('js/forms/custom-elements/collection.js');
$this->LinkScriptFromAppRoot('js/forms/custom-elements/collection_entry.js');
$this->LinkScriptFromAppRoot('js/forms/custom-elements/turbo_stream_event.js');
// Used by inline image, CKEditor and other places
$this->LinkScriptFromAppRoot('node_modules/magnific-popup/dist/jquery.magnific-popup.min.js');

View File

@@ -108,6 +108,7 @@ abstract class AbstractFormBlock implements IFormBlock
protected function RegisterOptions(OptionsRegister $oOptionsRegister): void
{
$oOptionsRegister->SetOption('form_block', $this);
$oOptionsRegister->SetOption('form_block_class', get_class($this));
}
/**

View File

@@ -45,8 +45,8 @@ class ClassAttributeGroupByFormBlock extends AttributeChoiceFormBlock
$sExtKeyAttCode = $oModelReflection->GetAttributeProperty($sTargetClass, $sExtFieldAttCode, 'extkey_attcode');
$sTargetAttCode = $oModelReflection->GetAttributeProperty($sTargetClass, $sExtFieldAttCode, 'target_attcode');
$sTargetClass = $oModelReflection->GetAttributeProperty($sTargetClass, $sExtKeyAttCode, 'targetclass');
$aTargetAttCodes = AttributeChoiceFormBlock::ListAttributeCodesByCategory($sTargetClass, 'group_by');
$sAttType = $aTargetAttCodes[$sTargetAttCode];
// $aTargetAttCodes = AttributeChoiceFormBlock::ListAttributeCodesByCategory($sTargetClass, 'group_by');
$sAttType = $sTargetAttCode;
$sExtFieldAttCode = $sTargetAttCode;
}

View File

@@ -36,6 +36,7 @@ class FormTypeExtension extends AbstractTypeExtension
{
$resolver->setDefined([
'form_block',
'form_block_class',
'builder_listener',
'prevent_form_build',
]);
@@ -55,6 +56,7 @@ class FormTypeExtension extends AbstractTypeExtension
{
if (array_key_exists('form_block', $options)) {
$view->vars['form_block'] = $options['form_block'];
$view->vars['form_block_class'] = $options['form_block_class'];
$oFormBlock = $options['form_block'];
$view->vars['trigger_form_submit_on_modify'] = $oFormBlock->ImpactDependentsBlocks();