@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | |
237 | 237 | $update->execute(array('id_visit' => $this->id_visit)); |
238 | 238 | //Set visit to not review available (include a refresh of the current object) |
239 | - $this->changeReviewAvailability(false); |
|
239 | + $this->changeReviewAvailability(false); |
|
240 | 240 | |
241 | 241 | } |
242 | 242 | |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | * @return Review|Review[] |
336 | 336 | */ |
337 | 337 | public function getReviewsObject(bool $local, bool $onlyValidated=false) { |
338 | - if(!$onlyValidated){ |
|
338 | + if(!$onlyValidated){ |
|
339 | 339 | $reviewQuery=$this->linkpdo->prepare('SELECT id_review FROM reviews WHERE id_visit=:idVisit AND deleted=0 AND is_local=:isLocal'); |
340 | 340 | |
341 | 341 | }else{ |
@@ -335,10 +335,10 @@ discard block |
||
335 | 335 | * @return Review|Review[] |
336 | 336 | */ |
337 | 337 | public function getReviewsObject(bool $local, bool $onlyValidated=false) { |
338 | - if(!$onlyValidated){ |
|
338 | + if (!$onlyValidated) { |
|
339 | 339 | $reviewQuery=$this->linkpdo->prepare('SELECT id_review FROM reviews WHERE id_visit=:idVisit AND deleted=0 AND is_local=:isLocal'); |
340 | 340 | |
341 | - }else{ |
|
341 | + }else { |
|
342 | 342 | $reviewQuery=$this->linkpdo->prepare('SELECT id_review FROM reviews WHERE id_visit=:idVisit AND deleted=0 AND validated=1 AND is_local=:isLocal'); |
343 | 343 | |
344 | 344 | } |
@@ -443,13 +443,13 @@ discard block |
||
443 | 443 | if ($this->getVisitCharacteristics()->reviewNeeded) { |
444 | 444 | //If review needed make it available for reviewers |
445 | 445 | $this->changeReviewAvailability(true); |
446 | - }else if( ! $this->getVisitCharacteristics()->qcNeeded) { |
|
446 | + }else if (!$this->getVisitCharacteristics()->qcNeeded) { |
|
447 | 447 | //The visit is QC accepted and will not go further as Review is not needed |
448 | 448 | //Inform supervisors that the visit is well recieved |
449 | 449 | //Do this only if QC is not needed as supervisor will get QC notification otherwise (avoid dual mail) |
450 | 450 | $this->sendUploadNotificationToSupervisor(); |
451 | 451 | } |
452 | - }else if ($controlDecision == Visit::QC_REFUSED){ |
|
452 | + }else if ($controlDecision == Visit::QC_REFUSED) { |
|
453 | 453 | $this->changeReviewAvailability(false); |
454 | 454 | } |
455 | 455 |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | if(!$onlyValidated){ |
339 | 339 | $reviewQuery=$this->linkpdo->prepare('SELECT id_review FROM reviews WHERE id_visit=:idVisit AND deleted=0 AND is_local=:isLocal'); |
340 | 340 | |
341 | - }else{ |
|
341 | + } else{ |
|
342 | 342 | $reviewQuery=$this->linkpdo->prepare('SELECT id_review FROM reviews WHERE id_visit=:idVisit AND deleted=0 AND validated=1 AND is_local=:isLocal'); |
343 | 343 | |
344 | 344 | } |
@@ -374,13 +374,16 @@ discard block |
||
374 | 374 | $filteredReview=array_filter($reviewsObjects, function($review) use ($username) { |
375 | 375 | if ($review->username == $username) { |
376 | 376 | return true; |
377 | - }else { |
|
377 | + } else { |
|
378 | 378 | return false; |
379 | 379 | } |
380 | 380 | }); |
381 | 381 | $filteredReview=array_values($filteredReview); |
382 | - if (sizeof($filteredReview) == 1) return $filteredReview[0]; |
|
383 | - else throw new Exception('No review for reviwer'); |
|
382 | + if (sizeof($filteredReview) == 1) { |
|
383 | + return $filteredReview[0]; |
|
384 | + } else { |
|
385 | + throw new Exception('No review for reviwer'); |
|
386 | + } |
|
384 | 387 | |
385 | 388 | } |
386 | 389 | |
@@ -399,7 +402,7 @@ discard block |
||
399 | 402 | |
400 | 403 | if (empty($dataVisits)) { |
401 | 404 | return true; |
402 | - }else { |
|
405 | + } else { |
|
403 | 406 | return false; |
404 | 407 | } |
405 | 408 | |
@@ -443,13 +446,13 @@ discard block |
||
443 | 446 | if ($this->getVisitCharacteristics()->reviewNeeded) { |
444 | 447 | //If review needed make it available for reviewers |
445 | 448 | $this->changeReviewAvailability(true); |
446 | - }else if( ! $this->getVisitCharacteristics()->qcNeeded) { |
|
449 | + } else if( ! $this->getVisitCharacteristics()->qcNeeded) { |
|
447 | 450 | //The visit is QC accepted and will not go further as Review is not needed |
448 | 451 | //Inform supervisors that the visit is well recieved |
449 | 452 | //Do this only if QC is not needed as supervisor will get QC notification otherwise (avoid dual mail) |
450 | 453 | $this->sendUploadNotificationToSupervisor(); |
451 | 454 | } |
452 | - }else if ($controlDecision == Visit::QC_REFUSED){ |
|
455 | + } else if ($controlDecision == Visit::QC_REFUSED){ |
|
453 | 456 | $this->changeReviewAvailability(false); |
454 | 457 | } |
455 | 458 | |
@@ -592,7 +595,7 @@ discard block |
||
592 | 595 | require_once($specificObjectFile); |
593 | 596 | $objectName=$modality."_".$this->study."_".$this->visitType; |
594 | 597 | $formProcessor=new $objectName($this, $local, $username, $this->linkpdo); |
595 | - }else { |
|
598 | + } else { |
|
596 | 599 | throw new Exception('Missing From Processor for this visit'); |
597 | 600 | } |
598 | 601 | |
@@ -624,7 +627,7 @@ discard block |
||
624 | 627 | |
625 | 628 | return true; |
626 | 629 | |
627 | - }else { |
|
630 | + } else { |
|
628 | 631 | return false; |
629 | 632 | } |
630 | 633 | } |
@@ -664,7 +667,7 @@ discard block |
||
664 | 667 | |
665 | 668 | try { |
666 | 669 | $reviewObject=$this->queryExistingReviewForReviewer($username); |
667 | - }catch (Exception $e) { |
|
670 | + } catch (Exception $e) { |
|
668 | 671 | //User does not have any review, so visit still awaiting it's review |
669 | 672 | return true; |
670 | 673 | } |
@@ -673,7 +676,7 @@ discard block |
||
673 | 676 | //not awaiting review if form already validated |
674 | 677 | if ($reviewObject->validated) { |
675 | 678 | return false; |
676 | - }else { |
|
679 | + } else { |
|
677 | 680 | return true; |
678 | 681 | } |
679 | 682 |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | try { |
39 | 39 | $modalityCreatedVisit=$this->studyObject->getStudySpecificGroupManager($visitGroup->groupModality)->getCreatedVisits(); |
40 | 40 | array_push($this->allcreatedVisits, ...$modalityCreatedVisit); |
41 | - }catch (Exception $e) { } |
|
41 | + } catch (Exception $e) { } |
|
42 | 42 | } |
43 | 43 | } |
44 | 44 | |
@@ -215,12 +215,12 @@ discard block |
||
215 | 215 | $localReviews=[]; |
216 | 216 | try { |
217 | 217 | $localReviews[]=$visitObject->getReviewsObject(true); |
218 | - }catch (Exception $e) { } |
|
218 | + } catch (Exception $e) { } |
|
219 | 219 | |
220 | 220 | $expertReviews=[]; |
221 | 221 | try { |
222 | 222 | $expertReviews=$visitObject->getReviewsObject(false, true); |
223 | - }catch (Exception $e) { } |
|
223 | + } catch (Exception $e) { } |
|
224 | 224 | |
225 | 225 | //Merge all reviews in an array |
226 | 226 | $reviewObjects=array_merge($localReviews, $expertReviews); |
@@ -318,29 +318,29 @@ discard block |
||
318 | 318 | |
319 | 319 | if ($visitObject->statusDone == Visit::NOT_DONE) { |
320 | 320 | return 0; |
321 | - }else if ($visitObject->uploadStatus == Visit::NOT_DONE || $visitObject->stateInvestigatorForm == Visit::NOT_DONE) { |
|
321 | + } else if ($visitObject->uploadStatus == Visit::NOT_DONE || $visitObject->stateInvestigatorForm == Visit::NOT_DONE) { |
|
322 | 322 | if ($visitObject->uploadStatus == Visit::NOT_DONE && $visitObject->stateInvestigatorForm == Visit::NOT_DONE) { |
323 | 323 | return 1; |
324 | - }else if ($visitObject->stateInvestigatorForm == Visit::NOT_DONE) { |
|
324 | + } else if ($visitObject->stateInvestigatorForm == Visit::NOT_DONE) { |
|
325 | 325 | return 3; |
326 | - }else if ($visitObject->uploadStatus == Visit::NOT_DONE) { |
|
326 | + } else if ($visitObject->uploadStatus == Visit::NOT_DONE) { |
|
327 | 327 | return 2; |
328 | 328 | } |
329 | - }else if ($visitObject->qcStatus == Visit::QC_NOT_DONE) { |
|
329 | + } else if ($visitObject->qcStatus == Visit::QC_NOT_DONE) { |
|
330 | 330 | return 4; |
331 | - }else if ($visitObject->qcStatus == Visit::QC_CORRECTIVE_ACTION_ASKED) { |
|
331 | + } else if ($visitObject->qcStatus == Visit::QC_CORRECTIVE_ACTION_ASKED) { |
|
332 | 332 | return 5; |
333 | - }else if ($visitObject->qcStatus == Visit::QC_REFUSED) { |
|
333 | + } else if ($visitObject->qcStatus == Visit::QC_REFUSED) { |
|
334 | 334 | return 6; |
335 | - }else if ($visitObject->reviewStatus == Visit::NOT_DONE) { |
|
335 | + } else if ($visitObject->reviewStatus == Visit::NOT_DONE) { |
|
336 | 336 | return 7; |
337 | - }else if ($visitObject->reviewStatus == Visit::REVIEW_ONGOING) { |
|
337 | + } else if ($visitObject->reviewStatus == Visit::REVIEW_ONGOING) { |
|
338 | 338 | return 8; |
339 | - }else if ($visitObject->reviewStatus == Visit::REVIEW_WAIT_ADJUDICATION) { |
|
339 | + } else if ($visitObject->reviewStatus == Visit::REVIEW_WAIT_ADJUDICATION) { |
|
340 | 340 | return 9; |
341 | - }else if ($visitObject->reviewStatus == Visit::REVIEW_DONE) { |
|
341 | + } else if ($visitObject->reviewStatus == Visit::REVIEW_DONE) { |
|
342 | 342 | return 10; |
343 | - }else { |
|
343 | + } else { |
|
344 | 344 | //If none of these case return -1, should not happen |
345 | 345 | return -1; |
346 | 346 | } |