1<?php 2# --------------------------------------------------------------------- 3# rth is a requirement, test, and bugtracking system 4# Copyright (C) 2005 George Holbrook - rth@lists.sourceforge.net 5# This program is distributed under the terms and conditions of the GPL 6# See the README and LICENSE files for details 7#---------------------------------------------------------------------- 8# ------------------------------------ 9# Report Area Tested 10# 11# $RCSfile: report_area_tested_page.php,v $ $Revision: 1.3 $ 12# ------------------------------------ 13 14include"./api/include_api.php"; 15 16$project_name = session_get_project_name(); 17$page = basename(__FILE__); 18 19$s_project_properties = session_get_project_properties(); 20$project_name = $s_project_properties['project_name']; 21$project_id = $s_project_properties['project_id']; 22 23$row_style = ''; 24 25$order_by = AREA_TESTED_NAME; 26$order_dir = "ASC"; 27$page_number = 1; 28 29util_set_order_by($order_by, $_POST); 30util_set_order_dir($order_dir, $_POST); 31util_set_page_number($page_number, $_POST); 32 33if( isset($_GET['_release_id']) ) { 34 $release_id = $_GET['_release_id'];; 35} 36 37if( isset($_GET['_build_id']) ) { 38 $build_id = $_GET['_build_id']; 39} 40 41if( isset($_GET['_testset_id']) ) { 42 $testset_id = $_GET['_testset_id']; 43} 44 45html_window_title(); 46 47auth_authenticate_user(); 48 49html_print_body(); 50html_page_title($project_name ." - " . lang_get('report_area_tested_page') ); 51html_page_header( $db, $project_name ); 52html_print_menu(); 53html_browse_release_menu($db, $page, $project_id); 54 55print"<br>"; 56error_report_check( $_GET ); 57 58global $db; 59 60print"<div align=center>"; 61if( isset( $testset_id ) && $testset_id != 'all') { 62 63 print"<form method=post action='$page?_release_id=$release_id&_build_id=$build_id&_testset_id=$testset_id'>"; 64 print"<table class=width80 rules=cols>". NEWLINE; 65 print"<tr>". NEWLINE; 66 html_tbl_print_header( lang_get('area_tested'), AREA_TESTED_NAME, $order_by, $order_dir ); 67 html_tbl_print_header( lang_get('num_of_tests_for_area') ); 68 html_tbl_print_header( lang_get('num_of_tests_used') ); 69 html_tbl_print_header( lang_get('percentage_of_area_tests') ); 70 print"</tr>". NEWLINE; 71 72 foreach( project_get_areas_tested($project_id, $order_by, $order_dir) as $row_area_tested ) { 73 74 $row_style = html_tbl_alternate_bgcolor($row_style); 75 76 $area_tested = $row_area_tested[AREA_TESTED_NAME]; 77 $tests_for_area = report_get_num_tests_in_area($project_id, $area_tested); 78 $tests_used = report_get_num_area_tested_in_testset($project_id, $_GET['_testset_id'], $area_tested); 79 80 if( $tests_for_area!=0 ) { 81 $percentage_tests_used = sprintf( "%01.2f", ($tests_used / $tests_for_area * 100) ); 82 } else { 83 $percentage_tests_used = "0.00"; 84 } 85 86 print"<tr class='$row_style'>". NEWLINE; 87 print"<td>$area_tested</td>". NEWLINE; 88 print"<td>$tests_for_area</td>". NEWLINE; 89 print"<td>$tests_used</td>". NEWLINE; 90 print"<td>$percentage_tests_used%</td>". NEWLINE; 91 print"</tr>". NEWLINE; 92 } 93 94 print"</table>". NEWLINE; 95 print"</form>"; 96} 97print"</div>"; 98html_print_footer(); 99 100 101# ------------------------------------ 102# $Log: report_area_tested_page.php,v $ 103# Revision 1.3 2006/08/05 22:08:37 gth2 104# adding NEWLINE constant to support multiple OS newline chars - gth 105# 106# Revision 1.2 2006/02/24 11:37:48 gth2 107# update to div - class=div-c not working in firefox - gth 108# 109# Revision 1.1.1.1 2005/11/30 23:00:57 gth2 110# importing initial version - gth 111# 112# ------------------------------------ 113?>