tessus / mwExtensionMantis

MediaWiki Extension:Mantis
https://www.mediawiki.org/wiki/Extension:Mantis
GNU General Public License v2.0
2 stars 6 forks source link

Custom fields #12

Open abeumer opened 8 years ago

abeumer commented 8 years ago

I've added custom fields to our MantisBT installation (1.3.1). Is it possible to include them in the table when specifying the show parameter on a wiki page?

tessus commented 8 years ago

No, it is not possible at the moment.

But I will look into it when I find some time. Pull requests are always welcome. :-)

abeumer commented 7 years ago

I read that you did not receiving any feedback on a similar question in the past. So when you do have time, just let me know and I will provide you with information if I can

tessus commented 7 years ago

Thank you for the offer. I will upgrade my Mantis installation to 1.3.1 and look into custom fields. Maybe you can give me a quick and easy example for a custom field, how to create it, and use it.

I suspect that custom fields are stored in a separate table, which means I will have to join an additional table in the query. But I will also have to investigate, if indexes are properly set, otherwise this can an have a negative performance impact with large data sets.

But your request is a good idea and this feature will be a nice addition to the extension.

abeumer commented 7 years ago

Hi Tessus,

mantis_custom_field_table In our case I've added a custom field "notify customer" which is a basic yes/no field. We use it to mark the need to notify end-users about the error.

(I've translated the values to English) INSERT INTO mantis_custom_field_table (id, name, type, possible_values, default_value, valid_regexp, access_level_r, access_level_rw, length_min, length_max, require_report, require_update, display_report, display_update, require_resolved, display_resolved, display_closed, require_closed, filter_by) VALUES (1, 'Notify customer', 9, 'Yes|No', 'No', '', 10, 25, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1);

By the look of it, it seems that the custom fields are stored in that table but their assignment to a project is stored in mantis_custom_field_project_table and when the value is set it seems to be stored in mantis_custom_field_string_table.

tessus commented 7 years ago

Current status: I hit a snag right now, because my development system is down. I hope I will be able to work on it again soon.

abeumer commented 7 years ago

Any luck with the development system?

tessus commented 7 years ago

@abeumer yes, I was able to get a dev system back up, but after looking into this issue, I have sincere doubts. the code changes would be extensive and would also have a negative effect on performance. Until I find a really good way to make this work, I'll put this on hold.

tessus commented 7 years ago

Stlll working on a good way to handle custom fields.

Currently a field that is not in the show columns list is ignored. Thus I would have to add an additional query to retrieve all possible custom fields. I don't want this to be the default. Maybe I could use an additional option custom = <col>[, <col], ...]. And only if that is set, additional query processing is done.