/** * copyReqAssignmentTo * copy requirement assignments for $from test case id to $to test case id * * mappings is only useful when source_id and target_id do not belong to same Test Project. * Because keywords are defined INSIDE a Test Project, ID will be different for same keyword * in a different Test Project. * */ function copyReqAssignmentTo($from, $to, $mappings, $userID) { static $req_mgr; if (is_null($req_mgr)) { $req_mgr = new requirement_mgr($this->db); } $itemSet = $req_mgr->get_all_for_tcase($from); if (!is_null($itemSet)) { $loop2do = count($itemSet); for ($idx = 0; $idx < $loop2do; $idx++) { if (isset($mappings[$itemSet[$idx]['id']])) { $items[$idx] = $mappings[$itemSet[$idx]['id']]; } else { $items[$idx] = $itemSet[$idx]['id']; } } $req_mgr->assign_to_tcase($items, $to, $userID); } }