2025-01-01 18:35:37 -05:00
# Tinker Tickets
2024-11-30 19:26:34 -05:00
2026-01-20 21:11:49 -05:00
A feature-rich PHP-based ticketing system designed for tracking and managing data center infrastructure issues with enterprise-grade workflow management and a retro terminal aesthetic.
2025-01-01 18:35:37 -05:00
2026-01-20 17:25:54 -05:00
## Core Features
2025-01-01 18:35:37 -05:00
2026-01-20 17:25:54 -05:00
### Dashboard & Ticket Management
2026-01-01 19:45:49 -05:00
- **Smart Dashboard**: Sortable columns, advanced filtering by status/priority/category/type
2026-01-20 21:11:49 -05:00
- **Stats Widgets**: Clickable cards for quick filtering (Open, Critical, Unassigned, Today's tickets)
2026-01-01 19:45:49 -05:00
- **Full-Text Search**: Search across tickets, descriptions, and metadata
2026-01-20 21:11:49 -05:00
- **Advanced Search**: Date ranges, priority ranges, user filters with saved filter support
2026-01-20 17:25:54 -05:00
- **Ticket Assignment**: Assign tickets to specific users with quick-assign from dashboard
2026-01-01 19:45:49 -05:00
- **Priority Tracking**: P1 (Critical) to P5 (Minimal Impact) with color-coded indicators
- **Custom Categories**: Hardware, Software, Network, Security, General
- **Ticket Types**: Maintenance, Install, Task, Upgrade, Issue, Problem
2026-01-20 17:25:54 -05:00
- **Export**: Export selected tickets to CSV or JSON format
2025-01-01 18:35:37 -05:00
2026-01-20 17:25:54 -05:00
### Workflow Management
2026-01-12 17:00:33 -05:00
- **Status Transitions**: Enforced workflow rules (Open → Pending → In Progress → Closed)
2026-01-20 17:25:54 -05:00
- **Workflow Designer**: Visual admin UI at `/admin/workflow` to configure transitions
2026-01-01 19:45:49 -05:00
- **Workflow Validation**: Server-side validation prevents invalid status changes
- **Admin Controls**: Certain transitions can require admin privileges
- **Comment Requirements**: Optional comment requirements for specific transitions
2025-01-01 18:35:37 -05:00
2026-01-20 17:25:54 -05:00
### Collaboration Features
- **Markdown Comments**: Full Markdown support with live preview and toolbar
- **@Mentions **: Tag users in comments with autocomplete
- **File Attachments**: Upload files to tickets with drag-and-drop support
- **Ticket Dependencies**: Link tickets as blocks/blocked-by/relates-to/duplicates
- **Activity Timeline**: Complete audit trail of all ticket changes
2025-01-01 18:35:37 -05:00
2026-01-20 17:25:54 -05:00
### Ticket Templates
- **Template Management**: Admin UI at `/admin/templates` to create/edit templates
2026-01-01 19:45:49 -05:00
- **Quick Creation**: Pre-configured templates for common issues
- **Auto-fill**: Templates populate title, description, category, type, and priority
2025-01-01 18:35:37 -05:00
2026-01-20 17:25:54 -05:00
### Recurring Tickets
- **Scheduled Tickets**: Automatically create tickets on a schedule
- **Admin UI**: Manage at `/admin/recurring-tickets`
- **Flexible Scheduling**: Daily, weekly, or monthly recurrence
- **Cron Integration**: Run `cron/create_recurring_tickets.php` to process
### Custom Fields
- **Per-Category Fields**: Define custom fields for specific ticket categories
- **Admin UI**: Manage at `/admin/custom-fields`
- **Field Types**: Text, textarea, select, checkbox, date, number
- **Required Fields**: Mark fields as required for validation
### User Management & Authentication
2026-01-01 19:45:49 -05:00
- **SSO Integration**: Authelia authentication with LLDAP backend
- **Role-Based Access**: Admin and standard user roles
2026-01-20 17:25:54 -05:00
- **User Activity**: View per-user stats at `/admin/user-activity`
- **Session Management**: Secure PHP session handling with timeout
2025-01-01 18:35:37 -05:00
2026-01-20 17:25:54 -05:00
### Bulk Actions (Admin Only)
2026-01-01 19:45:49 -05:00
- **Bulk Close**: Close multiple tickets at once
- **Bulk Assign**: Assign multiple tickets to a user
- **Bulk Priority**: Change priority for multiple tickets
2026-01-20 17:25:54 -05:00
- **Bulk Status**: Change status for multiple tickets
### Admin Pages
2026-01-20 21:11:49 -05:00
Access all admin pages via the **Admin dropdown ** in the dashboard header.
2026-01-20 17:25:54 -05:00
| Route | Description |
|-------|-------------|
2026-01-20 21:11:49 -05:00
| `/admin/templates` | Create and edit ticket templates |
| `/admin/workflow` | Visual workflow transition designer |
2026-01-20 17:25:54 -05:00
| `/admin/recurring-tickets` | Manage recurring ticket schedules |
| `/admin/custom-fields` | Define custom fields per category |
| `/admin/user-activity` | View per-user activity statistics |
2026-01-20 21:11:49 -05:00
| `/admin/audit-log` | Browse all audit log entries |
2026-01-20 17:25:54 -05:00
### Notifications
2026-01-01 19:45:49 -05:00
- **Discord Integration**: Webhook notifications for ticket creation and updates
- **Rich Embeds**: Color-coded priority indicators and ticket links
2026-01-20 17:25:54 -05:00
### Security Features
- **CSRF Protection**: Token-based protection on all forms
- **Rate Limiting**: API rate limiting to prevent abuse
- **Security Headers**: CSP, X-Frame-Options, X-Content-Type-Options
- **SQL Injection Prevention**: All queries use prepared statements
- **XSS Protection**: All output properly escaped
- **Audit Logging**: Complete audit trail of all actions
2026-01-01 19:45:49 -05:00
2026-01-20 17:25:54 -05:00
## Technical Architecture
2026-01-01 19:45:49 -05:00
### Backend
- **Language**: PHP 7.4+
- **Database**: MariaDB/MySQL
- **Architecture**: MVC pattern with models, views, controllers
### Frontend
2026-01-20 21:11:49 -05:00
- **HTML5/CSS3**: Semantic markup with retro terminal styling
2026-01-01 19:45:49 -05:00
- **JavaScript**: Vanilla JS with Fetch API for AJAX
2026-01-20 17:25:54 -05:00
- **Markdown**: Custom markdown parser with toolbar
2026-01-20 21:11:49 -05:00
- **Terminal UI**: Box-drawing characters, monospace fonts, CRT effects
2026-01-20 17:25:54 -05:00
### Database Tables
| Table | Purpose |
|-------|---------|
| `tickets` | Core ticket data |
| `ticket_comments` | Markdown-supported comments |
| `ticket_attachments` | File attachment metadata |
| `ticket_dependencies` | Ticket relationships |
| `users` | User accounts synced from LLDAP |
| `user_preferences` | User settings and preferences |
| `audit_log` | Complete audit trail |
| `status_transitions` | Workflow configuration |
| `ticket_templates` | Reusable ticket templates |
| `recurring_tickets` | Scheduled ticket definitions |
| `custom_field_definitions` | Custom field schemas |
| `custom_field_values` | Custom field data per ticket |
| `saved_filters` | User-saved dashboard filters |
2026-01-01 19:45:49 -05:00
### API Endpoints
2026-01-20 17:25:54 -05:00
| Endpoint | Method | Description |
|----------|--------|-------------|
| `/api/update_ticket.php` | POST | Update ticket with workflow validation |
| `/api/assign_ticket.php` | POST | Assign ticket to user |
| `/api/add_comment.php` | POST | Add comment to ticket |
| `/api/get_template.php` | GET | Fetch ticket template |
| `/api/get_users.php` | GET | Get user list for assignments |
| `/api/bulk_operation.php` | POST | Perform bulk operations |
| `/api/ticket_dependencies.php` | GET/POST/DELETE | Manage ticket dependencies |
| `/api/upload_attachment.php` | GET/POST | List or upload attachments |
| `/api/delete_attachment.php` | POST/DELETE | Delete attachment |
| `/api/export_tickets.php` | GET | Export tickets to CSV/JSON |
| `/api/check_duplicates.php` | GET | Check for duplicate tickets |
## Setup & Configuration
2026-01-01 19:45:49 -05:00
### 1. Environment Configuration
Create `.env` file in project root:
2025-01-01 18:35:37 -05:00
```env
2026-01-01 19:45:49 -05:00
DB_HOST=10.10.10.50
DB_USER=tinkertickets
DB_PASS=your_password
DB_NAME=ticketing_system
DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/...
```
### 2. Database Setup
2026-01-20 21:11:49 -05:00
The database schema should already be configured. For a fresh install, contact the system administrator for database setup instructions.
2026-01-01 19:45:49 -05:00
2026-01-20 17:25:54 -05:00
### 3. Cron Jobs
2026-01-01 19:45:49 -05:00
2026-01-20 17:25:54 -05:00
Add to crontab for recurring tickets:
```bash
# Run every hour to create scheduled recurring tickets
0 * * * * php /var/www/html/tinkertickets/cron/create_recurring_tickets.php
```
2026-01-01 19:45:49 -05:00
2026-01-20 17:25:54 -05:00
Optional cleanup job:
```bash
# Run weekly to clean up orphaned upload files
0 2 * * 0 php /var/www/html/tinkertickets/scripts/cleanup_orphan_uploads.php
```
2026-01-01 19:45:49 -05:00
2026-01-20 17:25:54 -05:00
### 4. File Uploads
2026-01-01 19:45:49 -05:00
2026-01-20 17:25:54 -05:00
Ensure the `uploads/` directory exists and is writable:
```bash
mkdir -p /var/www/html/tinkertickets/uploads
chown www-data:www-data /var/www/html/tinkertickets/uploads
chmod 755 /var/www/html/tinkertickets/uploads
2026-01-01 19:45:49 -05:00
```
2026-01-20 17:25:54 -05:00
### 5. Authelia Integration
2026-01-01 19:45:49 -05:00
Tinker Tickets uses Authelia for SSO. User information is passed via headers:
- `Remote-User` : Username
- `Remote-Name` : Display name
- `Remote-Email` : Email address
- `Remote-Groups` : User groups (comma-separated)
Admin users must be in the `admins` group in LLDAP.
2026-01-20 17:25:54 -05:00
## Project Structure
2026-01-01 19:45:49 -05:00
```
tinker_tickets/
├── api/ # API endpoints
2026-01-20 17:25:54 -05:00
├── assets/ # Static assets (CSS, JS)
2026-01-01 19:45:49 -05:00
├── config/ # Configuration
├── controllers/ # MVC Controllers
2026-01-20 17:25:54 -05:00
├── cron/ # Scheduled task scripts
├── helpers/ # Utility classes
├── middleware/ # Request middleware
2026-01-01 19:45:49 -05:00
├── models/ # Data models
2026-01-20 17:25:54 -05:00
├── scripts/ # Maintenance scripts
├── uploads/ # File upload storage
2026-01-01 19:45:49 -05:00
├── views/ # View templates
2026-01-20 17:25:54 -05:00
│ └── admin/ # Admin panel views
├── index.php # Main router
└── .env # Environment configuration
2026-01-01 19:45:49 -05:00
```
2026-01-20 17:25:54 -05:00
## Workflow States
2026-01-01 19:45:49 -05:00
### Default Workflow
```
2026-01-12 17:00:33 -05:00
Open → Pending → In Progress → Closed
2026-01-20 17:25:54 -05:00
↑ ↑
└───────────┘
2026-01-01 19:45:49 -05:00
```
2026-01-20 17:25:54 -05:00
All states can transition to Closed (with comment).
Closed tickets can be reopened to Open or In Progress.
2026-01-01 19:45:49 -05:00
2026-01-20 17:25:54 -05:00
## License
2026-01-01 19:45:49 -05:00
2026-01-20 17:25:54 -05:00
Internal use only - LotusGuild Infrastructure