Ryzom Account Management System  1.0
Public Member Functions | Static Public Member Functions | Private Attributes
Ticket Class Reference

class that handles most ticket related functions. More...

Public Member Functions

 __construct ()
 A constructor.
 set ($values)
 sets the object's attributes.
 create ()
 creates a new 'ticket' entry.
 load_With_TId ($id)
 loads the object's attributes.
 update ()
 update the objects attributes to the db.
 hasInfo ()
 check if a ticket has a ticket_info page or not.
 getTId ()
 get tId attribute of the object.
 getTimestamp ()
 get timestamp attribute of the object in the format defined in the outputTime function of the Helperclass.
 getTitle ()
 get title attribute of the object.
 getStatus ()
 get status attribute of the object.
 getStatusText ()
 get status attribute of the object in the form of text (string).
 getCategoryName ()
 get category attribute of the object in the form of text (string).
 getQueue ()
 get queue attribute of the object.
 getTicket_Category ()
 get ticket_category attribute of the object (int).
 getAuthor ()
 get author attribute of the object (int).
 getPriority ()
 get priority attribute of the object (int).
 getPriorityText ()
 get priority attribute of the object in the form of text (string).
 getAssigned ()
 get the user assigned to the ticket.
 getForwardedGroupName ()
 get the name of the support group to whom the ticket is forwarded or return 0 in case not forwarded.
 getForwardedGroupId ()
 get the id of the support group to whom the ticket is forwarded or return 0 in case not forwarded.
 setTId ($id)
 set tId attribute of the object.
 setTimestamp ($ts)
 set timestamp attribute of the object.
 setTitle ($t)
 set title attribute of the object.
 setStatus ($s)
 set status attribute of the object.
 setQueue ($q)
 set queue attribute of the object.
 setTicket_Category ($tc)
 set ticket_category attribute of the object.
 setAuthor ($a)
 set author attribute of the object.
 setPriority ($p)
 set priority attribute of the object.

Static Public Member Functions

static ticketExists ($id)
 check if a ticket exists.
static getStatusArray ()
 return an array of the possible statuses
static getPriorityArray ()
 return an array of the possible priorities
static getEntireTicket ($id, $view_as_admin)
 return an entire ticket.
static getTicketsOf ($author)
 return all tickets of a specific user.
static create_Ticket ($title, $content, $category, $author, $real_author, $for_support_group=0, $extra_info=0)
 function that creates a new ticket.
static updateTicketStatus ($ticket_id, $newStatus, $author)
 updates the ticket's status.
static updateTicketStatusAndPriority ($ticket_id, $newStatus, $newPriority, $author)
 updates the ticket's status & priority.
static getLatestReply ($ticket_id)
 return the latest reply of a ticket
static createReply ($content, $author, $ticket_id, $hidden)
 create a new reply for a ticket.
static assignTicket ($user_id, $ticket_id)
 assign a ticket to a user.
static unAssignTicket ($user_id, $ticket_id)
 unassign a ticket of a user.
static forwardTicket ($user_id, $ticket_id, $group_id)
 forward a ticket to a specific support group.

