Last updated May 29, 2008. Created by Ashford on May 29, 2008.
Log in to edit this page.

Our volunteers needed a way to record and track their volunteer hours. Here's how I used Drupal ver 5 to resolve the problem. If you have the same modules, I would surmise this would work in any Drupal version.

Step 1 - Download, install, and enable the Modules.

If you do not already have the modules listed, go to http://drupal.org/project/Modules. Follow the instructions to install and enable each one. The ReadMe files often have examples on how to use the modules.

Your Admin role will have permission to use all the modules. I do not set the access permissions for the other Users until I have tested the results of the new page content.

The modules I used were:

  • Content Construction Kit (CCK) -- to define custom content type (page type); create custom fields for the input form.
  • Optional Widgets -- defines selection, check box and radio button input for text and numeric data. Useful for creating drop down selection lists for the input fields.
  • Views -- to display data in a custom format with filters to narrow the results.
  • Views Calc -- to sum, count, and average rows and columns of numeric data in a Views table.
  • Masquerade - enables a person with access permission to record data as another member. We have several members who prefer handing in a paper copy of their hours. This module enables our Records Keeper to add their data for them.
  • Taxonomy (included in Drupal Core modules) - used to create categories. Be sure to enable it.

Step 2 - Create a new Content Type.

You need a new page input type for the volunteer to enter their activities and record the hours.

  • Go to: Admin >content management >content type
  • Click the tab for [Add Content Type]
    The names and descriptions can be whatever you want to use.
    • (human readable name) Name: My Hours -volunteer
    • (drupal program readable name) Type: hrs_volunteer
    • Description: Volunteers may use this page type to record their hours.
    • Submission form settings
      Title: Title
      Body: (leave blank)
      Submission guidelines: Any instructions you want to give to your Users.
    • Workflow settings
      Default options: nothing check marked
      Default comment: disabled
      Show in Event Calendar: never
  • Click the button to {Save the content type]
  • Click the tab for [Add Fields] - Add the following fields and Submit.
    • Label: activity date -- Name: date_end -- Type: Date -- Weight: 0
    • Label: hours -- Name: volunteer_hours -- Type: Decimal -- Weight: 1
  • Click the tab for [Display Fields] , make any changes, and Submit.
    • activity date -- Date -- Label: inline -- Teaser: default -- Full: default
    • hours -- Decimal -- Label: inline -- Teaser: 9999.99 -- Full: 9999.99

Step 3 - Create any required Taxonomy lists.

Our volunteer information is requested to be broken down into specific categories for our program's reports.
In our example, we needed nested categories.

Admin>content management>categories
---Add Vocabulary
------New vocabulary named "volunteer activity"

---Go back to the list of categories and each one has a link to "Add terms".
---Add Terms to "volunteer activity".
------Admin (Select parent 'root')
----------board meeting (Select parent 'Admin')
----------officer tasks (Select parent 'Admin')
----------promotional materials (Select parent 'Admin')
------Habitat (Select parent 'root')
----------trail (Select parent 'Habitat')
----------wildflower meadow (Select parent 'Habitat')

---Go back to the list of categories and each one has a link to "Edit Vocabulary".
---Edit vocabulary "volunteer activity".
-----Select the types of content pages where you want the categories list as a selection option (hours_volunteer).

Step 4 - Create a new View

