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.
Parameter: $attach_info
Expected type: mixed
Returns the icon name to use given the filename, i.e. looks up icons from a list of known extensions.
Parameter: $filename
Expected type: string
The filename of an attachment.
Queries the system for all tickets related to the specified (typically current) ticket, subject to current user's permissions, and populates $context. The function populates $context['relationships_count'] with the number of relationships found, and $context['ticket_relationships'] contains an array of the following keys: - parent: Current ticket is the parent of the discovered ticket - child: Current ticket is a child of the discovered ticket - linked: Current ticket is related to discovered ticket - duplicated: Curent ticket is a duplicate of discovered ticket Each of the keyed arrays is an indexed array (each index representing one ticket), of which those are hash arrays containing: - id: id of the ticket - display_id: zero padded display id of the ticket - subject: ticket's name - status: status of the discovered ticket (numeric) - status_txt: status of the discovered ticket (textual)
Parameter: $ticket
Expected type: mixed
Page created in 0.016 seconds with 11 queries.