36 lines
899 B
PHP
36 lines
899 B
PHP
<?php
|
|
|
|
namespace Admin;
|
|
|
|
class TicketOptionsController extends \BaseController
|
|
{
|
|
public function listPriorities()
|
|
{
|
|
$this->requireLogin();
|
|
// TODO: check admin
|
|
|
|
$model = new \TicketPriority($this->getDB());
|
|
$priorities = $model->findAll();
|
|
|
|
$this->renderView('/ui/views/admin/priorities/index.html', [
|
|
'priorities' => $priorities
|
|
]);
|
|
}
|
|
|
|
public function createPriorityForm()
|
|
{
|
|
$this->requireLogin();
|
|
$this->renderView('/ui/views/admin/priorities/create.html');
|
|
}
|
|
|
|
public function createPriority()
|
|
{
|
|
$this->requireLogin();
|
|
$p = new \TicketPriority($this->getDB());
|
|
$p->name = $this->f3->get('POST.name');
|
|
$p->sort_order = $this->f3->get('POST.sort_order');
|
|
$p->save();
|
|
}
|
|
|
|
// TODO: editPriorityForm(), updatePriorityForm(), deletePriorityForm()
|
|
} |