Acquia Drupal Commons 3 is a great Drupal 7 distribution to create a social network type site. Casetracker is a nice, extensible support ticket management system for Drupal 7 that can also be used as a task manager for distributed collaboration on tasks. Here's how to integrate both cleanly as I did for the Edgeryders site:

  1. Create a new Drupal Commons integrated content type as a module. This is really simple by the existing, quite generic Drupal Commons content type modules (commons_post), copying it to another module (here, commons_tasks) and replacing all occurences of post / posts with task / tasks respectively. In my case, the result is a module commons_tasks. Not yet readily packaged as a Drupal module, but you cand download the files from that link already. That's better than creating it yourself, since there are a few other tweaks included (like adapting the link for creating a new task to inclde a reference to the Casetracker project ID as parameter for which to create the task.)
  2. Install the new module. Here: Save the directory commons_tasks under ./sites/all/modules and call: drush pm-enable commons_tasks.
  3. Adapt Casetracker settings. In the "Casetracker settings" screen (at /admin/config/casetracker/settings), set "Group" to be the only project node type and "Task" to be the only case node type.
  4. Add og_group_ref to the new content type. Go to "Administration -> Structure -> Content types -> Task -> Manage fields" (/admin/structure/types/manage/task/fields) and add add the existing field og_group_ref.
  5. Configure field og_group_ref. That is, configure the field and fied display settings to be the same as in the Drupal Commons content types, e.g. Post. Especially take care to enable the "field prepopulate" setting to select proper group membership as default when creating new content from within a group.
  6. Configure permissions for Casetracker. To be done at /admin/people/permissions. Note that you don't need to give any permissions in the "CT Basic" section because these only relate to the Casetracker's default project and case content types, which we don't use.
  7. Disable the casetracker_basic module. It's not needed because we use other content types for Casetracker projects and cases here. Execute: drush pm-disable casetracker_basic.
  8. Adapt comments settings. In the content type settings for "Task" (/admin/structure/types/manage/task), adapt comments accordingly. You probably neither want a title nor threading for the comments.

As a result, all Tasks are now handled by the casetracker module and can also be managed in its task manager at /casetracker. But additionally, tasks are content of organic groups like posts, wikis, polls and questions in Drupal Commons, and are nicely integrated with the Drupal Commons group browsing widget, content creation widget and notifications system, including the "Follow" and e-mail notifications features.

8 thoughts on “How to integrate Casetracker with Drupal Commons 3?

  1. The og_group_ref field was already added to the Task content type.

    Should I add another one? Delete the default one maybe?

  2. Ok, I followed your instructions but it seems that the Casetracker considers an OG group as a project. I can therefore only add cases to a group, which is not desirable.

  3. If the og_group_ref field was already there, you don’t have to add it again. The existing one should work.

    To what else, if not just to an OG group, do you want to add cases? If I remember correctly, you can add multiple content types for the CaseTracker’s “project” role in /admin/config/casetracker/settings .

  4. Adding projects in groups and then cases to projects. Otherwise it is just a large list of tasks in the group.

    I´m going to continue playing around with this a bit.

    Thanks for posting the tut.

  5. I guess it´s just a matter of setting the Task content type as a Project in the Casetracker settings and then add another content type to use for cases (or use the default one that comes with Casetracker).

  6. “I guess it´s just a matter of setting the Task content type as a Project in the Casetracker settings and then add another content type to use for cases (or use the default one that comes with Casetracker).”

    Quite like it. I guess I would simply not disable the casetracker_basic module, as it provides a default Project content type. This one would be your only Casetracker project content type, so not using OG groups for that any more. You can then configure that Project content type to act both as an OG Group and OG Group content, essentially meaning you create subgroups.

    However the only benefit of my code would then be that “Add a Task” appears in the menu of the Drupal Commons group browsing widget. Since you can do that also from Casetracker Project nodes, added as above, you don’t need that. Means the simplest solution would be to use a standard Casetracker installation and just configure the Project content type to be also OG group content. My code would not be needed then. Only drawback is that Casetracker cases / tasks are then not considered OG group content, so access rights are not enforced. But maybe not an issue for you if you have only public groups, for example …

Leave a reply

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>