Gantt Calendar plugin for Trac

2010/07/08 Update : I’m not actually running Trac at the moment so it’s a little hard to maintain and respond to all the questions and problems. I’m planning to move this to github soon and (hopefully) recruit some maintainers – stay tuned :)

2008/12/17 Update : Thanks to Achim Spangler for providing a patch to fix some unicode issues!

I didn’t write this!

This is basically an English version of the Japanese plugin developed by the Shibuya Trac project – I’ve translated the source & cleaned up a few things but the bulk of the work is theirs.
Tidus
shibuya-trac

What is it?

The GanttCalendar plugin adds ticket Gantt chart and calendar functionality to Trac:



Requirements

This plugin is only compatible with Trac version 0.11 and above – 0.10 users will need to upgrade. The install instructions provided will only work if you have ez_setup installed – see the Trac Plugins page if you have any problems.

Installation

Use subversion to checkout the plugin, then install it using easy_install

> svn co http://recurser.com/svn/ganttcalendar/trunk/ ganttcalendar
> cd ganttcalendar
> python setup.py bdist_egg
> sudo easy_install dist/TracGanttCalendarPlugin-0.1-py2.4.egg

If you don’t have easy_install installed, see the Trac Plugins page for installation instructions

Configuration

To configure the plugin, you first need to add it to the [components] section
in trac.ini :

[components]
ganttcalendar.ticketcalendar.ticketcalendarplugin = enabled                                                                              
ganttcalendar.ticketgantt.ticketganttchartplugin = enabled

Next, you need to configure Trac to display a couple of extra fields in the
ticket page :

[ticket-custom]
complete = select
complete.label = % Complete
complete.options = 0|5|10|15|20|25|30|35|40|45|50|55|60|65|70|75|80|85|90|95|100
complete.order = 3
due_assign = text
due_assign.label = Start (YYYY/MM/DD)
due_assign.order = 1
due_close = text
due_close.label = End (YYYY/MM/DD)
due_close.order = 2

The start & end date fields should be inputted in the format YYYY/MM/DD. You can make these fields a little more user-friendly using the datefield plugin



