Skip to content

Commit

Permalink
fix(fieldsfield): restore mandatory field as read only
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Jun 23, 2023
1 parent f6f01d7 commit 52a9fc2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion inc/question.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class PluginFormcreatorQuestion extends CommonDBChild implements
static public $items_id = 'plugin_formcreator_sections_id';

/** @var PluginFormcreatorFieldInterface|null $field a field describing the question denpending on its field type */
private ?PluginFormcreatorFieldInterface $field = null;
public ?PluginFormcreatorFieldInterface $field = null;

private $skipChecks = false;

Expand Down
16 changes: 16 additions & 0 deletions templates/field/fieldsfield.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,20 @@
input_class: 'col-xxl-8',
}) }}
{% endif %}

{{ fields.nullField({
label_class: 'col-xxl-4',
input_class: 'col-xxl-8',
}) }}

{{ fields.dropdownYesNo(
'required',
item.field.getField().fields['mandatory'],
__('Required', 'formcreator'), {
label_class: 'col-xxl-4',
input_class: 'col-xxl-8',
disabled: true,
}
) }}

{% endblock %}

0 comments on commit 52a9fc2

Please sign in to comment.