mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-24 15:56:22 +00:00
when the ticket starter replies on a ticket the ticket status changes to waiting for support automatically!
This commit is contained in:
parent
0e0f0c0fd6
commit
d8458b2ddd
2 changed files with 27 additions and 2 deletions
|
@ -99,6 +99,23 @@ class Ticket{
|
|||
return $ticket_id;
|
||||
|
||||
}
|
||||
|
||||
/*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{
|
||||
|
|
|
@ -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();
|
||||
|
@ -57,6 +57,10 @@ class Ticket_Reply{
|
|||
$ticket_reply->set(Array('Ticket' => $ticket_id,'Content' => $content_id,'Author' => $author, 'Hidden' => $hidden));
|
||||
$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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue