diff --git a/api/Controllers/Tickets/TicketController.php b/api/Controllers/Tickets/TicketController.php index 57125ccb..daf12f72 100644 --- a/api/Controllers/Tickets/TicketController.php +++ b/api/Controllers/Tickets/TicketController.php @@ -2,6 +2,7 @@ namespace Controllers\Tickets; +use BusinessLogic\Tickets\TicketCreator; use BusinessLogic\Tickets\TicketRetriever; @@ -14,4 +15,15 @@ class TicketController { output($ticketRetriever->getTicketById($id, $hesk_settings, $userContext)); } + + 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); + } } \ No newline at end of file diff --git a/api/autoload.php b/api/autoload.php index c00cea7b..bb2c67a4 100644 --- a/api/autoload.php +++ b/api/autoload.php @@ -17,4 +17,5 @@ hesk_load_api_database_functions(); require_once(__DIR__ . '/../inc/custom_fields.inc.php'); // Load the ApplicationContext -$applicationContext = new \ApplicationContext(); \ No newline at end of file +$applicationContext = new \ApplicationContext(); +$modsForHeskSettings = mfh_getSettings(); \ No newline at end of file