mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-24 09:58:46 +00:00
updated, stroing to the db seems to work!
This commit is contained in:
parent
7f5c11e592
commit
155f7be270
9 changed files with 70 additions and 18 deletions
|
@ -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;
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
<?php
|
||||
|
||||
class Ticket_Log{
|
||||
class Ticket_Info{
|
||||
|
||||
private $tInfoId;
|
||||
private $ticket;
|
||||
|
||||
private $ticket;
|
||||
private $shardid;
|
||||
private $user_position;
|
||||
private $view_position;
|
||||
|
@ -20,6 +19,7 @@ class Ticket_Log{
|
|||
private $cpu_mask;
|
||||
private $ht;
|
||||
private $nel3d;
|
||||
private $user_id;
|
||||
|
||||
|
||||
////////////////////////////////////////////Functions////////////////////////////////////////////////////
|
||||
|
@ -41,7 +41,6 @@ class Ticket_Log{
|
|||
|
||||
//set values
|
||||
public function set($values) {
|
||||
$this->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;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -58,6 +58,27 @@
|
|||
<td>
|
||||
<input type="hidden" name="function" value="create_ticket">
|
||||
<input type="hidden" name="target_id" value="{$target_id}">
|
||||
|
||||
<!-- Additional Ticket info-->
|
||||
{if $ingame}
|
||||
<input type="hidden" name="ShardId" value="{$ShardId}">
|
||||
<input type="hidden" name="UserPosition" value="{$UserPosition}">
|
||||
<input type="hidden" name="ViewPosition" value="{$ViewPosition}">
|
||||
<input type="hidden" name="ClientVersion" value="{$ClientVersion}">
|
||||
<input type="hidden" name="PatchVersion" value="{$PatchVersion}">
|
||||
<input type="hidden" name="ServerTick" value="{$ServerTick}">
|
||||
<input type="hidden" name="ConnectState" value="{$ConnectState}">
|
||||
<input type="hidden" name="LocalAddress" value="{$LocalAddress}">
|
||||
<input type="hidden" name="Memory" value="{$Memory}">
|
||||
<input type="hidden" name="OS" value="{$OS}">
|
||||
<input type="hidden" name="Processor" value="{$Processor}">
|
||||
<input type="hidden" name="CPUID" value="{$CPUID}">
|
||||
<input type="hidden" name="CpuMask" value="{$CpuMask}">
|
||||
<input type="hidden" name="HT" value="{$HT}">
|
||||
<input type="hidden" name="NeL3D" value="{$NeL3D}">
|
||||
<input type="hidden" name="UserId" value="{$UserId}">
|
||||
|
||||
{/if}
|
||||
<input type="submit" value="Send Ticket"/>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -18,7 +18,7 @@ function create_ticket(){
|
|||
}else{
|
||||
$author= Ticket_User::constr_ExternId($_POST['target_id'])->getTUserId();
|
||||
}
|
||||
$ticket_id = Ticket::create_Ticket($title, $content, $category, $author, $_SESSION['ticket_user']->getTUserId());
|
||||
$ticket_id = Ticket::create_Ticket($title, $content, $category, $author, $_SESSION['ticket_user']->getTUserId(),0, $_POST);
|
||||
header("Location: index.php?page=show_ticket&id=".$ticket_id);
|
||||
exit;
|
||||
|
||||
|
|
|
@ -25,7 +25,13 @@ function createticket(){
|
|||
|
||||
|
||||
}
|
||||
if(Helpers::check_if_game_client()){
|
||||
//get all additional info, which is needed for adding the extra info page
|
||||
$result[] = $_GET;
|
||||
$result['ingame'] = true;
|
||||
}
|
||||
|
||||
|
||||
//create array of category id & names
|
||||
$catArray = Ticket_Category::getAllCategories();
|
||||
$result['category'] = Gui_Elements::make_table_with_key_is_id($catArray, Array("getName"), "getTCategoryId" );
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 194 KiB After Width: | Height: | Size: 201 KiB |
|
@ -396,14 +396,17 @@
|
|||
`PatchVersion` VARCHAR(65) NULL ,
|
||||
`ServerTick` VARCHAR(40) NULL ,
|
||||
`ConnectState` VARCHAR(40) NULL ,
|
||||
`LocalAddress` VARCHAR(60) NULL ,
|
||||
`LocalAddress` VARCHAR(70) NULL ,
|
||||
`Memory` VARCHAR(60) NULL ,
|
||||
`OS` VARCHAR(70) NULL ,
|
||||
`Processor` VARCHAR(70) NULL ,
|
||||
`OS` VARCHAR(120) NULL ,
|
||||
`Processor` VARCHAR(120) NULL ,
|
||||
`CPUID` VARCHAR(50) NULL ,
|
||||
`CpuMask` VARCHAR(50) NULL ,
|
||||
`HT` VARCHAR(65) NULL ,
|
||||
`NeL3D` VARCHAR(70) NULL ,
|
||||
`HT` VARCHAR(35) NULL ,
|
||||
`NeL3D` VARCHAR(120) NULL ,
|
||||
`PlayerName` VARCHAR(45) NULL ,
|
||||
`UserId` INT NULL ,
|
||||
`TimeInGame` VARCHAR(50) NULL ,
|
||||
PRIMARY KEY (`TInfoId`) ,
|
||||
INDEX `fk_ticket_info_ticket1` (`Ticket` ASC) ,
|
||||
CONSTRAINT `fk_ticket_info_ticket1`
|
||||
|
|
|
@ -352,12 +352,15 @@ CREATE TABLE IF NOT EXISTS `mydb`.`ticket_info` (
|
|||
`ConnectState` VARCHAR(40) NULL ,
|
||||
`LocalAddress` VARCHAR(60) NULL ,
|
||||
`Memory` VARCHAR(60) NULL ,
|
||||
`OS` VARCHAR(70) NULL ,
|
||||
`Processor` VARCHAR(70) NULL ,
|
||||
`OS` VARCHAR(120) NULL ,
|
||||
`Processor` VARCHAR(120) NULL ,
|
||||
`CPUID` VARCHAR(50) NULL ,
|
||||
`CpuMask` VARCHAR(50) NULL ,
|
||||
`HT` VARCHAR(65) NULL ,
|
||||
`NeL3D` VARCHAR(70) NULL ,
|
||||
`NeL3D` VARCHAR(120) NULL ,
|
||||
`PlayerName` VARCHAR(45) NULL ,
|
||||
`UserId` INT NULL ,
|
||||
`TimeInGame` VARCHAR(50) NULL ,
|
||||
PRIMARY KEY (`TInfoId`) ,
|
||||
INDEX `fk_ticket_info_ticket1` (`Ticket` ASC) ,
|
||||
CONSTRAINT `fk_ticket_info_ticket1`
|
||||
|
|
Binary file not shown.
Loading…
Reference in a new issue