diff --git a/modules/imaging_uploader/js/imaging_uploader.js b/modules/imaging_uploader/js/imaging_uploader.js index d7b6809f0a6..441747e9863 100644 --- a/modules/imaging_uploader/js/imaging_uploader.js +++ b/modules/imaging_uploader/js/imaging_uploader.js @@ -126,8 +126,14 @@ function uploadFile() { return xhr; }, success: function (data) { - alert("File Uploaded"); - location.reload(); + if (data.indexOf("The following errors occured while attempting to display this page:") > -1) { + document.open(); + document.write(data); + document.close(); + } else { + $("fileUpload").val(""); + $("#filter").click(); + } } }); } diff --git a/modules/imaging_uploader/php/NDB_Menu_Filter_imaging_uploader.class.inc b/modules/imaging_uploader/php/NDB_Menu_Filter_imaging_uploader.class.inc index 5947d3b579c..8dcb26cb1eb 100644 --- a/modules/imaging_uploader/php/NDB_Menu_Filter_imaging_uploader.class.inc +++ b/modules/imaging_uploader/php/NDB_Menu_Filter_imaging_uploader.class.inc @@ -138,7 +138,8 @@ class NDB_Menu_Filter_Imaging_Uploader extends NDB_Menu_Filter_Form ) { //catch file overload error... $upload_max_size = ini_get('upload_max_filesize'); $error_message = "Please make sure files are not larger than " . - $upload_max_size; + $upload_max_size . "
Please refresh this page to return ". + "to the Imaging Uploader module"; $tpl_data['error_message'][] = $error_message; } return true; @@ -239,6 +240,7 @@ class NDB_Menu_Filter_Imaging_Uploader extends NDB_Menu_Filter_Form { //make sure the file-name is valid $temp_file = $file->fileInfo['tmp_name']; + $temp_dir = $this->tempdir(); $db = Database::singleton(); $errors = array(); $config = NDB_Config::singleton(); @@ -249,6 +251,11 @@ class NDB_Menu_Filter_Imaging_Uploader extends NDB_Menu_Filter_Form $header_patient_name = array(); $file_name = $file->fileInfo['name']; $file_path = $temp_dir. "/". $file_name; + $isPhantom = $args['values']['IsPhantom']; + if (empty($isPhantom)) { + $errors[] ="Make sure 'Are these Phantom Scans' is filled out. +
Please refresh this page to return to the Imaging Uploader module"; + } /////////////////////////////////////////////////////////////////////// /////////Validate the advanced Options only if it's not a Phantom////// /////////////////////////////////////////////////////////////////////// @@ -261,7 +268,8 @@ class NDB_Menu_Filter_Imaging_Uploader extends NDB_Menu_Filter_Form $visit_label = trim($args['values']['Visit_label']); if ((empty($candid)) || (empty($pscid)) || (empty($visit_label))) { $errors[] ="Make sure the CandID, PSCID and Visit_label are ". - "filled out "; + "filled out.
Please refresh this page to return to the Imaging + Uploader module."; } /////////////////////////////////////////////////////////////////////// @@ -282,7 +290,8 @@ class NDB_Menu_Filter_Imaging_Uploader extends NDB_Menu_Filter_Form $errors[] = "Make sure you enter the CandID: $candid ,". " PSCID: $pscid and the corresponding". " Visit-label: $visit_label which". - " already exist"; + " already exist.
Please refresh this page". + "to return to the Imaging Uploader module"; } } } @@ -292,7 +301,8 @@ class NDB_Menu_Filter_Imaging_Uploader extends NDB_Menu_Filter_Form /////////////////////////////////////////////////////////////////////// if (!$this->isCompressed($temp_file)) { $errors[] = "The file $temp_file is not of type". - " .tgz, .tar.gz or .zip"; + " .tgz, .tar.gz or .zip.
Please refresh this + page to return to the Imaging Uploader module"; } if (count($errors) > 0) { diff --git a/modules/imaging_uploader/templates/menu_imaging_uploader.tpl b/modules/imaging_uploader/templates/menu_imaging_uploader.tpl index aab42719369..b51a48b2b8f 100644 --- a/modules/imaging_uploader/templates/menu_imaging_uploader.tpl +++ b/modules/imaging_uploader/templates/menu_imaging_uploader.tpl @@ -144,6 +144,14 @@ *} + + + + + + +
{$page_links}
+