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