Custom fields need to show in Summary page

Post about your customizations to share with others.

Moderators: Developer, Contributor

Post Reply
safee
Posts: 29
Joined: Jun 28, 2011 3:51 am

Custom fields need to show in Summary page

Post by safee » Jan 01, 2013 6:50 am

Hi

I added some custome fields in mantis. in summary page we are getting details By project, By Resoulation, Time Stats For Resolved Issues , Reporter Effectiveness etc..now customized fields need to show in Administrator > summary page.

can anybody tell me how to do that or is it possible or not ?

Please reply

Thanks

sparkscam
Posts: 2
Joined: Jun 03, 2014 1:20 pm

Re: Custom fields need to show in Summary page

Post by sparkscam » Jun 04, 2014 3:38 pm

I would like to know how to do this as well. Is there some sort of plugin or patch that anyone knows of that will allow showing the custom fields?

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

Re: Custom fields need to show in Summary page

Post by atrol » Jun 05, 2014 12:39 am

It's not clear what is meant with "showing custom fields".
You can have a lot of different custom fields with different data types where MantisBT is not able to know what's the meaning of it.

Of course, whatever you want: You have to implement your own logic.
Please use Search before posting and read the Manual

sparkscam
Posts: 2
Joined: Jun 03, 2014 1:20 pm

Re: Custom fields need to show in Summary page

Post by sparkscam » Jun 05, 2014 9:32 am

Thanks for the reply atrol, I know I'm kind of hijacking the original posters thread and this may not be exactly what the original poster may have wanted but I think it's somewhat similar. I'm a student who is somewhat new to PHP, MySQL, MantisBT, and programming in general. What I am asking for is help on displaying information on the custom fields similar to how information is displayed on the Summary page. For instance the Summary page displays a count of new, resolved, closed, and total issues "By Priority", "By Resolution", and "By Severity". What I would like help with is displaying information in an identical way to these data types(Enum I believe?) from custom fields.

I've looked at the summary_api.php and the summary_page.php and it appears that there is a function called "summary_print_by_enum" that is used. I've looked into it and I'm not sure how to adapt that function to getting the information from the three custom field tables (mantis_custom_field_string_table,mantis_custom_field_table, and mantis_custom_field_project_table) in the database. Especially in a way that would display the issues similarly to the default fields.

An example of the kind of custom field that I am looking to display information on is "Name: Type, Project Count: #1-10, Type: Enumeration, Possible Values: Blue|Yellow|Orange|Green".

Again, I appologize if this is something that requires too much individual information in order to accurately answer,something that is very basic, or something that shouldn't really be discussed on the forum but any help would be appreciated!

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

Re: Custom fields need to show in Summary page

Post by atrol » Jun 05, 2014 3:46 pm

Sorry, I have not enough time to provide such kind of support.
You could start studying code in core/custom_field_api.php, e.g. function custom_field_distinct_values ...
Please use Search before posting and read the Manual

kthl
Posts: 2
Joined: Oct 13, 2014 3:48 am

Re: Custom fields need to show in Summary page

Post by kthl » Oct 13, 2014 7:18 am

Hi All

Has there been any progress with this issue? My employer is using a custom field to help capture causes of issues (e.g. Enhancement request, Coding error, etc...). We’d like to include reporting on this in the summary page.

I’ve worked out how to do this with changes to config_inc.php and summary_page.php. However, if someone has already enhanced MantisBT to allow custom fields to be included in the summary page that would be preferable.

I’m new to this board so if the question has been answered elsewhere, a pointer in the right direction would be appreciated.

Thanks.

kthl
Posts: 2
Joined: Oct 13, 2014 3:48 am

Re: Custom fields need to show in Summary page

Post by kthl » Nov 14, 2014 2:15 pm

Dear All

Following on from previous email, what I did was:

i) Define a function "summary_print_by_custom_field()" in config_inc.php

ii) Added <?php summary_print_by_custom_field($t_orcttab) ?> to summary_page.php underneath <?php summary_print_by_category() ?>

summary_print_by_custom_field() is provided in the attachment. Anyone who wants to make use of this code is welcome to do so. However, please note the terms and conditions.
Attachments
func_def.txt
Definition of summary_print_by_custom_field()
(8.83 KiB) Downloaded 519 times

gopir
Posts: 1
Joined: Aug 06, 2015 6:46 am

Re: Custom fields need to show in Summary page

Post by gopir » Aug 06, 2015 6:49 am

kthl wrote:Dear All

Following on from previous email, what I did was:

i) Define a function "summary_print_by_custom_field()" in config_inc.php

ii) Added <?php summary_print_by_custom_field($t_orcttab) ?> to summary_page.php underneath <?php summary_print_by_category() ?>

summary_print_by_custom_field() is provided in the attachment. Anyone who wants to make use of this code is welcome to do so. However, please note the terms and conditions.
Some how the db query in the function doesn't seem to work and hence will not update the total closed, total open and other bugs count.
Can you please look into this once.

newbe
Posts: 13
Joined: Mar 14, 2014 11:06 am

Re: Custom fields need to show in Summary page

Post by newbe » Mar 12, 2018 8:33 am

Hi folks,
I added the code from kthl and it worked "somehow" on my local test installation , the bugs count is faulty, too.
Test installation means server and database and Mantis user are running on the same machine. After transferring this to the productive system I get the following error message:

>>>>>>>>>>>>>>>>>
APPLICATION ERROR #401
Datenbankabfrage fehlgeschlagen. Die Reportmeldung lautet #0: für die Abfrage: SELECT b.id, b.status
FROM mantis_bug_table AS b
INNER JOIN mantis_custom_field_string_table AS s
ON b.id = s.bug_id WHERE s.field_id = 10 AND s.value LIKE "%|?|%".

Bitte benutzen Sie die „Zurück“-Taste Ihres Browsers, um auf die vorhergehende Seite zurückzukehren. Dort können Sie den hier angezeigten Eintrag korrigieren oder eine andere Aktion ausführen. Über das Menü können Sie auch direkt zu einer anderen Aktion wechseln.
<<<<<<<<<<<<<<<<<
On the productive system the database is accessed by a remote machine in the network.

The code of "summary_page.php" in both cases is identical. The error message appears immediately, timeouts and max. file sizes I already increased due to problems with file uploading. I'm working with V2.5.0 of Mantis.

Hopefully there are ideas where to search further.

Cheers Uli

amphetamine
Posts: 49
Joined: Jun 04, 2019 7:17 pm

Re: Custom fields need to show in Summary page

Post by amphetamine » Aug 14, 2019 9:17 am

anyone who may share the template for current version 2.21.1

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

Re: Custom fields need to show in Summary page

Post by cas » Aug 16, 2019 7:07 am

if you use this add-on, please adjust one line within the function to ensure it works correctly:
$b_query .= " " . "AND s.value LIKE \"%|" . $possible_value . "|%\"";
should read:
$b_query .= " " . "AND s.value LIKE \"%" . $possible_value . "%\"";

amphetamine
Posts: 49
Joined: Jun 04, 2019 7:17 pm

Re: Custom fields need to show in Summary page

Post by amphetamine » Sep 06, 2019 10:58 am

2.22
INTERNAL APPLICATION ERROR

Post Reply