Private Attributes

 $tId
 The id of ticket.
 $timestamp
 Timestamp of the ticket.
 $title
 Title of the ticket.
 $status
 Status of the ticket (0 = waiting on user reply, 1 = waiting on support, (2= not used atm), 3 = closed.
 $queue
 (not in use atm)
 $ticket_category
 the id of the category belonging to the ticket
 $author
 The ticket_users id.
 $priority
 The priority of the ticket where 0 = low, 3= supadupahigh.

Detailed Description

class that handles most ticket related functions.

the ticket class is used for most ticketing related functions, it also holds some wrapper functions.

Author:
Daan Janssens, mentored by Matthew Lagoe

Constructor & Destructor Documentation

A constructor.

Empty constructor


Member Function Documentation

static assignTicket ( user_id,
ticket_id 
) [static]

assign a ticket to a user.

Checks if the ticket exists, if so then it will try to assign the user to it, a log entry will be written about this.

Parameters:
$user_idthe id of user trying to be assigned to the ticket.
$ticket_idthe id of the ticket that we try to assign to the user.
Returns:
SUCCESS_ASSIGNED, TICKET_NOT_EXISTING or ALREADY_ASSIGNED
create ( )

creates a new 'ticket' entry.

this method will use the object's attributes for creating a new 'ticket' entry in the database.

static create_Ticket ( title,
content,
category,
author,
real_author,
for_support_group = 0,
extra_info = 0 
) [static]

function that creates a new ticket.

A new ticket will be created, in case the extra_info != 0 and the http request came from ingame, then a ticket_info page will be created. A log entry will be written, depending on the $real_authors value. In case the for_support_group parameter is set, the ticket will be forwarded immediately. Also the mail handler will create a new email that will be sent to the author to notify him that his ticket is freshly created.

Parameters:
$titlethe title we want to give to the ticket.
$contentthe content we want to give to the starting post of the ticket.
$categorythe id of the category that should be related to the ticket.
$authorthe person who's id will be stored in the database as creator of the ticket.
$real_authorshould be the same id, or a moderator/admin who creates a ticket for another user (this is used for logging purposes).
$for_support_groupin case you directly want to forward the ticket after creating it. (default value = 0 = don't forward)
$extra_infoused for creating an ticket_info page related to the ticket, this only happens when the ticket is made ingame.
Returns:
the created tickets id.
static createReply ( content,
author,
ticket_id,
hidden 
) [static]

create a new reply for a ticket.

A reply will only be added if the content isn't empty and if the ticket isn't closed. The ticket creator will be notified by email that someone else replied on his ticket.

Parameters:
$contentthe content of the reply
$authorthe author of the reply
$ticket_idthe id of the ticket to which we want to add the reply.
$hiddenboolean that specifies if the reply should only be shown to mods/admins or all users.
static forwardTicket ( user_id,
ticket_id,
group_id 
) [static]

forward a ticket to a specific support group.

Checks if the ticket exists, if so then it will try to forward the ticket to the support group specified, a log entry will be written about this. if no log entry should be written then the user_id should be 0, else te $user_id will be used in the log to specify who forwarded it.

Parameters:
$user_idthe id of user trying to forward the ticket.
$ticket_idthe id of the ticket that we try to forward to a support group.
$group_idthe id of the support group.
Returns:
SUCCESS_FORWARDED, TICKET_NOT_EXISTING or INVALID_SGROUP

get the user assigned to the ticket.

or return 0 in case not assigned.

getAuthor ( )

get author attribute of the object (int).

get category attribute of the object in the form of text (string).

static getEntireTicket ( id,
view_as_admin 
) [static]

return an entire ticket.

returns the ticket object and an array of all replies to that ticket.

Parameters:
$idthe id of the ticket.
$view_as_admintrue if the viewer of the ticket is a mod, else false (depending on this it will also show the hidden comments)
Returns:
an array containing the 'ticket_obj' and a 'reply_array', which is an array containing all replies to that ticket.

get the id of the support group to whom the ticket is forwarded or return 0 in case not forwarded.

get the name of the support group to whom the ticket is forwarded or return 0 in case not forwarded.

static getLatestReply ( ticket_id) [static]

return the latest reply of a ticket

Parameters:
$ticket_idthe id of the ticket.
Returns:
a ticket_reply object.

get priority attribute of the object (int).

static getPriorityArray ( ) [static]

return an array of the possible priorities

Returns:
an array containing the string values that represent the different priorities.

get priority attribute of the object in the form of text (string).

getQueue ( )

get queue attribute of the object.

getStatus ( )

get status attribute of the object.

static getStatusArray ( ) [static]

return an array of the possible statuses

Returns:
an array containing the string values that represent the different statuses.

get status attribute of the object in the form of text (string).

get ticket_category attribute of the object (int).

static getTicketsOf ( author) [static]

return all tickets of a specific user.

an array of all tickets created by a specific user are returned by this function.

Parameters:
$authorthe id of the user of whom we want all tickets from.
Returns:
an array containing all ticket objects related to a user.
getTId ( )

get tId attribute of the object.

get timestamp attribute of the object in the format defined in the outputTime function of the Helperclass.

getTitle ( )

get title attribute of the object.

hasInfo ( )

check if a ticket has a ticket_info page or not.

Returns:
true or false
load_With_TId ( id)

loads the object's attributes.

loads the object's attributes by giving a TId (ticket id).

Parameters:
$idthe id of the ticket that should be loaded
set ( values)

sets the object's attributes.

Parameters:
$valuesshould be an array of the form array('TId' => ticket_id, 'Title' => title, 'Status'=> status, 'Timestamp' => ts, 'Queue' => queue, 'Ticket_Category' => tc, 'Author' => author, 'Priority' => priority).
setAuthor ( a)

set author attribute of the object.

Parameters:
$aauthor of the ticket
setPriority ( p)

set priority attribute of the object.

Parameters:
$ppriority of the ticket
setQueue ( q)

set queue attribute of the object.

Parameters:
$qqueue of the ticket
setStatus ( s)

set status attribute of the object.

Parameters:
$sstatus of the ticket(int)
setTicket_Category ( tc)

set ticket_category attribute of the object.

Parameters:
$tcticket_category id of the ticket(int)
setTId ( id)

set tId attribute of the object.

Parameters:
$idinteger id of the ticket
setTimestamp ( ts)

set timestamp attribute of the object.

Parameters:
$tstimestamp of the ticket
setTitle ( t)

set title attribute of the object.

Parameters:
$ttitle of the ticket
static ticketExists ( id) [static]

check if a ticket exists.

Parameters:
$idthe id of the ticket to be checked.
Returns:
true if the ticket exists, else false.
static unAssignTicket ( user_id,
ticket_id 
) [static]

unassign a ticket of a user.

Checks if the ticket exists, if so then it will try to unassign the user of it, a log entry will be written about this.

Parameters:
$user_idthe id of user trying to be assigned to the ticket.
$ticket_idthe id of the ticket that we try to assign to the user.
Returns:
SUCCESS_UNASSIGNED, TICKET_NOT_EXISTING or NOT_ASSIGNED
update ( )

update the objects attributes to the db.

static updateTicketStatus ( ticket_id,
newStatus,
author 
) [static]

updates the ticket's status.

A log entry about this will be created only if the newStatus is different from the current status.

Parameters:
$ticket_idthe id of the ticket of which we want to change the status.
$newStatusthe new status value (integer)
$authorthe user (id) that performed the update status action
static updateTicketStatusAndPriority ( ticket_id,
newStatus,
newPriority,
author 
) [static]

updates the ticket's status & priority.

A log entry about this will be created only if the newStatus is different from the current status and also when the newPriority is different from the current priority.

Todo:
break this function up into a updateStatus (already exists) and updatePriority function and perhaps write a wrapper function for the combo.
Parameters:
$ticket_idthe id of the ticket of which we want to change the status & priority
$newStatusthe new status value (integer)
$newPrioritythe new priority value (integer)
$authorthe user (id) that performed the update

Field Documentation

$author [private]

The ticket_users id.

$priority [private]

The priority of the ticket where 0 = low, 3= supadupahigh.

$queue [private]

(not in use atm)

$status [private]

Status of the ticket (0 = waiting on user reply, 1 = waiting on support, (2= not used atm), 3 = closed.

$ticket_category [private]

the id of the category belonging to the ticket

$tId [private]

The id of ticket.

$timestamp [private]

Timestamp of the ticket.

$title [private]

Title of the ticket.


The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables