@@ -35,17 +35,17 @@ |
||
| 35 | 35 | $visitObject=new Visit($id_visit, $linkpdo); |
| 36 | 36 | |
| 37 | 37 | try { |
| 38 | - $formProcessor = $visitObject->getFromProcessor(false, $username); |
|
| 39 | - $reviewData = $formProcessor->getExistingFormData(); |
|
| 38 | + $formProcessor=$visitObject->getFromProcessor(false, $username); |
|
| 39 | + $reviewData=$formProcessor->getExistingFormData(); |
|
| 40 | 40 | echo(json_encode($reviewData)); |
| 41 | 41 | |
| 42 | - } catch (Exception $e) { |
|
| 42 | + }catch (Exception $e) { |
|
| 43 | 43 | error_log($e->getMessage()); |
| 44 | 44 | header('HTTP/1.0 404 Not Found'); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | |
| 48 | -} else { |
|
| 48 | +}else { |
|
| 49 | 49 | header('HTTP/1.0 403 Forbidden'); |
| 50 | 50 | die('You are not allowed to access this file.'); |
| 51 | 51 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | throw new Exception("Error during save"); |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | - if($update){ |
|
| 125 | + if ($update) { |
|
| 126 | 126 | $this->reviewObject->updateReviewDate(); |
| 127 | 127 | } |
| 128 | 128 | |
@@ -254,9 +254,9 @@ discard block |
||
| 254 | 254 | * can be overrided to add additional data such as investigator form data |
| 255 | 255 | */ |
| 256 | 256 | public function getExistingFormData() { |
| 257 | - if( ! empty($this->reviewObject)){ |
|
| 257 | + if (!empty($this->reviewObject)) { |
|
| 258 | 258 | return ($this->reviewObject->getSpecificData()); |
| 259 | - }else{ |
|
| 259 | + }else { |
|
| 260 | 260 | return []; |
| 261 | 261 | } |
| 262 | 262 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | if (empty($this->reviewObject)) { |
| 103 | 103 | $this->createReview(); |
| 104 | 104 | $update=false; |
| 105 | - }else { |
|
| 105 | + } else { |
|
| 106 | 106 | $update=true; |
| 107 | 107 | //If already existing validated review, exit without modifying anything |
| 108 | 108 | if ($this->reviewObject->validated) { |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | //Call the child redifined save specific form to save the specific data of the form |
| 115 | 115 | try { |
| 116 | 116 | $this->saveSpecificForm($data, $this->reviewObject->id_review, $update); |
| 117 | - }catch (Exception $e) { |
|
| 117 | + } catch (Exception $e) { |
|
| 118 | 118 | error_log($e->getMessage()); |
| 119 | 119 | if (!$update) { |
| 120 | 120 | $this->reviewObject->hardDeleteReview(); |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | if ($this->local) { |
| 134 | 134 | if ($validate) { |
| 135 | 135 | $this->visitObject->changeVisitStateInvestigatorForm(Visit::LOCAL_FORM_DONE); |
| 136 | - }else { |
|
| 136 | + } else { |
|
| 137 | 137 | $this->visitObject->changeVisitStateInvestigatorForm(Visit::LOCAL_FORM_DRAFT); |
| 138 | 138 | } |
| 139 | 139 | } |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | //Log Activity |
| 142 | 142 | if ($this->local) { |
| 143 | 143 | $role="Investigator"; |
| 144 | - }else { |
|
| 144 | + } else { |
|
| 145 | 145 | $role="Reviewer"; |
| 146 | 146 | } |
| 147 | 147 | $actionDetails['patient_code']=$this->visitObject->patientCode; |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | ->addGroupEmails($this->visitObject->study, User::SUPERVISOR); |
| 185 | 185 | $email->sendAwaitingAdjudicationMessage($this->visitObject->study, $this->visitObject->patientCode, $this->visitObject->visitType); |
| 186 | 186 | |
| 187 | - }else if ($reviewStatus == Visit::REVIEW_DONE) { |
|
| 187 | + } else if ($reviewStatus == Visit::REVIEW_DONE) { |
|
| 188 | 188 | |
| 189 | 189 | $email=new Send_Email($this->linkpdo); |
| 190 | 190 | $uploaderUserObject=new User($this->visitObject->uploaderUsername, $this->linkpdo); |
@@ -206,11 +206,11 @@ discard block |
||
| 206 | 206 | try { |
| 207 | 207 | if ($this->local) { |
| 208 | 208 | $this->reviewObject=$this->visitObject->getReviewsObject(true); |
| 209 | - }else { |
|
| 209 | + } else { |
|
| 210 | 210 | $this->reviewObject=$this->visitObject->queryExistingReviewForReviewer($this->username); |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | - }catch (Exception $e) { } |
|
| 213 | + } catch (Exception $e) { } |
|
| 214 | 214 | |
| 215 | 215 | return $this->reviewObject; |
| 216 | 216 | |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | $validatedReviewObjects=array_filter($reviewsObject, function($review) { |
| 240 | 240 | if ($review->validated) { |
| 241 | 241 | return true; |
| 242 | - }else { |
|
| 242 | + } else { |
|
| 243 | 243 | return false; |
| 244 | 244 | } |
| 245 | 245 | }); |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | public function getExistingFormData() { |
| 257 | 257 | if( ! empty($this->reviewObject)){ |
| 258 | 258 | return ($this->reviewObject->getSpecificData()); |
| 259 | - }else{ |
|
| 259 | + } else{ |
|
| 260 | 260 | return []; |
| 261 | 261 | } |
| 262 | 262 | |