Improves code according to Ivan's comments

This commit is contained in:
Maxi Redigonda 2019-11-14 11:34:20 -03:00
parent 5ab155f8ce
commit 995d302a49
3 changed files with 4 additions and 4 deletions

View File

@ -100,8 +100,8 @@ class CommentController extends Controller {
'name' => $this->ticket->owner->name,
'staff' => true
]);
} else if($isOwner) {
!Controller::request('private') ? $this->sendMail($ticketAuthor) : null;
} else if($isOwner && !Controller::request('private')) {
$this->sendMail($ticketAuthor);
}
Log::createLog('COMMENT', $this->ticket->ticketNumber);

View File

@ -71,7 +71,7 @@ class Log extends DataStore {
'to' => $this->to,
'author' => [
'name' => $this->authorName,
'id' => $author && !$author->isNull() ? $author->id : null,
'id' => ($author && !$author->isNull()) ? $author->id : null,
'staff' => $author instanceof Staff
],
'date' => $this->date

View File

@ -92,7 +92,7 @@ class Ticketevent extends DataStore {
'name' => $user ? $user->name : $author['name'],
'staff' => $user instanceOf Staff,
'id' => $user ? $user->id : null,
'customfields' => $user && $user->xownCustomfieldvalueList ? $user->xownCustomfieldvalueList->toArray() : [],
'customfields' => ($user && $user->xownCustomfieldvalueList) ? $user->xownCustomfieldvalueList->toArray() : [],
],
'edited' => $this->editedContent
];