mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-24 15:56:22 +00:00
ticket_info class done, however I think I better add a field to the Ticket DB, instead the way I do it now..
This commit is contained in:
parent
468655de0e
commit
7f5c11e592
2 changed files with 20 additions and 20 deletions
|
@ -85,12 +85,14 @@ class Ticket{
|
|||
*/
|
||||
public static function create_Ticket( $title, $content, $category, $author, $real_author, $for_support_group = 0) {
|
||||
|
||||
//create the new ticket!
|
||||
$ticket = new Ticket();
|
||||
$values = array("Title" => $title, "Status"=> 1, "Queue"=> 0, "Ticket_Category" => $category, "Author" => $author, "Priority" => 0);
|
||||
$ticket->set($values);
|
||||
$ticket->create();
|
||||
$ticket_id = $ticket->getTId();
|
||||
|
||||
//write a log entry
|
||||
if ( $author == $real_author){
|
||||
Ticket_Log::createLogEntry( $ticket_id, $author, 1);
|
||||
}else{
|
||||
|
@ -98,11 +100,11 @@ class Ticket{
|
|||
}
|
||||
Ticket_Reply::createReply($content, $author, $ticket_id, 0, $author);
|
||||
|
||||
//send email that new ticket has been created
|
||||
//forwards the ticket directly after creation to the supposed support group
|
||||
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;
|
||||
|
||||
|
|
|
@ -27,19 +27,10 @@ class Ticket_Log{
|
|||
|
||||
|
||||
//Creates a log entry
|
||||
public static function createTicketInfo($info_array) {
|
||||
$dbl = new DBLayer("lib");
|
||||
$query = "INSERT INTO ticket_log (Timestamp, Query, Ticket, Author) VALUES (now(), :query, :ticket, :author )";
|
||||
$values = Array('ticket' => $ticket_id, 'author' => $author_id, 'query' => json_encode(array($action,$arg)));
|
||||
$dbl->execute($query, $values);
|
||||
}
|
||||
|
||||
|
||||
//return constructed element based on TLogId
|
||||
public static function constr_TInfoId( $id) {
|
||||
$instance = new self();
|
||||
$instance->setTInfoId($id);
|
||||
return $instance;
|
||||
public static function create_Ticket_Info($info_array) {
|
||||
$ticket_info = new self();
|
||||
$ticket_info->set($info_array);
|
||||
$ticket_info->create();
|
||||
}
|
||||
|
||||
|
||||
|
@ -55,13 +46,11 @@ class Ticket_Log{
|
|||
$this->setShardId($values['ShardId']);
|
||||
$this->setUser_Position($values['UserPosition']);
|
||||
$this->setView_Position($values['ViewPosition']);
|
||||
|
||||
$this->setClient_Version($values['ClientVersion']);
|
||||
$this->setPatch_Version($values['PatchVersion']);
|
||||
$this->setServer_Tick($values['ServerTick']);
|
||||
$this->setConnect_State($values['ConnectState']);
|
||||
$this->setLocal_Address($values['LocalAddress']);
|
||||
|
||||
$this->setMemory($values['Memory']);
|
||||
$this->setOS($values['OS']);
|
||||
$this->setProcessor($values['Processor']);
|
||||
|
@ -80,13 +69,22 @@ class Ticket_Log{
|
|||
}
|
||||
|
||||
//Load with ticket Id
|
||||
public function load_With_TId( $id) {
|
||||
public function load_With_Ticket( $id) {
|
||||
$dbl = new DBLayer("lib");
|
||||
$statement = $dbl->execute("SELECT * FROM ticket_info WHERE Ticket=:id", array('id' => $id));
|
||||
$row = $statement->fetch();
|
||||
$this->set($row);
|
||||
}
|
||||
|
||||
//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(),
|
||||
'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());
|
||||
$dbl->execute($query, $values);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////Getters////////////////////////////////////////////////////
|
||||
|
|
Loading…
Reference in a new issue