=== AegisTicket – Support Ticket System ===
Contributors: aegis
Tags: support, tickets, helpdesk
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 8.0
Stable tag: 1.2.6
License: GPLv2 or later

AegisTicket is a FREE WordPress-native support ticketing system using a custom post type and comment-based replies.

USE AT YOUR OWN RISKS.  AEGISIFY IS NOT RESPONSIBLE FOR ANY DAMAGES THIS PLUGIN MAY OCCUR. 

== Description ==
Phase I (Free):
- Custom Post Type: support_ticket
- Ticket number meta (_ticket_number) starts at 1000
- Priority meta (_ticket_priority)
- Status uses post_status: open / closed
- Product meta (_ticket_product, _ticket_version)
- Attachments supported on tickets and per-reply
- Replies use WP comments with comment_type = ticket_reply
- Email notification to the user when an admin replies (and admin when user replies)
- No PRO features, no external dependencies

== Shortcodes ==
1) [support_ticket_form]  
   Logged-in users can submit support tickets with:
   - Subject, Priority, Product, Product Version
   - Description
   - File and image uploads

2) [my_support_tickets]  
   User dashboard:
   - Ticket list with Open | Edit | Close | Delete
   - Date Open / Date Closed / Status / Admin Replied
   - Inline ticket view with full chat thread
   - Users can edit/delete their own replies

3) [aegisticket_admin_dashboard]  
   Admin frontend dashboard:
   - View all tickets
   - Open tickets inline with full chat
   - Admin can reply, attach files, close tickets
   - Admin can edit/delete their own replies

4) [aegisticket_profile]  
   User profile panel:
   - First Name / Last Name (wp_usermeta)
   - Username, Email
   - Password change

== Admin Menu ==
AegisTickets
- AegisTickets (Open Tickets)
- Closed Tickets
- Dashboard
  - Manage Products & Versions
- Helper
  - Shortcode reference and usage

== Installation ==
1. Upload and activate the plugin.
2. Create pages as needed:
   - Submit Ticket → [support_ticket_form]
   - My Tickets → [my_support_tickets]
   - (Optional) Admin frontend → [aegisticket_admin_dashboard]
3. Ensure WP mail is configured for email notifications.

== Changelog ==

= 1.1.3 =
- Phase I baseline.
- Custom post type support_ticket.
- Ticket numbers starting at 1000.
- User ticket submission and listing.
- Ticket view with chat-style replies.
- Admin open/closed ticket lists.
- Email notifications.

= 1.1.4 =
- Internal stability fixes.

= 1.1.5 =
- Added Date Open / Date Closed columns.
- Reliable Admin Replied detection.
- Chat attachments for both user and admin.
- Bold tickets when admin has replied.

= 1.1.6 =
- Open action always loads full ticket panel + chat.
- Unified behavior for user and admin dashboards.

= 1.1.7 =
- Fixed per-message chat attachments.
- Each reply maintains its own files.
- No overwriting or cross-bleed.

= 1.2.1 =
- Added [aegisticket_profile] shortcode.
- First/Last Name correctly tied to wp_usermeta.
- User can close tickets.
- Users and admins can edit/delete their own replies.

= 1.2.2 =
- Introduced Admin Dashboard for product/version support.
- Product & Version selection added to ticket form.
- Product & Version displayed on tickets.

= 1.2.3 =
- Improved product/version handling.
- Single-version entries supported per product.

= 1.2.4 =
- Fixed Dashboard submenu routing.
- Correct callback wiring for Dashboard page.

= 1.2.5 =
- Fixed Dashboard rendering (echo vs return issue).
- Dashboard UI reliably displayed.

= 1.2.6 =
- Dashboard logic corrected to ADD (append) products and versions.
- Multiple products supported.
- Multiple versions per product supported.
- Existing Products list now renders all entries correctly.
