<?php

$webdoc["page_title"].=" - Columns";

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

if (isset($_GET["test_id"])) $webdoc["test_id"]=(int)$_GET["test_id"];

kernel_get_url($filter,$columns,$pages,$sort); //precte url a podle toho nastavi filter. pokud v url nastaveni filtru neni, precte cookies a pokud v cookies neco je, presmeruje na odpovidajici url

$webdoc["url"]=kernel_create_pages_url($pages).kernel_create_sort_url($sort).kernel_create_columns_url($columns).kernel_create_filter_url($filter);

if (isset($_GET["button_select"]))
{
  $webdoc["url"]="./?subpage1=$_GET[subpage1]".$webdoc["url"];
  header("location: $webdoc[url]"); //presmerovani
  echo database_get_message("continue")." <a href=\"$webdoc[url]\">".database_get_message("here")."</a>."; //zobrazeni hlasky "pokracovat zde", pokud selze presmerovani
  exit;
}

$template->template_assign("url",$webdoc["url"]);
$template->template_assign("pages",$pages); //nastaveni hodnot stranky ve formulari
$template->template_assign("sort",$sort); //nastaveni hodnot razeni ve formulari
$template->template_assign("filter",$filter); //nastaveni hodnot filtru ve formulari
$template->template_assign("columns",$columns); //nastaveni hodnot sloupcu ve formulari
$template->template_assign("disabled",array("name"=>"1"));

switch ($webdoc["main_table"])
{
  case "requirement": $checkboxes=array("name"=>"Name","category"=>"Category","parent"=>"Parent","created"=>"Created","creator"=>"Creator","approved"=>"Approved","approver"=>"Approver","active"=>"Active","description"=>"Description","comments"=>"Comments","is_product_specific"=>"Is product specific","actions"=>"Actions"); break;
  case "product": $checkboxes=array("name"=>"Name","category"=>"Family","parent"=>"Parent","created"=>"Created","creator"=>"Creator","approved"=>"Approved","approver"=>"Approver","description"=>"Description","comments"=>"Comments","actions"=>"Actions"); break;
  case "test": $checkboxes=array("name"=>"Name","created"=>"Created","creator"=>"Creator","approved"=>"Approved","approver"=>"Approver","acceptance_criteria"=>"Acceptance criteria","comments"=>"Comments","terminate"=>"Terminated","terminator"=>"Terminator","actions"=>"Actions"); break;
  case "test_run": $checkboxes=array("name"=>"Name","created"=>"Created","creator"=>"Creator","approved"=>"Approved","approver"=>"Approver","tested"=>"Tested","tester"=>"Tester","sw_rev"=>"SW Rev","hw_rev"=>"HW Rev","setup"=>"Setup","result"=>"Result","duration"=>"Duration","description"=>"Description","actions"=>"Actions"); break;
}
$template->template_assign("checkboxes",$checkboxes);

?>