2017-01-31 22:26:46 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Controllers\Tickets;
|
|
|
|
|
2017-02-13 13:02:40 -05:00
|
|
|
use BusinessLogic\Tickets\TicketCreator;
|
2017-01-31 22:26:46 -05:00
|
|
|
use BusinessLogic\Tickets\TicketRetriever;
|
|
|
|
|
|
|
|
|
|
|
|
class TicketController {
|
|
|
|
function get($id) {
|
|
|
|
global $applicationContext, $hesk_settings, $userContext;
|
|
|
|
|
|
|
|
/* @var $ticketRetriever TicketRetriever */
|
|
|
|
$ticketRetriever = $applicationContext->get['TicketRetriever'];
|
|
|
|
|
|
|
|
output($ticketRetriever->getTicketById($id, $hesk_settings, $userContext));
|
|
|
|
}
|
2017-02-13 13:02:40 -05:00
|
|
|
|
|
|
|
function post() {
|
|
|
|
global $applicationContext, $hesk_settings, $modsForHeskSettings, $userContext;
|
|
|
|
|
|
|
|
/* @var $ticketCreator TicketCreator */
|
|
|
|
$ticketCreator = $applicationContext->get[TicketCreator::class];
|
|
|
|
|
|
|
|
//-- TODO Parse POST data
|
|
|
|
|
|
|
|
$ticketCreator->createTicketByCustomer(null, $hesk_settings, $modsForHeskSettings, $userContext);
|
|
|
|
}
|
2017-01-31 22:26:46 -05:00
|
|
|
}
|