View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update | 
|---|---|---|---|---|---|
| 0013338 | mantisbt | bugtracker | public | 2011-09-21 17:30 | 2011-09-27 06:42 | 
| Reporter | vincent_sels | Assigned To | |||
| Priority | normal | Severity | feature | Reproducibility | N/A | 
| Status | new | Resolution | open | ||
| Product Version | 1.2.8 | ||||
| Summary | 0013338: 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. | ||||
| Tags | patch | ||||
| 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'];
 		}
 
 | ||||
| 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 ) { No Category} File: core\versions_api.php: function version_full_name( $p_version_id, $p_show_project = null, $p_current_project_id = null ) { No Version} | |
| dregad, it appears you applied the wrong ticketnumber for your check-in :) | |
| @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. | |
