Experimenting with Activity Calendars

Published
2011-08-29 13:27
Written by

Several CiviCRM users have expressed an interest in managing CiviCRM activities with a smooth, interactive calendar screen.  Since calendaring can be a complex topic, we've put together a basic, working calendar to facilitate discussion.  The prototype resembles the calendar included in other relationship-management tools:

Calendar screenshot

The calendar is implemented in three pieces: (1) the excellent jquery-week-calendar plugin provides a rich Javascript interface for dragging and dropping calendar items, (2) arms_recur provides an API for creating recurring activities, and (3) example_calendar integrates these pieces into the CiviCRM interface.

If you think that a rich calendar interface would improve CiviCRM, then please give the prototype a spin and give some feedback.  What features make the most sense in a CiviCRM activity calendar?  What's good or bad about the prototype?  How should such a calendar interact with other calendaring tools -- do we need to reinvent Outlook or Google Calendar, or can we carve out a clear niche? What resources can you provide to help make this happen?
 

Limitations


As a proof-of-concept, the example_calendar isn't implemented to the same standards as much of CiviCRM, and deploying it requires PHP developer skills.  Notably, it has been tested with Drupal 6 using CiviCRM 2.2 and 3.4, but it hasn't been tested with any other configurations.  Additionally, the arms_recur module must install some MySQL triggers -- this only works correctly in certain configurations (e.g. MySQL 5.1 with a unified Drupal+CiviCRM database); if you have a different configuration, I can't help much, but you may be able to prepare the triggers yourself. (Read "function arms_recur_arms_trigger" in arms_recur.module.)
 

Instructions

1. Download and extract the modules example_calendar, arms_recur, and arms_util from http://code.locker10.com/
     export WEBROOT=/var/www/civi/drupal
     cd $WEBROOT/sites/all/modules/
     wget http://code.locker10.com/arms_util-latest.tar.gz
     wget http://code.locker10.com/arms_recur-latest.tar.gz
     wget http://code.locker10.com/example_calendar-latest.tar.gz
     tar xvzf arms_util-latest.tar.gz
     tar xvzf arms_recur-latest.tar.gz
     tar xvzf arms_calendar-latest.tar.gz
2. If you are working with a stable release of CiviCRM, then you probably need
   to update the images and CSS for the jQuery UI library. This can be done by:
     cd $WEBROOT/sites/all/modules/civicrm
     rsync -va $WEBROOT/sites/all/modules/example_calendar/lib/week-calendar/libs/css/smoothness/./ packages/jquery/css/./
     patch -p0 < $WEBROOT/sites/all/modules/example_calendar/civicrm.css.diff
3. Find the Drupal "files" directory and create a subdirectory called "arms_util" with can be read and written by PHP.
   For example:
      mkdir $WEBROOT/sites/default/files/arms_util
      chown www-data $WEBROOT/sites/default/files/arms_util
4. Activate the example_calendar module
5. Update the CiviCRM menu by visiting http://EXAMPLE.COM/civicrm/menu/rebuild?reset=1
6. In the CiviCRM menu, navigate to "Other -> Calendar"
7. In the upper-right corner of the calendar, click on the "settings" button
   and choose some filter options.
8. Use the calendar!

Comments

Anonymous (not verified)
2011-08-29 - 19:55

I had similar issues with a Civi install (and continue to have them with recurring activities which client is screaming for) and went down a similar path cobbling the excellent fullcalendar into something that could display both activities and events (in the screenshot, events are blue).

Other must have function included:

  • The ability to print out a calendar.
  • Different views (month/week/day)
  • Being able to see activities for "teams" (in mine, people with a role)

This tends to be a particular pain point if users have come from a desktop application (in this case Goldmine) or even if they have much familiarity with Google calendar.

Keep up the great work!

 

For some reason my image didn't attach.  At any rate will try out the prototype and tell you how I go.

fullcalendar looks like a great widget, and it seems more comprehensive than weekcalendar.

 

If you're having an issue with recurring activities, you should take a look at the arms_recur module. A few interesting things to note:

 * It supports scheduling based on day-of-week over a period of time. (e.g. "Every Tuesday and Thursday for the next two months")

 * It uses a mental model similar to Google calendar's for applying changes to "this one activity", "all activities in the same schedule", and "future activities in the same schedule".

 * There are fairly extensive unit-tests for things like enabling, disabling, and rescheduling activities.

 * There's a backwards compatibility mechanism (based on SQL triggers) which ensures that any pre-existing code (SQL/PHP/whatever) which manipulates activities will have a well-defined behavior (i.e. legacy code uses "this one activity" mode).

Looks interesting, and sorry tim, seems that I prefer fullcalendar as the supporting widget ;)

 

Is this a module you developped? Could you share the code?

 

X+

Anonymous (not verified)
2011-09-04 - 22:16

Hi,

 

Was trying to get this up and running but couldn't find  Arms_actperm to install?

 

Malks.

It's not really a dependency, though -- it shouldn't even be referenced, except that I was too lazy to design a proper hook. It's referenced maybe twice in arms_recur.module, and they're both guarded references ("if (function_exists(...))...").

 

Anyway, the module works without it, so I've removed the dependency clause from arms_recur.info and put up a new tarball.

I downloaded the latest tarball but the reference in arms_recur.info was still there so not sure whether I've grabbed the right version (I just re-grabbed the file at http://code.locker10.com/arms_recur-latest.tar.gz).  At any rate I've manually removed the clause from arms_recur.info manually and the module enables.

 

Going to the calendar though draws the widget but it remains in a "Processing..." state.  Any ideas?  I'll jump in and have a look now.

 

Also the instructions reference example_calendar in the wget (http://code.locker10.com/example_calendar-latest.tar.gz) and arms_calendar-latest in the tar (arms_calendar-latest.tar.gz).  Which one is right.  I'd tried arms_calendar-latest, but will try example_calendar as well.

Anonymous (not verified)
2011-09-09 - 00:21

In reply to by Anonymous (not verified)

i.e. at <webroot>/admin/build/services should I see the services defined in the ARM module?

Note that Tim pointed out on IRC that this exists now

https://civicrm.org/extensions/contact-calendar which "is a CiviCRM extension that displays activities where the contact is an assignee or a target contact. The calendar is useful when the activities are in the future and people can plan thier schedule"