View Issue Details

IDProjectCategoryView StatusLast Update
0016575mantisbtplug-inspublic2013-11-10 19:18
Reporterkigsf Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status acknowledgedResolutionopen 
Product Version 
Target VersionFixed in Version 
Summary0016575: New Plugin: Calendar export
Description

FUNCTION:

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.

REQUIREMENTS:

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

INSTALLATION:

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.

Relationships

related to 0010212 acknowledged ICAL plugin 

Activities

kigsf

kigsf

2013-11-04 02:36

reporter  

iCalExport.zip (91,748 bytes)
dregad

dregad

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.

kigsf

kigsf

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 https://github.com/iCalcreator/iCalExport

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

dregad

dregad

2013-11-08 02:56

developer   ~0038504

Last edited: 2013-11-10 04:58

View 2 revisions

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.

[1] https://github.com/mantisbt-plugins/iCalExport

dregad

dregad

2013-11-08 03:01

developer   ~0038505

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

APPLICATION ERROR 401
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.

kigsf

kigsf

2013-11-08 04:11

reporter   ~0038506

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

kigsf

kigsf

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'?

kigsf

kigsf

2013-11-10 04:35

reporter  

iCalExport-1.05.zip (91,980 bytes)
dregad

dregad

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.

kigsf

kigsf

2013-11-10 05:45

reporter   ~0038521

I've updated the 'Plugins list' at
http://www.mantisbt.org/wiki/doku.php/mantisbt:mantis_plugins
with a new entry.

But when accessing
http://www.mantisbt.org/wiki/doku.php/mantisbt:icalexport
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?

atrol

atrol

2013-11-10 06:30

developer   ~0038522

no permission?
Yes

I created the page.

kigsf

kigsf

2013-11-10 11:38

reporter   ~0038524

Fixed the wiki page.

Thanks for help, guidelines and directions!! :)

dregad

dregad

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.
https://github.com/iCalcreator/iCalExport/pull/2

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 https://github.com/mantisbt-plugins/iCalExport/network)

  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)

Issue History

Date Modified Username Field Change
2013-11-04 02:36 kigsf New Issue
2013-11-04 02:36 kigsf File Added: iCalExport.zip
2013-11-04 03:45 dregad Note Added: 0038436
2013-11-04 03:45 dregad Status new => feedback
2013-11-04 03:46 dregad Relationship added related to 0010212
2013-11-07 16:05 kigsf Note Added: 0038500
2013-11-07 16:05 kigsf Status feedback => new
2013-11-08 02:56 dregad Note Added: 0038504
2013-11-08 02:56 dregad Assigned To => dregad
2013-11-08 02:56 dregad Status new => acknowledged
2013-11-08 03:01 dregad Note Added: 0038505
2013-11-08 03:01 dregad Assigned To dregad =>
2013-11-08 04:11 kigsf Note Added: 0038506
2013-11-09 10:47 kigsf Note Added: 0038514
2013-11-10 04:35 kigsf File Added: iCalExport-1.05.zip
2013-11-10 04:58 dregad Note Edited: 0038504 View Revisions
2013-11-10 05:01 dregad Note Added: 0038520
2013-11-10 05:45 kigsf Note Added: 0038521
2013-11-10 06:30 atrol Note Added: 0038522
2013-11-10 11:38 kigsf Note Added: 0038524
2013-11-10 19:18 dregad Note Added: 0038525