This file handles all the actions that can be carried out through AJAX methods, performing them and providing adequate feedback/information.
This function sets up and calls the AJAX handlers; it is the primary receiver for action=helpdesk;sa=ajax. Primarily, it expects $context['ajax_return'] to be populated as an array of tags to be returned as XML items to the user, with this element being a key-value pair (e.g. $context['ajax_return']['message'] = 'Success!') to be returned as a literal tag, element message, value of Success!, wrapped in the character data block. An AJAX handler function may also return content in $context['ajax_raw'], this is when the function has prepared its own XML block to return. In such an instance, this function simply outputs the xml headers and assumes the return value is otherwise value. For example, if the error subarray is populated (['error'] = 'Insufficient permission'), the XML block will contain a tag called error, with a CDATA block containing 'Insufficient permission'.
@since 2.1
Receives a request via ?action=helpdesk;sa=ajax;op=privacy to flip the privacy setting. Operations: - silent session check; if fail, add to $context['ajax_return']['error'] - ticket id check; if fail, add to $context['ajax_return']['error'] - get enough ticket data to do this - check if the ticket is not able to be updated (either is closed/deleted, or insufficient permissions); if fail add to $context['ajax_return']['error'] - switch privacy, update database - clear the cache of tickets for the Helpdesk menu item - return $context['ajax_return']['message'] as the new privacy item
Receives request through ?action=helpdesk;sa=ajax;op=urgency;change=x where x is increase or decrease. Operations: - silent session check; if fail, add to $context['ajax_return']['error'] - ticket id check; if fail, add to $context['ajax_return']['error'] - get enough ticket data to do this - check permissions with {@link} and permissions; if fail, add to $context['ajax_return']['error'] - identify whether the new urgency needs 'urgent' styling or not and put the new urgency in $context['ajax_return']['message'] - update the database with the new urgency - identify whether the new urgency continues to allow the current user to change urgency or not - put the button links if appropriate into $context['ajax_return']['increase'] and $context['ajax_return']['decrease'] and return
Operations: - silent session check; if fail, add to $context['ajax_return']['error'] - ticket id check; if fail, add to $context['ajax_return']['error'] - get enough ticket data to do this - check permissions with {@link} and permissions; if fail, add to $context['ajax_return']['error'] - identify whether the new urgency needs 'urgent' styling or not and put the new urgency in $context['ajax_return']['message'] - update the database with the new urgency - identify whether the new urgency continues to allow the current user to change urgency or not - put the button links if appropriate into $context['ajax_return']['increase'] and $context['ajax_return']['decrease'] and return
Operations: - Session check; failing in a regular fashion (as opposed to normal return since we're using ;xml in the URL; the SMF handler can deal with that) - If a message id is provided, query for it. If not found (or not provided), die, otherwise continue. - Call un_preparsecode to remove extraneous sanity encoding. - Build the [quote] bbcode around the post body. - Convert to SMF style BBC-to-HTML if using WYSIWYG - Do other XML sanitising - Return via $context['ajax_raw'] for {@link} to output
Operations: - Session check; failing in a regular fashion (as opposed to normal return since we're using ;xml in the URL; the SMF handler can deal with that) - Checks for a department number in the URL, validates access to that department then queries for the requested template. - Call un_preparsecode to remove extraneous sanity encoding. - Convert to SMF style BBC-to-HTML if using WYSIWYG - Do other XML sanitising - Return via $context['ajax_raw'] for {@link} to output
Operations: - Session check - Permissions check (that you can assign a ticket to someone else); if you can't assign a ticket to someone else, bail. - Get the list of information for a ticket (which implicitly checks ticket access); if you can't see the ticket, bail. - Get the list of who can be assigned a ticket. - Return that via AJAX.
Operations: - Session check - Permissions check (that you can assign a ticket to someone else); if you can't assign a ticket to someone else, bail. - Get the list of information for a ticket (which implicitly checks ticket access); if you can't see the ticket, bail. - Get the list of who can be assigned a ticket; if requested user not on that list, bail. - Update and build return status, and return via AJAX.
Provide the list of possible notification recipients.
Formats a user with a valid profile link.
Parameter: $user_name
Expected type: mixed
Parameter: $user_id
Expected type: mixed
Parameter: $ticket_starter
Expected type: mixed
Page created in 0.016 seconds with 11 queries.