From 4a8898959b039b0229560c4c653cd22bfc7c5eb1 Mon Sep 17 00:00:00 2001 From: Kenzaburo Ito Date: Wed, 6 Dec 2000 04:05:11 +0000 Subject: [PATCH] Made summary useful git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@27 f5dc347c-c33d-0410-90a0-b07cc1902cb9 --- ChangeLog | 2 + core_API.php | 67 +++++++++++++----- manage_category_page.php3 | 2 +- summary_page.php3 | 144 ++++++++++++++++++++------------------ 4 files changed, 125 insertions(+), 90 deletions(-) diff --git a/ChangeLog b/ChangeLog index fc84f7e621..4d99c05f72 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,7 @@ To Do: * Refine viewing preferences * Add profiles for each user * Refine viewing news archives + * Make priority useful XX.XX.2000 - 0.10.2 @@ -19,6 +20,7 @@ XX.XX.2000 - 0.10.2 * Fixed variable error preventing Bugnote addition * Fixed minor viewing bugs related to \ characters * Added documentation section + * Summary is now useful 12.03.2000 - 0.10.1 diff --git a/core_API.php b/core_API.php index 9448539cae..f0535983fe 100644 --- a/core_API.php +++ b/core_API.php @@ -116,7 +116,7 @@ function print_menu( $p_menu_file="" ) { PRINT ""; } #-------------------- - function print_category_string() { + function get_enum_string( $p_field_name ) { global $g_mantis_bug_table $query = "SHOW FIELDS @@ -127,30 +127,23 @@ function print_category_string() { $row = mysql_fetch_array( $result ); $t_type = stripslashes($row["Type"]); $t_field = $row["Field"]; - if ( $t_field=="category" ) { + if ( $t_field==$p_field_name ) { return substr( $t_type, 5, strlen($t_type)-6); } - } + } ### end for } #-------------------- + function get_enum_count( $t_enum_string ) { + return count(explode(",",$t_enum_string)); + } + #-------------------- + ### Used for update pages function print_categories( $p_category="" ) { global $g_mantis_bug_table - $query = "SHOW FIELDS - FROM $g_mantis_bug_table"; - $result = db_mysql_query( $query ); - $entry_count = mysql_num_rows( $result ); - for ($i=0;$i<$entry_count;$i++) { - $row = mysql_fetch_array( $result ); - $t_type = stripslashes($row["Type"]); - $t_field = $row["Field"]; - if ( $t_field=="category" ) { - break; - } - } - - $t_str = substr( $t_type, 5, strlen($t_type)-6).","; - $cat_count = count(explode(",",$t_str))-1; + $t_category_string = get_enum_string( "category" ); + $t_str = $t_category_string.","; + $cat_count = get_enum_count($t_str)-1; for ($i=0;$i<$cat_count;$i++) { $t_s = substr( $t_str, 1, strpos($t_str, ",")-2 ); $t_str = substr( $t_str, strpos($t_str, ",")+1, strlen($t_str) ); @@ -160,7 +153,43 @@ function print_categories( $p_category="" ) { else { PRINT "