{# # --------------------------------------------------------------------- # # 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 params = { target: 'ReservationItem'|itemtype_search_path, canedit: true, candel: false, addbuttons: { submit: { text: _x('button', 'Search'), btn_class: 'btn-primary' }, cancel: { type: 'button', text: _x('button', 'Cancel'), btn_class: 'btn-outline-secondary', onclick: "$('#viewresasearch').toggleClass('d-none');$('#makesearch').toggleClass('d-none')" } } } %} {% import 'components/form/fields_macros.html.twig' as fields %}
{{ fields.largeTitle(__('Find a free item in a specific period')) }} {{ fields.datetimeField('reserve[begin]', _post['reserve']['begin'], __('Start date'), { maybeempty: false }) }} {% set duration = date(_post['reserve']['end']).getTimestamp() - date(_post['reserve']['begin']).getTimestamp() %} {% set default_delay = (duration / config('time_step') / constant('MINUTE_TIMESTAMP'))|round(0, 'floor') * (config('time_step') * constant('MINUTE_TIMESTAMP')) %} {{ fields.dropdownTimestampField('reserve[_duration]', default_delay, __('Duration'), { min: 0, max: 48 * constant('HOUR_TIMESTAMP'), emptylabel: __('Specify an end date') }) }} {% set date_end_field %}
{% endset %} {{ fields.htmlField('', date_end_field, __('End date'), { add_field_class: 'date_end_field d-none' }) }} {{ fields.dropdownArrayField('reservation_types', _post['reservation_types'], reservation_types, __('Item type'), { display_emptychoice: true }) }} {{ fields.dropdownField('Location', 'locations_id', default_location, __('Item location'), { entity: session('glpiactiveentities') }) }}
{{ include('components/form/buttons.html.twig') }}