Guillermo - staff-get-all-tickets[skip ci]

This commit is contained in:
AntonyAntonio 2016-11-19 22:54:08 -03:00
parent 1f7efd4086
commit 66281df491
6 changed files with 42 additions and 1 deletions

View File

@ -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();
}

View File

@ -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 {

View File

@ -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();

View File

@ -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 {

View File

@ -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();

View File

@ -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();