|
@@ -16,24 +16,22 @@ if($submit) {
|
|
|
$tests = Test::load($test_ids);
|
|
$tests = Test::load($test_ids);
|
|
|
$test_count = count($tests);
|
|
$test_count = count($tests);
|
|
|
|
|
|
|
|
|
|
+ $actioned_count = 0;
|
|
|
|
|
+
|
|
|
switch($batch_action) {
|
|
switch($batch_action) {
|
|
|
case "unassign":
|
|
case "unassign":
|
|
|
|
|
|
|
|
- $test_unassigned_count = 0;
|
|
|
|
|
-
|
|
|
|
|
foreach($tests as $test) {
|
|
foreach($tests as $test) {
|
|
|
$success = $test->unassignTester();
|
|
$success = $test->unassignTester();
|
|
|
- $test_unassigned_count += $success;
|
|
|
|
|
|
|
+ $actioned_count += $success;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Core::addAlert("success", "$test_unassigned_count of $test_count test(s) unassigned successfully.");
|
|
|
|
|
|
|
+ Core::addAlert("success", "$actioned_count of $test_count test(s) unassigned successfully.");
|
|
|
|
|
|
|
|
break;
|
|
break;
|
|
|
|
|
|
|
|
case "mark_tester_invoice_paid":
|
|
case "mark_tester_invoice_paid":
|
|
|
|
|
|
|
|
- $actioned_count = 0;
|
|
|
|
|
-
|
|
|
|
|
foreach($tests as $test) {
|
|
foreach($tests as $test) {
|
|
|
$actioned_count += ($test->markTesterInvoicePaid()) ? 1 : 0;
|
|
$actioned_count += ($test->markTesterInvoicePaid()) ? 1 : 0;
|
|
|
}
|
|
}
|
|
@@ -43,8 +41,6 @@ if($submit) {
|
|
|
|
|
|
|
|
case "reject_tester_invoice":
|
|
case "reject_tester_invoice":
|
|
|
|
|
|
|
|
- $actioned_count = 0;
|
|
|
|
|
-
|
|
|
|
|
foreach($tests as $test) {
|
|
foreach($tests as $test) {
|
|
|
$actioned_count += ($test->rejectTesterInvoice()) ? 1 : 0;
|
|
$actioned_count += ($test->rejectTesterInvoice()) ? 1 : 0;
|
|
|
}
|
|
}
|
|
@@ -52,6 +48,20 @@ if($submit) {
|
|
|
Core::addAlert("success", "{$actioned_count} of {$test_count} invoices rejected successfully.");
|
|
Core::addAlert("success", "{$actioned_count} of {$test_count} invoices rejected successfully.");
|
|
|
break;
|
|
break;
|
|
|
|
|
|
|
|
|
|
+ case "send_test_assigned_email":
|
|
|
|
|
+
|
|
|
|
|
+ foreach($tests as $test) {
|
|
|
|
|
+ $tester = $test->getTester();
|
|
|
|
|
+ if($tester) {
|
|
|
|
|
+ $test->sendAssignEmail("");
|
|
|
|
|
+ $actioned_count++;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ Core::addAlert("success", "{$actioned_count} of {$test_count} emails sent successfully.");
|
|
|
|
|
+
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
default:
|
|
default:
|
|
|
throw new RuntimeException("Invalid action.");
|
|
throw new RuntimeException("Invalid action.");
|
|
|
}
|
|
}
|