updated, stroing to the db seems to work!
This commit is contained in:
parent
52f90e9261
commit
fa86db3cc7
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!
|
* 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
|
* 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!
|
//create the new ticket!
|
||||||
$ticket = new Ticket();
|
$ticket = new Ticket();
|
||||||
|
@ -92,6 +92,12 @@ class Ticket{
|
||||||
$ticket->create();
|
$ticket->create();
|
||||||
$ticket_id = $ticket->getTId();
|
$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
|
//write a log entry
|
||||||
if ( $author == $real_author){
|
if ( $author == $real_author){
|
||||||
Ticket_Log::createLogEntry( $ticket_id, $author, 1);
|
Ticket_Log::createLogEntry( $ticket_id, $author, 1);
|
||||||
|
@ -104,6 +110,7 @@ class Ticket{
|
||||||
if($for_support_group){
|
if($for_support_group){
|
||||||
Ticket::forwardTicket(0, $ticket_id, $for_support_group);
|
Ticket::forwardTicket(0, $ticket_id, $for_support_group);
|
||||||
}
|
}
|
||||||
|
|
||||||
//send email that new ticket has been created
|
//send email that new ticket has been created
|
||||||
Mail_Handler::send_ticketing_mail($ticket->getAuthor(), $ticket, $content, "NEW", $ticket->getForwardedGroupId());
|
Mail_Handler::send_ticketing_mail($ticket->getAuthor(), $ticket, $content, "NEW", $ticket->getForwardedGroupId());
|
||||||
return $ticket_id;
|
return $ticket_id;
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class Ticket_Log{
|
class Ticket_Info{
|
||||||
|
|
||||||
private $tInfoId;
|
private $tInfoId;
|
||||||
private $ticket;
|
private $ticket;
|
||||||
|
|
||||||
private $shardid;
|
private $shardid;
|
||||||
private $user_position;
|
private $user_position;
|
||||||
private $view_position;
|
private $view_position;
|
||||||
|
@ -20,6 +19,7 @@ class Ticket_Log{
|
||||||
private $cpu_mask;
|
private $cpu_mask;
|
||||||
private $ht;
|
private $ht;
|
||||||
private $nel3d;
|
private $nel3d;
|
||||||
|
private $user_id;
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////Functions////////////////////////////////////////////////////
|
////////////////////////////////////////////Functions////////////////////////////////////////////////////
|
||||||
|
@ -41,7 +41,6 @@ class Ticket_Log{
|
||||||
|
|
||||||
//set values
|
//set values
|
||||||
public function set($values) {
|
public function set($values) {
|
||||||
$this->setTInfoId($values['TInfoId']);
|
|
||||||
$this->setTicket($values['Ticket']);
|
$this->setTicket($values['Ticket']);
|
||||||
$this->setShardId($values['ShardId']);
|
$this->setShardId($values['ShardId']);
|
||||||
$this->setUser_Position($values['UserPosition']);
|
$this->setUser_Position($values['UserPosition']);
|
||||||
|
@ -58,6 +57,8 @@ class Ticket_Log{
|
||||||
$this->setCPU_Mask($values['CpuMask']);
|
$this->setCPU_Mask($values['CpuMask']);
|
||||||
$this->setHT($values['HT']);
|
$this->setHT($values['HT']);
|
||||||
$this->setNel3D($values['NeL3D']);
|
$this->setNel3D($values['NeL3D']);
|
||||||
|
$this->setUser_Id($values['UserId']);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Load with tInfoId
|
//Load with tInfoId
|
||||||
|
@ -78,11 +79,12 @@ class Ticket_Log{
|
||||||
|
|
||||||
//create ticket info
|
//create ticket info
|
||||||
public function create() {
|
public function create() {
|
||||||
$query = "INSERT INTO ticket_Info (TInfoId, Ticket, ShardId, UserPosition,ViewPosition, ClientVersion, PatchVersion,ServerTick, ConnectState, LocalAddress, Memory, OS,
|
$dbl = new DBLayer("lib");
|
||||||
Processor, CPUID, CpuMask, HT, NeL3D) VALUES (:id, :ticket, :shardid, :userposition, :viewposition, :clientversion, :patchversion, :servertick, :connectstate, :localaddress, :memory, :os, :processor, :cpuid, :cpu_mask, :ht, :nel3d )";
|
$query = "INSERT INTO ticket_info ( Ticket, ShardId, UserPosition,ViewPosition, ClientVersion, PatchVersion,ServerTick, ConnectState, LocalAddress, Memory, OS,
|
||||||
$values = Array('id' => $this->getTInfoId(), 'ticket' => $this->getTicket(), 'shardid' => $this->getShardId, 'userposition' => $this->getUser_Position(), 'viewposition' => $this->getView_Position(), 'clientversion' => $this->getClient_Version(),
|
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(),
|
'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);
|
$dbl->execute($query, $values);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,6 +160,11 @@ Processor, CPUID, CpuMask, HT, NeL3D) VALUES (:id, :ticket, :shardid, :userposit
|
||||||
return $this->nel3d;
|
return $this->nel3d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getUser_Id(){
|
||||||
|
return $this->user_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////Setters////////////////////////////////////////////////////
|
////////////////////////////////////////////Setters////////////////////////////////////////////////////
|
||||||
|
|
||||||
public function setTInfoId($id){
|
public function setTInfoId($id){
|
||||||
|
@ -229,4 +236,9 @@ Processor, CPUID, CpuMask, HT, NeL3D) VALUES (:id, :ticket, :shardid, :userposit
|
||||||
$this->nel3d = $n;
|
$this->nel3d = $n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setUser_Id($u){
|
||||||
|
$this->user_id = $u;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -58,6 +58,27 @@
|
||||||
<td>
|
<td>
|
||||||
<input type="hidden" name="function" value="create_ticket">
|
<input type="hidden" name="function" value="create_ticket">
|
||||||
<input type="hidden" name="target_id" value="{$target_id}">
|
<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"/>
|
<input type="submit" value="Send Ticket"/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -18,7 +18,7 @@ function create_ticket(){
|
||||||
}else{
|
}else{
|
||||||
$author= Ticket_User::constr_ExternId($_POST['target_id'])->getTUserId();
|
$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);
|
header("Location: index.php?page=show_ticket&id=".$ticket_id);
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,12 @@ 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
|
//create array of category id & names
|
||||||
$catArray = Ticket_Category::getAllCategories();
|
$catArray = Ticket_Category::getAllCategories();
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 194 KiB After Width: | Height: | Size: 201 KiB |
|
@ -396,14 +396,17 @@
|
||||||
`PatchVersion` VARCHAR(65) NULL ,
|
`PatchVersion` VARCHAR(65) NULL ,
|
||||||
`ServerTick` VARCHAR(40) NULL ,
|
`ServerTick` VARCHAR(40) NULL ,
|
||||||
`ConnectState` VARCHAR(40) NULL ,
|
`ConnectState` VARCHAR(40) NULL ,
|
||||||
`LocalAddress` VARCHAR(60) NULL ,
|
`LocalAddress` VARCHAR(70) NULL ,
|
||||||
`Memory` VARCHAR(60) NULL ,
|
`Memory` VARCHAR(60) NULL ,
|
||||||
`OS` VARCHAR(70) NULL ,
|
`OS` VARCHAR(120) NULL ,
|
||||||
`Processor` VARCHAR(70) NULL ,
|
`Processor` VARCHAR(120) NULL ,
|
||||||
`CPUID` VARCHAR(50) NULL ,
|
`CPUID` VARCHAR(50) NULL ,
|
||||||
`CpuMask` VARCHAR(50) NULL ,
|
`CpuMask` VARCHAR(50) NULL ,
|
||||||
`HT` VARCHAR(65) NULL ,
|
`HT` VARCHAR(35) NULL ,
|
||||||
`NeL3D` VARCHAR(70) NULL ,
|
`NeL3D` VARCHAR(120) NULL ,
|
||||||
|
`PlayerName` VARCHAR(45) NULL ,
|
||||||
|
`UserId` INT NULL ,
|
||||||
|
`TimeInGame` VARCHAR(50) NULL ,
|
||||||
PRIMARY KEY (`TInfoId`) ,
|
PRIMARY KEY (`TInfoId`) ,
|
||||||
INDEX `fk_ticket_info_ticket1` (`Ticket` ASC) ,
|
INDEX `fk_ticket_info_ticket1` (`Ticket` ASC) ,
|
||||||
CONSTRAINT `fk_ticket_info_ticket1`
|
CONSTRAINT `fk_ticket_info_ticket1`
|
||||||
|
|
|
@ -352,12 +352,15 @@ CREATE TABLE IF NOT EXISTS `mydb`.`ticket_info` (
|
||||||
`ConnectState` VARCHAR(40) NULL ,
|
`ConnectState` VARCHAR(40) NULL ,
|
||||||
`LocalAddress` VARCHAR(60) NULL ,
|
`LocalAddress` VARCHAR(60) NULL ,
|
||||||
`Memory` VARCHAR(60) NULL ,
|
`Memory` VARCHAR(60) NULL ,
|
||||||
`OS` VARCHAR(70) NULL ,
|
`OS` VARCHAR(120) NULL ,
|
||||||
`Processor` VARCHAR(70) NULL ,
|
`Processor` VARCHAR(120) NULL ,
|
||||||
`CPUID` VARCHAR(50) NULL ,
|
`CPUID` VARCHAR(50) NULL ,
|
||||||
`CpuMask` VARCHAR(50) NULL ,
|
`CpuMask` VARCHAR(50) NULL ,
|
||||||
`HT` VARCHAR(65) 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`) ,
|
PRIMARY KEY (`TInfoId`) ,
|
||||||
INDEX `fk_ticket_info_ticket1` (`Ticket` ASC) ,
|
INDEX `fk_ticket_info_ticket1` (`Ticket` ASC) ,
|
||||||
CONSTRAINT `fk_ticket_info_ticket1`
|
CONSTRAINT `fk_ticket_info_ticket1`
|
||||||
|
|
Binary file not shown.
Loading…
Reference in a new issue