Skip to content

Commit

Permalink
fix image displaying
Browse files Browse the repository at this point in the history
  • Loading branch information
guillegiu committed Apr 16, 2020
1 parent 33bf2c4 commit 2aded07
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions server/controllers/ticket/comment.php
Expand Up @@ -38,6 +38,7 @@ class CommentController extends Controller {
private $ticket;
private $content;
private $session;
private $imagePaths;

public function validations() {
$this->session = Session::getInstance();
Expand Down Expand Up @@ -119,12 +120,12 @@ private function requestData() {
private function storeComment() {
$fileUploader = FileUploader::getInstance();
$fileUploader->setPermission(FileManager::PERMISSION_TICKET, $this->ticket->ticketNumber);
$imagePaths = $this->uploadImages(Controller::isStaffLogged());
$this->imagePaths = $this->uploadImages(Controller::isStaffLogged());
$fileUploader = $this->uploadFile(Controller::isStaffLogged());

$comment = Ticketevent::getEvent(Ticketevent::COMMENT);
$comment->setProperties(array(
'content' => $this->replaceWithImagePaths($imagePaths, $this->content),
'content' => $this->replaceWithImagePaths($this->imagePaths, $this->content),
'file' => ($fileUploader instanceof FileUploader) ? $fileUploader->getFileName() : null,
'date' => Date::getCurrentDate(),
'private' => (Controller::isStaffLogged() && Controller::request('private')) ? 1 : 0
Expand Down Expand Up @@ -164,7 +165,7 @@ private function sendMail($recipient) {
'name' => $name,
'title' => $this->ticket->title,
'ticketNumber' => $this->ticket->ticketNumber,
'content' => $this->content,
'content' => $this->replaceWithImagePaths($this->imagePaths, $this->content),
'url' => $url
]);

Expand Down

0 comments on commit 2aded07

Please sign in to comment.