<?php
# ---------------------------------------------------------------------
# truc is a tool for requirement and use case tracking
# Copyright (C) 2006 ASDIS - http://sf.net/projects/truc
#
# (rth) Initial truc version based on rth
#       Copyright (C) 2005 George Holbrook - rth@lists.sourceforge.net
#
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details
#----------------------------------------------------------------------

include"./api/include_api.php";
auth_authenticate_user();

$project_properties     = session_get_project_properties();
$s_project_name			= $project_properties['project_name'];
$s_project_id			= $project_properties['project_id'];
$s_test_details			= session_get_properties("test");
$s_test_id				= $s_test_details['test_id'];
//$test_version_id		= $_POST['test_version_id'];
$page					= 'test_detail_page.php';
$redirect_page 			= "test_detail_page.php?test_id=$s_test_id&tab=3";

$user_properties		= session_get_user_properties();
$user_id				= $user_properties['user_id'];
$username				= $user_properties['username'];
$project_id=$s_project_id;
$test_id=$s_test_id;

        if (usecase_locked($project_id,$test_id,$username)) {
                 html_print_operation_failed( 'usecase_edit_page',error_report_msg(CAN_NOT_MODIFY_USECASE_LOCKED,usecase_locked_by($project_id,$test_id)), "test_detail_page.php?test_id=".$test_id);
                 exit;
       }


session_records("test_req_assoc");
session_validate_form_set($_POST);

test_edit_assoc_requirements( $s_test_id, "test_req_assoc", "percent_covered_" );

session_validate_form_reset();

html_print_operation_successful( "test_req_assoc_page", $redirect_page );
?>