/**
 * Implementation of hook_civicrm_enable
 */
function petitionemail_civicrm_enable()
{
    // Ensure the profile id is created.
    petitionemail_create_custom_fields();
    petitionemail_get_profile_id('petitionemail_profile_matching_fields');
    petitionemail_get_profile_id('petitionemail_profile_default_contact');
    petitionemail_get_profile_id('petitionemail_profile_default_activity');
    return _petitionemail_civix_civicrm_enable();
}
 /**
  * Ensure all profiles and custom fields are created.
  */
 function upgrade_1003()
 {
     // These are indempotent.
     if (FALSE === petitionemail_create_custom_fields()) {
         return FALSE;
     }
     if (FALSE === petitionemail_get_profile_id('petitionemail_profile_matching_fields')) {
         return FALSE;
     }
     if (FALSE === petitionemail_get_profile_id('petitionemail_profile_default_contact')) {
         return FALSE;
     }
     if (FALSE === petitionemail_get_profile_id('petitionemail_profile_default_activity')) {
         return FALSE;
     }
     return TRUE;
 }