Skip to content

Commit

Permalink
Enh #3918: Allow restricting filter views to advanced or simple.
Browse files Browse the repository at this point in the history
git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@2598 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
narcissus committed Jun 8, 2004
1 parent 8fa1058 commit e4a4ec7
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
3 changes: 2 additions & 1 deletion 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.168 2004-05-27 22:09:20 int2str Exp $
# $Id: config_defaults_inc.php,v 1.169 2004-06-08 06:47:12 narcissus Exp $
# --------------------------------------------------------


Expand Down Expand Up @@ -911,6 +911,7 @@
#######################################
$g_filter_by_custom_fields = ON;
$g_filter_custom_fields_per_row = 7;
$g_view_filters = SIMPLE_DEFAULT;

#######################################
# Mantis Database Table Variables
Expand Down
4 changes: 3 additions & 1 deletion core/constant_inc.php
Expand Up @@ -6,7 +6,7 @@
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Id: constant_inc.php,v 1.17 2004-05-25 23:43:48 int2str Exp $
# $Id: constant_inc.php,v 1.18 2004-06-08 06:47:13 narcissus Exp $
# --------------------------------------------------------

### CONSTANTS ###
Expand Down Expand Up @@ -100,6 +100,8 @@
define( 'BOTH', 0 );
define( 'SIMPLE_ONLY', 1 );
define( 'ADVANCED_ONLY', 2 );
define( 'SIMPLE_DEFAULT', 3 );
define( 'ADVANCED_DEFAULT', 4 );

# news values
define( 'BY_LIMIT', 0 );
Expand Down
2 changes: 2 additions & 0 deletions doc/ChangeLog
Expand Up @@ -30,6 +30,7 @@ Mantis ChangeLog
* Enh #3841: Add real name ability to mantis.
* Enh #3867: Give the user control whether to open hyperlink in new or current window.
* Enh #3870: Support for custom functions which provides hooks for customizing behaviour.
* Enh #3918: Allow restricting filter views to advanced or simple.
* Fix #3094: Switching projects clears filter values.
* Fix #3159: Allow case of user name to be changed. Also fixed bug where database error was displayed when trying to create user "TeSt" when user "Test" already exists.
* Fix #3397: Delete notification should be off when deleting a project.
Expand Down Expand Up @@ -82,6 +83,7 @@ Mantis ChangeLog
* New Config: bug_readonly_status_threshold (default RESOLVED). Status threshold after which the issue is considered readonly.
* New Config: update_readonly_bug_threshold (default MANAGER). Status threshold after which the user is allowed to edit readonly issues.
* New Config: view_changelog_threshold (default VIEWER). Status threshold after which the user is allowed to view the changelog. The changelog will include private issues only if user has the approach access level.
* New Config: view_filters (default SIMPLE_DEFAULT) - Default filter view.
* Removed config option (use_phpMailer): phpMailer has always been used
* Removed config option (phpMailer_path): phpMailer has been included to Mantis distribution
* Removed config option (use_x_priority): phpMailer always puts X-Priority header
Expand Down
24 changes: 19 additions & 5 deletions view_filters_page.php
Expand Up @@ -106,7 +106,19 @@ function SwitchDateFields() {
$t_action = "view_all_set.php";
}

$f_view_type = gpc_get_string( 'view_type', 'simple' );
$f_default_view_type = 'simple';
if ( ADVANCED_DEFAULT == config_get( 'view_filters' ) ) {
$f_default_view_type = 'advanced';
}

$f_view_type = gpc_get_string( 'view_type', $f_default_view_type );
if ( ADVANCED_ONLY == config_get( 'view_filters' ) ) {
$f_view_type = 'advanced';
}
if ( SIMPLE_ONLY == config_get( 'view_filters' ) ) {
$f_view_type = 'simple';
}

$t_select_modifier = '';
if ( 'advanced' == $f_view_type ) {
$t_select_modifier = 'multiple="multiple" size="10" ';
Expand All @@ -133,10 +145,12 @@ function SwitchDateFields() {
<?php
$f_switch_view_link = 'view_filters_page.php?target_field=' . $t_target_field . '&amp;view_type=';

if ( 'advanced' == $f_view_type ) {
print_bracket_link( $f_switch_view_link . 'simple', lang_get( 'simple_filters' ) );
} else {
print_bracket_link( $f_switch_view_link . 'advanced', lang_get( 'advanced_filters' ) );
if ( ( SIMPLE_ONLY != config_get( 'view_filters' ) ) && ( ADVANCED_ONLY != config_get( 'view_filters' ) ) ) {
if ( 'advanced' == $f_view_type ) {
print_bracket_link( $f_switch_view_link . 'simple', lang_get( 'simple_filters' ) );
} else {
print_bracket_link( $f_switch_view_link . 'advanced', lang_get( 'advanced_filters' ) );
}
}
?>
</td>
Expand Down

0 comments on commit e4a4ec7

Please sign in to comment.