Posted 09.09.2009 by Jack
These are truly raw notes taken at the CiviCRM Developer Camp in NYC. These notes are mostly intended for and thus primarily decipherable by me, but I’m sharing them in case there’s something of use or interest for other folks.
Lobo extended CiviCRM for use in his kids' school. This is a high-level overview of what he did.
Basic Overview
- Writing a Simple Extension
- Write a .info and .module file
- Enable the module
- Implement your CiviCRM and/or Drupal hooks in the .module file
- What does the module do?
- For parents to manage their info themselves
- update address/email/phone
- sign up for extended care classes
- sign up for parent teacher conference meetings
- answer teacher questionnaires
- How did they do it?
- Custom Groups and Fields
- Profiles
- Permissioned Relationships - if User A has a permissioned relationship with User B, User A can edit User B's data.
- Hooks
- buildForm / postProcess
- pageRun
- xmlMenu
- More details
- Used multi-record Custom Data Groups; implemented save/update via hooks
- Customized templates to improve look of multi-record custom data groups display
- Customized menu handlers for some functionality
- Manage one custom table to hold data
- Custom reports for teachers
- Code is publicly available, same CiviCRM license - http://svn.civicrm.org/sfschool/trunk
A more intensive look
- The Drupal module
- http://svn.civicrm.org/sfschool/trunk/drupal/sfschool/sfschool.module
- sfschool_civicrm_pageRun is the civicrm_pageRun (render a page) hook used within the sfschool module
- Drupal takes care of all of the hook implementation
- And this is where I get lost; think I'm missing some basic understanding of hooks, Drupal modules, etc. Might be time to finally learn that stuff! From here out I'll take some sparse notes on key tips, resources, etc.
- Smarty template engine: http://www.smarty.net/
- check out civicrm/drupal/civitest.module.sample for examples of hooks implementation
- on the CiviCRM wiki in the developer section, list of all the hooks with explanation and some examples: http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+hook+specifica...
- Custom Template for Multiple Record Custom Data Groups
- Lobo changed the view for a specific custom data group, not for the other custom groups.
- Created two new templates: CustomDataView.tpl and StandardCustomDataView.tpl. CustomDataView.tpl has some Smarty code that tests for the right $groupId and redirects to StandardCustomDataView.tpl if it's not the specific group ($groupId = 2) that Lobo wanted to show differently.