We relaunched the TWiki.org project with an expanded TWiki charter, and we invite you to participate! The TWiki.org Code of Conduct agreement took effect on 27 Oct 2008. We ask existing twiki.org users to opt-in. You need to opt-in to participate in the Blog, Codev, Plugins and TWiki webs. -- PeterThoeny - 27 Oct 2008
Tags:
create new tag
, view all tags

Question

Is there a way to integrate CalendarPlugin with TimeTablePlugin to create a combination monthly/weekly calendar?

Environment

TWiki version: TWikiRelease04x01x02
TWiki plugins: CalendarPlugin, TimeTablePlugin, ToolTipPlugin, GluePlugin
Categories:  

-- LynnwoodBrown - 08 Jun 2007

Answer

ALERT! If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list below the edit box.

A client asked for a combination monthly and weekly calendar and after a fair amount of tinkering, I got a fairly satisfactory solution combining CalendarPlugin and TimeTablePlugin. I also incorporated the add-an-event "wizard" described in CalendarPluginAddEventCommentPluginTemplate. I'm sharing my work here for others that may find it useful and perhaps further refine it.

Here's some screen shots: (click to view full size)

  • Month view:
month.jpg
  • Week view:
week.jpg
  • Event list view:
event_list.jpg
  • Posting new event:
post_new.jpg

Miscellaneous notes:

  • In addition to CalendarPlugin and TimeTablePlugin, this setup uses ToolTipPlugin (which was used by TimeTablePlugin), IfDefinedPlugin, and GluePlugin. GluePlugin really isn't necessary. I just use it because I find it useful. If you don't use it, you'll need to reformat a couple of the tags (which should be fairly self-evident if you look at the code). Likewise, the use of IfDefinedPlugin could be replaced with IfStatements to reduce the requirements. (Again, I just find IfDefinedPlugin easier to use.)
  • I incorporated the prior/next month links described in CalendarPluginDev and modified that setup to provide prior/next week links also. I also added a fix so that these would work better with transitions across years (with some kind help from PeterThoeny).
  • I tweaked CalendarPluginAddEventCommentPluginTemplate to accommodate the time input. If you don't enter the times, the event is listed at the top in the week view.
  • If you look at this in detail, you'll see that because of the differences between the two plugins, I had to make various compromises and a couple of semi-kludge to make it all work. I'm confident that others may be able to add some improvements!

To set it up:

  1. Add content from this comment template to UserCommentsTemplate
  2. Create a topic using MonthWeekCalendar.txt as a template.

-- LynnwoodBrown - 08 Jun 2007


Comments & Discussion

Thanks Lynnwood for sharing this with the TWikiCommunity!

-- PeterThoeny - 08 Jun 2007

NICE

-- VickiBrown - 08 Jun 2007

is there additional documentation? I have really problems to integrate this greate proposal! The commands ~~~ year="%CURYEAR%" adn ~~~ month="%CURMONTH%" are not working..... Additionally another error occured: No such template def MPL:DEF{PROMPT:AddCalendarEvent} The events aren't displayed in the Month View.

-- StephanMunk - 17 Jul 2007

Stephan - I'm sorry but there isn't more documentation. Regarding ~~~      year="%CURYEAR% and similar lines with "~~~", that is formatting for GluePlugin. If you are not using that plugin, you need to reformat those tags to be on a single line (and remove the "~~~"). Regarding the second error, that suggest that you did not add the CommentPlugin template as instructed in step 1 in my instructions above.

Having worked with this setup for a few weeks now, let me comment that I am not entirely happy with it. Basically, it's a huge hack of a lot of pieces that are prone to break. In particular, the use of ToolTipPlugin? adds a level of complexity and fragility that is is not worth it IMHO. I simply included it because CalendarPluginAddEventCommentPluginTemplate used it. If I can figure a way to remove that part of it, I most certainly will. For example, I have discovered that after you have added a few events, the list of events basically breaks the application and the tooltips don't work anymore. :-\ As a work around, I now store the events list in a separate topic.

Also, I just received a report today that the javascript for adding new events doesn't work in MS Vista. I can't even begin to debug that since I don't have a copy of Vista (and have no intent on getting one, thank you).

So, in short, I think this really needs some work in simplifying it to make is less fragile. That's a shame because this is approaching the minimum requirements of a decent calendar application for TWiki IMO. Unfortunately, I don't have the luxury to work more on this at present unless someone would like to sponsor the work. I would be glad to share ideas and code with someone else if they would like to work with me on it. (Particularly someone with javascript knowledge and a vista installation.) If I do get some time and/or sponsorship to take this further, I'll certain share the results back here.

-- LynnwoodBrown - 18 Jul 2007

Hi, thanks for your quick reply. Now the Calendar is working half. I have only problems that the start and end dates / time and coloars won't be transferred to the EventsList? . Only the description is displayed in the list.... So without extra editing nothing appears in the calendar....any advice?

-- StephanMunk - 18 Jul 2007

Stephan -
The template OUTPUT section is incomplete. I'm working on understanding why myself. (See: Support.IntegrateWeekAndMonthCalendar)

-- VickiBrown - 29 Aug 2007

Closing this after more than 30 days of inactivity.

-- PeterThoeny - 03 Oct 2007

 
Change status to:
Topic attachments
I Attachment Action Size Date Who Comment
txttxt Add_to_UserCommentsTemplate.txt manage 24.3 K 08 Jun 2007 - 18:25 LynnwoodBrown Comment template
txttxt MonthWeekCalendar.txt manage 6.0 K 08 Jun 2007 - 18:18 LynnwoodBrown Topic combining monthly and weekly calendar
jpgjpg event_list.jpg manage 46.3 K 08 Jun 2007 - 18:47 LynnwoodBrown event list view
jpgjpg month.jpg manage 97.6 K 08 Jun 2007 - 18:39 LynnwoodBrown Month view
jpgjpg post_new.jpg manage 73.4 K 08 Jun 2007 - 18:48 LynnwoodBrown post new event view
jpgjpg week.jpg manage 88.8 K 08 Jun 2007 - 18:46 LynnwoodBrown Week view
Topic revision: r10 - 03 Oct 2007 - 05:52:51 - PeterThoeny
 
TWIKI.NET
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback