commit
323b481c62
|
@ -35,9 +35,16 @@ class AssignStaffController extends Controller {
|
|||
$this->user->sharedTicketList->add($this->ticket);
|
||||
$this->ticket->owner = $this->user;
|
||||
$this->ticket->unread = true;
|
||||
$event = Ticketevent::getEvent(Ticketevent::ASSIGN);
|
||||
$event->setProperties(array(
|
||||
'authorStaff' => Controller::getLoggedUser(),
|
||||
'date' => Date::getCurrentDate()
|
||||
));
|
||||
$this->ticket->addEvent($event);
|
||||
|
||||
$this->ticket->store();
|
||||
$this->user->store();
|
||||
|
||||
|
||||
Response::respondSuccess();
|
||||
}
|
||||
|
||||
|
|
|
@ -27,6 +27,13 @@ class UnAssignStaffController extends Controller {
|
|||
$user->store();
|
||||
$ticket->owner = null;
|
||||
$ticket->unread = true;
|
||||
$event = Ticketevent::getEvent(Ticketevent::UN_ASSIGN);
|
||||
$event->setProperties(array(
|
||||
'authorStaff' => Controller::getLoggedUser(),
|
||||
'date' => Date::getCurrentDate()
|
||||
));
|
||||
|
||||
$ticket->addEvent($event);
|
||||
$ticket->store();
|
||||
Response::respondSuccess();
|
||||
} else {
|
||||
|
|
|
@ -33,6 +33,13 @@ class ChangeDepartmentController extends Controller {
|
|||
return;
|
||||
}
|
||||
|
||||
$event = Ticketevent::getEvent(Ticketevent::DEPARTMENT_CHANGED);
|
||||
$event->setProperties(array(
|
||||
'authorStaff' => Controller::getLoggedUser(),
|
||||
'content' => $department->name,
|
||||
'date' => Date::getCurrentDate()
|
||||
));
|
||||
$ticket->addEvent($event);
|
||||
$ticket->department = $department;
|
||||
$ticket->unread = true;
|
||||
$ticket->store();
|
||||
|
|
|
@ -29,6 +29,13 @@ class ChangePriorityController extends Controller {
|
|||
if($ticket->owner && $user->id === $ticket->owner->id) {
|
||||
$ticket->priority = $priority;
|
||||
$ticket->unread = true;
|
||||
$event = Ticketevent::getEvent(Ticketevent::PRIORITY_CHANGED);
|
||||
$event->setProperties(array(
|
||||
'authorStaff' => Controller::getLoggedUser(),
|
||||
'content' => $ticket->priority,
|
||||
'date' => Date::getCurrentDate()
|
||||
));
|
||||
$ticket->addEvent($event);
|
||||
$ticket->store();
|
||||
Response::respondSuccess();
|
||||
} else {
|
||||
|
|
|
@ -37,6 +37,13 @@ class CloseController extends Controller {
|
|||
} else {
|
||||
$ticket->unreadStaff = true;
|
||||
}
|
||||
$event = Ticketevent::getEvent(Ticketevent::CLOSE);
|
||||
$event->setProperties(array(
|
||||
'authorStaff' => Controller::getLoggedUser(),
|
||||
'date' => Date::getCurrentDate()
|
||||
));
|
||||
|
||||
$ticket->addEvent($event);
|
||||
$ticket->closed = true;
|
||||
$ticket->store();
|
||||
Response::respondSuccess();
|
||||
|
|
|
@ -35,6 +35,12 @@ class ReOpenController extends Controller {
|
|||
} else {
|
||||
$ticket->unreadStaff = true;
|
||||
}
|
||||
$event = Ticketevent::getEvent(Ticketevent::RE_OPEN);
|
||||
$event->setProperties(array(
|
||||
'authorUser' => Controller::getLoggedUser(),
|
||||
'date' => Date::getCurrentDate()
|
||||
));
|
||||
$ticket->addEvent($event);
|
||||
$ticket->closed = false;
|
||||
$ticket->store();
|
||||
Response::respondSuccess();
|
||||
|
|
|
@ -5,20 +5,21 @@ class Ticketevent extends DataStore {
|
|||
|
||||
const COMMENT = 'COMMENT';
|
||||
const ASSIGN = 'ASSIGN';
|
||||
const UNASSIGN = 'UNASSIGN';
|
||||
const UN_ASSIGN = 'UN_ASSIGN';
|
||||
const CLOSE = 'CLOSE';
|
||||
const REOPEN = 'REOPEN';
|
||||
const RE_OPEN = 'RE_OPEN';
|
||||
const DEPARTMENT_CHANGED = 'DEPARTMENT_CHANGED';
|
||||
const PRIORITY_CHANGED = 'PRIORITY_CHANGED';
|
||||
|
||||
private static function getEventTypes() {
|
||||
return [
|
||||
'COMMENT',
|
||||
'UNASSIGN',
|
||||
'ASSIGN',
|
||||
'UN_ASSIGN',
|
||||
'CLOSE',
|
||||
'REOPEN',
|
||||
'RE_OPEN',
|
||||
'DEPARTMENT_CHANGED',
|
||||
'PRIORITY_CHANGED',
|
||||
'PRIORITY_CHANGED'
|
||||
];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue