mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Documentation
This commit is contained in:
@@ -7033,9 +7033,11 @@ abstract class MetaModel
|
||||
/**
|
||||
* (Re)Init the global service locator with a configuration file
|
||||
*
|
||||
* @param string|null $sRelativeConfigFileName default to the runtime config file
|
||||
* @param string|null $sRelativeConfigFileName default to the runtime config file when null
|
||||
*
|
||||
* @return void
|
||||
* @api
|
||||
* @since 3.3.0
|
||||
*/
|
||||
public static function InitServiceLocator(string $sRelativeConfigFileName = null): void
|
||||
{
|
||||
@@ -7048,16 +7050,16 @@ abstract class MetaModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Get configured service
|
||||
*
|
||||
* @see conf/production/ServiceLocatorRuntimeConfig.php
|
||||
* Get configured service using a service locator
|
||||
*
|
||||
* Example: $oModelReflection = \MetaModel::GetService('ModelReflexion');
|
||||
*
|
||||
* @param string $sServiceName
|
||||
* @param string $sServiceName Name of the service to get
|
||||
*
|
||||
* @return mixed
|
||||
* @return mixed The service object instance corresponding to the service name
|
||||
* @throws \Combodo\iTop\Service\ServiceLocator\ServiceLocatorException
|
||||
* @api
|
||||
* @since 3.3.0
|
||||
*/
|
||||
public static function GetService(string $sServiceName): mixed
|
||||
{
|
||||
|
||||
@@ -151,6 +151,7 @@ abstract class Controller extends AbstractController
|
||||
* @param array $aThemes
|
||||
*
|
||||
* @return void
|
||||
* @throws \Combodo\iTop\Service\ServiceLocator\ServiceLocatorException
|
||||
* @throws \ReflectionException
|
||||
* @throws \Twig\Error\LoaderError
|
||||
*/
|
||||
|
||||
@@ -23,6 +23,7 @@ use Combodo\iTop\Forms\Register\RegisterException;
|
||||
*
|
||||
* @package Combodo\iTop\Forms\Block
|
||||
* @since 3.3.0
|
||||
* @api
|
||||
*/
|
||||
abstract class AbstractFormBlock implements IFormBlock
|
||||
{
|
||||
@@ -119,6 +120,7 @@ abstract class AbstractFormBlock implements IFormBlock
|
||||
* @param OptionsRegister $oOptionsRegister
|
||||
*
|
||||
* @throws RegisterException
|
||||
* @api
|
||||
*/
|
||||
protected function RegisterOptions(OptionsRegister $oOptionsRegister): void
|
||||
{
|
||||
@@ -130,6 +132,7 @@ abstract class AbstractFormBlock implements IFormBlock
|
||||
* @param array $aOptions
|
||||
*
|
||||
* @return void
|
||||
* @throws \Combodo\iTop\Forms\Register\RegisterException
|
||||
*/
|
||||
private function SetOptions(array $aOptions): void
|
||||
{
|
||||
|
||||
@@ -18,11 +18,23 @@ use Combodo\iTop\Forms\Register\RegisterException;
|
||||
*
|
||||
* @package Combodo\iTop\Forms\Block
|
||||
* @since 3.3.0
|
||||
* @api
|
||||
*/
|
||||
abstract class AbstractTypeFormBlock extends AbstractFormBlock
|
||||
{
|
||||
// Inputs
|
||||
/**
|
||||
* Boolean input to display or not the block
|
||||
* (visible by default)
|
||||
* @api
|
||||
*/
|
||||
public const INPUT_VISIBLE = 'visible';
|
||||
|
||||
/**
|
||||
* Boolean input to enable/disable the block
|
||||
* (enabled by default)
|
||||
* @api
|
||||
*/
|
||||
public const INPUT_ENABLE = 'enable';
|
||||
|
||||
/** @var bool flag indicating the form insertion */
|
||||
|
||||
@@ -17,12 +17,17 @@ use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||
* A block to manage a checkbox.
|
||||
* This block expose one output: whether the checkbox is checked or not.
|
||||
*
|
||||
* @package Combodo\iTop\Forms\Block\Base
|
||||
* @api
|
||||
* @package FormBlock
|
||||
* @since 3.3.0
|
||||
*/
|
||||
class CheckboxFormBlock extends AbstractTypeFormBlock
|
||||
{
|
||||
// outputs
|
||||
// Outputs
|
||||
/**
|
||||
* Boolean output whether the checkbox is checked or not
|
||||
* @api
|
||||
*/
|
||||
public const OUTPUT_CHECKED = 'checked';
|
||||
|
||||
/** @inheritdoc */
|
||||
|
||||
@@ -18,14 +18,23 @@ use Combodo\iTop\Forms\Register\OptionsRegister;
|
||||
* A block to manage a list of choices.
|
||||
* This block expose two outputs: the label and the value of the selected choice.
|
||||
*
|
||||
* @package Combodo\iTop\Forms\Block\Base
|
||||
* @api
|
||||
* @package FormBlock
|
||||
* @since 3.3.0
|
||||
*/
|
||||
class ChoiceFormBlock extends AbstractTypeFormBlock
|
||||
{
|
||||
// Outputs
|
||||
/**
|
||||
* String output of the label of the selected choice
|
||||
* @api
|
||||
*/
|
||||
public const OUTPUT_LABEL = 'label';
|
||||
public const OUTPUT_VALUE = 'value';
|
||||
|
||||
/**
|
||||
* String output of the value of the selected choice
|
||||
* @api
|
||||
*/ public const OUTPUT_VALUE = 'value';
|
||||
|
||||
/** @inheritdoc */
|
||||
public function GetFormType(): string
|
||||
|
||||
@@ -13,7 +13,8 @@ use Combodo\iTop\Forms\Register\OptionsRegister;
|
||||
/**
|
||||
* A block to manage a list of choices given by forms inputs current values.
|
||||
*
|
||||
* @package Combodo\iTop\Forms\Block\Base
|
||||
* @api
|
||||
* @package FormBlock
|
||||
* @since 3.3.0
|
||||
*/
|
||||
class ChoiceFromInputsBlock extends ChoiceFormBlock
|
||||
|
||||
@@ -14,7 +14,8 @@ use utils;
|
||||
* A block to manage a list of images.
|
||||
* This block expose two outputs: the label and the value of the selected choice.
|
||||
*
|
||||
* @package Combodo\iTop\Forms\Block\Base
|
||||
* @api
|
||||
* @package FormBlock
|
||||
* @since 3.3.0
|
||||
*/
|
||||
class ChoiceImageFormBlock extends ChoiceFormBlock
|
||||
|
||||
@@ -19,13 +19,19 @@ use Combodo\iTop\Forms\Register\RegisterException;
|
||||
/**
|
||||
* A block to manage collections of form blocks.
|
||||
*
|
||||
* @package Combodo\iTop\Forms\Block\Base
|
||||
* @api
|
||||
* @package FormBlock
|
||||
* @since 3.3.0
|
||||
*/
|
||||
class CollectionBlock extends AbstractTypeFormBlock
|
||||
{
|
||||
/** @var AbstractTypeFormBlock Prototype block */
|
||||
private AbstractTypeFormBlock $oPrototypeBlock;
|
||||
|
||||
/**
|
||||
* Integer output value giving the number of entries in the collection
|
||||
* @api
|
||||
*/
|
||||
public const OUTPUT_COUNT = 'count';
|
||||
|
||||
/** @inheritdoc */
|
||||
|
||||
@@ -14,7 +14,8 @@ use Symfony\Component\Form\Extension\Core\Type\DateType;
|
||||
/**
|
||||
* A block to manage a date field.
|
||||
*
|
||||
* @package Combodo\iTop\Forms\Block\Base
|
||||
* @api
|
||||
* @package FormBlock
|
||||
* @since 3.3.0
|
||||
*/
|
||||
class DateFormBlock extends AbstractTypeFormBlock
|
||||
|
||||
@@ -14,7 +14,8 @@ use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
|
||||
/**
|
||||
* A block to manage a date and time field
|
||||
*
|
||||
* @package Combodo\iTop\Forms\Block\Base
|
||||
* @api
|
||||
* @package FormBlock
|
||||
* @since 3.3.0
|
||||
*/
|
||||
class DateTimeFormBlock extends AbstractTypeFormBlock
|
||||
|
||||
@@ -21,7 +21,8 @@ use ReflectionException;
|
||||
/**
|
||||
* A block to manage a form with children.
|
||||
*
|
||||
* @package Combodo\iTop\Forms\Block\Base
|
||||
* @api
|
||||
* @package FormBlock
|
||||
* @since 3.3.0
|
||||
*/
|
||||
class FormBlock extends AbstractTypeFormBlock
|
||||
@@ -77,6 +78,7 @@ class FormBlock extends AbstractTypeFormBlock
|
||||
* @return $this
|
||||
* @throws ReflectionException
|
||||
* @throws FormBlockException
|
||||
* @api
|
||||
*/
|
||||
public function Add(string $sName, string $sBlockClass, array $aOptions = []): AbstractFormBlock
|
||||
{
|
||||
@@ -148,6 +150,7 @@ class FormBlock extends AbstractTypeFormBlock
|
||||
/**
|
||||
* Build the form.
|
||||
*
|
||||
* @api
|
||||
* @return void
|
||||
*/
|
||||
protected function BuildForm(): void
|
||||
|
||||
@@ -13,7 +13,8 @@ use Symfony\Component\Form\Extension\Core\Type\HiddenType;
|
||||
/**
|
||||
* A block to manage a hidden field
|
||||
*
|
||||
* @package Combodo\iTop\Forms\Block\Base
|
||||
* @api
|
||||
* @package FormBlock
|
||||
* @since 3.3.0
|
||||
*/
|
||||
class HiddenFormBlock extends AbstractTypeFormBlock
|
||||
|
||||
@@ -17,11 +17,16 @@ use Symfony\Component\Form\Extension\Core\Type\IntegerType;
|
||||
* A block to manage an integer
|
||||
* This block exposes a single output: the integer value.
|
||||
*
|
||||
* @package Combodo\iTop\Forms\Block\Base
|
||||
* @api
|
||||
* @package FormBlock
|
||||
* @since 3.3.0
|
||||
*/
|
||||
class IntegerFormBlock extends AbstractTypeFormBlock
|
||||
{
|
||||
/**
|
||||
* Integer output giving the value entered
|
||||
* @api
|
||||
*/
|
||||
public const OUTPUT_INTEGER = 'integer';
|
||||
|
||||
public function GetFormType(): string
|
||||
|
||||
@@ -16,12 +16,17 @@ use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
||||
* A block to manage a number input.
|
||||
* This block exposes a single output: the number value.
|
||||
*
|
||||
* @package Combodo\iTop\Forms\Block\Base
|
||||
* @api
|
||||
* @package FormBlock
|
||||
* @since 3.3.0
|
||||
*/
|
||||
class NumberFormBlock extends AbstractTypeFormBlock
|
||||
{
|
||||
// Outputs
|
||||
/**
|
||||
* Number output giving the value entered
|
||||
* @api
|
||||
*/
|
||||
public const OUTPUT_NUMBER = "number";
|
||||
|
||||
/** @inheritdoc */
|
||||
|
||||
@@ -9,6 +9,13 @@ namespace Combodo\iTop\Forms\Block\Base;
|
||||
|
||||
use Combodo\iTop\Forms\Block\AbstractFormBlock;
|
||||
|
||||
/**
|
||||
* A block that can be instantiated into other block type
|
||||
*
|
||||
* @api
|
||||
* @package FormBlock
|
||||
* @since 3.3.0
|
||||
*/
|
||||
class PolymorphicFormBlock extends AbstractFormBlock
|
||||
{
|
||||
}
|
||||
|
||||
@@ -13,7 +13,8 @@ use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||
/**
|
||||
* A block to manage a textarea.
|
||||
*
|
||||
* @package Combodo\iTop\Forms\Block\Base
|
||||
* @api
|
||||
* @package FormBlock
|
||||
* @since 3.3.0
|
||||
*/
|
||||
class TextAreaFormBlock extends AbstractTypeFormBlock
|
||||
|
||||
@@ -16,12 +16,17 @@ use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
* A block to manage a text input.
|
||||
* This block exposes a single text output.
|
||||
*
|
||||
* @package Combodo\iTop\Forms\Block\Base
|
||||
* @api
|
||||
* @package FormBlock
|
||||
* @since 3.3.0
|
||||
*/
|
||||
class TextFormBlock extends AbstractTypeFormBlock
|
||||
{
|
||||
// Outputs
|
||||
/**
|
||||
* String output giving the value entered
|
||||
* @api
|
||||
*/
|
||||
public const OUTPUT_TEXT = "text";
|
||||
|
||||
/** @inheritdoc */
|
||||
|
||||
@@ -22,16 +22,29 @@ use utils;
|
||||
/**
|
||||
* A block to choose an attribute from a given class.
|
||||
*
|
||||
* @package Combodo\iTop\Forms\Block\DataModel
|
||||
* @api
|
||||
* @package FormBlock
|
||||
* @since 3.3.0
|
||||
*/
|
||||
class AttributeChoiceFormBlock extends ChoiceFormBlock
|
||||
{
|
||||
// inputs
|
||||
/**
|
||||
* Class input reflecting the selected class
|
||||
* @api
|
||||
*/
|
||||
public const INPUT_CLASS_NAME = 'class';
|
||||
/**
|
||||
* String input for the category of attributes to select from
|
||||
* @api
|
||||
*/
|
||||
public const INPUT_CATEGORY = 'category';
|
||||
|
||||
// outputs
|
||||
/**
|
||||
* String output of the selected attribute
|
||||
* @api
|
||||
*/
|
||||
public const OUTPUT_ATTRIBUTE = 'attribute';
|
||||
|
||||
/** @inheritdoc */
|
||||
@@ -61,7 +74,7 @@ class AttributeChoiceFormBlock extends ChoiceFormBlock
|
||||
/**
|
||||
* @inheritdoc
|
||||
*
|
||||
* @throws ServiceLocationException
|
||||
* @throws ServiceLocatorException
|
||||
* @throws FormBlockException
|
||||
* @throws RegisterException
|
||||
*/
|
||||
|
||||
@@ -15,12 +15,17 @@ use Combodo\iTop\Forms\Register\OptionsRegister;
|
||||
/**
|
||||
* A block to choose an attribute type.
|
||||
*
|
||||
* @package Combodo\iTop\Forms\Block\DataModel
|
||||
* @api
|
||||
* @package FormBlock
|
||||
* @since 3.3.0
|
||||
*/
|
||||
class AttributeTypeChoiceFormBlock extends ChoiceFormBlock
|
||||
{
|
||||
// outputs
|
||||
/**
|
||||
* String output of the selected attribute type
|
||||
* @api
|
||||
*/
|
||||
public const OUTPUT_ATTRIBUTE_TYPE = 'output_type';
|
||||
|
||||
/** @inheritdoc */
|
||||
@@ -29,10 +34,13 @@ class AttributeTypeChoiceFormBlock extends ChoiceFormBlock
|
||||
parent::RegisterOptions($oOptionsRegister);
|
||||
$oOptionsRegister->SetOption('placeholder', 'Select a type...');
|
||||
$oOptionsRegister->SetOption('choices', [
|
||||
'numeric' => 'numeric',
|
||||
'group_by' => 'group_by',
|
||||
'date' => 'date',
|
||||
'enum' => 'enum',
|
||||
'numeric' => 'numeric',
|
||||
'groupable' => 'groupable',
|
||||
'date' => 'date',
|
||||
'enum' => 'enum',
|
||||
'link' => 'link',
|
||||
'string' => 'string',
|
||||
'all' => 'all',
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
@@ -19,13 +19,22 @@ use Exception;
|
||||
/**
|
||||
* A block to choose some values from attribute of a given class.
|
||||
*
|
||||
* @package Combodo\iTop\Forms\Block\DataModel
|
||||
* @api
|
||||
* @package FormBlock
|
||||
* @since 3.3.0
|
||||
*/
|
||||
class AttributeValueChoiceFormBlock extends ChoiceFormBlock
|
||||
{
|
||||
// inputs
|
||||
/**
|
||||
* Class input reflecting the selected class
|
||||
* @api
|
||||
*/
|
||||
public const INPUT_CLASS_NAME = 'class';
|
||||
/**
|
||||
* String input reflecting the selected attribute
|
||||
* @api
|
||||
*/
|
||||
public const INPUT_ATTRIBUTE = 'attribute';
|
||||
|
||||
/** @inheritdoc */
|
||||
|
||||
@@ -17,11 +17,16 @@ use Dict;
|
||||
/**
|
||||
* A block to manage an aggregation function list
|
||||
*
|
||||
* @package Combodo\iTop\Forms\Block\DataModel\Dashlet
|
||||
* @api
|
||||
* @package FormBlock
|
||||
* @since 3.3.0
|
||||
*/
|
||||
class AggregateFunctionFormBlock extends ChoiceFormBlock
|
||||
{
|
||||
/**
|
||||
* Class input reflecting the selected class
|
||||
* @api
|
||||
*/
|
||||
public const INPUT_CLASS_NAME = 'class';
|
||||
|
||||
/** @inheritdoc */
|
||||
|
||||
@@ -17,7 +17,8 @@ use Exception;
|
||||
/**
|
||||
* A block to manage an attribute of a data model class for grouping purpose
|
||||
*
|
||||
* @package Combodo\iTop\Forms\Block\DataModel\Dashlet
|
||||
* @api
|
||||
* @package FormBlock
|
||||
* @since 3.3.0
|
||||
*/
|
||||
class ClassAttributeGroupByFormBlock extends AttributeChoiceFormBlock
|
||||
|
||||
@@ -9,6 +9,13 @@ namespace Combodo\iTop\Forms\Block\DataModel;
|
||||
|
||||
use Combodo\iTop\Forms\Block\Base\TextFormBlock;
|
||||
|
||||
/**
|
||||
* A block to input text matching dictionary entry
|
||||
*
|
||||
* @api
|
||||
* @package FormBlock
|
||||
* @since 3.3.0
|
||||
*/
|
||||
class LabelFormBlock extends TextFormBlock
|
||||
{
|
||||
}
|
||||
|
||||
@@ -18,12 +18,17 @@ use Combodo\iTop\Forms\Register\OptionsRegister;
|
||||
* A block to manage OQL expression input.
|
||||
* This block exposes an output providing the selected class from the OQL.
|
||||
*
|
||||
* @package Combodo\iTop\Forms\Block\DataModel
|
||||
* @api
|
||||
* @package FormBlock
|
||||
* @since 3.3.0
|
||||
*/
|
||||
class OqlFormBlock extends TextAreaFormBlock
|
||||
{
|
||||
// outputs
|
||||
/**
|
||||
* Class output reflecting the selected class
|
||||
* @api
|
||||
*/
|
||||
public const OUTPUT_SELECTED_CLASS = 'selected_class';
|
||||
|
||||
/** @inheritdoc */
|
||||
|
||||
@@ -18,7 +18,8 @@ use Symfony\Component\Form\FormEvents;
|
||||
/**
|
||||
* An abstract block to manage an expression.
|
||||
*
|
||||
* @package Combodo\iTop\Forms\Block\Expression
|
||||
* @api
|
||||
* @package FormBlock
|
||||
* @since 3.3.0
|
||||
*/
|
||||
abstract class AbstractExpressionFormBlock extends AbstractFormBlock
|
||||
|
||||
@@ -15,13 +15,23 @@ use Combodo\iTop\Forms\Register\IORegister;
|
||||
* An abstract block to manage an expression.
|
||||
* This block expose two boolean outputs: the result of the expression and its negation.
|
||||
*
|
||||
* @package Combodo\iTop\Forms\Block\Expression
|
||||
* @api
|
||||
* @package FormBlock
|
||||
* @since 3.3.0
|
||||
*/
|
||||
class BooleanExpressionFormBlock extends AbstractExpressionFormBlock
|
||||
{
|
||||
// Outputs
|
||||
/**
|
||||
* Boolean output of the result of the expression
|
||||
* @api
|
||||
*/
|
||||
public const OUTPUT_RESULT = "result";
|
||||
|
||||
/**
|
||||
* Boolean output of the negation of the result of the expression
|
||||
* @api
|
||||
*/
|
||||
public const OUTPUT_NOT_RESULT = "not_result";
|
||||
|
||||
/** @inheritdoc */
|
||||
|
||||
@@ -12,15 +12,21 @@ use Combodo\iTop\Forms\IO\Format\NumberIOFormat;
|
||||
use Combodo\iTop\Forms\Register\IORegister;
|
||||
|
||||
/**
|
||||
* A block to manage an number expression.
|
||||
* A block to manage a number expression.
|
||||
* This block expose a number output: the result of the expression.
|
||||
*
|
||||
* @package Combodo\iTop\Forms\Block\Expression
|
||||
* @api
|
||||
* @package FormBlock
|
||||
* @since 3.3.0
|
||||
*/
|
||||
class NumberExpressionFormBlock extends AbstractExpressionFormBlock
|
||||
{
|
||||
// Outputs
|
||||
|
||||
/**
|
||||
* Number output of the result of the expression
|
||||
* @api
|
||||
*/
|
||||
public const OUTPUT_RESULT = "result";
|
||||
|
||||
/** @inheritdoc */
|
||||
|
||||
@@ -10,9 +10,22 @@ namespace Combodo\iTop\Forms\Block\Expression;
|
||||
use Combodo\iTop\Forms\IO\Format\StringIOFormat;
|
||||
use Combodo\iTop\Forms\Register\IORegister;
|
||||
|
||||
/**
|
||||
* A block to manage a string expression.
|
||||
* This block expose a string output: the result of the expression.
|
||||
*
|
||||
* @api
|
||||
* @package FormBlock
|
||||
* @since 3.3.0
|
||||
*/
|
||||
class StringExpressionFormBlock extends AbstractExpressionFormBlock
|
||||
{
|
||||
// Outputs
|
||||
|
||||
/**
|
||||
* String output of the result of the expression
|
||||
* @api
|
||||
*/
|
||||
public const OUTPUT_RESULT = 'result';
|
||||
|
||||
/** @inheritdoc */
|
||||
|
||||
@@ -20,7 +20,7 @@ class FormBlockService
|
||||
{
|
||||
private PropertyTypeService $oPropertyTypeService;
|
||||
|
||||
public function __construct(ModelReflection $oModelReflection = null)
|
||||
public function __construct()
|
||||
{
|
||||
$this->oPropertyTypeService = \MetaModel::GetService('PropertyTypeService');
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ use Symfony\Component\Security\Csrf\CsrfTokenManager;
|
||||
* Factory form builder (from Symfony form component @link https://symfony.com/doc/current/components/form.html)
|
||||
*
|
||||
* @since 3.3.0
|
||||
* @api
|
||||
*/
|
||||
class FormFactoryBuilderService
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user