View Issue Details

IDProjectCategoryView StatusLast Update
0016575mantisbtplug-inspublic2013-11-10 19:18
Reporterkigsf Assigned To 
Status acknowledgedResolutionopen 
Summary0016575: New Plugin: Calendar export


Export selected MantisBT bug reports as calendar tasks (i.e. TODOs) in a iCal
(rfc5545) media file (extension .ics) for import to a public calendar (ex.
Google) or a private calendar in a PC, pad or smartphone.

The plugin uses the iCalcreator class, included (license LGPL), for the iCal
PHP 'hard stuff'.

Perform a database backup before installing the plugin! When installing the
plugin, a new property is added to the MantisBT bug report table, used as a bug
report update counter. The property is removed when the plugin is uninstalled.


Made for and tested against PHP >= 5.2 and MantisBT version 1.2.0.
The default timezone (config $g_default_timezone) MUST be set!


Extract the iCalExport plugin in the 'plugins' directory, sub-directory
'iCalExport'. In 'Manage' module, you should find and install 'iCalExport'.

More info in the docs/README.txt file.
I would appreciate a test, a code review and comments!

TagsNo tags attached.


related to 0010212 acknowledged ICAL plugin 




2013-11-04 02:36

reporter (91,748 bytes)


2013-11-04 03:45

developer   ~0038436

Thanks for your contribution. There was already a plugin offering similar functionality (see 0010212), maybe you want to review it and evaluate whether the two can be merged ?

Also if you're hosting your plugin's source code on Github we can fork and add it to the mantisbt-plugins organization for better visibility.



2013-11-07 16:05

reporter   ~0038500

The ICAL plugin creates a very basic iCal calendar file.
IMHO, (despite the lack of vevent support) the iCalExport plugin is a more
complete and rfc5546 compliant calendar TODO exporter tool including

  • ALL bug report properties and bugnotes
  • links (back) to the bug report and attachments

You will find it at

I would very much appreciate a test and a code review!



2013-11-08 02:56

developer   ~0038504

Last edited: 2013-11-10 04:58

I have forked your plugin into the mantisbt-plugins organization on Github [1] and granted you push access to it.

Your responsibility to keep the fork up-to-date :-)

Don't have time for a proper test or review atm, but I had a quick look through the code and here are some comments

  • MantisBT coding guidelines seem mostly respected, with a few minor issues, e.g. function( ) instead of function()
  • Noticed a few whitespace / indentation issues
  • Check <pre>SYSTEM NOTICE: 'Undefined variable: p_bug_id' in '/home/dregad/dev/plugins/iCalExport/pages/iCalExport.php' line 296</pre>

I do have a MAJOR objection to your altering of the MantisBT core schema. A plugin must NEVER do that, as it has the potential to completely screw up the upgrade path for the users of the plugin.

You need to store plugin-specific data in your own tables, i.e. use plugin_table() and not of db_get_table(). Check the source-integration plugin as an example.

Hope this helps.




2013-11-08 03:01

developer   ~0038505

Oh, and when I tried to uninstall your plugin, I got

Database query failed. Error received from database was 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mantis_bug_table DROP COLUMN sequence' at line 1 for the query: ALTER mantis_bug_table DROP COLUMN sequence.

You're missing 'TABLE' after ALTER.



2013-11-08 04:11

reporter   ~0038506

I'll look over your issues and especially the table one!



2013-11-09 10:47

reporter   ~0038514

I've fixed the table issue, created a plugin table instead.

However.. .
After uninstalling the plugin, there is still a row in the
'mantis_config_table', preventing later re-install.
Bug or feature?
Should the uninstall method in the plugin class delete the
plugin row in the 'mantis_config_table'?



2013-11-10 04:35

reporter (91,980 bytes)


2013-11-10 05:01

developer   ~0038520

I believe it's normal that this row remains however it should not prevent reinstall. I'll try to have a look later.

As a side note considering your plugin is at github, i suggest you stop uploading zip files here; you should also reference it on our wiki if not done already.



2013-11-10 05:45

reporter   ~0038521

I've updated the 'Plugins list' at
with a new entry.

But when accessing
with the text
"You’ve followed a link to a topic that doesn’t exist yet. If permissions allow, you may create it by using the Create this page button."
I can't find the 'Create this page button', no permission?



2013-11-10 06:30

developer   ~0038522

no permission?

I created the page.



2013-11-10 11:38

reporter   ~0038524

Fixed the wiki page.

Thanks for help, guidelines and directions!! :)



2013-11-10 19:18

developer   ~0038525

In reply to 0016575:0038514

After uninstalling the plugin, there is still a row in the 'mantis_config_table', preventing later re-install.
Bug or feature?

Depends on how you look at it...

Should the uninstall method in the plugin class delete the plugin row in the 'mantis_config_table'?

That's one way to do it. However, on principle plugins should not delete data when uninstalling, so IMO the correct solution is to not drop the table when uninstalling.

I created an issue on your repo and sent a pull request with the fix.

A few more things, unrelated to this issue:

  1. not sure how familiar you are with Git, but you should on principle NEVER rewrite history (i.e. push --force for example after rebasing your local branch). You did that when you updated your repo with the "1.05" fix (see

  2. In the wiki page,

    • 'Source Code' section has a (wrong) link to customer-management plugin;
    • furthermore this conflicts with the link you provide under 'Download' section. Decide which is the official link and stick to that;
    • Support, you ask users to report issues in our tracker, into a project that does not exist. Suggest you use Github issues instead.
  3. If you're going to keep iCalcreator/iCalExport as the official repository, you need to keep mantisbt-plugins/iCalExport up-to-date (or we need to talk to github support to make that a mirror instead of a fork)