Skip to content

Commit

Permalink
Removed dependency on s_ enum strings. Use g_ enum strings instead.
Browse files Browse the repository at this point in the history
git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@879 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
Kenzaburo Ito committed Apr 4, 2002
1 parent 7db50d0 commit 44229a1
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 19 deletions.
5 changes: 0 additions & 5 deletions core_email_API.php
Expand Up @@ -273,11 +273,6 @@ function email_build_bug_message( $p_bug_id ) {
$s_email_duplicate, $s_email_date_submitted,
$s_email_last_modified, $s_email_summary,
$s_email_description,
$s_resolution_enum_string,
$s_severity_enum_string,
$s_priority_enum_string,
$s_status_enum_string,
$s_reproducibility_enum_string,
$g_email_separator1,
$g_email_padding_length;

Expand Down
5 changes: 3 additions & 2 deletions core_helper_API.php
Expand Up @@ -364,13 +364,14 @@ function get_enum_element( $p_enum_name, $p_val ) {
$s_var = "s_".$p_enum_name."_enum_string";
global $$g_var, $$s_var;

return get_enum_to_string( $$s_var, $p_val );
# use the global enum string to search
$t_arr = explode_enum_string( $$g_var );
$t_arr_count = count( $t_arr );
for ( $i=0;$i<$t_arr_count;$i++ ) {
$elem_arr = explode_enum_arr( $t_arr[$i] );
if ( $elem_arr[0] == $p_val ) {
get_enum_to_string( $$s_var, $elem_arr[0] );
# now get the appropriate translation
return get_enum_to_string( $$s_var, $p_val );
}
}
return "@null@";
Expand Down
2 changes: 1 addition & 1 deletion core_html_API.php
Expand Up @@ -508,7 +508,7 @@ function print_mantis_error( $p_error_num=0 ) {
# --------------------
# Print the color legend for the colors
function print_status_colors() {
global $g_status_enum_string, $s_status_enum_string,
global $g_status_enum_string,
$g_new_color, $g_feedback_color,
$g_acknowledged_color, $g_confirmed_color,
$g_assigned_color, $g_resolved_color,
Expand Down
17 changes: 11 additions & 6 deletions core_print_API.php
Expand Up @@ -426,20 +426,25 @@ function print_enum_string_option_list( $p_enum_name, $p_val=0 ) {
} # end for
}
# --------------------
function print_project_user_option_list( $p_val=0 ) {
global $g_mantis_project_table, $s_access_levels_enum_string;
# prints the list of access levels exluding ADMINISTRATOR
# this is used when adding users to projects
function print_project_user_option_list( $p_val ) {
global $g_mantis_project_table, $g_access_levels_enum_string;

$t_arr = explode_enum_string( $s_access_levels_enum_string );
$t_arr = explode_enum_string( $g_access_levels_enum_string );
$enum_count = count( $t_arr );
for ($i=0;$i<$enum_count;$i++) {
$t_elem = explode_enum_arr( $t_arr[$i] );

if ( ADMINISTRATOR == $t_elem[0] ) { continue; }
if ( $t_elem[0] >= ADMINISTRATOR ) {
continue;
}

$t_access_level = get_enum_element( "access_levels", $t_elem[0] );
if ( $p_val == $t_elem[0] ) {
PRINT "<option value=\"$t_elem[0]\" SELECTED>$t_elem[1]</option>";
PRINT "<option value=\"$t_elem[0]\" SELECTED>$t_access_level</option>";
} else {
PRINT "<option value=\"$t_elem[0]\">$t_elem[1]</option>";
PRINT "<option value=\"$t_elem[0]\">$t_access_level</option>";
}
} # end for
}
Expand Down
2 changes: 1 addition & 1 deletion core_summary_API.php
Expand Up @@ -65,7 +65,7 @@ function print_bug_enum_summary( $p_enum_string, $p_enum ) {

PRINT "<tr align=\"center\">";
PRINT "<td width=\"50%\" bgcolor=\"$t_bgcolor\">";
echo get_enum_to_string( $p_enum_string, $t_s[0] );
echo get_enum_element( $p_enum, $t_s[0] );
PRINT "</td>";
PRINT "<td width=\"50%\" bgcolor=\"$t_bgcolor\">";
#PRINT "$open_bug_count $resolved_bug_count $closed_bug_count $t_enum_count";
Expand Down
1 change: 1 addition & 0 deletions doc/ChangeLog
Expand Up @@ -50,6 +50,7 @@ Mantis
* Removed access_min and access threshold concepts from the user and project management.
* Removed extra "echo" in news archive page.
* Removed proj_user_delete_page.php.
* Removed dependency on s_ enum strings. Use g_ enum strings instead.
* Updated Copyright to 2002.

03.15.2002 - 0.17.1
Expand Down
8 changes: 4 additions & 4 deletions summary_page.php
Expand Up @@ -73,7 +73,7 @@
<?php echo $s_by_status ?>:
</td>
</tr>
<?php print_bug_enum_summary( $s_status_enum_string, "status" ) ?>
<?php print_bug_enum_summary( $g_status_enum_string, "status" ) ?>
</table>
</td>
<td width="50%">
Expand All @@ -97,7 +97,7 @@
<?php echo $s_by_severity ?>:
</td>
</tr>
<?php print_bug_enum_summary( $s_severity_enum_string, "severity" ) ?>
<?php print_bug_enum_summary( $g_severity_enum_string, "severity" ) ?>
</table>
</td>
<td>
Expand All @@ -108,7 +108,7 @@
<?php echo $s_by_resolution ?>:
</td>
</tr>
<?php print_bug_enum_summary( $s_resolution_enum_string, "resolution" ) ?>
<?php print_bug_enum_summary( $g_resolution_enum_string, "resolution" ) ?>
</table>
</td>
</tr>
Expand All @@ -132,7 +132,7 @@
<?php echo $s_by_priority ?>:
</td>
</tr>
<?php print_bug_enum_summary( $s_priority_enum_string, "priority" ) ?>
<?php print_bug_enum_summary( $g_priority_enum_string, "priority" ) ?>
</table>
</td>
</tr>
Expand Down

0 comments on commit 44229a1

Please sign in to comment.