bug_report_page.php and auto select project

Get help from other users here.

Moderators: Contributor, Developer

Post Reply
truefriend-cz
Posts: 65
Joined: Jan 08, 2019 2:14 am

bug_report_page.php and auto select project

Post by truefriend-cz » Jan 08, 2019 2:23 am

How i can for users define automaticaly select project and category from URL for my users?

Idea: I wanted public link as this format:
www.anydomain.org/bugs/bug_report_page. ... egory_id=2

Where project ID 34 is named as "Software XYZ" and category ID 2 is named as "Blabla" and auto skip Project selector and auto hide line where is input selector "Category".

Thanks
Mantis version: 2.19.0, OS: Windows, PHP: 7.3, Charset (PHP, Database): UTF-8, and: little, bad english

cas
Posts: 484
Joined: Mar 11, 2006 11:08 am
Contact:

Re: bug_report_page.php and auto select project

Post by cas » Jan 08, 2019 3:51 am

Within user managemnt you can only assign a default project. Perhaps you should look at using sub-projects rather than categories.

atrol
Site Admin
Posts: 7526
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: bug_report_page.php and auto select project

Post by atrol » Jan 08, 2019 3:57 am

Your link should work, e.g. this works for me to report an issue for category "feature" in project "mantisbt"
https://www.mantisbt.org/bugs/bug_repor ... oject_id=1

To hide the category see option $g_bug_report_page_fields https://www.mantisbt.org/docs/master/en ... fig.fields
Please use Search before posting and read the Manual

truefriend-cz
Posts: 65
Joined: Jan 08, 2019 2:14 am

Re: bug_report_page.php and auto select project

Post by truefriend-cz » Jan 08, 2019 4:33 am

Ok, thanks i will testing. How i use g_bug_report_page_fields for hide category_id?
Yes, i know change config file but i dont know formated array. I use simple ON OFF swithes on one line.

I wanted on net and this solution is right? After add no accepted sorting and enabling disabling.

$g_bug_report_page_fields = array(
'category_id' =>'1',
'view_state' =>'2',
'handler' =>'3',
'priority' =>'4',
'severity' =>'5',
'reproducibility' =>'6',
'platform' =>'7',
'os' =>'0',
'os_version' =>'0',
'product_version' =>'0',
'product_build' =>'0',
'target_version' =>'0',
'summary' =>'8',
'description' =>'9',
'additional_info' =>'10',
'steps_to_reproduce' =>'11',
'attachments' =>'12',
'due_date' =>'13',
);


atrol wrote:
Jan 08, 2019 3:57 am
Your link should work, e.g. this works for me to report an issue for category "feature" in project "mantisbt"
https://www.mantisbt.org/bugs/bug_repor ... oject_id=1

To hide the category see option $g_bug_report_page_fields https://www.mantisbt.org/docs/master/en ... fig.fields
Mantis version: 2.19.0, OS: Windows, PHP: 7.3, Charset (PHP, Database): UTF-8, and: little, bad english

atrol
Site Admin
Posts: 7526
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: bug_report_page.php and auto select project

Post by atrol » Jan 08, 2019 4:54 am

Copy the deafult settings of $g_bug_report_page_fields from file config_defaults_inc.php to your config_inc.php and adjust it to your needs.
Please use Search before posting and read the Manual

truefriend-cz
Posts: 65
Joined: Jan 08, 2019 2:14 am

Re: bug_report_page.php and auto select project

Post by truefriend-cz » Jan 08, 2019 5:18 am

atrol wrote:
Jan 08, 2019 4:54 am
Copy the deafult settings of $g_bug_report_page_fields from file config_defaults_inc.php to your config_inc.php and adjust it to your needs.
Thank you very much. I did not know there was next configuration file in the base folder :D
Mantis version: 2.19.0, OS: Windows, PHP: 7.3, Charset (PHP, Database): UTF-8, and: little, bad english

atrol
Site Admin
Posts: 7526
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: bug_report_page.php and auto select project

Post by atrol » Jan 08, 2019 5:58 am

truefriend-cz wrote:
Jan 08, 2019 5:18 am
I did not know there was next configuration file in the base folder :D
config_defaults_inc.php is not meant as a configuration file that should be changed by user.
Never ever change it, as you might get problems when upgarding Mantis.
All configuration should be done in config_inc.php and/or the web UI.
Please use Search before posting and read the Manual

Post Reply