/** * * */ private function copy_testplans($source_id, $target_id, $user_id, $mappings) { static $tplanMgr; $tplanSet = $this->get_all_testplans($source_id); if (!is_null($tplanSet)) { $keySet = array_keys($tplanSet); if (is_null($tplanMgr)) { $tplanMgr = new testplan($this->db); } foreach ($keySet as $itemID) { $new_id = $tplanMgr->create($tplanSet[$itemID]['name'], $tplanSet[$itemID]['notes'], $target_id, $tplanSet[$itemID]['active'], $tplanSet[$itemID]['is_public']); if ($new_id > 0) { // TICKET 5190: Copy Test projects - tester assignments to testplan+build are not copied $tplanMgr->copy_as($itemID, $new_id, null, $target_id, $user_id, array('copy_assigned_to' => 1), $mappings); } } } }
/** * * */ private function copy_testplans($source_id, $target_id, $user_id, $mappings) { static $tplanMgr; $tplanSet = $this->get_all_testplans($source_id); if (!is_null($tplanSet)) { $keySet = array_keys($tplanSet); if (is_null($tplanMgr)) { $tplanMgr = new testplan($this->db); } foreach ($keySet as $itemID) { $new_id = $tplanMgr->create($tplanSet[$itemID]['name'], $tplanSet[$itemID]['notes'], $target_id, $tplanSet[$itemID]['active'], $tplanSet[$itemID]['is_public']); if ($new_id > 0) { $tplanMgr->copy_as($itemID, $new_id, null, $target_id, $user_id, null, $mappings); } } } }
if ($new_tplan_id == 0) { $gui->user_feedback = $db->error_msg(); } else { logAuditEvent(TLS("audit_testplan_created", $args->tproject_name, $args->testplan_name), "CREATED", $new_tplan_id, "testplans"); $cf_map = $tplan_mgr->get_linked_cfields_at_design($new_tplan_id, $args->tproject_id); $tplan_mgr->cfield_mgr->design_values_to_db($_REQUEST, $new_tplan_id, $cf_map); $status_ok = true; $template = null; $gui->user_feedback = ''; if ($args->rights == 'on') { $result = insertTestPlanUserRight($db, $new_tplan_id, $args->user_id); } if ($args->copy) { // BUGID 3485: "Create from existing Test Plan" always copies builds $options = array('items2copy' => $args->copy_options, 'copy_assigned_to' => $args->copy_assigned_to, 'tcversion_type' => $args->tcversion_type); $tplan_mgr->copy_as($args->source_tplanid, $new_tplan_id, $args->testplan_name, $args->tproject_id, $args->user_id, $options); } } } else { $gui->user_feedback = lang_get("warning_duplicate_tplan_name"); } if (!$status_ok) { // $gui->tplan_id=$new_tplan_id; $gui->tproject_name = $args->tproject_name; $gui->notes = $of->CreateHTML(); } break; } switch ($args->do_action) { case "do_create": case "do_delete":