# Test Requirement Edit Coverage Page
#
# $RCSfile: test_req_edit_coverage_page.php,v $  $Revision: 1.2 $
# ---------------------------------------------------------------------
include "./api/include_api.php";
$page = basename(__FILE__);
$action_page = 'test_req_edit_coverage_action.php';
$s_project_properties = session_get_project_properties();
$s_project_name = $s_project_properties['project_name'];
$s_project_id = $s_project_properties['project_id'];
$s_test_details = session_set_properties("test", $_GET);
$s_test_id = $s_test_details['test_id'];
# $test_version_id	= $s_test_details['test_version_id'];
$test_name = test_get_name($s_test_id);
$req_id = $_GET['req_id'];
$req_name = requirement_get_name($req_id);
if (isset($_GET['failed'])) {
    $is_validation_failure = $_GET['failed'];
} else {
    $is_validation_failure = false;
}
html_window_title();
html_page_title($s_project_name . " - " . lang_get('test_req_coverage_page'));
html_page_header($db, $s_project_name);
html_print_body();
html_print_menu();
test_menu_print($page);
error_report_check($_GET);
print "<br>";
print "<div align=center>";
//print "<span class='required'>*</span><span class='print'>" . lang_get('must_complete_field') . "</span><br>";
 # if this requirement has children OR a parent
 if (!empty($rows_children) || $req_parent != 0) {
     $row_style = html_tbl_alternate_bgcolor($row_style);
     print "<table rules=cols align=center class=width90>";
     print "<tr>";
     html_tbl_print_header(lang_get('req_id'));
     html_tbl_print_header(lang_get('req_name'));
     if ($user_has_delete_rights) {
         html_tbl_print_header(lang_get('delete'));
     }
     print "</tr>";
     # PRINT PARENT RECORD
     if ($req_parent != 0) {
         $assoc_id = $s_req_id;
         $rel_parent_id = util_pad_id($req_parent);
         $req_parent_name = requirement_get_name($req_parent);
         $req_parent_version = requirement_get_latest_version($rel_parent_id);
         $rel_type = 'child of';
         print "<tr class='{$row_style}' align=left>" . NEWLINE;
         print "<td class='tbl-c'>{$rel_type} <a href='requirement_detail_page.php?req_id={$req_parent}&amp;req_version_id={$req_parent_version}'>{$rel_parent_id}</a></td>" . NEWLINE;
         print "<td class='tbl-l'>{$req_parent_name}</td>" . NEWLINE;
         if ($user_has_delete_rights) {
             print "<td class='tbl-c'></td>" . NEWLINE;
         }
         print "</tr>" . NEWLINE;
     }
     # PRINT CHILDREN RECORDS
     if (!empty($rows_children)) {
         foreach ($rows_children as $row_child) {
             $rel_req_id = util_pad_id($row_child['req_id']);
             $child_id = $rel_req_id;