when the ticket starter replies on a ticket the ticket status changes to waiting for support automatically!

--HG--
branch : quitta-gsoc-2013
This commit is contained in:
Quitta 2013-07-22 22:58:12 +02:00
parent 6887ee889e
commit 7fba0cab1c
2 changed files with 27 additions and 2 deletions

View file

@ -100,6 +100,23 @@ class Ticket{
}
/*FUNCTION: updateTicketStatus()
*
*
*/
public static function updateTicketStatus( $ticket_id, $newStatus, $author) {
$ticket = new Ticket();
$ticket->load_With_TId($ticket_id);
if ($ticket->getStatus() != $newStatus){
$ticket->setStatus($newStatus);
Ticket_Log::createLogEntry( $ticket_id, $author, 5, $newStatus);
}
$ticket->update();
}
/*FUNCTION: updateTicketStatusAndPriority()
* creates a ticket + first initial reply and fills in the content of it!
*
@ -135,7 +152,7 @@ class Ticket{
$ticket->load_With_TId($ticket_id);
//if status is not closed
if($ticket->getStatus() != 3){
Ticket_Reply::createReply($content, $author, $ticket_id, $hidden);
Ticket_Reply::createReply($content, $author, $ticket_id, $hidden, $ticket->getAuthor());
}else{
//TODO: Show error message that ticket is closed
}
@ -169,7 +186,11 @@ class Ticket{
public static function forwardTicket($user_id, $ticket_id, $group_id){
if(self::ticketExists($ticket_id)){
if(isset($group_id) && $group_id != ""){
//unassign the ticket incase the ticket is assined to yourself
self::unAssignTicket($user_id, $ticket_id);
//forward the ticket
$returnvalue = Forwarded::forwardTicket($group_id, $ticket_id);
//make a log entry of this action
Ticket_Log::createLogEntry( $ticket_id, $user_id, 8, $group_id);
return $returnvalue;
}else{

View file

@ -47,7 +47,7 @@ class Ticket_Reply{
return $result;
}
public static function createReply($content, $author, $ticket_id , $hidden){
public static function createReply($content, $author, $ticket_id , $hidden, $ticket_creator){
$ticket_content = new Ticket_Content();
$ticket_content->setContent($content);
$ticket_content->create();
@ -58,6 +58,10 @@ class Ticket_Reply{
$ticket_reply->create();
$reply_id = $ticket_reply->getTReplyId();
if($ticket_creator == $author){
Ticket::updateTicketStatus( $ticket_id, 1, $author);
}
Ticket_Log::createLogEntry( $ticket_id, $author, 4, $reply_id);
}