|
@@ -11,6 +11,7 @@ $is_unverified = $test->status == Test::STATUS_PENDING_VERIFICATION;
|
|
|
|
|
|
|
|
$location = $test->getLocation();
|
|
$location = $test->getLocation();
|
|
|
$project = $test->getProject();
|
|
$project = $test->getProject();
|
|
|
|
|
+$customer = $project->getCustomer();
|
|
|
$tester = $test->getTester();
|
|
$tester = $test->getTester();
|
|
|
$template = $project->getTemplate();
|
|
$template = $project->getTemplate();
|
|
|
|
|
|
|
@@ -276,7 +277,6 @@ else if(Core::$user->level >= User::LEVEL_ADMIN) {
|
|
|
// Accept test as completed
|
|
// Accept test as completed
|
|
|
if($accept) {
|
|
if($accept) {
|
|
|
$test->status = Test::STATUS_COMPLETED;
|
|
$test->status = Test::STATUS_COMPLETED;
|
|
|
- // TODO: Send email to venue/HQ/tester
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Reject test
|
|
// Reject test
|
|
@@ -304,6 +304,28 @@ else if(Core::$user->level >= User::LEVEL_ADMIN) {
|
|
|
if($accept) {
|
|
if($accept) {
|
|
|
$tester->score++;
|
|
$tester->score++;
|
|
|
$tester->commit();
|
|
$tester->commit();
|
|
|
|
|
+
|
|
|
|
|
+ // Save PDF
|
|
|
|
|
+ $pdf = $test->getPDF();
|
|
|
|
|
+ $pdf_string = $pdf->Output("S");
|
|
|
|
|
+
|
|
|
|
|
+ $directory = $test->getDirectory();
|
|
|
|
|
+ $pdf_path = $directory . "/test.pdf";
|
|
|
|
|
+
|
|
|
|
|
+ $success = file_put_contents($pdf_path, $pdf_string);
|
|
|
|
|
+
|
|
|
|
|
+ // TODO: Send email to venue/HQ/tester
|
|
|
|
|
+ $email_customer = http::value("email_customer");
|
|
|
|
|
+ $email_location = http::value("email_location");
|
|
|
|
|
+
|
|
|
|
|
+ if($email_customer && $customer->email_after_test && $customer->email) {
|
|
|
|
|
+ $test->sendResultEmail($customer->email);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if($email_location && $customer->email_locations_after_test && $location->email) {
|
|
|
|
|
+ $test->sendResultEmail($location->email);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Core::addAlert("success", "Test verified successfully.");
|
|
Core::addAlert("success", "Test verified successfully.");
|
|
@@ -318,7 +340,7 @@ else if(Core::$user->level >= User::LEVEL_ADMIN) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
View::includeOnce("header", compact("page_title"));
|
|
View::includeOnce("header", compact("page_title"));
|
|
|
- View::include("test_verify_form", compact("test", "tester", "location", "project", "template", "fields", "values", "tester_message"));
|
|
|
|
|
|
|
+ View::include("test_verify_form", compact("test", "tester", "location", "project", "customer", "template", "fields", "values", "tester_message"));
|
|
|
View::includeOnce("footer");
|
|
View::includeOnce("footer");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|