Skip to content

Commit 68c239b

Browse files
committed
fix(ComputerUsageProfile): use native time dropdown field
1 parent 2ae40f5 commit 68c239b

3 files changed

Lines changed: 2 additions & 194 deletions

File tree

src/Html.php

Lines changed: 0 additions & 166 deletions
This file was deleted.

templates/components/form/fields_macros.html.twig

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -29,31 +29,6 @@
2929
# -------------------------------------------------------------------------
3030
#}
3131

32-
{% macro timeField(name, value, label = '', options = {}) %}
33-
{% import 'components/form/fields_macros.html.twig' as fields %}
34-
{% set options = {
35-
'rand': random(),
36-
'disabled': false
37-
}|merge(options)
38-
%}
39-
40-
{% if options.disabled %}
41-
{% set options = options|merge({specific_tags: {'disabled': 'disabled'}}) %}
42-
{% endif %}
43-
{% if options.fields_template.isMandatoryField(name)|default(false) %}
44-
{% set options = {'specific_tags': {'required': true}}|merge(options) %}
45-
{% endif %}
46-
47-
{% set field %}
48-
{% do call('GlpiPlugin\\Carbon\\Html::showTimeField', [name, {
49-
'value': value,
50-
'rand': options.rand,
51-
'width': '100%'
52-
}|merge(options)]) %}
53-
{% endset %}
54-
{{ fields.field(name, field, label, options) }}
55-
{% endmacro %}
56-
5732
{% macro dropdownBoaviztaZone(name, value, label = '', options = {}) %}
5833
{% import 'components/form/fields_macros.html.twig' as fields %}
5934

templates/computerusageprofile.html.twig

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131

3232
{% extends "generic_show_form.html.twig" %}
3333
{% import "components/form/fields_macros.html.twig" as fields %}
34-
{% import '@carbon/components/form/fields_macros.html.twig' as carbonFields %}
3534

3635
{% block form_fields %}
3736
{{ fields.textField(
@@ -46,13 +45,13 @@
4645
input_class: 'col-xxl-8',
4746
}) }}
4847

49-
{{ carbonFields.timeField(
48+
{{ fields.dropdownHoursField(
5049
'time_start',
5150
item.fields['time_start'],
5251
__('Start time', 'carbon')
5352
) }}
5453

55-
{{ carbonFields.timeField(
54+
{{ fields.dropdownHoursField(
5655
'time_stop',
5756
item.fields['time_stop'],
5857
__('Stop time', 'carbon')

0 commit comments

Comments
 (0)