From a795c582562968de4d37c4790899fd24d37b6b2d Mon Sep 17 00:00:00 2001 From: Quitta Date: Wed, 28 Aug 2013 05:31:06 +0200 Subject: [PATCH] ticket showing works outgame, but needs fancyfying :D --- .../ryzom_ams/ams_lib/autoload/ticket.php | 5 +++ .../ams_lib/autoload/ticket_info.php | 10 ++++- .../ryzom_ams/www/html/inc/show_ticket.php | 2 + .../www/html/inc/show_ticket_info.php | 39 +++++++++---------- .../www/html/templates/show_ticket.tpl | 2 +- .../www/html/templates/show_ticket_info.tpl | 7 +++- 6 files changed, 41 insertions(+), 24 deletions(-) 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 51f88cbed..321409b24 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 @@ -283,6 +283,11 @@ class Ticket{ $statement = $dbl->execute($query, $values); } + //hasInfo + public function hasInfo(){ + return Ticket_Info::TicketHasInfo($this->getTId()); + } + /*FUNCTION: postreply * returns all possible statusses * 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 67c33bc41..513967c99 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 @@ -33,7 +33,15 @@ class Ticket_Info{ $ticket_info->create(); } - + public static function TicketHasInfo($ticket_id) { + $dbl = new DBLayer("lib"); + //check if ticket is already assigned + if( $dbl->execute(" SELECT * FROM `ticket_info` WHERE `Ticket` = :ticket_id", array('ticket_id' => $ticket_id) )->rowCount() ){ + return true; + }else{ + return false; + } + } ////////////////////////////////////////////Methods//////////////////////////////////////////////////// public function __construct() { diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_ticket.php b/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_ticket.php index 3179a0e25..d69fbc319 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_ticket.php +++ b/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_ticket.php @@ -36,6 +36,7 @@ function show_ticket(){ if(Ticket_User::isMod($_SESSION['ticket_user'])){ $show_as_admin = true; } + $entire_ticket = Ticket::getEntireTicket( $result['ticket_id'],$show_as_admin); Ticket_Log::createLogEntry($result['ticket_id'],$_SESSION['ticket_user']->getTUserId(), 3); $result['ticket_tId'] = $entire_ticket['ticket_obj']->getTId(); @@ -66,6 +67,7 @@ function show_ticket(){ $result['statusList'] = Ticket::getStatusArray(); $result['sGroups'] = Gui_Elements::make_table_with_key_is_id(Support_Group::getAllSupportGroups(), Array("getName"), "getSGroupId" ); } + $result['hasInfo'] = $target_ticket->hasInfo(); return $result; }else{ diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_ticket_info.php b/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_ticket_info.php index e2ee00150..14f9c026c 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_ticket_info.php +++ b/code/ryzom/tools/server/ryzom_ams/www/html/inc/show_ticket_info.php @@ -9,29 +9,28 @@ function show_ticket_info(){ $target_ticket = new Ticket(); $target_ticket->load_With_TId($result['ticket_id']); - if(($target_ticket->getAuthor() == $_SESSION['ticket_user']->getTUserId()) || Ticket_User::isMod($_SESSION['ticket_user'] )){ + if( $target_ticket->hasInfo() && (($target_ticket->getAuthor() == $_SESSION['ticket_user']->getTUserId()) || Ticket_User::isMod($_SESSION['ticket_user'] ))){ $result['ticket_title'] = $target_ticket->getTitle(); $result['ticket_author'] = $target_ticket->getAuthor(); - - $result['shard_id'] = $_GET['ShardId']; - $result['user_position'] = $_GET['UserPosition']; - $result['view_position'] = $_GET['ViewPosition']; - $result['client_version'] = $_GET['ClientVersion']; - $result['patch_version'] = $_GET['PatchVersion']; - - - $result['server_tick'] = $_GET['ServerTick']; - $result['connect_state'] = $_GET['ConnectState']; - $result['local_address'] = $_GET['LocalAddress']; - $result['memory'] = $_GET['Memory']; - $result['os'] = $_GET['OS']; - $result['processor'] = $_GET['Processor']; - $result['cpu_id'] = $_GET['CPUID']; - $result['cpu_mask'] = $_GET['CpuMask']; - $result['ht'] = $_GET['HT']; - - $result['nel3d'] = $_GET['NeL3D']; + $ticket_info = new Ticket_Info(); + $ticket_info->load_With_Ticket($result['ticket_id']); + $result['shard_id'] = $ticket_info->getShardId(); + $result['user_position'] = $ticket_info->getUser_Position(); + $result['view_position'] = $ticket_info->getView_Position(); + $result['client_version'] = $ticket_info->getClient_Version(); + $result['patch_version'] = $ticket_info->getPatch_Version(); + $result['server_tick'] = $ticket_info->getServer_Tick(); + $result['connect_state'] = $ticket_info->getConnect_State(); + $result['local_address'] = $ticket_info->getLocal_Address(); + $result['memory'] = $ticket_info->getMemory(); + $result['os'] = $ticket_info->getOS(); + $result['processor'] = $ticket_info->getProcessor(); + $result['cpu_id'] = $ticket_info->getCPUId(); + $result['cpu_mask'] = $ticket_info->getCPU_Mask(); + $result['ht'] = $ticket_info->getHT(); + $result['nel3d'] = $ticket_info->getNel3D(); + $result['user_id'] = $ticket_info->getUser_Id(); if(Ticket_User::isMod($_SESSION['ticket_user'])){ $result['isMod'] = "TRUE"; diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/templates/show_ticket.tpl b/code/ryzom/tools/server/ryzom_ams/www/html/templates/show_ticket.tpl index a7cbc7777..1ac5b2f46 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/templates/show_ticket.tpl +++ b/code/ryzom/tools/server/ryzom_ams/www/html/templates/show_ticket.tpl @@ -224,7 +224,7 @@
  • {if isset($isMod) and $isMod eq "TRUE"}
  • Show Ticket Log
  • {/if}
  • Send Other Ticket
  • -
  • Show ticket Info
  • + {if $hasInfo}
  • Show ticket Info
  • {/if}
  • diff --git a/code/ryzom/tools/server/ryzom_ams/www/html/templates/show_ticket_info.tpl b/code/ryzom/tools/server/ryzom_ams/www/html/templates/show_ticket_info.tpl index cf256946b..54f8e13d2 100644 --- a/code/ryzom/tools/server/ryzom_ams/www/html/templates/show_ticket_info.tpl +++ b/code/ryzom/tools/server/ryzom_ams/www/html/templates/show_ticket_info.tpl @@ -16,7 +16,7 @@
    - + @@ -60,7 +60,10 @@ - + + + +
    Shard ID: {$shard_id} Shard ID: {$shard_id}
    User Position: {$user_position}
    nel3d: {$nel3d}
    user_id: {$user_id}