<?php
global $webdoc;
$webdoc["page_title"].=" - Copy Test Run";

$person_role = 4;
if (!auth($person_role)) 
{
  $webdoc["message"][]=database_get_message("no_permission");
  $template->template_assign("no_display",true);
  return;
}

if (isset($_REQUEST["test_run_id"])) //test existence test_id
{
  $webdoc["test_run_id"]=$_REQUEST["test_run_id"];  
  $result=database_query("SELECT * FROM test_run WHERE test_run_id LIKE '$webdoc[test_run_id]'");
  $list = database_fetch_array($result);
  $template->template_assign("list",$list);
}

if (isset($_POST["button_copy"])) //test existence test_id
{
  $webdoc["test_run_id"]=$_POST["test_run_id"];  
  $record = database_get_record_test($webdoc["test_run_id"],$row);
  $record["approver_id"]=0;
  $record["approved"]=0;
  $record["tester_id"]=0;
  $record["tested"]=0;
  database_save_record_test($record);
}

?>
