From: John R. <jr...@le...> - 2010-04-14 13:44:54
|
Pablo Pedrosa wrote: > El 14/04/2010 14:55, John Reese escribió: > Thanks for the reply!, let me explain again, I think I couldn´t > explain very good the problem, my english is not so good. > The thing is that I wanto to modify the page when you "report a bug", > and add a few more data, all of this with plugin in order to update the > version of mantis whenever i want. > So told that, the only problem is that i can insert any form > element via plugin in that page, but when I do a submit, the event I use > give me the data in an "bug object", and not the "form data", so the bug > object doesn´t have the data I put in the form, do I explain it well?. I > need to do something, if I could call an event that executes in the > submit and before the form data goes to the object, would be great. > I read the documentation and there is no event that fit my need, i > will look in the plugins to see what happened, if you want i can send > you the plugin in order to understand what i want to say, or maybe if > you speak spanish i could explain you better. OK, that makes sense. I've actually done something similar in the product-matrix.git plugin on mantisforge. Basically, after you have the form elements added to the report page via EVENT_REPORT_BUG_FORM, then you also need to hook EVENT_REPORT_BUG_DATA, and then call the gpc_get_* functions to gather your own data from the form, modify the bug object as needed, persist any other data in database tables for your plugin, and then return the modified bug object. In other words, your plugin is resonsible for handling both sides of the equation: generating the form elements and processing those form elements. You just need to make your plugin hook the appropriate events, and use the appropriate API calls to gather your data and store it in the database. If your plugin needs its own database tables, it will need to define its own table schemas, and generate its own database queries. Cheers -- John Reese LeetCode.net |