Guillermo - Ticket-seen [skip ci]
This commit is contained in:
parent
ef3bd809aa
commit
221288402e
|
@ -34,6 +34,7 @@ class AssignStaffController extends Controller {
|
|||
} else {
|
||||
$this->user->sharedTicketList->add($this->ticket);
|
||||
$this->ticket->owner = $this->user;
|
||||
$this->ticket->unread = true;
|
||||
$this->ticket->store();
|
||||
$this->user->store();
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ class UnAssignStaffController extends Controller {
|
|||
$user->sharedTicketList->remove($ticket);
|
||||
$user->store();
|
||||
$ticket->owner = null;
|
||||
$ticket->uread = true;
|
||||
$ticket->store();
|
||||
Response::respondSuccess();
|
||||
} else {
|
||||
|
|
|
@ -34,6 +34,7 @@ class ChangeDepartmentController extends Controller {
|
|||
}
|
||||
|
||||
$ticket->department = $department;
|
||||
$ticket->unread = true;
|
||||
$ticket->store();
|
||||
Response::respondSuccess();
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@ class ChangePriorityController extends Controller {
|
|||
|
||||
if($ticket->owner && $user->id === $ticket->owner->id) {
|
||||
$ticket->priority = $priority;
|
||||
$ticket->unread = true;
|
||||
$ticket->store();
|
||||
Response::respondSuccess();
|
||||
} else {
|
||||
|
|
|
@ -32,6 +32,11 @@ class CloseController extends Controller {
|
|||
return;
|
||||
}
|
||||
|
||||
if(Controller::isStaffLogged()) {
|
||||
$ticket->unread = true;
|
||||
} else {
|
||||
$ticket->unreadStaff = true;
|
||||
}
|
||||
$ticket->closed = true;
|
||||
$ticket->store();
|
||||
Response::respondSuccess();
|
||||
|
|
|
@ -51,11 +51,11 @@ class CommentController extends Controller {
|
|||
));
|
||||
|
||||
if(Controller::isStaffLogged()) {
|
||||
$comment->authorUser = Controller::getLoggedUser();
|
||||
$this->ticket->unread = true;
|
||||
} else {
|
||||
$comment->authorUser = Controller::getLoggedUser();
|
||||
$this->ticket->unreadStaff = true;
|
||||
}
|
||||
|
||||
$comment->authorUser = Controller::getLoggedUser();
|
||||
$this->ticket->addEvent($comment);
|
||||
$this->ticket->store();
|
||||
}
|
||||
|
|
|
@ -58,6 +58,7 @@ class CreateController extends Controller {
|
|||
'file' => '',
|
||||
'date' => Date::getCurrentDate(),
|
||||
'unread' => false,
|
||||
'unreadStaff' => true,
|
||||
'closed' => false,
|
||||
));
|
||||
|
||||
|
|
|
@ -30,7 +30,11 @@ class ReOpenController extends Controller {
|
|||
Response::respondError(ERRORS::NO_PERMISSION);
|
||||
return;
|
||||
}
|
||||
|
||||
if(Controller::isStaffLogged()) {
|
||||
$ticket->unread = true;
|
||||
} else {
|
||||
$ticket->unreadStaff = true;
|
||||
}
|
||||
$ticket->closed = false;
|
||||
$ticket->store();
|
||||
Response::respondSuccess();
|
||||
|
|
|
@ -21,13 +21,13 @@ class SeenController extends Controller {
|
|||
$user = Controller::getLoggedUser();
|
||||
$ticket = Ticket::getByTicketNumber($ticketnumber);
|
||||
|
||||
if (Controller::isStaffLogged() && $ticket->owner_id === $user->id) {
|
||||
if (Controller::isStaffLogged() && $ticket->owner && $ticket->owner->id === $user->id) {
|
||||
$ticket->unreadStaff = false;
|
||||
$ticket->store();
|
||||
Response::respondSuccess();
|
||||
return;
|
||||
}
|
||||
if (!Controller::isStaffLogged() && $user->id === $ticket->author_id) {
|
||||
if (!Controller::isStaffLogged() && $ticket->author && $user->id === $ticket->author->id) {
|
||||
$ticket->unread = false;
|
||||
$ticket->store();
|
||||
Response::respondSuccess();
|
||||
|
|
Loading…
Reference in New Issue