View Issue Details

IDProjectCategoryView StatusLast Update
0013338mantisbtbugtrackerpublic2011-09-27 06:42
Reportervincent_sels Assigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
Status newResolutionopen 
Product Version1.2.8 
Summary0013338: Option to hide [project name] in front of inherited categories and versions
Description

I don't need to see the super project's name as a tag in front of categories and version numbers of inherited projects, since they all use the same categories and versions, and they don't have any of their own. Hence, including the project they originate from has no added value whatsoever and is only confusing for the end-users.

Tagspatch
Attached Files
0013338.diff (1,854 bytes)   
--- C:/Documents and Settings/vsel/mantisbt-1.2.8/config_defaults_inc.php	Mon Sep 26 21:54:19 2011
+++ C:/Documents and Settings/vsel/mantisbt-edited/config_defaults_inc.php	Mon Sep 26 21:53:54 2011
@@ -2511,6 +2511,13 @@
 	$g_allow_no_category = OFF;
 
 	/**
+	 * When set ON, the inherited project name of the super-project is no longer displayed
+	 * between [brackets] before categories and versions in sub-projects.
+	 * @global int $g_hide_parent_project_name_on_categories
+	 */
+	$g_hide_parent_project_name_on_categories = ON;
+
+	/**
 	 * login method
 	 * MD5, LDAP, BASIC_AUTH or HTTP_AUTH.
 	 * Note: you may not be able to easily switch encryption methods, so this
--- C:/Documents and Settings/vsel/mantisbt-1.2.8/core/category_api.php	Tue Sep 06 10:23:10 2011
+++ C:/Documents and Settings/vsel/mantisbt-edited/core/category_api.php	Wed Sep 21 23:28:54 2011
@@ -600,7 +600,7 @@
 
 		$t_current_project = is_null( $p_current_project ) ? helper_get_current_project() : $p_current_project;
 
-		if( $p_show_project && $t_project_id != $t_current_project ) {
+		if( OFF == config_get( 'hide_parent_project_name_on_categories' ) && $t_project_id != $t_current_project ) {
 			return '[' . project_get_name( $t_project_id ) . '] ' . $t_row['name'];
 		}
 
--- C:/Documents and Settings/vsel/mantisbt-1.2.8/core/version_api.php	Mon Sep 26 21:55:41 2011
+++ C:/Documents and Settings/vsel/mantisbt-edited/core/version_api.php	Wed Sep 21 23:29:26 2011
@@ -581,7 +581,7 @@
 			$t_show_project = $p_show_project;
 		}
 
-		if ( $t_show_project && $t_project_id != $t_current_project_id ) {
+		if ( OFF == config_get( 'hide_parent_project_name_on_categories' ) && $t_show_project && $t_project_id != $t_current_project_id ) {
 			return '[' . project_get_name( $t_project_id ) . '] ' . $t_row['version'];
 		}
 
0013338.diff (1,854 bytes)   

Activities

vincent_sels

vincent_sels

2011-09-21 17:36

reporter   ~0029830

To achieve this, I added a setting:

$g_hide_parent_project_name_on_categories = ON;

And modified these two functions:

File: core\categories_api.php

function category_full_name( $p_category_id, $p_show_project = true, $p_current_project = null ) {
if( 0 == $p_category_id ) {

No Category

    return lang_get( 'no_category' );
} else {
    $t_row = category_get_row( $p_category_id );
    $t_project_id = $t_row['project_id'];

    $t_current_project = is_null( $p_current_project ) ? helper_get_current_project() : $p_current_project;

    if( <b>OFF == config_get( 'hide_parent_project_name_on_categories' ) &&</b> $t_project_id != $t_current_project ) {
        return '[' . project_get_name( $t_project_id ) . '] ' . $t_row['name'];
    }

    return $t_row['name'];
}

}

File: core\versions_api.php:

function version_full_name( $p_version_id, $p_show_project = null, $p_current_project_id = null ) {
if ( 0 == $p_version_id ) {

No Version

    return '';
} else {
    $t_row = version_cache_row( $p_version_id );
    $t_project_id = $t_row['project_id'];

    $t_current_project_id = is_null( $p_current_project_id ) ? helper_get_current_project() : $p_current_project_id;

    if ( $p_show_project === null ) {
        $t_show_project = $t_project_id != $t_current_project_id;
    } else {
        $t_show_project = $p_show_project;
    }

    if ( <b>OFF == config_get( 'hide_parent_project_name_on_categories' ) &&</b> $t_show_project && $t_project_id != $t_current_project_id ) {
        return '[' . project_get_name( $t_project_id ) . '] ' . $t_row['version'];
    }

    return $t_row['version'];
}

}

vincent_sels

vincent_sels

2011-09-23 07:32

reporter   ~0029855

dregad, it appears you applied the wrong ticketnumber for your check-in :)

dregad

dregad

2011-09-26 03:44

developer   ~0029862

@vincent_sels - I know, it was a typo but with git once a commit is public, you can't go back and rewrite history, so...

I detached the changesets from this bug to avoid confusion.