Beispiel #1
0
 /**
  * Displays details for a ticket
  *
  * @apiMethod GET
  * @apiUri    /support/{ticket}
  * @apiParameter {
  * 		"name":        "ticket",
  * 		"description": "Ticket identifier",
  * 		"type":        "integer",
  * 		"required":    true,
  * 		"default":     0
  * }
  * @return    void
  */
 public function readTask()
 {
     $this->requiresAuthentication();
     if (!$this->acl->check('read', 'tickets')) {
         throw new Exception(Lang::txt('Not authorized'), 403);
     }
     // Initiate class and bind data to database fields
     $ticket_id = Request::getInt('ticket', 0);
     // Initiate class and bind data to database fields
     $ticket = new \Components\Support\Models\Ticket($ticket_id);
     $response = new stdClass();
     $response->id = $ticket->get('id');
     $response->owner = new stdClass();
     $response->owner->username = $ticket->owner('username');
     $response->owner->name = $ticket->owner('name');
     $response->owner->id = $ticket->owner('id');
     $response->reporter = new stdClass();
     $response->reporter->name = $ticket->submitter('name');
     $response->reporter->username = $ticket->submitter('username');
     $response->reporter->email = $ticket->submitter('email');
     $response->status = new stdClass();
     $response->status->alias = $ticket->status('class');
     $response->status->title = $ticket->status('text');
     $response->status->id = $ticket->get('status');
     foreach (array('created', 'severity', 'os', 'browser', 'ip', 'hostname', 'uas', 'referrer', 'open', 'closed') as $prop) {
         $response->{$prop} = $ticket->get($prop);
     }
     $response->report = $ticket->content('raw');
     $response->url = str_replace('/api', '', rtrim(Request::base(), '/') . '/' . ltrim(Route::url('index.php?option=com_support&controller=tickets&task=tickets&id=' . $response->id), '/'));
     $response->comments = array();
     foreach ($ticket->comments() as $comment) {
         $c = new stdClass();
         $c->id = $comment->get('id');
         $c->created = $comment->get('created');
         $c->creator = new stdClass();
         $c->creator->username = $comment->creator('username');
         $c->creator->name = $comment->creator('name');
         $c->creator->id = $comment->creator('id');
         $c->private = $comment->access ? true : false;
         $c->content = $comment->content('raw');
         $response->comments[] = $c;
     }
     $this->send($response);
 }
Beispiel #2
0
                		}*/
                echo $this->escape(stripslashes($row->get('group')));
                //'<a href="' . Route::url('index.php?option=' . $this->option . '&controller=' . $this->controller . '&task=display&show=' . $queryid . '&find=' . urlencode('group:' . $this->escape(stripslashes($row->get('group'))))) . '">' . $this->escape(stripslashes($row->get('group'))) . '</a>';
                ?>
											</span>
										<?php 
            }
            ?>
										<?php 
            if ($row->isOwned()) {
                ?>
											<span class="ticket-owner hasTip" title="<?php 
                echo Lang::txt('COM_SUPPORT_ASSIGNED_TO');
                ?>
::<img border=&quot;1&quot; src=&quot;<?php 
                echo $row->owner()->picture();
                ?>
&quot; name=&quot;imagelib&quot; alt=&quot;User photo&quot; width=&quot;40&quot; height=&quot;40&quot; style=&quot;float: left; margin-right: 0.5em;&quot; /><?php 
                echo $this->escape(stripslashes($row->owner()->get('username')));
                ?>
<br /><?php 
                echo $this->escape(stripslashes($row->owner()->get('organization', Lang::txt('COM_SUPPORT_UNKNOWN'))));
                ?>
">
												<?php 
                echo $this->escape(stripslashes($row->owner()->get('name')));
                ?>
											</span>
										<?php 
            }
            ?>