mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-22 09:59:06 +01:00
LSform / dataEntryForm: Add forceGeneration parameter
This commit is contained in:
parent
f8c38dd3b6
commit
29bfca1792
2 changed files with 42 additions and 18 deletions
|
@ -155,21 +155,26 @@ et dont la valeur associée est sa configuration.
|
|||
'label' => '[label du masque de saisie]',
|
||||
'disabledLayout' => [booleen],
|
||||
'displayedElements' => array (
|
||||
'arg1',
|
||||
'arg2',
|
||||
'attr1',
|
||||
'attr2',
|
||||
...
|
||||
),
|
||||
'defaultValues' => array (
|
||||
'arg3' => [value],
|
||||
'arg4' => [value],
|
||||
'attr3' => [value],
|
||||
'attr4' => [value],
|
||||
...
|
||||
),
|
||||
'requiredAllAttributes' => [booleen],
|
||||
'requiredAttributes' => array (
|
||||
'arg1',
|
||||
'arg2',
|
||||
'attr1',
|
||||
'attr2',
|
||||
...
|
||||
)
|
||||
),
|
||||
'forceGeneration' => array (
|
||||
'attr1',
|
||||
'attr2',
|
||||
...
|
||||
),
|
||||
),
|
||||
...
|
||||
);]]>
|
||||
|
@ -234,6 +239,14 @@ et dont la valeur associée est sa configuration.
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>forceGeneration</term>
|
||||
<listitem>
|
||||
<simpara>Tableau contenant la liste des attributs dont la génération sera forcée lors de la
|
||||
validation du formation.</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</para>
|
||||
</sect3>
|
||||
|
|
|
@ -492,6 +492,14 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
|||
else {
|
||||
$LSform=false;
|
||||
}
|
||||
|
||||
$forceGeneration = (
|
||||
$LSform && $LSform -> dataEntryForm?
|
||||
LSconfig::get(
|
||||
'forceGeneration', array(), 'array', $LSform -> dataEntryFormConfig
|
||||
):array()
|
||||
);
|
||||
|
||||
foreach($this -> attrs as $attr_name => $attr) {
|
||||
$attr_values = $attr -> getValue();
|
||||
if (!$attr -> isValidate()) {
|
||||
|
@ -500,7 +508,10 @@ class LSldapObject extends LSlog_staticLoggerClass {
|
|||
$retval = false;
|
||||
}
|
||||
}
|
||||
else if( (empty($attr_values)) && ($attr -> isRequired()) ) {
|
||||
else if(
|
||||
in_array($attr_name, $forceGeneration)
|
||||
|| (empty($attr_values) && $attr -> isRequired())
|
||||
) {
|
||||
if ( $attr -> canBeGenerated()) {
|
||||
if ($attr -> generateValue()) {
|
||||
if (!$this -> validateAttrData($LSform, $attr, $justCheck)) {
|
||||
|
|
Loading…
Reference in a new issue