{# # --------------------------------------------------------------------- # # GLPI - Gestionnaire Libre de Parc Informatique # # http://glpi-project.org # # @copyright 2015-2024 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 . # # --------------------------------------------------------------------- #} {% set datatable_id = datatable_id|default('datatable' ~ random()) %} {% if total_number < 1 and filters|length == 0 %} {% if super_header is defined and super_header is not empty %} {% set super_header_label = super_header is array ? super_header['label'] : super_header %} {% set super_header_raw = super_header is array ? super_header['is_raw'] : false %} {% endif %}
{{ super_header_raw ? super_header_label|raw : super_header_label }}
{{ __('No data') }}
{% else %} {% set total_cols = columns|length + (showmassiveactions ? 1 : 0) + (nofilter ? 0 : 1) %} {% if not nopager %} {{ include('components/pager.html.twig', { 'count': filtered_number, 'additional_params': additional_params ~ '&sort=' ~ sort ~ '&order=' ~ order }) }} {% endif %}
{% if showmassiveactions %}
{% do call('Html::showMassiveActions', [massiveactionparams|default([])]) %}
{% endif %} {% if super_header is defined and super_header is not empty %} {% set super_header_label = super_header is array ? super_header['label'] : super_header %} {% set super_header_raw = super_header is array ? super_header['is_raw'] : false %} {% if super_header_raw != 'th_elements' %}{% endif %} {% endif %} {% if no_header is not defined or no_header == false %} {% if showmassiveactions %} {% endif %} {% for colkey, column in columns %} {% set column_label = column is array ? column['label'] : column %} {% set raw_header = column is array ? column['raw_header']|default(false) : false %} {% set sort_icon = '' %} {% set new_order = "DESC" %} {% if sort == colkey %} {% set sort_icon = order == 'ASC' ? 'ti ti-sort-ascending' : (order == 'DESC' ? 'ti ti-sort-descending' : '') %} {% set new_order = (order == 'ASC' ? 'DESC' : 'ASC') %} {% endif %} {% set sort_href = "javascript:reloadTab('sort=" ~ colkey ~ "&order=" ~ new_order ~ "&" ~ additional_params ~ "');" %} {% endfor %} {% if nofilter is not defined or csv_url|length %} {% endif %} {% endif %} {% if filters|length > 0 %} {% if showmassiveactions %} {% endif %} {% for colkey, colum in columns %} {% set formatter = colum['filter_formatter']|default(formatters[colkey])|default('') %} {% endfor %} {% endif %} {% if entries|length > 0 %} {% for entry in entries %} {% set row_massiveactions = entry['showmassiveactions']|default(showmassiveactions) %} {% if row_massiveactions %} {% endif %} {% for colkey, colum in columns %} {% endfor %} {% if not nofilter %} {% endif %} {% endfor %} {% else %} {% endif %} {% if footers %} {% for footer in footers %} {% if showmassiveactions %} {% endif %} {% for footer_col, footerval in footer %} {% endfor %} {% if nofilter is not defined %} {% endif %} {% endfor %} {% endif %}
{% endif %} {{ super_header_raw ? super_header_label|raw : super_header_label }} {% if super_header_raw != 'th_elements' %}
{% if not nosort and not (column is array and column['nosort'] is defined) %} {% endif %} {{ raw_header ? column_label|raw : column_label }} {% if not nosort and not (column is array and column['nosort'] is defined) %} {% endif %} {% if nofilter is not defined %} {% endif %} {% if csv_url|length %} {{ __('Export') }} {% endif %}
{% if colum is not array or colum['no_filter']|default(false) == false %} {% if formatter == "array" and columns_values[colkey] is defined %} {% elseif formatter == "datetime" %} {{ call("Html::showDateTimeField", [ "filters[" ~ colkey ~ "]", { 'value': filters[colkey], 'display': false } ])|raw }} {% elseif formatter == "date" %} {{ call("Html::showDateField", [ "filters[" ~ colkey ~ "]", { 'value': filters[colkey], 'display': false } ])|raw }} {% elseif formatter starts with "progress" %} {% elseif formatter == 'avatar' %} {# Cannot be filtered #} {% elseif formatter == 'yesno' %} {% else %} {% endif %} {% endif %}
{% if entry['skip_ma'] is not defined or entry['skip_ma'] == false %} {% endif %} {% if colkey in entry|keys %} {% set formatter = formatters[colkey] %} {% if formatter == "maintext" %} {{ entry[colkey] }} {% elseif formatter == "longtext" %} {{ entry[colkey] }} {% elseif formatter starts with "progress" %} {{ call("Html::progress", [100, entry[colkey]])|raw }} {% elseif formatter == "date" %} {{ call("Html::convDate", [entry[colkey]])|raw }} {% elseif formatter == "datetime" %} {{ call("Html::convDateTime", [entry[colkey]])|raw }} {% elseif formatter == "duration" %} {{ entry[colkey]|formatted_duration }} {% elseif formatter == "bytesize" %} {{ call("Toolbox::getSize", [entry[colkey]])|raw }} {% elseif formatter == 'number' %} {{ entry[colkey]|formatted_number }} {% elseif formatter == 'integer' %} {{ entry[colkey]|formatted_integer }} {% elseif formatter == "raw_html" %} {{ entry[colkey]|raw }} {% elseif formatter == 'avatar' %} {# Note: Does not support anonymization currently #} {% set entry_data = entry[colkey] %} {% set avatar_size = entry_data['avatar_size'] ?? 'avatar-md' %} {% set img = entry_data['picture'] %} {% set initials = entry_data['initials'] %} {% set bg_color = img is not empty ? 'inherit' : entry_data['initials_bg'] %} {% if img is empty %} {{ initials }} {% endif %} {% else %} {{ entry[colkey] }} {% endif %} {% endif %}
{{ __('No data') }}
{{ footerval|nl2br }}
{% if not nopager %}
{{ __('Entries to show:') }} {% include 'components/dropdown/limit.html.twig' %}
{% endif %} {% endif %}