/sources/tickets2.php

Description
Functions
add_ticket_type (line 29)

Add a ticket type.

void add_ticket_type (SHORT_TEXT $ticket_type, [BINARY $guest_emails_mandatory = 0], [BINARY $search_faq = 0], [?SHORT_TEXT $send_sms_to = NULL])
  • SHORT_TEXT $ticket_type: The ticket type
  • BINARY $guest_emails_mandatory: Whether guest e-mail addresses are mandatory for new tickets
  • BINARY $search_faq: Whether the FAQ should be searched before submitting a new ticket
  • ?SHORT_TEXT $send_sms_to: Comma-separated list of member IDs to text when a post is made in a ticket of this type (NULL: don't text anyone)
delete_ticket_by_topic_id (line 254)

Remove a ticket from the database. This does not remove the associated forum topic.

void delete_ticket_by_topic_id (AUTO_LINK $topic_id)
  • AUTO_LINK $topic_id: The associated topic ID
delete_ticket_type (line 62)

Delete a ticket type.

void delete_ticket_type (integer $ticket_type)
  • integer $ticket_type: The ticket type
edit_ticket_type (line 46)

Edit a ticket type, keeping the integer ID the same.

void edit_ticket_type (integer $old_ticket_type, ?SHORT_TEXT $new_ticket_type, BINARY $guest_emails_mandatory, BINARY $search_faq, ?SHORT_TEXT $send_sms_to)
  • integer $old_ticket_type: The old ticket type
  • ?SHORT_TEXT $new_ticket_type: The new ticket type (NULL: do not change)
  • BINARY $guest_emails_mandatory: Whether guest e-mail addresses are mandatory for new tickets
  • BINARY $search_faq: Whether the FAQ should be searched before submitting a new ticket
  • ?SHORT_TEXT $send_sms_to: Comma-separated list of member IDs to text when a post is made in a ticket of this type (NULL: don't text anyone)
get_tickets (line 150)

Get an array of tickets for the given member and ticket type. If the member has permission to see others' tickets, it will be a list of all tickets in the system, restricted by ticket type as appropriate. Otherwise, it will be a list of that member's tickets, as restricted by ticket type.

  • return: Array of tickets, empty on failure
array get_tickets (AUTO_LINK $member, [?AUTO_LINK $ticket_type = NULL], [boolean $override_view_others_tickets = false], [boolean $silent_error_handling = false])
  • AUTO_LINK $member: The member ID
  • ?AUTO_LINK $ticket_type: The ticket type (NULL: all ticket types)
  • boolean $override_view_others_tickets: Don't view others' tickets, even if the member has permission to
  • boolean $silent_error_handling: Whether to skip showing errors, returning NULL instead
get_ticket_posts (line 220)

Get the posts from a given ticket, and also return the IDs of the forum and topic containing it. The return value is the same as that of get_forum_topic_posts(), except in error conditions

  • return: The array of maps (Each map is: title, message, member, date) (NULL: no such ticket)
mixed get_ticket_posts (string $ticket_id, AUTO_LINK &$forum, AUTO_LINK &$topic_id, integer &$ticket_type)
  • string $ticket_id: The ticket ID
  • AUTO_LINK &$forum: Return location for the forum ID
  • AUTO_LINK &$topic_id: Return location for the topic ID
  • integer &$ticket_type: Return location for the ticket type
get_ticket_type (line 81)

Get a map of properties for the given ticket type.

  • return: Array of properties (NULL: ticket type not found)
?array get_ticket_type (?integer $ticket_type)
  • ?integer $ticket_type: The ticket type (NULL: fallback for old tickets)
is_ticket_post_staff_only (line 404)

Is the given ticket post intended for staff only? Works only on OCF.

  • return: Whether the post's staff only
boolean is_ticket_post_staff_only (array $post)
  • array $post: Array of data for the post
send_ticket_email (line 306)

Send an e-mail notification for a new post in a support ticket, either to the staff or to the ticket's owner.

void send_ticket_email (string $ticket_id, LONG_TEXT $title, LONG_TEXT $post, mixed $home_url, string $email, integer $ticket_type_if_new)
  • string $ticket_id: The ticket ID
  • LONG_TEXT $title: The ticket title
  • LONG_TEXT $post: The ticket post's content
  • mixed $home_url: The home URL (to view the ticket) (URLPATH or Tempcode URL)
  • string $email: Ticket owner's e-mail address, in the case of a new ticket
  • integer $ticket_type_if_new: The new ticket type, or -1 if it is a reply to an existing ticket
ticket_add_post (line 273)

Add a new post to a ticket, or create a new ticket if a ticket with the given ID doesn't exist.

It has the same return value as make_post_forum_topic().

  • return: Success?
boolean ticket_add_post (AUTO_LINK $member, string $ticket_id, integer $ticket_type, LONG_TEXT $title, LONG_TEXT $post, tempcode $home_link, string $home_url, [boolean $staff_only = false])
  • AUTO_LINK $member: The member ID
  • string $ticket_id: The ticket ID (doesn't have to exist)
  • integer $ticket_type: The ticket type
  • LONG_TEXT $title: The post title
  • LONG_TEXT $post: The post content in Comcode format
  • tempcode $home_link: The home link
  • string $home_url: The home URL
  • boolean $staff_only: Whether the reply is staff only (invisible to ticket owner, only on OCF)
update_ticket_type_lead_times (line 94)

Update the cache of ticket type lead times (average time taken for a response to tickets of that type) in the database.

This is a query-intensive function, so should only be run occasionally.

void update_ticket_type_lead_times ()

Documentation generated on Sun, 02 Jan 2011 23:27:06 +0000 by phpDocumentor 1.4.3