mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-25 08:36:14 +00:00
Show_Ticket starts to work :)
This commit is contained in:
parent
3dbf4a63ce
commit
9ae290ca2e
7 changed files with 64 additions and 8 deletions
|
@ -8,7 +8,25 @@ class Gui_Elements{
|
|||
foreach($inputList as $element){
|
||||
$j = 0;
|
||||
foreach($funcArray as $function){
|
||||
$result[$i][$fieldArray[$j]] = $element->$function();
|
||||
$fnames = explode('->', $function);
|
||||
$intermediate_result = NULL;
|
||||
foreach($fnames as $fname) {
|
||||
if(substr($fname, -2) == "()") {
|
||||
$fname = substr($fname, 0, strlen($fname)-2);
|
||||
if($intermediate_result == NULL) {
|
||||
$intermediate_result = $element->$fname();
|
||||
} else {
|
||||
$intermediate_result = $intermediate_result->$fname();
|
||||
}
|
||||
} else {
|
||||
if($intermediate_result == NULL) {
|
||||
$intermediate_result = $element->$fname();
|
||||
} else {
|
||||
$intermediate_result = $intermediate_result->$fname();
|
||||
}
|
||||
}
|
||||
}
|
||||
$result[$i][$fieldArray[$j]] = $intermediate_result;
|
||||
$j++;
|
||||
}
|
||||
$i++;
|
||||
|
|
|
@ -12,7 +12,19 @@ class Ticket{
|
|||
|
||||
////////////////////////////////////////////Functions////////////////////////////////////////////////////
|
||||
|
||||
/*FUNCTION: getTicketTitlesOf()
|
||||
/*FUNCTION: getEntireTicket
|
||||
* return all ticket of the given author's id.
|
||||
*
|
||||
*/
|
||||
public static function getEntireTicket($id, $db_data) {
|
||||
$ticket = new Ticket($db_data);
|
||||
$ticket->load_With_TId($id);
|
||||
$reply_array = Ticket_Reply::getRepliesOfTicket($id,$db_data);
|
||||
return Array('ticket_obj' => $ticket,'reply_array' => $reply_array);
|
||||
}
|
||||
|
||||
|
||||
/*FUNCTION: getTicketTitlesOf
|
||||
* return all ticket of the given author's id.
|
||||
*
|
||||
*/
|
||||
|
@ -58,6 +70,8 @@ class Ticket{
|
|||
$ticket_reply->set($ticket_id, $content_id, $author);
|
||||
$ticket_reply->create();
|
||||
|
||||
return $ticket_id;
|
||||
|
||||
}
|
||||
|
||||
////////////////////////////////////////////Methods////////////////////////////////////////////////////
|
||||
|
|
|
@ -58,7 +58,7 @@ class Ticket_Content{
|
|||
|
||||
|
||||
public function getTContentId(){
|
||||
return $this->tContentId;
|
||||
return nl2br($this->tContentId);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -17,6 +17,29 @@ class Ticket_Reply{
|
|||
return $instance;
|
||||
}
|
||||
|
||||
//return constructed element based on TCategoryId
|
||||
public static function getRepliesOfTicket( $ticket_id, $db_data) {
|
||||
$dbl = new DBLayer($db_data);
|
||||
$statement = $dbl->execute("SELECT * FROM ticket_reply INNER JOIN ticket_content ON ticket_reply.Content = ticket_content.TContentId and ticket_reply.Ticket=:id", array('id' => $ticket_id));
|
||||
$row = $statement->fetchAll();
|
||||
$result = Array();
|
||||
foreach($row as $tReply){
|
||||
$instanceReply = new self($db_data);
|
||||
$instanceReply->setTReplyId($tReply['TReplyId']);
|
||||
$instanceReply->setTimestamp($tReply['Timestamp']);
|
||||
$instanceReply->set($tReply['Ticket'],$tReply['Content'],$tReply['Author']);
|
||||
|
||||
$instanceContent = new Ticket_Content($db_data);
|
||||
$instanceContent->setTContentId($tReply['TContentId']);
|
||||
$instanceContent->setContent($tReply['Content']);
|
||||
|
||||
$instanceReply->setContent($instanceContent);
|
||||
|
||||
$result[] = $instanceReply;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////Methods////////////////////////////////////////////////////
|
||||
|
||||
public function __construct($db_data) {
|
||||
|
@ -26,9 +49,9 @@ class Ticket_Reply{
|
|||
|
||||
//Set ticket_reply object
|
||||
public function set($t,$c,$a){
|
||||
$this->ticket = $t;
|
||||
$this->content = $c;
|
||||
$this->author = $a;
|
||||
$this->setTicket($t);
|
||||
$this->setContent($c);
|
||||
$this->setAuthor($a);
|
||||
}
|
||||
|
||||
//create ticket by writing private data to DB.
|
||||
|
|
|
@ -20,6 +20,7 @@ name = "Name"
|
|||
email = "Email"
|
||||
action = "Action"
|
||||
|
||||
[show_ticket]
|
||||
[show_user]
|
||||
|
||||
[createticket]
|
||||
|
|
|
@ -21,7 +21,7 @@ email = "Email"
|
|||
action = "Action"
|
||||
|
||||
[createticket]
|
||||
|
||||
[show_ticket]
|
||||
[show_user]
|
||||
|
||||
[error]
|
||||
|
|
Loading…
Reference in a new issue