This file sets up the regular ticket view, including the menu of operations that can be applied to a ticket. It is also resposible for setting up the AJAX items for modifying privacy and urgency from the ticket view itself, as well as all the handling responsible for Quick Reply including the 'Go Advanced' mode.
This function does a lot of work in setting up a ticket to be displayed:
The process set up by shd_view_ticket() and invoked within template_view_replies() is reasonably complex. {@link} identifies what messages should be displayed on the current page of the ticket, and performs a query to load the ticket data. Instead, however, of retrieving every row directly into memory before passing to the template, it passes the query result, and the name of a handler function into $context, so the template can call to get an individual row at a time, which saves memory amongst other things. With respect to {@link}, the relevant items are $reply_request being defined and $context['get_replies'] being defined as the name of this function, and in {@link}, the reference is $reply = $context['get_replies']()
Queries the {db_prefix}helpdesk_attachments table for the current ticket, or the messages that will be displayed (previously identified by {@link}) and loads the id, name and size of them for display purposes. Differentiation between "attach to ticket" and "attach to reply" is made here; the data is loaded differently depending on the context; "attach to ticket" is simply loaded into an indexed array stored in $context['ticket_attach']['ticket'], while "attach to reply" is loaded into an indexed array subset in $context['ticket_attach']['reply'][msg_id] to retain the association.
Page created in 0.015 seconds with 11 queries.