Current File : /home/escuelai/public_html/it/templates/components/form/flags.html.twig
{#
 # ---------------------------------------------------------------------
 #
 # GLPI - Gestionnaire Libre de Parc Informatique
 #
 # http://glpi-project.org
 #
 # @copyright 2015-2022 Teclib' and contributors.
 # @copyright 2003-2014 by the INDEPNET Development Team.
 # @licence   https://www.gnu.org/licenses/gpl-3.0.html
 #
 # ---------------------------------------------------------------------
 #
 # LICENSE
 #
 # This file is part of GLPI.
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
 #
 # ---------------------------------------------------------------------
 #}

{% set flags = {
   'have_serial'      : __('Serial'),
   'have_parallel'    : __('Parallel'),
   'have_usb'         : __('USB'),
   'have_ethernet'    : __('Ethernet'),
   'have_wifi'        : __('Wifi'),
   'have_micro'       : __('Microphone'),
   'have_speaker'     : __('Speakers'),
   'have_subd'        : __('Sub-D'),
   'have_bnc'         : __('BNC'),
   'have_dvi'         : __('DVI'),
   'have_pivot'       : __('Pivot'),
   'have_hdmi'        : __('HDMI'),
   'have_displayport' : __('DisplayPort'),
   'have_headset'     : __('Headset'),
   'have_hp'          : __('Speaker'),
} %}
{% for field, label in flags %}
   {% if item.isField(field) %}
      <div class="m-2">
         <label class="form-check">
            <input type="hidden" name="{{ field }}" value="0" />
            <input class="form-check-input"
                   type="checkbox"
                   name="{{ field }}"
                   {% if item.fields[field] == 1 %}checked="checked"{% endif %}
                   value="1" />
            <span class="form-check-label">
               {{ label }}
            </span>
         </label>
      </div>
   {% endif %}
{% endfor %}