Skip to content

Commit

Permalink
Fixed #8018: Add configuration option to allow/disallow free text in …
Browse files Browse the repository at this point in the history
…platform, os, and os_build (vboctor)

git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@4368 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
vboctor committed May 26, 2007
1 parent 3453269 commit 328914a
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 16 deletions.
41 changes: 37 additions & 4 deletions bug_report_advanced_page.php
Expand Up @@ -6,7 +6,7 @@
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Id: bug_report_advanced_page.php,v 1.61 2007-04-20 08:28:22 vboctor Exp $
# $Id: bug_report_advanced_page.php,v 1.62 2007-05-26 03:32:42 vboctor Exp $
# --------------------------------------------------------

# This file POSTs data to report_bug.php
Expand Down Expand Up @@ -234,7 +234,18 @@
</td>
<td>
<?php
projax_autocomplete( 'platform_get_with_prefix', 'platform', array( 'value' => $f_platform, 'size' => '32', 'maxlength' => '32', 'tabindex' => helper_get_tab_index_value() ) );
if ( config_get( 'allow_freetext_in_profile_fields' ) == OFF ) {
?>
<select name="platform">
<option value=""></option>
<?php
print_platform_option_list( $f_platform );
?>
</select>
<?php
} else {
projax_autocomplete( 'platform_get_with_prefix', 'platform', array( 'value' => $f_platform, 'size' => '32', 'maxlength' => '32', 'tabindex' => helper_get_tab_index_value() ) );
}
?>
</td>
</tr>
Expand All @@ -247,7 +258,18 @@
</td>
<td>
<?php
projax_autocomplete( 'os_get_with_prefix', 'os', array( 'value' => $f_os, 'size' => '32', 'maxlength' => '32', 'tabindex' => helper_get_tab_index_value() ) );
if ( config_get( 'allow_freetext_in_profile_fields' ) == OFF ) {
?>
<select name="os">
<option value=""></option>
<?php
print_os_option_list( $f_os );
?>
</select>
<?php
} else {
projax_autocomplete( 'os_get_with_prefix', 'os', array( 'value' => $f_os, 'size' => '32', 'maxlength' => '32', 'tabindex' => helper_get_tab_index_value() ) );
}
?>
</td>
</tr>
Expand All @@ -260,7 +282,18 @@
</td>
<td>
<?php
projax_autocomplete( 'os_build_get_with_prefix', 'os_build', array( 'value' => $f_os_build, 'size' => '16', 'maxlength' => '16', 'tabindex' => helper_get_tab_index_value() ) );
if ( config_get( 'allow_freetext_in_profile_fields' ) == OFF ) {
?>
<select name="os_build">
<option value=""></option>
<?php
print_os_build_option_list( $f_os_build );
?>
</select>
<?php
} else {
projax_autocomplete( 'os_build_get_with_prefix', 'os_build', array( 'value' => $f_os_build, 'size' => '16', 'maxlength' => '16', 'tabindex' => helper_get_tab_index_value() ) );
}
?>
</td>
</tr>
Expand Down
43 changes: 38 additions & 5 deletions bug_update_advanced_page.php
@@ -1,12 +1,12 @@
<?php
# Mantis - a php based bugtracking system
# Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
# Copyright (C) 2002 - 2006 Mantis Team - mantisbt-dev@lists.sourceforge.net
# Copyright (C) 2002 - 2007 Mantis Team - mantisbt-dev@lists.sourceforge.net
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Id: bug_update_advanced_page.php,v 1.99 2007-04-25 06:22:20 vboctor Exp $
# $Id: bug_update_advanced_page.php,v 1.100 2007-05-26 03:32:42 vboctor Exp $
# --------------------------------------------------------

