Custom Field in Roadmap Page

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
marcolino7
Posts: 8
Joined: 14 Jun 2008, 12:24

Custom Field in Roadmap Page

Post by marcolino7 »

Hi all,
I have mantis 1.1.2 and I would like to add a Custom Field created for the project in Roadmap page.
Is possible to do this? With Parameters? Modifying codes?

Please help.

If this feature is not implemeted yet, is possible to add in future release?

Many thanks
deboutv
Posts: 507
Joined: 15 Jan 2007, 14:31
Location: La Ciotat, FRANCE
Contact:

Re: Custom Field in Roadmap Page

Post by deboutv »

You can override a custom function (custom_function_override_roadmap_print_issue) to display the issue as you want.
Want more plugins to customize Mantis?
=> http://deboutv.free.fr/mantis/

Mantis: 1.1.0, 1.1.0a2
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux
marcolino7
Posts: 8
Joined: 14 Jun 2008, 12:24

Re: Custom Field in Roadmap Page

Post by marcolino7 »

hi,
thanks for your suggestion.
Do you have an example on how implement it?

Many Thanks in advance
deboutv
Posts: 507
Joined: 15 Jan 2007, 14:31
Location: La Ciotat, FRANCE
Contact:

Re: Custom Field in Roadmap Page

Post by deboutv »

Take a look at the default one (in core/custom_function_api.php).
Want more plugins to customize Mantis?
=> http://deboutv.free.fr/mantis/

Mantis: 1.1.0, 1.1.0a2
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux
marcolino7
Posts: 8
Joined: 14 Jun 2008, 12:24

Re: Custom Field in Roadmap Page

Post by marcolino7 »

I can't find custom_function_override_roadmap_print_issue in custom function API, but i solved with this code:

Code: Select all

# --------------------
	# Prints one entry in the roadmap.
	function custom_function_default_roadmap_print_issue( $p_issue_id, $p_issue_level = 0 ) {
		$t_bug = bug_get( $p_issue_id );
		
		if ( bug_is_resolved( $p_issue_id ) ) {
			$t_strike_start = '<strike>';
			$t_strike_end = '</strike>';
			$t_avanzamento = '';
		} else {
			$t_strike_start = $t_strike_end = '';
			$t_avanzamento = ' - '.custom_field_get_value( '3', $p_issue_id );
		}
		
		$t_category = is_blank( $t_bug->category ) ? '' : '<b>[' . $t_bug->category . ']</b> ';
		echo str_pad( '', $p_issue_level * 6, '&nbsp;' ), '- ', $t_strike_start, string_get_bug_view_link( $p_issue_id ), ': ', $t_category, string_display_line_links( $t_bug->summary );

		if ( $t_bug->handler_id != 0 ) {
			echo ' (', prepare_user_name( $t_bug->handler_id ) , $t_avanzamento , ')';
		}

		echo ' - ', get_enum_element( 'status', $t_bug->status ), $t_strike_end, '.<br />';
	}
Many thanks.
autra
Posts: 21
Joined: 25 Aug 2008, 09:40

Re: Custom Field in Roadmap Page

Post by autra »

If the function custom_function_override_roadmap_print_issue doesn't exist, you must create it and put your modified function here. Mantis will call custom_function_override_roadmap_print_issue instead of custom_function_default_roadmap_print_issue.
It allows you not to change the default function.
marcolino7
Posts: 8
Joined: 14 Jun 2008, 12:24

Re: Custom Field in Roadmap Page

Post by marcolino7 »

Thanks to all.
I customized Roadmap in according with my requirments.
Many thanks a lot to all.
artgroup
Posts: 29
Joined: 02 Jul 2008, 12:35

Re: Custom Field in Roadmap Page

Post by artgroup »

Is there a way to strike the closed issue on mantis 1.1.2?

I'm looking in bug traker and forum but it seems fixed into 1.2.a01 only

thanks
Chris by ArtGroup

Mantis: 1.1.2
PHP: 5.2.5
SQL: MySQL 5.0.51a
OS: XP SP2
deboutv
Posts: 507
Joined: 15 Jan 2007, 14:31
Location: La Ciotat, FRANCE
Contact:

Re: Custom Field in Roadmap Page

Post by deboutv »

It is already the case.
Want more plugins to customize Mantis?
=> http://deboutv.free.fr/mantis/

Mantis: 1.1.0, 1.1.0a2
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux
artgroup
Posts: 29
Joined: 02 Jul 2008, 12:35

Re: Custom Field in Roadmap Page

Post by artgroup »

That is true on the roadmap but not on the changelog where the bug id link is not striked.
While on mantis bug tracker I see that al bug id when closed/resolved are striked (the recently visited also)

Do I need to apply some patch? I looked into the bug tracker finding nothing.

My version is Mantis 1.1.2
Chris by ArtGroup

Mantis: 1.1.2
PHP: 5.2.5
SQL: MySQL 5.0.51a
OS: XP SP2
deboutv
Posts: 507
Joined: 15 Jan 2007, 14:31
Location: La Ciotat, FRANCE
Contact:

Re: Custom Field in Roadmap Page

Post by deboutv »

You have also a custom function to print issue on the changelog page: custom_function_override_changelog_print_issue. You can change it to look like the roadmap function.
Want more plugins to customize Mantis?
=> http://deboutv.free.fr/mantis/

Mantis: 1.1.0, 1.1.0a2
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux
Post Reply