mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 02:28:44 +02:00
change turbo for form errors
This commit is contained in:
@@ -246,8 +246,8 @@ return array(
|
||||
'Combodo\\iTop\\Application\\UI\\Base\\Component\\Toolbar\\ToolbarUIBlockFactory' => $baseDir . '/sources/Application/UI/Base/Component/Toolbar/ToolbarUIBlockFactory.php',
|
||||
'Combodo\\iTop\\Application\\UI\\Base\\Component\\TurboForm\\TurboForm' => $baseDir . '/sources/Application/UI/Base/Component/TurboForm/TurboForm.php',
|
||||
'Combodo\\iTop\\Application\\UI\\Base\\Component\\TurboForm\\TurboFormUIBlockFactory' => $baseDir . '/sources/Application/UI/Base/Component/TurboForm/TurboFormUIBlockFactory.php',
|
||||
'Combodo\\iTop\\Application\\UI\\Base\\Component\\TurboUpdate\\TurboUpdate' => $baseDir . '/sources/Application/UI/Base/Component/TurboUpdate/TurboUpdate.php',
|
||||
'Combodo\\iTop\\Application\\UI\\Base\\Component\\TurboUpdate\\TurboUpdateUIBlockFactory' => $baseDir . '/sources/Application/UI/Base/Component/TurboUpdate/TurboUpdateUIBlockFactory.php',
|
||||
'Combodo\\iTop\\Application\\UI\\Base\\Component\\TurboUpdate\\TurboStream' => $baseDir . '/sources/Application/UI/Base/Component/TurboStream/TurboStream.php',
|
||||
'Combodo\\iTop\\Application\\UI\\Base\\Component\\TurboUpdate\\TurboStreamUIBlockFactory' => $baseDir . '/sources/Application/UI/Base/Component/TurboStream/TurboStreamUIBlockFactory.php',
|
||||
'Combodo\\iTop\\Application\\UI\\Base\\Layout\\ActivityPanel\\ActivityEntry\\ActivityEntry' => $baseDir . '/sources/Application/UI/Base/Layout/ActivityPanel/ActivityEntry/ActivityEntry.php',
|
||||
'Combodo\\iTop\\Application\\UI\\Base\\Layout\\ActivityPanel\\ActivityEntry\\ActivityEntryFactory' => $baseDir . '/sources/Application/UI/Base/Layout/ActivityPanel/ActivityEntry/ActivityEntryFactory.php',
|
||||
'Combodo\\iTop\\Application\\UI\\Base\\Layout\\ActivityPanel\\ActivityEntry\\CMDBChangeOp\\CMDBChangeOpAttachmentAddedFactory' => $baseDir . '/sources/Application/UI/Base/Layout/ActivityPanel/ActivityEntry/CMDBChangeOp/CMDBChangeOpAttachmentAddedFactory.php',
|
||||
@@ -516,7 +516,6 @@ return array(
|
||||
'Combodo\\iTop\\Forms\\IO\\Converter\\AbstractConverter' => $baseDir . '/sources/Forms/IO/Converter/AbstractConverter.php',
|
||||
'Combodo\\iTop\\Forms\\IO\\Converter\\ChoiceValueToLabelConverter' => $baseDir . '/sources/Forms/IO/Converter/ChoiceValueToLabelConverter.php',
|
||||
'Combodo\\iTop\\Forms\\IO\\Converter\\OqlToClassConverter' => $baseDir . '/sources/Forms/IO/Converter/OqlToClassConverter.php',
|
||||
'Combodo\\iTop\\Forms\\IO\\Converter\\StringToAttributeConverter' => $baseDir . '/sources/Forms/IO/Converter/StringToAttributeConverter.php',
|
||||
'Combodo\\iTop\\Forms\\IO\\FormBinding' => $baseDir . '/sources/Forms/IO/FormBinding.php',
|
||||
'Combodo\\iTop\\Forms\\IO\\FormBlockIOException' => $baseDir . '/sources/Forms/IO/FormBlockIOException.php',
|
||||
'Combodo\\iTop\\Forms\\IO\\FormInput' => $baseDir . '/sources/Forms/IO/FormInput.php',
|
||||
|
||||
@@ -627,8 +627,8 @@ class ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f
|
||||
'Combodo\\iTop\\Application\\UI\\Base\\Component\\Toolbar\\ToolbarUIBlockFactory' => __DIR__ . '/../..' . '/sources/Application/UI/Base/Component/Toolbar/ToolbarUIBlockFactory.php',
|
||||
'Combodo\\iTop\\Application\\UI\\Base\\Component\\TurboForm\\TurboForm' => __DIR__ . '/../..' . '/sources/Application/UI/Base/Component/TurboForm/TurboForm.php',
|
||||
'Combodo\\iTop\\Application\\UI\\Base\\Component\\TurboForm\\TurboFormUIBlockFactory' => __DIR__ . '/../..' . '/sources/Application/UI/Base/Component/TurboForm/TurboFormUIBlockFactory.php',
|
||||
'Combodo\\iTop\\Application\\UI\\Base\\Component\\TurboUpdate\\TurboUpdate' => __DIR__ . '/../..' . '/sources/Application/UI/Base/Component/TurboUpdate/TurboUpdate.php',
|
||||
'Combodo\\iTop\\Application\\UI\\Base\\Component\\TurboUpdate\\TurboUpdateUIBlockFactory' => __DIR__ . '/../..' . '/sources/Application/UI/Base/Component/TurboUpdate/TurboUpdateUIBlockFactory.php',
|
||||
'Combodo\\iTop\\Application\\UI\\Base\\Component\\TurboUpdate\\TurboStream' => __DIR__ . '/../..' . '/sources/Application/UI/Base/Component/TurboStream/TurboStream.php',
|
||||
'Combodo\\iTop\\Application\\UI\\Base\\Component\\TurboUpdate\\TurboStreamUIBlockFactory' => __DIR__ . '/../..' . '/sources/Application/UI/Base/Component/TurboStream/TurboStreamUIBlockFactory.php',
|
||||
'Combodo\\iTop\\Application\\UI\\Base\\Layout\\ActivityPanel\\ActivityEntry\\ActivityEntry' => __DIR__ . '/../..' . '/sources/Application/UI/Base/Layout/ActivityPanel/ActivityEntry/ActivityEntry.php',
|
||||
'Combodo\\iTop\\Application\\UI\\Base\\Layout\\ActivityPanel\\ActivityEntry\\ActivityEntryFactory' => __DIR__ . '/../..' . '/sources/Application/UI/Base/Layout/ActivityPanel/ActivityEntry/ActivityEntryFactory.php',
|
||||
'Combodo\\iTop\\Application\\UI\\Base\\Layout\\ActivityPanel\\ActivityEntry\\CMDBChangeOp\\CMDBChangeOpAttachmentAddedFactory' => __DIR__ . '/../..' . '/sources/Application/UI/Base/Layout/ActivityPanel/ActivityEntry/CMDBChangeOp/CMDBChangeOpAttachmentAddedFactory.php',
|
||||
@@ -897,7 +897,6 @@ class ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f
|
||||
'Combodo\\iTop\\Forms\\IO\\Converter\\AbstractConverter' => __DIR__ . '/../..' . '/sources/Forms/IO/Converter/AbstractConverter.php',
|
||||
'Combodo\\iTop\\Forms\\IO\\Converter\\ChoiceValueToLabelConverter' => __DIR__ . '/../..' . '/sources/Forms/IO/Converter/ChoiceValueToLabelConverter.php',
|
||||
'Combodo\\iTop\\Forms\\IO\\Converter\\OqlToClassConverter' => __DIR__ . '/../..' . '/sources/Forms/IO/Converter/OqlToClassConverter.php',
|
||||
'Combodo\\iTop\\Forms\\IO\\Converter\\StringToAttributeConverter' => __DIR__ . '/../..' . '/sources/Forms/IO/Converter/StringToAttributeConverter.php',
|
||||
'Combodo\\iTop\\Forms\\IO\\FormBinding' => __DIR__ . '/../..' . '/sources/Forms/IO/FormBinding.php',
|
||||
'Combodo\\iTop\\Forms\\IO\\FormBlockIOException' => __DIR__ . '/../..' . '/sources/Forms/IO/FormBlockIOException.php',
|
||||
'Combodo\\iTop\\Forms\\IO\\FormInput' => __DIR__ . '/../..' . '/sources/Forms/IO/FormInput.php',
|
||||
|
||||
@@ -9,20 +9,27 @@ namespace Combodo\iTop\Application\UI\Base\Component\TurboUpdate;
|
||||
|
||||
use Combodo\iTop\Application\UI\Base\Layout\UIContentBlock;
|
||||
|
||||
class TurboUpdate extends UIContentBlock
|
||||
class TurboStream extends UIContentBlock
|
||||
{
|
||||
// Overloaded constants
|
||||
public const DEFAULT_HTML_TEMPLATE_REL_PATH = 'base/components/turbo-update/layout';
|
||||
public const DEFAULT_HTML_TEMPLATE_REL_PATH = 'base/components/turbo-stream/layout';
|
||||
private string $sTarget;
|
||||
private string $sAction;
|
||||
|
||||
public function __construct(string $sTarget, string $sId = null)
|
||||
public function __construct(string $sTarget, string $sAction, string $sId = null)
|
||||
{
|
||||
parent::__construct($sId);
|
||||
$this->sTarget = $sTarget;
|
||||
$this->sAction = $sAction;
|
||||
}
|
||||
|
||||
public function GetTarget(): string
|
||||
{
|
||||
return $this->sTarget;
|
||||
}
|
||||
|
||||
public function GetAction(): string
|
||||
{
|
||||
return $this->sAction;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* @copyright Copyright (C) 2010-2025 Combodo SAS
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
namespace Combodo\iTop\Application\UI\Base\Component\TurboUpdate;
|
||||
|
||||
use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory;
|
||||
|
||||
/**
|
||||
* Class TurboUpdateUIBlockFactory
|
||||
*
|
||||
* @api
|
||||
* @since 3.3.0
|
||||
* @package UIBlockAPI
|
||||
*/
|
||||
class TurboStreamUIBlockFactory extends AbstractUIBlockFactory
|
||||
{
|
||||
/** @inheritDoc */
|
||||
public const TWIG_TAG_NAME = 'UITurboStream';
|
||||
/** @inheritDoc */
|
||||
public const UI_BLOCK_CLASS_NAME = TurboStream::class;
|
||||
|
||||
/**
|
||||
* @api
|
||||
*
|
||||
* @param string $sTarget Id of the block to update
|
||||
* @param string|null $sId
|
||||
*
|
||||
* @return \Combodo\iTop\Application\UI\Base\Component\TurboUpdate\TurboStream An HTML form in which you can add UIBlocks
|
||||
*/
|
||||
public static function MakeUpdate(string $sTarget, string $sId = null): TurboStream
|
||||
{
|
||||
return new TurboStream($sTarget, 'update', $sId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @api
|
||||
*
|
||||
* @param string $sTarget Id of the block to update
|
||||
* @param string|null $sId
|
||||
*
|
||||
* @return \Combodo\iTop\Application\UI\Base\Component\TurboUpdate\TurboStream An HTML form in which you can add UIBlocks
|
||||
*/
|
||||
public static function MakeReplace(string $sTarget, string $sId = null): TurboStream
|
||||
{
|
||||
return new TurboStream($sTarget, 'replace', $sId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @api
|
||||
*
|
||||
* @param string $sTarget Id of the block to update
|
||||
* @param string|null $sId
|
||||
*
|
||||
* @return \Combodo\iTop\Application\UI\Base\Component\TurboUpdate\TurboStream An HTML form in which you can add UIBlocks
|
||||
*/
|
||||
public static function MakePrepend(string $sTarget, string $sId = null): TurboStream
|
||||
{
|
||||
return new TurboStream($sTarget, 'prepend', $sId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @api
|
||||
*
|
||||
* @param string $sTarget Id of the block to update
|
||||
* @param string|null $sId
|
||||
*
|
||||
* @return \Combodo\iTop\Application\UI\Base\Component\TurboUpdate\TurboStream An HTML form in which you can add UIBlocks
|
||||
*/
|
||||
public static function MakeAppend(string $sTarget, string $sId = null): TurboStream
|
||||
{
|
||||
return new TurboStream($sTarget, 'append', $sId);
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* @copyright Copyright (C) 2010-2025 Combodo SAS
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
namespace Combodo\iTop\Application\UI\Base\Component\TurboUpdate;
|
||||
|
||||
use Combodo\iTop\Application\UI\Base\AbstractUIBlockFactory;
|
||||
|
||||
/**
|
||||
* Class TurboUpdateUIBlockFactory
|
||||
*
|
||||
* @api
|
||||
* @since 3.3.0
|
||||
* @package UIBlockAPI
|
||||
*/
|
||||
class TurboUpdateUIBlockFactory extends AbstractUIBlockFactory
|
||||
{
|
||||
/** @inheritDoc */
|
||||
public const TWIG_TAG_NAME = 'UITurboUpdate';
|
||||
/** @inheritDoc */
|
||||
public const UI_BLOCK_CLASS_NAME = TurboUpdate::class;
|
||||
|
||||
/**
|
||||
* @api
|
||||
*
|
||||
* @param string $sTarget Id of the block to update
|
||||
* @param string|null $sId
|
||||
*
|
||||
* @return \Combodo\iTop\Application\UI\Base\Component\TurboUpdate\TurboUpdate An HTML form in which you can add UIBlocks
|
||||
*/
|
||||
public static function MakeStandard(string $sTarget, string $sId = null): TurboUpdate
|
||||
{
|
||||
return new TurboUpdate($sTarget, $sId);
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@ use Combodo\iTop\Forms\IO\FormInput;
|
||||
use Combodo\iTop\Forms\IO\FormOutput;
|
||||
use Combodo\iTop\Forms\Register\IORegister;
|
||||
use Combodo\iTop\Forms\Register\OptionsRegister;
|
||||
use Combodo\iTop\Forms\Register\RegisterException;
|
||||
|
||||
/**
|
||||
* Abstract form block.
|
||||
@@ -101,6 +102,7 @@ abstract class AbstractFormBlock implements IFormBlock
|
||||
*
|
||||
* @param OptionsRegister $oOptionsRegister
|
||||
*
|
||||
* @throws RegisterException
|
||||
*/
|
||||
protected function RegisterOptions(OptionsRegister $oOptionsRegister): void
|
||||
{
|
||||
|
||||
@@ -10,6 +10,7 @@ namespace Combodo\iTop\Forms\Block;
|
||||
use Combodo\iTop\Forms\IO\Format\BooleanIOFormat;
|
||||
use Combodo\iTop\Forms\Register\IORegister;
|
||||
use Combodo\iTop\Forms\Register\OptionsRegister;
|
||||
use Combodo\iTop\Forms\Register\RegisterException;
|
||||
|
||||
abstract class AbstractTypeFormBlock extends AbstractFormBlock
|
||||
{
|
||||
@@ -47,10 +48,12 @@ abstract class AbstractTypeFormBlock extends AbstractFormBlock
|
||||
if (!$oInput->IsBound()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$bVisible = $oInput->GetValue($sEventType);
|
||||
|
||||
return $bVisible !== null && $bVisible->IsTrue();
|
||||
else if (!$oInput->HasEventValue($sEventType)) {
|
||||
return false;
|
||||
}
|
||||
else{
|
||||
return $oInput->GetValue($sEventType)->IsTrue();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -83,7 +86,10 @@ abstract class AbstractTypeFormBlock extends AbstractFormBlock
|
||||
$this->bIsAddedToForm = $bIsAdded;
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
/** @inheritdoc
|
||||
* @throws RegisterException
|
||||
* @throws FormBlockException
|
||||
*/
|
||||
public function UpdateOptions(OptionsRegister $oOptionsRegister): void
|
||||
{
|
||||
parent::UpdateOptions($oOptionsRegister);
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
namespace Combodo\iTop\Forms\Block\Base;
|
||||
|
||||
use Combodo\iTop\Forms\Block\AbstractTypeFormBlock;
|
||||
use Combodo\iTop\Forms\IO\Converter\BoolConverter;
|
||||
use Combodo\iTop\Forms\IO\Format\BooleanIOFormat;
|
||||
use Combodo\iTop\Forms\Register\IORegister;
|
||||
use Combodo\iTop\Forms\Register\OptionsRegister;
|
||||
|
||||
@@ -12,6 +12,7 @@ use Combodo\iTop\Forms\FormType\Base\CollectionFormType;
|
||||
use Combodo\iTop\Forms\IO\Format\ClassIOFormat;
|
||||
use Combodo\iTop\Forms\Register\IORegister;
|
||||
use Combodo\iTop\Forms\Register\OptionsRegister;
|
||||
use Combodo\iTop\Forms\Register\RegisterException;
|
||||
|
||||
/**
|
||||
* Collection form type.
|
||||
@@ -73,8 +74,14 @@ class CollectionBlock extends AbstractTypeFormBlock
|
||||
$sBlockEntryOptions = $this->GetOption('block_entry_options');
|
||||
$this->oPrototypeBlock = new ($sBlockEntryType)('prototype', $sBlockEntryOptions);
|
||||
|
||||
$oOptionsRegister->SetOption('entry_type', $this->oPrototypeBlock->GetFormType());
|
||||
$oOptionsRegister->SetOption('entry_options', $this->oPrototypeBlock->GetOptions());
|
||||
try{
|
||||
$oOptionsRegister->SetOption('entry_type', $this->oPrototypeBlock->GetFormType());
|
||||
$oOptionsRegister->SetOption('entry_options', $this->oPrototypeBlock->GetOptions());
|
||||
}
|
||||
catch(RegisterException $e){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ namespace Combodo\iTop\Forms\Block\DataModel;
|
||||
|
||||
use Combodo\iTop\Service\DependencyInjection\DIService;
|
||||
use Combodo\iTop\Forms\Block\Base\ChoiceFormBlock;
|
||||
use Combodo\iTop\Forms\IO\Converter\StringToAttributeConverter;
|
||||
use Combodo\iTop\Forms\IO\Format\AttributeIOFormat;
|
||||
use Combodo\iTop\Forms\IO\Format\ClassIOFormat;
|
||||
use Combodo\iTop\Forms\Register\IORegister;
|
||||
@@ -41,7 +40,7 @@ class AttributeChoiceFormBlock extends ChoiceFormBlock
|
||||
{
|
||||
parent::RegisterIO($oIORegister);
|
||||
$oIORegister->AddInput(self::INPUT_CLASS_NAME, ClassIOFormat::class);
|
||||
$oIORegister->AddOutput(self::OUTPUT_ATTRIBUTE, AttributeIOFormat::class, new StringToAttributeConverter());
|
||||
$oIORegister->AddOutput(self::OUTPUT_ATTRIBUTE, AttributeIOFormat::class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -44,7 +44,6 @@ class FormTypeHelper
|
||||
|
||||
// Get the form corresponding to the turbo trigger
|
||||
$oFormTurboTrigger = self::GetFormAt($oForm, $sBlockTurboTriggerName);
|
||||
$sBlockTurboTriggerId = self::GetFormId($oFormTurboTrigger);
|
||||
|
||||
// Get the parent form
|
||||
$oParent = $oFormTurboTrigger->getParent();
|
||||
@@ -54,9 +53,6 @@ class FormTypeHelper
|
||||
$oBlockTurboTrigger = $oFormTurboTrigger->getConfig()->getOption('form_block');
|
||||
$oMap = $oBlockTurboTrigger->GetParent()->GetDependenciesMap();
|
||||
|
||||
// Add itself
|
||||
$aBlocksToRedraw[$sBlockTurboTriggerId] = $oFormTurboTrigger->createView();
|
||||
|
||||
// Add impacted blocks
|
||||
$aImpacted = $oMap->GetBlocksImpactedBy($oBlockTurboTrigger->GetName());
|
||||
foreach ($aImpacted as $oImpactedBlock) {
|
||||
@@ -69,7 +65,10 @@ class FormTypeHelper
|
||||
|
||||
}
|
||||
|
||||
return $aBlocksToRedraw;
|
||||
return [
|
||||
'blocks_to_redraw' => $aBlocksToRedraw,
|
||||
'current_block' => $oFormTurboTrigger->createView(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* @copyright Copyright (C) 2010-2025 Combodo SARL
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
namespace Combodo\iTop\Forms\IO\Converter;
|
||||
|
||||
use Combodo\iTop\Forms\IO\Format\AttributeIOFormat;
|
||||
|
||||
/**
|
||||
* String to attribute converter.
|
||||
*/
|
||||
class StringToAttributeConverter extends AbstractConverter
|
||||
{
|
||||
/** @inheritdoc */
|
||||
public function Convert(mixed $oData): ?AttributeIOFormat
|
||||
{
|
||||
if ($oData === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new AttributeIOFormat($oData);
|
||||
}
|
||||
}
|
||||
@@ -44,7 +44,8 @@ class FormOutput extends AbstractFormIO
|
||||
public function ConvertValue(mixed $oData): mixed
|
||||
{
|
||||
if (is_null($this->oConverter)) {
|
||||
return $oData;
|
||||
$sType = $this->GetDataType();
|
||||
return new $sType($oData);
|
||||
}
|
||||
|
||||
return $this->oConverter->Convert($oData);
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
{%- endblock form_row -%}
|
||||
|
||||
{%- block form_errors -%}
|
||||
<div class="form-error">
|
||||
<div id="turbo_error_{{ form.vars.id }}" class="form-error">
|
||||
{{- parent() -}}
|
||||
</div>
|
||||
{%- endblock form_errors -%}
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
{# @copyright Copyright (C) 2010-2025 Combodo SARL #}
|
||||
{# @license http://opensource.org/licenses/AGPL-3.0 #}
|
||||
|
||||
<turbo-stream action="update" target="turbo_itop_profiler">
|
||||
<template>
|
||||
{% if aProfilesInfo is not empty %}
|
||||
{% UIPanel Neutral { sTitle:'Debug' } %}
|
||||
{% for aProfileInfo in aProfilesInfo %}
|
||||
{% set aProfileData = aProfileInfo.aProfileData %}
|
||||
{{ include(aProfileInfo.sTemplate) }}
|
||||
{% endfor %}
|
||||
{% EndUIPanel %}
|
||||
{% endif %}
|
||||
</template>
|
||||
</turbo-stream>
|
||||
{% UITurboStream Update { sTarget: "turbo_itop_profiler"} %}
|
||||
{% if aProfilesInfo is not empty %}
|
||||
{% UIPanel Neutral { sTitle:'Debug' } %}
|
||||
{% for aProfileInfo in aProfilesInfo %}
|
||||
{% set aProfileData = aProfileInfo.aProfileData %}
|
||||
{{ include(aProfileInfo.sTemplate) }}
|
||||
{% endfor %}
|
||||
{% EndUIPanel %}
|
||||
{% endif %}
|
||||
{% EndUITurboStream %}
|
||||
@@ -1,8 +1,8 @@
|
||||
{# @copyright Copyright (C) 2010-2025 Combodo SARL #}
|
||||
{# @license http://opensource.org/licenses/AGPL-3.0 #}
|
||||
|
||||
{% UITurboUpdate Standard { sTarget: "turbo_itop_error"} %}
|
||||
{% UITurboStream Update { sTarget: "turbo_itop_error"} %}
|
||||
{% if sControllerError %}
|
||||
{% UIAlert ForDanger { sTitle:'', sContent:sControllerError } %}{% EndUIAlert %}
|
||||
{% endif %}
|
||||
{% EndUITurboUpdate %}
|
||||
{% EndUITurboStream %}
|
||||
@@ -2,11 +2,14 @@
|
||||
{# @license http://opensource.org/licenses/AGPL-3.0 #}
|
||||
|
||||
{% for sBlockIdentifier, oBlockToRedraw in blocks_to_redraw %}
|
||||
{% UITurboUpdate Standard { sTarget: "turbo_" ~ sBlockIdentifier} %}
|
||||
{% UITurboStream Update { sTarget: "turbo_" ~ sBlockIdentifier} %}
|
||||
{% if oBlockToRedraw is not null %}
|
||||
{{ form_row(oBlockToRedraw) }}
|
||||
{# {% else %}#}
|
||||
{# <div style="background-color: #ecd9eb;border-radius: 6px;padding: 2px 5px;">Reserved place for <b>{{ sBlockIdentifier }}</b></div>#}
|
||||
{% endif %}
|
||||
{% EndUITurboUpdate %}
|
||||
{% endfor %}
|
||||
{% EndUITurboStream %}
|
||||
{% endfor %}
|
||||
{% if current_block %}
|
||||
{% UITurboStream Replace { sTarget: "turbo_error_" ~ current_block.vars.id} %}
|
||||
{{ form_errors(current_block) }}
|
||||
{% EndUITurboStream %}
|
||||
{% endif %}
|
||||
@@ -1,7 +1,7 @@
|
||||
{# @copyright Copyright (C) 2010-2025 Combodo SAS #}
|
||||
{# @license http://opensource.org/licenses/AGPL-3.0 #}
|
||||
|
||||
<turbo-stream action="update" target="{{ oUIBlock.GetTarget() }}">
|
||||
<turbo-stream action="{{ oUIBlock.GetAction() }}" target="{{ oUIBlock.GetTarget() }}">
|
||||
<template>
|
||||
{%- block iboContentBlockContainer -%}
|
||||
{% for oSubBlock in oUIBlock.GetSubBlocks() %}
|
||||
@@ -69,6 +69,10 @@
|
||||
<file>../../core/apc-emulation.php</file>
|
||||
<file>../../core/ormlinkset.class.inc.php</file>
|
||||
<file>../../datamodels/2.x/itop-tickets/main.itop-tickets.php</file>
|
||||
<file>../../sources/Forms/Block/AbstractTypeFormBlock.php</file>
|
||||
<file>../../sources/Forms/Block/AbstractFormBlock.php</file>
|
||||
<file>../../sources/Forms/Block/Base/FormBlock.php</file>
|
||||
<!-- <folder>../../sources</folder>-->
|
||||
</whitelist>
|
||||
</filter>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user