|
|
@@ -29,14 +29,14 @@ $target_project_id = http::value("target_project_id");
|
|
|
$test_ids_json = http::value("test_ids_json", "string");
|
|
|
|
|
|
if($action) {
|
|
|
- switch($action) {
|
|
|
- case "move-tests":
|
|
|
|
|
|
- $test_ids = json_decode($test_ids_json);
|
|
|
- if(!is_array($test_ids)) {
|
|
|
- $test_ids = [];
|
|
|
- }
|
|
|
+ $test_ids = json_decode($test_ids_json);
|
|
|
+ if(!is_array($test_ids)) {
|
|
|
+ $test_ids = [];
|
|
|
+ }
|
|
|
|
|
|
+ switch($action) {
|
|
|
+ case "move-tests":
|
|
|
$target_project = Project::get($target_project_id);
|
|
|
if(!$target_project) {
|
|
|
throw new RuntimeException("Target project not found.");
|
|
|
@@ -81,14 +81,22 @@ if($action) {
|
|
|
Core::addAlert("success", __("Tests moved successfully."));
|
|
|
break;
|
|
|
|
|
|
+ case "unassign":
|
|
|
+ $tests = Test::query(["id" => $test_ids, "project_id" => $id, "status" => Test::STATUS_ASSIGNED]);
|
|
|
+ foreach($tests as $test) {
|
|
|
+ $test->unassign();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Core::addAlert("success", __("Tests unassigned successfully."));
|
|
|
+
|
|
|
+ break;
|
|
|
+
|
|
|
default:
|
|
|
throw new RuntimeException(__("Invalid action."));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
$completed_percentage = $project->getCompletedPercentage();
|
|
|
|
|
|
$locations = $customer->getLocations();
|