Skip to content

Feat/reservation question - #36

Open
RomainLvr wants to merge 26 commits into
mainfrom
feat/reservation-question
Open

Feat/reservation question#36
RomainLvr wants to merge 26 commits into
mainfrom
feat/reservation-question

Conversation

@RomainLvr

@RomainLvr RomainLvr commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Checklist before requesting a review

Please delete options that are not relevant.

  • I have performed a self-review of my code.
  • I have added tests (when available) that prove my fix is effective or that my feature works.
  • I have updated the CHANGELOG with a short functional description of the fix or new feature.
  • This change requires a documentation update.

Description

  • It fixes !39540
  • Here is a brief description of what this PR does

Adds a material reservation capability to AdvancedForms: end users can reserve equipment directly from a GLPI form. The answer creates a ticket-driven reservation request that can be validated from the ticket timeline, and the actual reservation is created in the GLPI planning once approved (or immediately, in direct mode).

Features

  • New question type "Material reservation" equipment dropdown (grouped by type, loaded via AJAX and filtered by the allowed types configured on the question) plus start/end date pickers with real-time availability check and a list of the item's existing reservations.
  • New destination field "Pre-reservation" on the Ticket destination, maps a reservation question to a reservation request, with a "Require technician approval" toggle:
    • Approval mode (default): the request appears in the ticket timeline as pending, with Approve / Refuse actions; the reservation is created on approval.
    • Direct mode: if the slot is still free at submission, the reservation is created and confirmed automatically; if it was taken meanwhile, the request is canceled and the requester is notified.
  • Ticket timeline integration each request is shown in the timeline (equipment, time slot, status) with inline approve/refuse handling.
  • Notifications requester is notified on creation, approval, refusal and slot-unavailable events; template and notifications are set up at install.
  • Reservation traceability an approved request is linked to its reservation, and deleting the request cleans up the reservation.

Screenshots (if appropriate):

  • Question configuration "Material reservation" question type in the form editor (allowed equipment types)
image
  • End-user widget equipment selection, date pickers, availability check and existing reservations
image
  • Destination config "Pre-reservation" field with the "Require technician approval" toggle
image
  • Ticket timeline (approval mode) pending request with Approve / Refuse buttons
image
  • Ticket timeline (direct mode) automatically confirmed reservation
image

@RomainLvr RomainLvr self-assigned this Jul 28, 2026
@RomainLvr RomainLvr added the enhancement New feature or request label Jul 28, 2026
@RomainLvr
RomainLvr requested review from Rom1-B and ccailly July 28, 2026 10:06
Comment thread src/Model/QuestionType/ReservationQuestionAnswer.php Outdated
Comment thread src/Model/QuestionType/ReservationQuestionConfig.php
@RomainLvr
RomainLvr requested a review from Rom1-B July 28, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants