Custom Page Structure

Post about your customizations to share with others.

Moderators: Developer, Contributor

Post Reply
KSD

Custom Page Structure

Post by KSD »

In the interest of saving any interested parties 5 minutes of sifting through code, I will outline the process required to make alteration to the structure of mantis page.
I had to customise the structure of the bug view page for work. This is a very simple process. To make the required alterations, no change need be made to any data collection functions. All that needs to be done is to change the order that those functions appear in the affected php file.

Follows is the necessary alterations to change the structure of the bug view page from

- Bug Details
- Relationships
- Upload file
- Users Monitoring
- Add Note
- Notes
- Issue History

To

- Bug Details
- Notes
- Add Note
- Upload file
- Relationships
- Users Monitoring
- Issue History


Changes:




bug_view_page.php
------------------

Replace line 407 - 431 with

Code: Select all

<?php
	$t_mantis_dir = dirname( __FILE__ ) . DIRECTORY_SEPARATOR;

	# User list sponsoring the bug
	include( $t_mantis_dir . 'bug_sponsorship_list_view_inc.php' );
	
	# Bugnotes
	include( $t_mantis_dir . 'bugnote_view_inc.php' );
	include( $t_mantis_dir . 'bugnote_add_inc.php' );

	# File upload box
	if ( !bug_is_readonly( $f_bug_id ) ) {
		include( $t_mantis_dir . 'bug_file_upload_inc.php' );
	}

	# Bug Relationships
	# MASC RELATIONSHIP
	if ( ON == config_get( 'enable_relationship' ) ) {
		relationship_view_box ( $f_bug_id );
	
	# MASC RELATIONSHIP

	# User list monitoring the bug
	include( $t_mantis_dir . 'bug_monitor_list_view_inc.php' );
?>


bug_view_advanced_page.php
--------------------------

Replace line 512 - 543 with

Code: Select all

<?php
	$t_mantis_dir = dirname( __FILE__ ) . DIRECTORY_SEPARATOR;


	# User list sponsoring the bug
	include( $t_mantis_dir . 'bug_sponsorship_list_view_inc.php' );


	# Bugnotes
	include( $t_mantis_dir . 'bugnote_view_inc.php' );
	include( $t_mantis_dir . 'bugnote_add_inc.php' );


	# File upload box
	if ( !bug_is_readonly( $f_bug_id ) ) {
		include( $t_mantis_dir . 'bug_file_upload_inc.php' );
	}


	# Bug Relationships
	# MASC RELATIONSHIP
	if ( ON == config_get( 'enable_relationship' ) ) {
		relationship_view_box ( $f_bug_id );
	}
	# MASC RELATIONSHIP


	# User list monitoring the bug
	include( $t_mantis_dir . 'bug_monitor_list_view_inc.php' );


	# History
	if ( $f_history ) {
		include( $t_mantis_dir . 'history_inc.php' );
	}


	html_page_bottom1( __FILE__ );
?>
as you can see i changed both the simple and advanced pages.

I think this process should be applicable to most of mantis, though I don’t know.
Post Reply