This guide will explain how to extend Open Atrium Work Tracker.

Architecture of Work Tracker

Because every organization has different needs when it comes to tracking work, making it possible to easily extend Work Tracker was a very high priority in it's design!

Work Tracker is a Feature implemented using standard components like Fields, Views, Panels, and Comment Alter, with as little custom code as possible.

This means you can easily extend it, almost entirely in the user interface, and export those changes using Features Override into your own extension module.

IMPORTANT NOTE: If you don't put your changes into an extension module, you risk losing your customizations when new versions of Work Tracker come out!

Tutorial: Add a "Due date" field to Tasks

One of the most common extensions is adding a new field to Tasks, that you want to be updated via posting a comment and displayed in the "Task List".

Work Tracker (since version 1.0-beta1) includes an extension module for adding a Due Date, which you can refer to as a complete example.

In this short tutorial, we're going to walk through all the steps necessary to create a "Due date" extension module.

NOTE: the resulting module won't work exactly the same as the one included in Work Tracker, however, the steps described here will help you get started on your own extension!

Step 1: Add the field to the Task

  1. Go to: "Admin" -> "Structure" -> "Content types"
  2. Click the "manage fields" link next to "Task"
  3. Under "Add new field" set the label to "Due date" and select "Date" for the field type and "Popup calendar" for the widget type - click "Save"
  4. Check the "Enable altering this field from comments" - this is from Comment Alter, which is what allows you to update the field via a comment: Selection_051.png
  5. Expand the "Default values" fieldset and change the "Default date" to "No default value"
  6. Click "Save settings"

Step 2: Position the field on all displays

You'll need to put the field in the correct place on the node form, comment form and node view. There is a "Task information" fieldset on each of those that the field should appear under.

  • Node form: /admin/structure/types/manage/oa-worktracker-task/fields
  • Comment form: admin/structure/types/manage/oa-worktracker-task/comment/fields
  • Node view: /admin/structure/types/manage/oa-worktracker-task/display (be sure to change the "Label" to "Inline", like the other fields)

Don't forget to save after moving the field into the correct place!

Step 3: Add a column to the "Task list" view

  1. Go to: "Admin" -> "Structure" -> "Views"
  2. Find the "Open Atrium Work Tracker" view and click "Edit"
  3. Click the "Task list" display (if you're not already on it)
  4. In the "Fields" section click "Add"
  5. Select the "Content: Due date" field and click "Apply"
  6. Leave the defaults and click "Apply" again
  7. Save the view

Step 4: Update the "Tasks Section" panelizer default

The "Due date" column now exists on the "Task list" view - however, by default it won't be shown on any "Tasks Section". To change this:

  1. Go to: "Admin" -> "Structure" -> "Content types"
  2. Click the "panelizer" link next to "Section Page"
  3. Click "Full page override"
  4. Click the dropdown arrow and select "Content" in the row for "Tasks Section"
  5. Click the gear icon in the "Task list" pane and select "Settings"
  6. Under "Field settings", make sure that "Display Content: Due date" is selected and click "Save"

Step 5: Create a Features module with your extension

  1. Go to: "Admin" -> "Structure" -> "Features"
  2. Click the "Create feature" tab
  3. Fill in the "Name", "Description" and "Package" with whatever you like!
  4. Under "Field bases" select "field_oa_worktracker_duedate"
  5. Under "Field instances" select "node-oa_worktracker_task-field_oa_worktracker_duedate"
  6. Under "Field overrides" select the following:
    • field_group group_oa_worktracker_task_info|comment|comment_node_oa_worktracker_task|form
    • field_group group_oa_worktracker_task_info|node|oa_worktracker_task|default
    • views_view oa_worktracker
    • panelizer_defaults node:oa_section:oa_section_worktracker
  7. Click "Download feature" and save your module to your computer
  8. Upload the module to your server, extract in sites/all/modules and enabled it!

Now, your customizations are in a custom extension module. If you disable the module, your changes will go away and everything will be restored to default. Also, if a new version of Work Tracker comes out, your customizations won't get overwritten!

If you think your extension module might be useful to others, please consider contributing it back to Work Tracker by creating an issue in the issue queue:

https://drupal.org/node/add/project-issue/oa_worktracker

Step 6: (Optional) Add some CSS to make it look pretty

Here is what the comment form looks like after following steps 1-5 above:

Selection_036.png

Not pretty, eh? :-)

In your module's .info file, you can add a CSS file, for example:

stylesheets[all][] = oa_worktracker_duedate.css

Then create the 'oa_worktracker_duedate.css' file and use your CSS skills to make it look better! This is beyond the scope of this guide, but you can look at one included in the Due Date extension for an example.

AttachmentSize
Selection_051.png3.45 KB
Selection_036.png17.5 KB

Comments

peijun’s picture

Hi,

I could not find the 'field overrides' under Step 5.6. on my installation (7.x-2.18). Should it be feature overrides?

Thanks,

peijun

fritzpadilla’s picture

When I try to update the Tasks Section panelizer default, I click on the Settings link on step 4.5 and the page show a cog and just hangs. I've updated to OA 2.25 from 2.24 and it still hangs. I'll try using another build before ditching OA.

http://youtu.be/8vzHuW1HaZk

Carameth’s picture

Hey fritzpadilla,

I had this same issue. It ended up being that I needed to revert my features as explained in step 6 the webinar HERE at around 14 minutes 10 seconds.

I ended up getting the Features Tools module whicih gave me a "revert all" button that made reverting the features after updating very easy. The webinar also provides you with a way to save a custom feature to keep you from losing your overrides during updates.

kamalMaroc’s picture

1- I create a group with users
2- I create a space and affected to group created
3- I create a section for this space and i choose a group created
4- I want to creat a task and affect same users, but not work because in the list field i see just admin !!

same idea ?

esculapio’s picture

Hello. i have a problem with thos module, only Admin users can add a New Task after the space was created and i cannot find any way to change this. I only have this issue with this, i use Documents, Calendars and Forums whit same config and all autenthicate user can add. Any guide to solve this? thnaks in advance