Browse Source

Commit 15/10/2024

master
Alice Tossici 1 year ago
parent
commit
01f81dfd15
3 changed files with 41 additions and 4 deletions
  1. 3
    3
      App/Vendor/Helper.class.php
  2. 1
    1
      App/Views/Request/requestView.view.php
  3. 37
    0
      public_html/dicom/dicom.php

+ 3
- 3
App/Vendor/Helper.class.php View File

@@ -224,7 +224,7 @@
$videos = ['mp4', 'm4p', 'm4v', 'mov', 'mpg', 'mpeg', 'mp2', 'mpeg', 'mpe', 'mpv', 'webm', 'ogv', 'ogg'];
$audio = ['mp3', 'mpa', 'aac', 'oga'];
$files = ['pdf'];
$dicom = ['dcm'];
$dicom = ['dcm', 'DCM'];

if (!is_null($fileName)) {
$ext = strtolower($this->getExtension($fileName));
@@ -246,7 +246,7 @@
}

if (in_array($ext, $dicom)) {
return 'iframe';
return 'dicom';
}
}

@@ -305,7 +305,7 @@
break;

case 'dicom':
return $wrapStart.$user.'<a data-options=\'{"hash":false}\' data-fancybox data-type="iframe" data-src="/dicom/?attach_id='.$attachId.'" href="#" class="'.$linkClass.'"><span class="icon-file-picture"></span> '.$attachTitle.'</a>'.$wrapEnd;
return $wrapStart.$user.'<a data-options=\'{"hash":false}\' data-fancybox data-type="iframe" data-src="/dicom/dicom.php?attach_id='.$attachId.'" href="#" class="'.$linkClass.'"><span class="icon-file-picture"></span> '.$attachTitle.'</a>'.$wrapEnd;
break;

case 'video':

+ 1
- 1
App/Views/Request/requestView.view.php View File

@@ -142,7 +142,7 @@
<?php endforeach; ?>
</ul>
<?php endforeach; ?>
<?php //debug($this->view->isSimpleViewer); ?>
<?php //debug($this->view->groupedAttachments); ?>
</div>
</div>
</div>

+ 37
- 0
public_html/dicom/dicom.php View File

@@ -0,0 +1,37 @@
<?php
// Il percorso al file DICOM sul server
require_once '../../App/bootstrap.php';

$attachId = isset($_GET['attach_id']) ? $_GET['attach_id'] : 0;
if (!$user->isLogged()) {
//exit(0);
}

$attach = $db->where('id', $attachId)->getOne('requests_attachments');
$file_name = $attach['file_name'];

$dicomFilePath = ATTACH_DIR . $file_name;

echo $dicomFilePath;
/*
// Verifica che il file DICOM esista
if (file_exists($dicomFilePath)) {
// Imposta l'intestazione Content-Type per il file DICOM
header('Content-Type: application/dicom');

// Indica la lunghezza del file in modo che il client possa sapere quanto è grande
header('Content-Length: ' . filesize($dicomFilePath));

// Disabilita la memorizzazione nella cache per assicurarsi che il file venga sempre caricato
header('Cache-Control: no-cache, must-revalidate');
header('Expires: 0');

// Leggi e trasmetti il file DICOM come se fosse il contenuto della risposta
readfile($dicomFilePath);
exit();
} else {
// Restituisci un errore 404 se il file non viene trovato
http_response_code(404);
echo "File non trovato.";
}*/
?>

Loading…
Cancel
Save