require_once( 'core.php' );
Expand Down Expand Up @@ -237,7 +237,18 @@
</td>
<td>
<?php
projax_autocomplete( 'platform_get_with_prefix', 'platform', array( 'value' => $t_bug->platform, 'size' => '16', 'maxlength' => '32', 'tabindex' => helper_get_tab_index_value() ) );
if ( config_get( 'allow_freetext_in_profile_fields' ) == OFF ) {
?>
<select name="platform">
<option value=""></option>
<?php
print_platform_option_list( $t_bug->platform );
?>
</select>
<?php
} else {
projax_autocomplete( 'platform_get_with_prefix', 'platform', array( 'value' => $t_bug->platform, 'size' => '16', 'maxlength' => '32', 'tabindex' => helper_get_tab_index_value() ) );
}
?>
</td>

Expand Down Expand Up @@ -278,7 +289,18 @@
</td>
<td>
<?php
projax_autocomplete( 'os_get_with_prefix', 'os', array( 'value' => $t_bug->os, 'size' => '16', 'maxlength' => '32', 'tabindex' => helper_get_tab_index_value() ) );
if ( config_get( 'allow_freetext_in_profile_fields' ) == OFF ) {
?>
<select name="os">
<option value=""></option>
<?php
print_os_option_list( $t_bug->os );
?>
</select>
<?php
} else {
projax_autocomplete( 'os_get_with_prefix', 'os', array( 'value' => $t_bug->os, 'size' => '16', 'maxlength' => '32', 'tabindex' => helper_get_tab_index_value() ) );
}
?>
</td>

Expand Down Expand Up @@ -306,7 +328,18 @@
</td>
<td>
<?php
projax_autocomplete( 'os_build_get_with_prefix', 'os_build', array( 'value' => $t_bug->os_build, 'size' => '16', 'maxlength' => '16', 'tabindex' => helper_get_tab_index_value() ) );
if ( config_get( 'allow_freetext_in_profile_fields' ) == OFF ) {
?>
<select name="os_build">
<option value=""></option>
<?php
print_os_build_option_list( $t_bug->os_build );
?>
</select>
<?php
} else {
projax_autocomplete( 'os_build_get_with_prefix', 'os_build', array( 'value' => $t_bug->os_build, 'size' => '16', 'maxlength' => '16', 'tabindex' => helper_get_tab_index_value() ) );
}
?>
</td>

Expand Down
22 changes: 15 additions & 7 deletions config_defaults_inc.php
Expand Up @@ -6,7 +6,7 @@
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Id: config_defaults_inc.php,v 1.334 2007-05-09 17:58:09 prichards Exp $
# $Id: config_defaults_inc.php,v 1.335 2007-05-26 03:32:42 vboctor Exp $
# --------------------------------------------------------


Expand Down Expand Up @@ -1012,9 +1012,6 @@
# Update bugnote threshold (if the bugnote is not your own)
$g_update_bugnote_threshold = DEVELOPER;

# Add profile threshold
$g_add_profile_threshold = REPORTER;

# Threshold needed to view project documentation
$g_view_proj_doc_threshold = ANYBODY;

Expand Down Expand Up @@ -1075,9 +1072,6 @@
# $g_bug_readonly_status_threshold.
$g_update_readonly_bug_threshold = MANAGER;

# Threshold needed to be able to create and modify global profiles
$g_manage_global_profile_threshold = MANAGER;

# threshold for viewing changelog
$g_view_changelog_threshold = VIEWER;

Expand Down Expand Up @@ -1822,4 +1816,18 @@

# access level required to run reports
$g_time_tracking_reporting_threshold = MANAGER;

#############################
# Profile Related Settings
#############################

# Add profile threshold
$g_add_profile_threshold = REPORTER;

# Threshold needed to be able to create and modify global profiles
$g_manage_global_profile_threshold = MANAGER;

# Allows the users to enter free text when reporting/updating issues
# for the profile related fields (i.e. platform, os, os build)
$g_allow_freetext_in_profile_fields = ON;
?>

0 comments on commit 328914a

Please sign in to comment.