diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket.php index 386ec5ddf..51f88cbed 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket.php +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket.php @@ -83,7 +83,7 @@ class Ticket{ * creates a ticket + first initial reply and fills in the content of it! * for_support_group defines to which support group the ticket has to be forwarded */ - public static function create_Ticket( $title, $content, $category, $author, $real_author, $for_support_group = 0) { + public static function create_Ticket( $title, $content, $category, $author, $real_author, $for_support_group = 0, $extra_info = 0) { //create the new ticket! $ticket = new Ticket(); @@ -92,6 +92,12 @@ class Ticket{ $ticket->create(); $ticket_id = $ticket->getTId(); + //if ingame then add an extra info + if(Helpers::check_if_game_client() && $extra_info != 0){ + $extra_info['Ticket'] = $ticket_id; + Ticket_Info::create_Ticket_Info($extra_info); + } + //write a log entry if ( $author == $real_author){ Ticket_Log::createLogEntry( $ticket_id, $author, 1); @@ -104,6 +110,7 @@ class Ticket{ if($for_support_group){ Ticket::forwardTicket(0, $ticket_id, $for_support_group); } + //send email that new ticket has been created Mail_Handler::send_ticketing_mail($ticket->getAuthor(), $ticket, $content, "NEW", $ticket->getForwardedGroupId()); return $ticket_id; diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_info.php b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_info.php index 25f07440e..67c33bc41 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_info.php +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/autoload/ticket_info.php @@ -1,10 +1,9 @@ setTInfoId($values['TInfoId']); $this->setTicket($values['Ticket']); $this->setShardId($values['ShardId']); $this->setUser_Position($values['UserPosition']); @@ -58,6 +57,8 @@ class Ticket_Log{ $this->setCPU_Mask($values['CpuMask']); $this->setHT($values['HT']); $this->setNel3D($values['NeL3D']); + $this->setUser_Id($values['UserId']); + } //Load with tInfoId @@ -78,11 +79,12 @@ class Ticket_Log{ //create ticket info public function create() { - $query = "INSERT INTO ticket_Info (TInfoId, Ticket, ShardId, UserPosition,ViewPosition, ClientVersion, PatchVersion,ServerTick, ConnectState, LocalAddress, Memory, OS, -Processor, CPUID, CpuMask, HT, NeL3D) VALUES (:id, :ticket, :shardid, :userposition, :viewposition, :clientversion, :patchversion, :servertick, :connectstate, :localaddress, :memory, :os, :processor, :cpuid, :cpu_mask, :ht, :nel3d )"; - $values = Array('id' => $this->getTInfoId(), 'ticket' => $this->getTicket(), 'shardid' => $this->getShardId, 'userposition' => $this->getUser_Position(), 'viewposition' => $this->getView_Position(), 'clientversion' => $this->getClient_Version(), + $dbl = new DBLayer("lib"); + $query = "INSERT INTO ticket_info ( Ticket, ShardId, UserPosition,ViewPosition, ClientVersion, PatchVersion,ServerTick, ConnectState, LocalAddress, Memory, OS, +Processor, CPUID, CpuMask, HT, NeL3D, UserId) VALUES ( :ticket, :shardid, :userposition, :viewposition, :clientversion, :patchversion, :servertick, :connectstate, :localaddress, :memory, :os, :processor, :cpuid, :cpu_mask, :ht, :nel3d, :user_id )"; + $values = Array('ticket' => $this->getTicket(), 'shardid' => $this->getShardId(), 'userposition' => $this->getUser_Position(), 'viewposition' => $this->getView_Position(), 'clientversion' => $this->getClient_Version(), 'patchversion' => $this->getPatch_Version(), 'servertick' => $this->getServer_Tick(), 'connectstate' => $this->getConnect_State(), 'localaddress' => $this->getLocal_Address(), 'memory' => $this->getMemory(), 'os'=> $this->getOS(), 'processor' => $this->getProcessor(), 'cpuid' => $this->getCPUId(), -'cpu_mask' => $this->getCpu_Mask(), 'ht' => $this->getHT(), 'nel3d' => $this->getNel3D()); +'cpu_mask' => $this->getCpu_Mask(), 'ht' => $this->getHT(), 'nel3d' => $this->getNel3D(), 'user_id' => $this->getUser_Id()); $dbl->execute($query, $values); } @@ -158,6 +160,11 @@ Processor, CPUID, CpuMask, HT, NeL3D) VALUES (:id, :ticket, :shardid, :userposit return $this->nel3d; } + public function getUser_Id(){ + return $this->user_id; + } + + ////////////////////////////////////////////Setters//////////////////////////////////////////////////// public function setTInfoId($id){ @@ -229,4 +236,9 @@ Processor, CPUID, CpuMask, HT, NeL3D) VALUES (:id, :ticket, :shardid, :userposit $this->nel3d = $n; } + public function setUser_Id($u){ + $this->user_id = $u; + } + + } \ No newline at end of file diff --git a/code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/createticket.tpl b/code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/createticket.tpl index dd19fd291..4445fca39 100644 --- a/code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/createticket.tpl +++ b/code/ryzom/tools/server/ryzom_ams/ams_lib/ingame_templates/createticket.tpl @@ -58,6 +58,27 @@