46 Responses to “Gantt Calendar plugin for Trac”  

  1. 1 Chris

    looks great, but it doesn’t seem to work. I install the plugin and enable it as per your instructions, the custom ticket fields and the calender and gantt chart are all there, but the ticket information doesn’t appear in the calender or chart

    this is on Trac 0.11.2.1

    any ideas what might be stopping it from working?

    I’d really like to use it as I need to use Gantt charts with my project, and tying it into the ticket system would be ideal

  2. 2 echarp

    For information, the date parser seem to be wrong.

    I corrected it in ticketcalendar.py and ticketgantt.py.

    For information here is the change to apply (in 4 different lines):

    t = time.strptime(due_close,”%d.%m.%Y”)

    should be written as

    t = time.strptime(due_assign,”%Y/%m/%d”)

    (sorry if the display is ugly, I don’t know if there is any wiki syntax available here)

    Resulting screens look real great!!!

  3. 3 Chris

    hmmm, I made the changes, but it’s still not working.

    I also downloaded the source from the Shibuya Trac project and that also doesn’t work with my version.

    I shows milestones on the calender, but none of the tickets display

    looks like I’ll have to do it by hand :(

  4. 4 echarp

    hum, my comment was a bit fast: be careful that due_close does remain due_close in the correction, same with due_assign.

    t = time.strptime(due_assign,”%Y/%m/%d”)

    t = time.strptime(due_close,”%Y/%m/%d”)

    … depending on what was there before.

    Otherwise, ensuring ticket dates are formatted according to YYYY/MM/DD, it should go all right.

    Hum, are you using something else than sqlite?

  5. 5 Chris

    no, I’m using sqlite.

    and yes, I only changed the %Y/%m/%d (I didn’t actually notice the difference with due_assign and due_close)

    I’m wondering if it’s an incompatibility with my particular version of trac, but as I’m not familiar with python or developing trac plugins I don’t know how to go about fixing it

  6. 6 echarp

    Just a possibility, do you have open milestones?

  7. 7 Chris

    Yep, currently have 5 milestone, covering the next 3 months of our project

  8. 8 dave

    Hi guys, thanks for the feedback! I’ve fixed up the date format in SVN – it makes sense to use the more standardized format you’re using.

    @Chris – strange, I can’t think of any obvious reason for it not to work. We were using it with sqlite at work before with milestones etc without any problems, on Trac-0.11-py2.4. Could you check if you are running with UTF8 enabled (LANG=en_US.UTF-8) ? I imagine if encoding was the problem you’d get some fairly obvious error messages though.

  9. 9 Chris

    I’m afraid I don’t know where to find out about the encoding, there’s nothing obvious in trac.ini

    However, you have reminded me that my site is running on python 2.5, rather than 2.4, although I have no idea if that would make a difference… I’m reluctant to go reinstalling things as the site’s being used

  10. 10 MDaniel

    Chris,
    The same as you happen to me following the instructions in this wiki. I also have python 2.5 and trac 0.11.2.1 on an Ubuntu 8.10 server. I found that if after following them, you also go to the admin screen, then to the plugin screen, you can choose to upload and install the plugin file: TracGanttCalendarPlugin-0.1-py2.5.egg. After this is done your trac should now have added the calendar and gantt ticket options. I am not quite sure why trac needs this extra step, as the regular python shell does see the plugin after issuing the sudo easy_install dist/TracGanttCalendarPlugin-0.1-py2.5.egg and also the instructions add the components ganttcalendar

  11. 11 Chris

    Thanks MDaniel, installing the egg by uploading it via the plugin admins screen did the trick :)

  12. 12 echarp

    For information: do you plan to introduce this plugin on the trac hacks website?

    Do you follow it in its Japanese origins? Are there interesting development being done?

    You read Japanese? :)

  13. 13 Baybora Oren

    Looks great but how can we make upgrade for Trac 0.10 ?

  14. 14 steve

    Great work !! I have one problem with the print function. It is not possible to print the chart. I get a empty print page. I use Trac 0.11.2.1.

  15. 15 Vanderstraeten Marc

    where can I find the code? where is the link to the svn rep?

  16. 16 Chris

    The repository URL is in the first code block in the installation section.

    The address is: http://recurser.com/svn/ganttcalendar/trunk/

    enjoy :)

  17. 17 Simon

    Is there a way to set the permissions for this plugin? I noticed that I can view the ticketcalndar and the ganttcalendar when I’m not logged into trac (anonymous).

    Any help would be appreciated.
    Thanks,
    Simon

  18. 18 Christian Herrera

    Hi there,

    I followed the instructions and everything was ok except because at the end, the Plug In doesn’t appear listed on the Plug Ins Sections :-\, I installed it from the admin plug in section, If I try to re-install it it says that it is already installed. The log file shows this:

    DEBUG: Loading ganttcalendar.ticketgantt from c:\python25\lib\site-packages\tracganttcalendarplugin-0.1-py2.5.egg ERROR: Skipping “ganttcalendar.ticketgantt = ganttcalendar.ticketgantt”: (can’t import “ImportError: No module named ganttcalendar.ticketgantt”)
    DEBUG: Loading ganttcalendar.ticketcalendar from c:\python25\lib\site-packages\tracganttcalendarplugin-0.1-py2.5.egg ERROR: Skipping “ganttcalendar.ticketcalendar = ganttcalendar.ticketcalendar”: (can’t import “ImportError: No module named ganttcalendar.ticketcalendar”)

    Any ideas?? Thanks for your Help.

  19. 19 princesseryane

    hi there,
    Do you know what file I must edit to change the display and the names of the fields on Gantt ticket? please tell me.

    sorry i not speak well english.

    Thanks for your Help

  20. 20 Ricardo

    Hi, I installed this plugin as showed here, but it doesn’t show in trac menu. My Trac version is 0.11.3 and I use MySQL.

  21. 21 allen

    Hi, thanks for your plug-in. it’s amazing.

    I have a question, i am not quite sure it’s a bug.

    After i installed the plug-in I found i can’t see any option of milestone the selection in the CALENDAR page.I mean i can see “MILESTONE” list control, but it’s empty so that i can’t see my milestones on this pages.
    Other function of this plug-in is ok!

    i install this plug-in by using command “easy_install TracGanttCalendarPlugin-0.1-py2.5.egg” and do some configuration follow your manual on this page.

    is there someone got this issue also? give me some help or advice.thank you in adavance.

  22. 22 Internal Error

    I have a problem with TracGanttCalendarPlugin, after install and configure, whe i try to open calendar or the gantt ticker

    Trac detected an internal error:

    ValueError: need more than 1 value to unpack

    DEBUG
    ==

    2009-09-01 16:57:16,882 Trac[ticketgantt] DEBUG: generated sql: status ‘closed’
    2009-09-01 16:57:16,882 Trac[ticketgantt] DEBUG: SELECT id, type, summary, owner, t.description, status, a.value, c.value, cmp.value, component from ticket t JOIN ticket_custom a ON a.ticket = t.id AND a.name = ‘due_assign’ JOIN ticket_custom c ON c.ticket = t.id AND c.name = ‘due_close’ JOIN ticket_custom cmp ON cmp.ticket = t.id AND cmp.name = ‘complete’ WHERE status ‘closed’ ORDER by component , a.value
    2009-09-01 16:57:16,885 Trac[ticketgantt] DEBUG: {‘status’: u’new’, ‘description’: u’some text’, ‘component’: u’some component’, ‘summary’: u’some text’, ‘due_assign’: datetime.date(2009, 9, 1), ‘owner’: u’dolguin’, ‘type’: u’Tarea’, ‘id’: 624, ‘due_close’: datetime.date(2009, 9, 10), ‘complete’: u’0’}
    2009-09-01 16:57:16,885 Trac[ticketgantt] DEBUG: {‘status’: u’new’, ‘description’: u’‘, ‘component’: u’some component’, ‘summary’: u’tetsting’, ‘due_assign’: datetime.date(2009, 9, 1), ‘owner’: u’dolguin’, ‘type’: u’Defecto’, ‘id’: 639, ‘due_close’: datetime.date(2009, 9, 10), ‘complete’: u’10’}
    2009-09-01 16:57:16,885 Trac[ticketgantt] DEBUG: SELECT name from component
    2009-09-01 16:57:16,886 Trac[session] DEBUG: Retrieving session for ID u’dolguin’
    2009-09-01 16:57:16,889 Trac[main] ERROR: need more than 1 value to unpack
    Traceback (most recent call last):
    File “/usr/lib/python2.5/site-packages/trac/web/main.py”, line 233, in dispatch
    self._post_process_request(req)
    File “/usr/lib/python2.5/site-packages/trac/web/main.py”, line 301, in _post_process_request
    f.post_process_request(req, *(None,)*extra_arg_count)
    File “build/bdist.linux-i686/egg/announcerplugin/subscribers/watchers.py”, line 134, in post_process_request
    realm, _ = path.split(’/’, 1)
    ValueError: need more than 1 value to unpack
    2009-09-01 16:57:16,889 Trac[main] ERROR: need more than 1 value to unpack
    Traceback (most recent call last):
    File “/usr/lib/python2.5/site-packages/trac/web/main.py”, line 423, in _dispatch_request
    dispatcher.dispatch(req)
    File “/usr/lib/python2.5/site-packages/trac/web/main.py”, line 209, in dispatch
    self._post_process_request(req, *resp)
    File “/usr/lib/python2.5/site-packages/trac/web/main.py”, line 299, in _post_process_request
    resp = f.post_process_request(req, *resp)
    File “build/bdist.linux-i686/egg/announcerplugin/subscribers/watchers.py”, line 134, in post_process_request
    realm, _ = path.split(’/’, 1)
    ValueError: need more than 1 value to unpack

    Trac: 0.11.1
    Python: 2.5.2 (r252:60911, Jan 4 2009, 18:00:02) [GCC 4.3.2]
    setuptools: 0.6c9
    SQLite: 3.5.9
    pysqlite: 2.4.1
    Genshi: 0.5.1
    mod_python: 3.3.1
    Pygments: 0.10
    Mercurial: 1.0.1
    jQuery: 1.2.6
    SO: Debian Lenny

  23. 23 Hagen

    When installing from r6 the plugin ignored the Trac 0.11.1 navbar in the html output.

    To fix it, edit gantt.html and calendar.html in the templates folder and wrap the contents of the element into a div like this:

    I have used “report” because it is a valid Trac CSS class that fits into the “content” slot of the Trac page.

  24. 24 princesseryane

    Hello,
    I installed the plugin but the diagram does not appear.
    What may be the problem?
    thank you in adavance.

  25. 25 Robert Kuropkat

    Hello,

    I seem to have the same problem as Christian Herrera above (… (can’t import “ImportError: No module named ganttcalendar.ticketcalendar”)… )

    Trac 0.11.1, Ubuntu 9.0.4, Python 2.6

  26. 26 dinsdale

    @steve – found the way the print the chart (6 months later you asked). The trac style sheet must be modified.

    on my server the file is at:

    /usr/lib/python2.5/site-packages/Trac-0.11.3-py2.5.egg/trac/htdocs/css/trac.css

    I modifioed the last lines like this:

    @media print {
    #search, #header, #altlinks, #footer, #help { display: none }
    .list, .nav, .buttons form, form .buttons, form .inlinebuttons, .noprint {
    display: none;
    }
    form.printableform { display: block }
    }

  27. 27 Eric

    Is there any plan to add permissions to this? I’d really like to hide it from specific users. Even if only admin can access things that would be great.

  28. 28 dave

    @Eric and others who have commented – sorry about the slow reply. I haven’t really added any features to this, it’s basically just an English translation of the Japanese project. I’m not actually running Trac at work or for private projects any more, so I probably won’t be adding much more to it. That said, if anyone has patches or features they’d like to add I’d be happy to take a look at them and see about integrating them. Would it help anyone to have this up on GitHub to make it easier for others to fork/patch?

  29. 29 Chris from Germany

    Hi,

    I’m using the plugin for a year at work and added some features and fixed the date issues to work with european dates… Currently I’m searching for new feature wishes and plan to add more features…

    So: at http://projects.3DH.de I’m hosting some of my opensource projects – of course based on Trac ;-) with Subversion etc. …thus I thought about publishing my versions of the plugin and to allow others to add own patches etc. …so the development will go further…

    Due to the fact that I need GanttPlugin at work, the further development is quite safe ;-)

    Is my proposal an option? Anybody interested?

    Kind Regards from Germany,
    Chris

  30. 30 Stefan Göckeritz

    Hey,

    just installed this plugin on a freshly setup trac 0.11.5 under ubuntu 9.10 and it runs just smothly. Nice…the only thing I have to figure out right now is how to get my gantt data in there. That’s gone go pretty fast I guess.

    Cheers
    Keep it up guys!

    Greeting from germany.
    Stefan

  31. 31 EddyGordo

    I had many of the same issues trying to get this plugin to install. I searched for existing trac plugins and made sure that this plugin and egg were laid out similarly. Finally, the rehup of the webserver kicked it into gear and caused the calendar and gantt links to appear on the nav.

    Thanks for writing this plugin, it works well, especially when combined with the datefield plugin. My only complaint is that I cannot print the chart (at least not without resorting to a screen grab). But overall, it makes communicating progress to my PHB a breeze.

  32. 32 Michael Renzmann

    Hi.

    An anonymous user today created a page for this plugin on trac-hacks.org, with nothing more than a link to this page in it. I’ve reworked the page a bit and renamed it to match our standard naming scheme:

    http://trac-hacks.org/wiki/GanttCalendarPlugin

    Bye, Mike

  33. 33 gant chart template

    I felt like it s the Monthly Planning or Calendar or Timetable . Not look like the Work schedule much.

  34. 34 Sameh

    I’ve also been using for nearly a year, and I must say it’s invaluable. It would be really nice to have a holiday configuration option as I live in Egypt and we take Fridays and Saturdays off. Right now I could settle with this patch. Thanks guys!
    Index: gantt.html
    ===============================================================
    —- gantt.html (revision 6)
    gantt.html (working copy)
    -280,7 280,7

    – 11” py:for=“d in range(0,term)”>
    11” py:for=“d in range(-1,term)”>

    ${weekdays[cur.weekday()]}

    Index: calendar.html
    ===============================================================
    —- calendar.html (revision 6)
    calendar.html (working copy)
    -136,7 136,7

    <?python
    cls="active" – if d 0 or d6:
    if d 5 or d6:
    cls="holiday"
    if mday == date.today():
    cls="today"

  35. 35 wang

    Hello, Can someone let me know, why i can only see additional fields but the menü item of Calendar and GanttTicket. Should I install some Calendar Plugins before? Thank you.

  36. 36 wang

    I have it. I build the egg on the server (python 2.5) and download the egg file to PC. And then i login into the trac and install the egg under admin -> plugins -> Install plugin. Maybe it a way, that we do not need change trac.ini, manually.

    Now i can see the menu items.

  37. 37 Laszlo Papp

    Hello!

    - I’ve fixed the printing error bug, you can print out pretty easily, I needed to modify the template of gantt.html

    - I’ve added a new feature to this plugin, you can take a sort by operation for owner of the tickets, I hope it would be useful for the opensource world, but for my boss it’s sure :)

    http://djszapi.homelinux.net/ganttcalendar.tar.gz

  38. 38 Julien J.

    Hello,
    I was looking for this kind of plugin for a while, and it’s really easy to install, and useful.
    I only have a question, because I don’t reallly speak japonese at all:
    – Is there a way to make a ticket dependante of another one (like a task dependancy in a classic gantt diagram)?

    Thanks.

    Julien

  39. 39 Nico

    Hey Guys,

    i have a problem with these plugin and the datefield project. When I
    want to create a new ticket, I could not open the Datepicker. There is no
    option to select the Date. I must enter the date manually.

    But when I open a already created ticket, I see the option to the right of
    the textfield, where I can open the Datepicker. These works perfectly!

    Can anybody tell me, how I become the datepicker option into the template
    of new tickets?

    Thanks for help

  40. 40 Dror

    Hi ,
    Is there a way to filter the gantt by user ?

  41. 41 Vinicius

    Hi,
    I’m trying to checkout via svn but I got an error message (400 Bad Request) for
    ‘http://recurser.com/svn/ganttcalendar’.

    I can see http://recurser.com/svn/ganttcalendar/trunk/ via web browser.

    Does anyone know how to fix this problem?

    Thanks in advance

  42. 42 yozy

    For my part, I have these error in the trac.log snifff..
    Why?

    2010-07-06 15:59:28,306 Trac[loader] DEBUG: Loading ganttcalendar.admin from f:\trac\plugins\tracganttcalendarplugin-0.2-py2.5.egg
    2010-07-06 15:59:28,368 Trac[loader] ERROR: Skipping “ganttcalendar.admin = ganttcalendar.admin”: (can’t import “ImportError: cannot import name from_utimestamp”)
    2010-07-06 15:59:28,368 Trac[loader] DEBUG: Loading ganttcalendar.ticketgantt from f:\trac\plugins\tracganttcalendarplugin-0.2-py2.5.egg
    2010-07-06 15:59:28,384 Trac[loader] ERROR: Skipping “ganttcalendar.ticketgantt = ganttcalendar.ticketgantt”: (can’t import “ImportError: cannot import name from_utimestamp”)
    2010-07-06 15:59:28,384 Trac[loader] DEBUG: Loading ganttcalendar.ticketcalendar from f:\trac\plugins\tracganttcalendarplugin-0.2-py2.5.egg
    2010-07-06 15:59:28,384 Trac[loader] ERROR: Skipping “ganttcalendar.ticketcalendar = ganttcalendar.ticketcalendar”: (can’t import “ImportError: cannot import name from_utimestamp”)
    2010-07-06 15:59:28,384 Trac[loader] DEBUG: Loading ganttcalendar.complete_by_close from f:\trac\plugins\tracganttcalendarplugin-0.2-py2.5.egg
    2010-07-06 15:59:28,401 Trac[loader] ERROR: Skipping “ganttcalendar.complete_by_close = ganttcalendar.complete_by_close”: (can’t import “ImportError: cannot import name from_utimestamp”)

  43. 43 3DH

    Hi,

    @yozy:
    Please supply more infos about your installation – nobody can help you unless we know which Trac version, which operating system, python and ganttcalendar plugin version you have.

    ciao,
    3DH

  44. 44 yozy

    Hi!

    I’m using TRAC 0.11.7, Python 2.5, Apache 2.0.63 and
    TracGanttCalendarPlugin doesn’t work sniff….

    I have these errors in the trac.log :
    2010-07-06 15:59:28,306 Trac[loader] DEBUG: Loading ganttcalendar.admin from f:\trac\plugins\tracganttcalendarplugin-0.2-py2.5.egg
    2010-07-06 15:59:28,368 Trac[loader] ERROR: Skipping “ganttcalendar.admin = ganttcalendar.admin”: (can’t import “ImportError: cannot import name from_utimestamp”)
    2010-07-06 15:59:28,368 Trac[loader] DEBUG: Loading ganttcalendar.ticketgantt from f:\trac\plugins\tracganttcalendarplugin-0.2-py2.5.egg
    2010-07-06 15:59:28,384 Trac[loader] ERROR: Skipping “ganttcalendar.ticketgantt = ganttcalendar.ticketgantt”: (can’t import “ImportError: cannot import name from_utimestamp”)
    2010-07-06 15:59:28,384 Trac[loader] DEBUG: Loading ganttcalendar.ticketcalendar from f:\trac\plugins\tracganttcalendarplugin-0.2-py2.5.egg
    2010-07-06 15:59:28,384 Trac[loader] ERROR: Skipping “ganttcalendar.ticketcalendar = ganttcalendar.ticketcalendar”: (can’t import “ImportError: cannot import name from_utimestamp”)
    2010-07-06 15:59:28,384 Trac[loader] DEBUG: Loading ganttcalendar.complete_by_close from f:\trac\plugins\tracganttcalendarplugin-0.2-py2.5.egg
    2010-07-06 15:59:28,401 Trac[loader] ERROR: Skipping “ganttcalendar.complete_by_close = ganttcalendar.complete_by_close”: (can’t import “ImportError: cannot import name from_utimestamp”)

    Does anyone have an idea?

  45. 45 Sarika

    Hi,

    I followed all instructions on your website to install the plugin.

    svn co http://recurser.com/svn/ganttcalendar/trunk/ ganttcalendar
    > cd ganttcalendar
    > python setup.py bdist_egg
    > sudo easy_install dist/TracGanttCalendarPlugin-0.1-py2.4.egg

    The plugin installed ok however it’s in Japanese! :) Can you point me to the English version?

    Thanks
    -sarika

  46. 46 Joe

    Hi,

    nice work! Is there a way to display more than 3 months in the gantt chart to get a better overview of the tickets?

    Thx, Joe

Leave a Reply