Repository navigation
v26.10.44 - Ticket views: multi-select filters and a default view (DB 2.6.166)
·
782 commits
to production
since this release
Service Desk ticket filters now take more than one value, and a saved view can be made the default. DB 2.6.166: one idempotent step gated on 2.6.165 that creates one new table, ticket_view_defaults (CREATE TABLE IF NOT EXISTS, nothing existing altered; db.sql carries the same table, fresh import and migrated schema compared over all 408 tables with 0 differences). Nothing is switched on by the update; until it runs everything works as before and only the default-view stars and boxes are hidden.
- Multi-select filters. Assigned to (Me, Unassigned, any agents, in any combination), Priority (Low / Medium / High), Board, Category, Where (On-site / Remote; both is the same as no filter), Due (Overdue and Due today are independent: either) and the specific statuses are checkbox groups, each with Select all, Clear and a count badge. Inside a group it is OR, across groups AND (High or Medium, and assigned to me or unassigned). The saved-view dialogs (Save Current View, Edit) show them as labelled fieldsets; the filter bar at the top of Tickets shows them as buttons that open the same checkbox list and apply when it closes (Esc closes; keyboard and 390 px checked, light and dark). The Status button keeps All open / All closed / Open + Closed and lets you tick specific statuses instead (the two cancel each other). Assigned to moved from More Filters into the bar; Where and Due are new in More Filters.
- Old links and saved views keep working.
assigned=me,priority=High,board=5,category=9,onsite=1,overdue=1are read as one-item lists; the stored form of a view is now lists (assigned[]=me&assigned[]=7&priority[]=High&priority[]=Medium). A comma list in one value is read the same way. Two small fixes ride along: the dashboard'stickets.php?assigned=0(Unassigned tickets) used to ignore the filter and now shows unassigned tickets, andassigned_to=<id>(the "My tickets" link) is read asassigned. - One reader, no raw input in SQL.
includes/ticket_filter_sets.phpturns the request into validated sets (ids are digits only, priorities come from a fixed list, nested arrays, objects and anything else are dropped, 50 values per group at most) and builds theIN (...)SQL; the Tickets list, the kanban board, saved views, the active-view highlight and the API all use it. The kanban board now honours board, priority, on-site, due and tag filters too (it only applied status, assigned and category before). Pagination and sort links carry the lists. - Readable descriptions.
Open tickets · Priority: High, Medium · Assigned to: me, Unassigned, Ted Tech · Board: Helpdesk, Infrastructure · Where: On-site · Due: Overdue, Due today; tags are described too. - Default view. A star next to each view in the list makes it your default (click again to clear); the Save and Edit dialogs have Make this my default view. Opening Tickets, or the list or kanban link, with no filter of its own loads it, with a banner ("Showing your default view ... Show all open tickets"). Any filter in the URL (or
?nodefault=1) wins, Reset to my default (the Reset button) comes back to it, and Show all open tickets is one click. An administrator with the support module at level 3 can also make a view shared with all agents the default for everyone who has no personal default (box in the dialogs, or the view's menu). One personal default per person and one shared default, enforced by a unique key (default_key=u:<user id>orshared) and replaced in one statement. A deleted, archived or no-longer-shared default is ignored: the person falls back to the shared default, then the built-in open list. Setting and clearing are written to the log and the audit trail (ticket_view.default_set,ticket_view.default_cleared). - Permissions. The Edit dialog used to load any saved view by id; it now only opens views the person may edit (their own, or shared ones for an administrator) and needs the support module at level 2, like the Save dialog. The default stars need the support module (a read-only agent can pick a personal default; only an administrator can touch the shared one).
- API (no new routes;
check_openapi_drift.shoutput is identical to the base).GET /ticket-viewsaddsshared,is_default,default_scope, and a view with several values gives comma lists inparams(priorityhigh,medium,assignedme,unassigned,board,category_id; assigned to only the caller keepsmine=1, so older app versions read it as before).GET /ticketsaccepts the same comma lists forpriority,assigned,board,category_idandonsite;category_id(which the app sent but the endpoint ignored) now filters, and an unknown priority still matches nothing. - Not changed. Export still exports every ticket (it never followed the filters); there were no saved-view count badges in the sidebar, so none were added; the per-ticket live stream is not a list and has no filters.
- Tests: new
tests/ticket_views.php(197 checks: parsing and validation of old and new forms, hostile and oversized values, the SQL run against fixture tickets for every combination, form to stored query to description round trips, default storage rules and resolution order, the page, kanban, the post handlers, both dialogs, permissions and the API with real HTTP), newtests/browser/ticket_views_smoke.mjs+ticket_views_seed.php(15 browser checks),tests/endpoint_agent_migration.php+8 (2.6.166). - Not verified: nothing was deployed; the browser run was Chrome only.