Page 1 of 1

Building plugins for MantisBT 2.8.0 - Help with events

Posted: 27 Nov 2017, 14:42
by rkarmann
Hi everyone,

I was wondering if any of you could help me with plugin structure. In fact, my company decided to migrate from Mantis 1.2.14 to 2.8.0. I've read documentation of course, many times, but can't find out where to begin.

In the old version, we used to install many plugins like: HTMLMail, EmailReporter, etc... Some of them doesn't support the new 2.X core system.

So my question is:

- Wich event should I trigger / hook to build a HTML Mail plugin ? (display HTML in mail instead of plain text)


- Wich event should I trigger / hook to build a multi-LDAP connection plugin ? (yeah, I know, that sounds bad but I do really need it)

All replies are welcome !

Romain

Re: Building plugins for MantisBT 2.8.0 - Help with events

Posted: 30 Nov 2017, 10:59
by cas
First of all principles are the same,most events are still there, some have been added.
Best way forward is to take a plugin for the 1 series which is also available in the 2 series.
Then do a compare and you will find the differences. This way, you will see how to adjust "old" plugins.
Or you can wait of the original creator provides an update.

Re: Building plugins for MantisBT 2.8.0 - Help with events

Posted: 30 Nov 2017, 16:35
by rkarmann
Hi there,

I found out some temporary solution for multi-LDAP authentication (doing some changes in core files :? )
cas wrote: Then do a compare and you will find the differences. This way, you will see how to adjust "old" plugins.
Or you can wait of the original creator provides an update.
Sure, i'll do that as soon as possible. But still, there's something I can't understand : event system is not able to hook on email events. The only events available for emails are : EXCLUDE / INCLUDE users... I think the best solution is to create some custom event, to allow the plugin to modify email format.

- Where should I declare it ? In core system, like a patch ? Or in the plugin itself ("function events()" wich returns an array) ?

Re: Building plugins for MantisBT 2.8.0 - Help with events

Posted: 30 Nov 2017, 20:20
by cas
You can define new events in the plugin. Next you need to place the plugin at the right spot in one of the core files.