This file handles ticket assignments, both the user interface for the assignment page, plus actually assigning users to tickets. There are also helper functions here for that purpose.
This validates that the user can see the ticket in question initially, before determining the level of assignment that can be carried out. Users who can assign any ticket cause a query to trigger to identify users who have shd_staff permission (and thus can be the target of assignment) and the template is loaded with a dropdown to provide this choice to the user. Users who can only assign to themselves will at this point have the ticket assigned to them if it was unassigned before, or unassigned from them if they are able to assign tickets to themselves in the first place; if it was assigned to someone else, they will not have the option. Access through action=helpdesk;sa=assign;ticket=x;sessvar=sessid before redirecting back to the ticket, or add ;home to the URL to have it redirect back to the home page (passed through to the form for {@link}'s use too)
Primarily this is just about receiving the form, making the same checks that {@link} does and then logging the action before passing over to {@link} to actually assign the ticket.
This function sets up the relevant options before handing over to shd_modify_ticket_post() which is the preferred way to modify tickets generally. No permissions check is performed here. Relies on $context['shd_return_to'] to have been set, defaults to 'ticket' to return to ticket, otherwise return to home page on value of 'home'.
Parameter: $ticket
Expected type: int
Ticket id number, assumed to exist.
Parameter: $assignment
Expected type: int
User id of the user to which this ticket will be assigned; can be 0 to unassign a ticket
This function centralises who a ticket can be assigned to. Currently this is: - user with shd_staff permission - can see "any" ticket (not just their own) - additionally, if the ticket is private, the user must also be able to see 'any' private ticket. - additionally, check whether user is staff + ticket starter, and then whether we should block them from being assigned
Parameter: $private
Expected type: bool
Default: false
Whether the ticket in question is private or not.
Parameter: $ticket_owner
Expected type: int
User id of the ticket owner
Page created in 0.015 seconds with 11 queries.