3.4 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
This is the Ticket Center module — a ticket management/support system — for the AWO Hamburg intranet. It is a traditional PHP application with no build system: files are served directly.
No Build System
There is no package.json, Makefile, or test framework. No compilation or build step is needed. CSS/JS files are served as-is with filemtime()-based cache busting.
Architecture
Module Structure
This module lives inside a larger mysyde platform. It depends on:
- Common platform functions (e.g.
encryptId/decryptId, translation registry, permission helpers) - Shared DB connection config at
mysyde/dc.config.php(dev) ormysyde/dc-server.config.php(prod) - Environment variables via
vlucas/phpdotenvloaded from/config/.envand/vendor/autoload.php
Request Flow
- URL:
/module/ticketcenter/ - Main controller:
views/ticketcenter/show_ticketcenter.inc.php— handles all ticket CRUD, state transitions, file uploads, and page routing (956 lines) - List view:
views/ticketcenter/show_ticketcenter_listform.inc.php— renders ticket table via Grid.js - Detail/edit view:
views/ticketcenter/show_ticketcenter_cardform.inc.php - Create view:
views/ticketcenter/show_ticketcenter_create_cardform.inc.php - JSON API:
services/ticketcenter.api.php— POST endpoint used by Grid.js for ticket list data - AJAX endpoints:
views/ticketcenter/show_ticketcenter_ajax.php(category hierarchy),show_ticketcenter_category_desc_ajax.php
Admin Sub-views
views/category/— hierarchical category CRUDviews/process/— ticket workflow process definitionsviews/status/— ticket status definitionsviews/settings/— system settings UI
Frontend Stack
- Grid.js (
js/gridjs.umd.js) — data table with server-side pagination/filtering via the JSON API - Select2 — enhanced dropdowns (loaded via CDN)
- Semantic UI — UI components (loaded via CDN)
- FontAwesome — icons (CDN)
- Vanilla JS + jQuery; no bundler or transpiler
Database Tables
| Table | Purpose |
|---|---|
main_tickets |
Core ticket records |
main_tickets_messages |
Ticket conversation/comments |
main_tickets_category |
Hierarchical category definitions |
main_tickets_status |
Status definitions |
main_tickets_process |
Workflow process definitions |
main_tickets_notification |
Notification tracking |
main_contact / main_contact_department |
User/department info |
main_tickets_category_{mandant,department,contact} |
Visibility/access control per category |
Ticket Lifecycle
Tickets move through status IDs: Draft → 2 (Open) → 3 (In Progress) → 4 (Closed)
List View Filters (cues)
The cue parameter drives 8 ticket views: created by me, assigned to me, pool, archive, all, escalated, unassigned, insurance claims.
File Uploads
Attachments are stored at userdata/Tickets/{ticket_id}/.
Language
All UI text is in German. Button labels, validation messages, and field names are German throughout.
Key Conventions
- PHP templating via
include/require— no MVC framework - Both MySQLi and PDO are used in different files
- IDs are encrypted/decrypted before being exposed to the frontend (
encryptId/decryptId) - Role-based access is enforced via mandant/department/contact associations on categories