remove menu options
Moderators: Developer, Contributor
remove menu options
Hi,
Is it possible to remove some of the main menu options?
For example I don’t need the roadmap, the Docs, the Change Log.
If yes, how?
Thank you for the help
Massimo
Is it possible to remove some of the main menu options?
For example I don’t need the roadmap, the Docs, the Change Log.
If yes, how?
Thank you for the help
Massimo
-
- Posts: 5
- Joined: 17 Sep 2009, 07:04
- Contact:
Re: remove menu options
Hello,
I think you shoudl change/comment/remove some lines inside function print_menu().
You can find it in the core/html_api.php
I think you shoudl change/comment/remove some lines inside function print_menu().
You can find it in the core/html_api.php
Re: remove menu options
Jeferson Oliveira in the mantis_help mailing list gave me he solution (and I thank him).
I cut and paste his answer.
Yes, it is possible. And you don't need to change the core to customize the most of the items mentioned above.
There are two places where you can mange the permissions or availability of some modules:
1) Log into Mantis and access Manage/Manage configurations
- in this section you can control Workflow Thresholds (and change, for example, "View Change Log" access), Workflow Transitions, E-mail Notifications;
2) Set in "config_inc.php" (that definitely is not a core file) new values to the configuration variables defined in "config_defaults_inc.php".
Please notice that is a good practice don't change "config_defaults_inc.php". When some variable need to be changed define it's new value in "config_inc.php".
You can, for example, add
$g_roadmap_view_threshold = NOBODY;
in "config_inc.php" and this way deny the access to the roadmap page for everyone.
In this way I was able to remove the roadmap and the Change log (that I don't use) But I have not been able to remove the "Docs" menu.
It is OK I am happy with this solution.
Thanks to Jeferson
I cut and paste his answer.
Yes, it is possible. And you don't need to change the core to customize the most of the items mentioned above.
There are two places where you can mange the permissions or availability of some modules:
1) Log into Mantis and access Manage/Manage configurations
- in this section you can control Workflow Thresholds (and change, for example, "View Change Log" access), Workflow Transitions, E-mail Notifications;
2) Set in "config_inc.php" (that definitely is not a core file) new values to the configuration variables defined in "config_defaults_inc.php".
Please notice that is a good practice don't change "config_defaults_inc.php". When some variable need to be changed define it's new value in "config_inc.php".
You can, for example, add
$g_roadmap_view_threshold = NOBODY;
in "config_inc.php" and this way deny the access to the roadmap page for everyone.
In this way I was able to remove the roadmap and the Change log (that I don't use) But I have not been able to remove the "Docs" menu.
It is OK I am happy with this solution.
Thanks to Jeferson
Re: remove menu options
I disabled the menu items by these config lines:
$g_roadmap_view_threshold = NOBODY;
$g_view_changelog_threshold = NOBODY;
$g_enable_project_documentation = OFF;
$g_manage_news_threshold = NOBODY;
so now there's only the core functionality left!
$g_roadmap_view_threshold = NOBODY;
$g_view_changelog_threshold = NOBODY;
$g_enable_project_documentation = OFF;
$g_manage_news_threshold = NOBODY;
so now there's only the core functionality left!
Re: remove menu options
Thank you Iphar.
It works great.
Only a small extra question.
Where can I find the documentation of all these parameters (other than in the config_default_inc.php file)?
It works great.
Only a small extra question.
Where can I find the documentation of all these parameters (other than in the config_default_inc.php file)?
Re: remove menu options
Check the configuration section in the manual:
http://www.mantisbt.org/docs/master-1.2.x/en/
The above link points to the 1.2.x release branch manual.
http://www.mantisbt.org/docs/master-1.2.x/en/
The above link points to the 1.2.x release branch manual.
Migrate your MantisBT to the MantisHub Cloud
Re: remove menu options
I understood the question as removing primary menu links i.e.
Main | My View | View Issues | Report Issue | My Account | Logout
if you're interested in removing these, simply to to the html_api.php file and comment out the menu you want to not show. For example, I wanted to eliminate Roadmap, Documentation, and News.
Once you open html_api.php file, put a # in-front of the lines of the menus you want to hide.
Exapmle:
# Project Documentation Page
#if( ON == config_get( 'enable_project_documentation' ) ) {
# $t_menu_options[] = '<a href="proj_doc_page.php">' . lang_get( 'docs_link' ) . #'</a>';
# }
Notice you also need the # where the } is...
good luck!
Main | My View | View Issues | Report Issue | My Account | Logout
if you're interested in removing these, simply to to the html_api.php file and comment out the menu you want to not show. For example, I wanted to eliminate Roadmap, Documentation, and News.
Once you open html_api.php file, put a # in-front of the lines of the menus you want to hide.
Exapmle:
# Project Documentation Page
#if( ON == config_get( 'enable_project_documentation' ) ) {
# $t_menu_options[] = '<a href="proj_doc_page.php">' . lang_get( 'docs_link' ) . #'</a>';
# }
Notice you also need the # where the } is...
good luck!
Re: remove menu options
You should better use MantisBT configuration in config_inc.php to achieve this.
The advantage is, that you don't have to change the MantisBT source code and you will have fever problems when updating to a newer version.
The advantage is, that you don't have to change the MantisBT source code and you will have fever problems when updating to a newer version.
Re: hide my account menu options
Hi,
I want to hide my account menu from user. So they can't change their own password.
Only administrator can reset the password.
Can you describe me in details how to do it correctly.
Thanks..
I want to hide my account menu from user. So they can't change their own password.
Only administrator can reset the password.
Can you describe me in details how to do it correctly.
Thanks..
Re: remove menu options
That you can only achieve if you "protect" the account. This you can do under Manage/manage users.
-
- Posts: 5
- Joined: 07 Mar 2016, 19:56
Re: remove menu options
I don't know if this will help anyone at this point, but i did modify the html_api.php to hide My Account from users.
You need to find this line and comment it:
if( OFF == $t_protected ) {
$t_menu_options[] = '<a href="' . helper_mantis_url( 'account_page.php">' ) . lang_get( 'account_link' ) . '</a>';
}
Or you could change the helper_mantis_url to helper_mantis_url( 'account_prefs_page.php">' ) so the User go to preference when he hits My Account
Then you need to find the line where this function starts: function print_account_menu( $p_page = '' )
Then you need to comment this lines:
print_bracket_link( $t_account_page, lang_get( 'account_link' ) );
print_bracket_link( $t_account_prefs_page, lang_get( 'change_preferences_link' ) );
print_bracket_link( $t_account_manage_columns_page, lang_get( 'manage_columns_config' ) );
So he doesn't see the sub menu to change to manage columns or to change his password, but this would hide it for all users so if you want it to only show to administrator add this IF:
if (current_user_is_administrator()){
print_bracket_link( $t_account_page, lang_get( 'account_link' ) );
print_bracket_link( $t_account_prefs_page, lang_get( 'change_preferences_link' ) );
print_bracket_link( $t_account_manage_columns_page, lang_get( 'manage_columns_config' ) );
}
Or if you want it to show to some acces levels only:
if (current_user_get_access_level() == ADMINISTRATOR || current_user_get_access_level() == MANAGER || current_user_get_access_level() == DEVELOPER){
print_bracket_link( $t_account_page, lang_get( 'account_link' ) );
print_bracket_link( $t_account_prefs_page, lang_get( 'change_preferences_link' ) );
print_bracket_link( $t_account_manage_columns_page, lang_get( 'manage_columns_config' ) );
}
Hope it helps anyone, is only a bit modification to the code and you can have the modifications you did (like me) in a txt/word and always save the Original file from Mantis.
Cheers.
You need to find this line and comment it:
if( OFF == $t_protected ) {
$t_menu_options[] = '<a href="' . helper_mantis_url( 'account_page.php">' ) . lang_get( 'account_link' ) . '</a>';
}
Or you could change the helper_mantis_url to helper_mantis_url( 'account_prefs_page.php">' ) so the User go to preference when he hits My Account
Then you need to find the line where this function starts: function print_account_menu( $p_page = '' )
Then you need to comment this lines:
print_bracket_link( $t_account_page, lang_get( 'account_link' ) );
print_bracket_link( $t_account_prefs_page, lang_get( 'change_preferences_link' ) );
print_bracket_link( $t_account_manage_columns_page, lang_get( 'manage_columns_config' ) );
So he doesn't see the sub menu to change to manage columns or to change his password, but this would hide it for all users so if you want it to only show to administrator add this IF:
if (current_user_is_administrator()){
print_bracket_link( $t_account_page, lang_get( 'account_link' ) );
print_bracket_link( $t_account_prefs_page, lang_get( 'change_preferences_link' ) );
print_bracket_link( $t_account_manage_columns_page, lang_get( 'manage_columns_config' ) );
}
Or if you want it to show to some acces levels only:
if (current_user_get_access_level() == ADMINISTRATOR || current_user_get_access_level() == MANAGER || current_user_get_access_level() == DEVELOPER){
print_bracket_link( $t_account_page, lang_get( 'account_link' ) );
print_bracket_link( $t_account_prefs_page, lang_get( 'change_preferences_link' ) );
print_bracket_link( $t_account_manage_columns_page, lang_get( 'manage_columns_config' ) );
}
Hope it helps anyone, is only a bit modification to the code and you can have the modifications you did (like me) in a txt/word and always save the Original file from Mantis.
Cheers.