How can I leave only the category name (remove "all projects

General discussion of Mantis.

Moderators: Developer, Contributor

Post Reply
andrebbm
Posts: 2
Joined: 05 Oct 2012, 14:11

How can I leave only the category name (remove "all projects

Post by andrebbm »

Good morning!

Would anyone know How can I leave only the category name (remove "all projects") on the "Report Issue"?

Gotta leave just showing the category names.

Here is a print attached.
[img] http://img255.imagevenue.com/img.php?im ... _374lo.jpg [/ img]


Thanks for the help and hugs!
atrol
Site Admin
Posts: 8376
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: How can I leave only the category name (remove "all proj

Post by atrol »

The "All Projects" shows that you are using global categories.
There is no configuration option to change this. You would have to change the source code of MantisB (function category_full_name).

If you don't need all categories for all projects you could use project specific categories instead of the globals.
Please use Search before posting and read the Manual
andrebbm
Posts: 2
Joined: 05 Oct 2012, 14:11

Re: How can I leave only the category name (remove "all proj

Post by andrebbm »

atrol wrote:The "All Projects" shows that you are using global categories.
There is no configuration option to change this. You would have to change the source code of MantisB (function category_full_name).

If you don't need all categories for all projects you could use project specific categories instead of the globals.

Actually, I need the name does not appear "all projects" before the categories, because whoever opens the call technician uses the auto-complete text, so you can quickly filter the category name. So I would just leave the name of the category, at least in this part of the mantis. Grateful for help and hugs!
than8705
Posts: 1
Joined: 18 Jan 2013, 21:24

Re: How can I leave only the category name (remove "all proj

Post by than8705 »

modify the for each loop in core\print_api.php

Code: Select all

foreach( $cat_arr as $t_category_row ) {
		$t_category_id = $t_category_row['id'];
		echo "<option value=\"$t_category_id\"";
		check_selected( $p_category_id, $t_category_id );
		/*************************MODIFIED 1/18/2013******************************/
		//removes Project Name from category drop down on bug_report_page.php
		$t_category_only_name = string_attribute( category_full_name( $t_category_id, $t_category_row['project_id'] != $t_project_id ) );
		$pos = strpos($t_category_only_name, "] ");
		$t_category_only_name = substr($t_category_only_name, $pos+2);
		echo '>' . $t_category_only_name . '</option>';
		/*********************END MODIFICATIONS ******************************/
		
		//original echo command
		//echo '>' . string_attribute( category_full_name( $t_category_id, $t_category_row['project_id'] != $t_project_id ) ) . '</option>';
	}
orfeonhn
Posts: 1
Joined: 18 Jun 2013, 19:20

Re: How can I leave only the category name (remove "all proj

Post by orfeonhn »

You can use parameter:

/**
* shows project '[project] category' when 'All Projects' is selected
* otherwise only 'category name'
* @global int $g_summary_category_include_project
*/
$g_summary_category_include_project = OFF;

Just add it in config_inc.php
atrol
Site Admin
Posts: 8376
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: How can I leave only the category name (remove "all proj

Post by atrol »

orfeonhn wrote: $g_summary_category_include_project = OFF;
Just add it in config_inc.php
a) You don't have to put any option in config_inc.php if you don't want to change the default value.
The default of $g_summary_category_include_project is set in config_defaults_inc.php and is set to OFF

b) The question was
andrebbm wrote: Would anyone know How can I leave only the category name (remove "all projects") on the "Report Issue"?
The option $g_summary_category_include_project does not affect the "Report Issue" page
Please use Search before posting and read the Manual
atef
Posts: 3
Joined: 29 May 2014, 12:27

Re: How can I leave only the category name (remove "all proj

Post by atef »

the solution by than8705 works fine
testuser1
Posts: 3
Joined: 18 Aug 2014, 06:12

Re: How can I leave only the category name (remove "all proj

Post by testuser1 »

than8705 wrote:modify the for each loop in core\print_api.php
This solution is working perfect. thanks "than8705" :D
Post Reply