|
|
@@ -362,6 +362,17 @@ else if(Core::$user->level >= User::LEVEL_ADMIN) {
|
|
|
$success = $test->commit();
|
|
|
if(!$success) throw new Exception("Failed to update the test. Please try again later.");
|
|
|
|
|
|
+
|
|
|
+ if($retest_project) {
|
|
|
+ $retest = new Test;
|
|
|
+ $retest->project_id = $retest_project->id;
|
|
|
+ $retest->location_id = $location->id;
|
|
|
+ $retest->status = Test::STATUS_UNASSIGNED;
|
|
|
+ $retest->dts_created = Util::getDateTime();
|
|
|
+ $retest->retest = 1;
|
|
|
+ $success = $retest->commit();
|
|
|
+ }
|
|
|
+
|
|
|
// If rejected, recreate empty test for the location
|
|
|
if($reject) {
|
|
|
$new_test = new Test;
|
|
|
@@ -377,16 +388,6 @@ else if(Core::$user->level >= User::LEVEL_ADMIN) {
|
|
|
$tester->score++;
|
|
|
$tester->commit();
|
|
|
|
|
|
- if(!$test->pass && $retest_project) {
|
|
|
- $retest = new Test;
|
|
|
- $retest->project_id = $retest_project->id;
|
|
|
- $retest->location_id = $location->id;
|
|
|
- $retest->status = Test::STATUS_UNASSIGNED;
|
|
|
- $retest->dts_created = Util::getDateTime();
|
|
|
- $retest->retest = 1;
|
|
|
- $success = $retest->commit();
|
|
|
- }
|
|
|
-
|
|
|
// Save PDF
|
|
|
$mpdf = $test->getMPDF();
|
|
|
$pdf_string = $mpdf->Output("", "S");
|
|
|
@@ -445,6 +446,8 @@ else if(Core::$user->level >= User::LEVEL_ADMIN) {
|
|
|
}
|
|
|
|
|
|
$projects = $customer->getProjects();
|
|
|
+
|
|
|
+ /** @var Project[] $future_projects */
|
|
|
$future_projects = array_filter($projects, function($p) use ($project) {
|
|
|
if($p->id == $project->id) return false;
|
|
|
if($p->template_id != $project->template_id) return false;
|
|
|
@@ -465,5 +468,3 @@ else if(Core::$user->level >= User::LEVEL_VENUE) {
|
|
|
else {
|
|
|
throw new Exception(__("Invalid request."));
|
|
|
}
|
|
|
-
|
|
|
-?>
|