19 October, 2008
By kurund
Filed under v2.2, Architecture

Lately there has been lot of confusion using Name, Title/Label and Value. There is also a lot of inconsistency in code and database, hence we are planning to fix it in CiviCRM v2.x release.

Lets take an example of Participant Status, 'Registered'. In this case Name will be 'Registered', value will be an integer from 1..N (this depends on each install) and Label/title can be "Registered" or "I will come" etc. (or a localized version of the word/phrase).

Basic rules are:

  • Name: This is fixed value and cannot be changed by user. This is used internally in the code base to do certain actions. This will typically be in english.
  • Title/Label: This is user editable field and can be translated. This will be displayed in the system.
  • Value: Actual value that is stored in database.

There are few tables where we have adopted correct approach, like "civicrm_option_value". In this table we have separate fields name...

Read more
19 July, 2008
By lobo
Filed under v2.1, Architecture, CiviCRM

Integrating CiviCRM with an email client (specifically Outlook) has been a long requested feature. Unfortunately we dont really have any internal windows expertise to make this happen (for now). For now, we've built some code for the HRD project that attaches incoming email as an activity to the contact record of emails that are in the from / to / cc / bcc fields (we create a contact record if not found)

We are currently using ezComponents Mail library to read and process incoming emails. If possible i'd like to transition this to using the Zend Framework, since that will be our basic library framework for CiviCRM v3.0.

The current approach is file based. The...

Read more
18 June, 2008
By lobo
Filed under v2.1, Architecture, CiviCRM
From a forum post by Chris Burgess (with Green Party NZ). A related blog post is: Another approach to ACL and permissioning for hierarchical organizations Our (Drupal5+CiviCRM2.0) site needed a regional ACL implementation in order to give us the ability to easily grant access for our internal staff to contacts in their geographic region. Because we have staff at a provincial, regional and branch level, we needed to be able to configure permissions for each level. We did this by implementing code which overrides the ACL implementation in CiviCRM. I'd appreciate any input and suggestions on our methodology - it's a work in progress, but it's working well for us so far. I haven't tested this with Joomla, but I hope that my notes below help someone roll a similar implementation there.

...

Read more
17 June, 2008
By lobo
Filed under v2.1, Architecture, CiviCRM
CiviEvent is one of the more popular components in CiviCRM (followed by CiviContribute, CiviMember and CiviMail). We have improved CiviEvent significantly in the past few releases and more improvements are slated for CiviEvent in v2.1. With this increased usage, we've seen more folks using Price Sets. Briefly, price sets gives admins the option to break an event into smaller pieces and charge for each selected piece. Price Sets was one of the first significant of code contributions to CiviCRM (thanx to Ideal Solutions and Marshal Newrock). We were planning to restructure this code in 2.2, but there were two missing features which came up a few times with some of our 'regular' users. The first missing feature was that two options in a price set item could not have the same amount. In order to include meals on multiple days with the same price, you would have to separate... Read more
03 June, 2008
By lobo
Filed under v2.1, Architecture, CiviCRM
So while doing the custom data hook, CRM-1594, I also implemented a hook for setting the default values of a 'Form' in CiviCRM, CRM-3176. So now we have a defaults and validate hook for the form object. The two missing hooks are for buildQuickForm and postProcess, which I'm planning to implement in the next couple of days. This coupled with template customization will allow developers to inject form elements and save them to the database (similar to drupal hook_form_alter). I'm also planning to implement the ACL improvements as an ACL related hook (along with a sample implementation). These new features should give CiviCRM developers more power and flexibility... Read more
02 June, 2008
By lobo
Filed under v2.1, Architecture, CiviCRM
With the new custom data model in 2.0, it seemed a good time to allow developers to add columns to a custom group that are computed rather than entered. Some examples of this is computing the GPA of a student given the student's individual grades, computing the age of a contact given his/her birthday. This has been an outstanding issue, CRM-1594, for quite some time. We went down the path of describing an interface and making the admin implement the interface, similar to what we do with custom search. The admin would need to add the class implementing the interface to the group settings file. After implementing this, i could not articulate when we use an interface vs using a hook. I decided to implement it as a new "civicrm_custom" hook and it seemed a lot easier and also more inline with some of our other hooks. I did not introduce a specific "php code" data type. I chose to give the custom field a new property called "... Read more
25 May, 2008
By lobo
Filed under Architecture, CiviCRM

Earlier this month Evan posted a query about a CiviCRM AMI for Amazon EC2. Joe Murray responded with some proof of concept scripts along with the persistent storage space limitations in EC2. Seems like the folks at EC2 have been busy addressing these limitations and have introduced persistent storage support for EC2 (its currently in beta).

This perked my interest enough, that I spent a few hours over the weekend exploring and thinking about the possibility of using EC2 + Storage as a potential deployment engine for CiviCRM. I think building a base AMI to do this is quite easy, which follows that we can script upgrades, backups and the other missing pieces for a reliable "indivdualized" online hosting service. The tech savvy users can basically...

Read more
18 May, 2008
By lobo
Filed under v2.1, Architecture, CiviCRM
So i've been looking a bit closely at performance for 2.1 (both database and usability) and am attempting to boost it up significantly compared to 2.0 (and prior). Here are some of the highlights
  • We've introduced a new database cache table (civicrm_cache) to cache a few database queries that are repeated a lot. Some of the specific queries include listing all the fields available for the contact types (individual/org/household). This is a combination of the built-in fields (name, address etc) and the custom fields added by the user. This reduces the number of queries invoked from 5 complex queries to 1 simple cache query (and an un-serialize)
  • We've added a column (group_type) to the profile table (civicrm_uf_group), so we know the profile type rather than recompute it every time we need it.
  • Thanx to Dave Lange who reported and did some analysis on this, we've reduced the number of LOWER( dbColumnName) LIKE 'value' to skip the LOWER part. Email is now stored as lower...
Read more
13 May, 2008
By lobo
Filed under v2.1, Architecture, CiviCRM
One of the core features of CiviCRM is the ability to store a query as a group (smart group). This allows folks to create groups of contacts that share the same attribute(s). For e.g. A group of all the people in California. Thus contacts can be added/edited/deleted from the database, and the smart group will always give you all the contacts who live in CA at that point in time. I suspect this feature is heavily used by quite a few installs. Hierarchical organizations / political parties can separate their contacts based on electorate / voting segment / branch etc by using smart groups. For the NZ green party, this results in approx 80 smart groups. More details on their setup can be read in this blog post While smart groups are very convenient, the current implementation within CiviCRM is quite inefficient. The complexity of the queries increase quite significantly as... Read more
07 May, 2008
By lobo
Filed under v2.1, Architecture, CiviCRM
Today we spent a fair amount of time with Pete and Chris from the NZ greens. We got a pretty good overview of how the NZ Greens are using the system and some of their pain points. We saw some of the cool integration that Chris has done with the NZ voter database and linking the electorate ID to a CiviCRM contact ID, ability to merge the address from the voter database etc. Its kinda cool how folks can extend and integrate the systems with other db's and we need to make it significantly easier to enable folks to build such system within CiviCRM. I'll focus on one of their major issues. Restricting who can see what information on whom is a big issue with most political parties. There is one contact database for all their contacts. Some large percentage of the contacts are members. Members can belong to one of nine provinces. Each province is split up into smaller branches. There are approx 70 branches in the NZ green party system. There are users at every level. A branch user can see... Read more