You need to create a new page display type to view the results.

  • Go to: Admin >site building >views
  • Click the tab for [Add]
  • Basic Information settings
    • Name: myhours_volunteer
    • Access: check mark the roles that can see this page View. At first, mark your new View so only "Admin" can see it and play with the settings until it's ready for others to view.
    • Description: Volunteer service details for a specific volunteer.
  • Page settings
    • Check mark "Provide page view".
    • URL: myhours/volunteer
    • View type: table view
    • Title: my Volunteer Hours
    • Pager:
      I did not use Pager because I wanted View Calc to display the totals at the bottom of the columns and it will only total the items on the current page. Therefore, I want all the records for the volunteer to appear on a single page.
    • Header: Any text message or instructions for the volunteer when viewing the page results.
    • Check mark "Provide menu". This will add it to your list in Admin >site building >menu for managing your menu links.
  • Block settings -Skip. Not necessary for this example.
  • Fields settings -What info the user put in do you want to display on this page? Select a field and then mark the settings for that field.
    • Date: activity date
      Label: date
      Handler: do not group multiple values
      Option: default
      Sortable: yes
    • Decimal: hours
      Label: hours
      Handler: do not group multiple values
      Option: 9,999.99
      Sortable: no
    • Node: title
      Label: your title
      Handler: normal
      Option: without links
      Sortable: yes
    • Taxonomy: Terms for volunteer activity
      Label: activity
      Option: without links
    • Node edit -Adds an [edit] button, so the volunteer can easily change the data entered.
      Label: edit
      Handler: return to view
      Option: (blank)
    • Node delete -Adds a [delete] button.
      Label: delete
      Handler: return to view
      Option: (blank)
  • Arguments settings -Skip. Not necessary for this example.
  • Filter settings -Which records do you want to display on this page? Select each field and then fill in the settings.
    • Show pages (nodes) input by the volunteer who is currently logged in
      • Field: Node -Author is Current User
      • Operator: Is equal to
      • Value: currently logged in user
    • AND limit it to where the Year is the current year
      • Field: Date- activity date - Year
      • Operator: Is equal to
      • Value: now
    • AND limit it to the page type called myhours_volunteer
      • Field: Node type
      • Operator: Is one of
      • Value: select "My Hours -volunteer" from the list
  • Exposed Filters settings -Skip. Not necessary for this example.
  • Sort Criteria settings
    Select the field "Date: activity date". Select the Order as 'descending'.
  • Click the [save] button to save the new View.

Step 5 - Allow ViewCalc.module to calculate the totals on your new View.

  • Go to: admin >Site configuration >Views Calc
  • Check mark the view called "myhours_volunteer".
  • Click the [save configuration] button.
  • After the page reloads, click the tab [configure fields].
  • Select the proper field and mark it to Sum the Column. Sorry I cannot get too detailed here. They are doing an upgrade on our Server tonight. It just started, so I don't have access to the page to see the exact settings and wording.

Step 6 - Check your results.

  • Go to: create content >My Hours -volunteer
  • Add a few entries
  • Click the menu link for "my Volunteer Hours". You should see the data you just entered listed on the page with the column totals you selected.
  • Go to Admin >site building >views
    If your test page looked the way you expected, mark the other Roles you want to have access to this page View.
    Or, you can tweak your View results by changing the settings.

Step 7 - Access permissions -Who can create and edit the new content type?

  • Go to: admin >User >Access
  • Check mark the Role for "create content_myhours_volunteer" and "edit own content_myhours_volunteer".
  • If you need a person to enter the hours for those who do not wish to do their own, check mark that Role for "allow Masquerade".

This was an example to help you create the input page (CCK) and output page (View) you need for your volunteers to track their own hours. You may need to make adjustments or create new fields to fit your organization's special criteria.

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

Quite clear and precise instructions. Helped me do in an hour what would have taken me days to do without the tutorial!

Within the next few weeks, I will have completed an overhaul on our organization's web site. Once that is done, I will add the latest tips and techniques I have used to improve on How to track volunteer hours.

Thank you for your note. It is good to know I helped someone. I am normally the one asking for help.

_____________________________
Pay It Forward at Drupal
When you ask a Forum question, look for one you can answer.

I added this to our school's intranet for parents and teachers. This year's big push is tracking volunteer hours, so I'll be keeping an eye out for further advice. I did make this following addition which I think will be helpful for our community. I added an additional feed view that is available to admins only, which contains all users. Then I added and .xls download so volunteer hours can be downloaded into Excel and sorted/calculated, etc.

I do not use Excel, but many of our members do. Can you offer me an easy explanation of how you generated and made the download file available?

_____________________________
Pay It Forward at Drupal
When you ask a Forum question, look for one you can answer.

First, to create the online list of all Volunteer Hours I removed the "User: Current - Yes" filter on a new page layout. Then I created a new "Feed" layout of that view with the Style set as XLS file, and attached it to the "All Volunteer Hours" layout. Now that page has an xls icon at the bottom, when I click it the entire spreadsheet downloads. I included contact information on that layout as well so volunteer coordinators can follow up via phone or email with each volunteer.

The other thing that's been really helpful is putting a block on everyone's home page with the total hours they've contributed so far this year, with links to view their hours or add hours (we have a 40 hour/year commitment so everyone knows what their goal is).

I should note that this was all done in D6, don't know if there are any features in D6 that are being utilized that are not available in D5.