Skip to content
  1. Extras
  2. Tickets
  3. Frontend and AJAX

Frontend and AJAX

TicketForm, TicketComments, and TicketMeta load CSS/JS from tickets_frontend_css and tickets_frontend_js.

Endpoint

Requests go to assets/components/tickets/action.php (TicketsConfig.actionUrl).

Main action values:

actionPurpose
ticket/savesave ticket from frontend
ticket/previewpreview
ticket/delete / ticket/undeletedelete/restore
ticket/votevote on ticket
ticket/starstar ticket
comment/savenew comment
comment/previewpreview comment
comment/votevote on comment
comment/starstar comment
comment/getlistreload list
section/subscribesection subscription
author/subscribeauthor subscription

Thread snippet properties are stored on TicketThread.properties and in TicketForm session.

TicketsConfig

FieldSource
actionUrlpath to action.php
enable_editortickets_enable_editor
editor.ticket / editor.commenttickets_editor_config.*
formBeforeTicketComments &formBefore
thread_depthTicketComments &depth
thread_treeTicketComments &tree
sourcecomment file uploads (&allowFiles)

jQuery events (1.14+)

EventWhen
tickets_before_ticket_previewticket preview
tickets_before_ticket_saveticket save
tickets_before_comment_previewcomment preview
tickets_before_comment_savecomment submit
javascript
$(document).on('tickets_before_comment_save', function (e, form, button) {
  // return false to cancel
});

Anchors and unread

Since 1.14.0, tpl.Tickets.list.row may link to #first_unread. On load, JS scrolls to #first_unread or #comments when the hash matches.

Tickets plugin

EventBehavior
OnSiteRefreshclear default/tickets cache
OnPageNotFoundredirect section URI to ticket (FURL + section URI pattern)
OnLoadWebDocumentview counting; guest cookie if tickets_count_guests
OnWebPagePrerenderrestore escaped [ { in HTML

subscribeAuthor on custom pages

Pass &TicketsInit=1`` to load Tickets JS without TicketComments on the page. See subscribeAuthor.