From: Olaf Buddenhagen Date: Tue, 13 Aug 2013 21:58:07 +0000 (+0200) Subject: Introduce new `communication_style` field for Contacts X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=aa62b35561fed2b37560625faf7115bb30606416;p=civicrm-core.git Introduce new `communication_style` field for Contacts Add new field in the Communication Preferences block, mostly for driving the new conditional greeting templates. (Though other uses are possible of course.) The Communication Style field is implemented as radio buttons defined through an option group (pseudoconstant), similar to the Gender field. Unlike Gender, it has a default value assigned automatically for new contacts. The field is placed just above the Email Greeting, Postal Greeting, and Addresse controls, as it's meant to be used as a kind of master switch driving the various greeting templates. Just like the Prefix/Suffix fields in the name block for Individual contacts, the Communication Style field is automatically hidden from all forms and views if no option values are defined for the field. The database field comes with an index, like all(?) pseudoconstant fields. Presently the index is not used much (probably the only place being deletion of existing option values); but this is likely to change when more functionality is added around this field in the future. (Search etc.) The handling of the new field throughout the CiviCRM code base should be mostly complete. We deliberately punted on some of the obvious, larger pieces of functionality (search, import, profiles) for now, as they would require considerable additional effort, so we treat them as extra features to be implemented seperately upon need. We tried to be complete with all smaller bits (mostly by grepping for `gender`, which requires similar handling in most places...); but we might have omitted some, and/or done some that aren't actually necessary -- it's rather hard to tell sometimes what a particular piece of code is all about... --- diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index 57768039f5..64e029841c 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -520,6 +520,7 @@ WHERE civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer'); CRM_Utils_Array::lookupValue($defaults, 'prefix', CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'prefix_id'), $reverse); CRM_Utils_Array::lookupValue($defaults, 'suffix', CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'suffix_id'), $reverse); CRM_Utils_Array::lookupValue($defaults, 'gender', CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id'), $reverse); + CRM_Utils_Array::lookupValue($defaults, 'communication_style', CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'communication_style_id'), $reverse); //lookup value of email/postal greeting, addressee, CRM-4575 foreach (self::$_greetingTypes as $greeting) { diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index 064308d657..a8432dc195 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -756,6 +756,9 @@ class CRM_Contact_BAO_Query { if ($fieldName == 'gender_id') { $this->_pseudoConstantsSelect['gender'] = array('pseudoField' => 'gender_id', 'idCol' => "gender_id", 'bao' => 'CRM_Contact_BAO_Contact'); } + if ($name == 'communication_style_id') { + $this->_pseudoConstantsSelect['communication_style'] = array('pseudoField' => 'communication_style_id', 'idCol' => "communication_style_id", 'bao' => 'CRM_Contact_BAO_Contact'); + } $this->_select[$name] = "contact_a.{$fieldName} as `$name`"; } } @@ -3988,6 +3991,7 @@ civicrm_relationship.start_date > {$today} 'prefix_id' => 1, 'suffix_id' => 1, 'formal_title' => 1, + 'communication_style_id' => 1, 'birth_date' => 1, 'gender_id' => 1, 'street_address' => 1, @@ -4540,6 +4544,7 @@ SELECT COUNT( civicrm_contribution.total_amount ) as cancel_count, 'prefix_id' => 1, 'suffix_id' => 1, 'formal_title' => 1, + 'communication_style_id' => 1, 'email_greeting' => 1, 'postal_greeting' => 1, 'addressee' => 1, @@ -5017,7 +5022,7 @@ AND displayRelType.is_active = 1 $qill = $value; } - $pseudoFields = array('email_greeting', 'postal_greeting', 'addressee', 'gender_id', 'prefix_id', 'suffix_id'); + $pseudoFields = array('email_greeting', 'postal_greeting', 'addressee', 'gender_id', 'prefix_id', 'suffix_id', 'communication_style_id'); if (is_numeric($value)) { $qill = $selectValues[(int ) $value]; @@ -5051,7 +5056,7 @@ AND displayRelType.is_active = 1 } if (in_array($name, $pseudoFields)) { - if (!in_array($name, array('gender_id', 'prefix_id', 'suffix_id'))) { + if (!in_array($name, array('gender_id', 'prefix_id', 'suffix_id', 'communication_style_id'))) { $wc = "contact_a.{$name}_id"; } $dataType = 'Positive'; diff --git a/CRM/Contact/Form/Edit/CommunicationPreferences.php b/CRM/Contact/Form/Edit/CommunicationPreferences.php index bf2a39e8aa..905a5dc7bc 100644 --- a/CRM/Contact/Form/Edit/CommunicationPreferences.php +++ b/CRM/Contact/Form/Edit/CommunicationPreferences.php @@ -99,6 +99,18 @@ class CRM_Contact_Form_Edit_CommunicationPreferences { $form->add('select', 'preferred_mail_format', ts('Email Format'), CRM_Core_SelectValues::pmf()); $form->add('checkbox', 'is_opt_out', ts('NO BULK EMAILS (User Opt Out)')); + $communicationStyleOptions = array(); + $communicationStyle = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'communication_style_id', array('localize' => TRUE)); + foreach ($communicationStyle as $key => $var) { + $communicationStyleOptions[$key] = $form->createElement('radio', NULL, + ts('Communication Style'), $var, $key, + array('id' => "civicrm_communication_style_{$var}_{$key}") + ); + } + if (!empty($communicationStyleOptions)) { + $form->addGroup($communicationStyleOptions, 'communication_style_id', ts('Communication Style')); + } + //check contact type and build filter clause accordingly for greeting types, CRM-4575 $greetings = self::getGreetingFields($form->_contactType); @@ -171,6 +183,10 @@ class CRM_Contact_Form_Edit_CommunicationPreferences { $defaults['preferred_language'] = $config->lcMessages; } + if (empty($defaults['communication_style_id'])) { + $defaults['communication_style_id'] = array_pop(CRM_Core_OptionGroup::values('communication_style', TRUE, NULL, NULL, 'AND is_default = 1')); + } + //set default from greeting types CRM-4575, CRM-9739 if ($form->_action & CRM_Core_Action::ADD) { foreach (CRM_Contact_BAO_Contact::$_greetingTypes as $greeting) { diff --git a/CRM/Contact/Form/Inline/CommunicationPreferences.php b/CRM/Contact/Form/Inline/CommunicationPreferences.php index e3894a6371..729ce157f8 100644 --- a/CRM/Contact/Form/Inline/CommunicationPreferences.php +++ b/CRM/Contact/Form/Inline/CommunicationPreferences.php @@ -69,6 +69,10 @@ class CRM_Contact_Form_Inline_CommunicationPreferences extends CRM_Contact_Form_ $defaults['preferred_language'] = $config->lcMessages; } + if (empty($defaults['communication_style_id'])) { + $defaults['communication_style_id'] = array_pop(CRM_Core_OptionGroup::values('communication_style', TRUE, NULL, NULL, 'AND is_default = 1')); + } + foreach (CRM_Contact_BAO_Contact::$_greetingTypes as $greeting) { $name = "{$greeting}_display"; $this->assign($name, CRM_Utils_Array::value($name, $defaults)); diff --git a/CRM/Contact/Page/Inline/CommunicationPreferences.php b/CRM/Contact/Page/Inline/CommunicationPreferences.php index 445b6a60b8..30e95eb1cd 100644 --- a/CRM/Contact/Page/Inline/CommunicationPreferences.php +++ b/CRM/Contact/Page/Inline/CommunicationPreferences.php @@ -58,6 +58,17 @@ class CRM_Contact_Page_Inline_CommunicationPreferences extends CRM_Core_Page { CRM_Contact_BAO_Contact::getValues( $params, $defaults ); $defaults['privacy_values'] = CRM_Core_SelectValues::privacy(); + $communicationStyle = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'communication_style_id'); + if (!empty($communicationStyle)) { + if (CRM_Utils_Array::value('communication_style_id', $defaults)) { + $defaults['communication_style_display'] = $communicationStyle[CRM_Utils_Array::value('communication_style_id', $defaults)]; + } + else { + // Make sure the field is displayed as long as it is active, even if it is unset for this contact. + $defaults['communication_style_display'] = ''; + } + } + $this->assign('contactId', $contactId); $this->assign($defaults); diff --git a/CRM/Contact/Page/View/Summary.php b/CRM/Contact/Page/View/Summary.php index c09ffc4810..b1d09b9eeb 100644 --- a/CRM/Contact/Page/View/Summary.php +++ b/CRM/Contact/Page/View/Summary.php @@ -211,6 +211,17 @@ class CRM_Contact_Page_View_Summary extends CRM_Contact_Page_View { $defaults['gender_display'] = $gender[CRM_Utils_Array::value('gender_id', $defaults)]; } + $communicationStyle = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'communication_style_id'); + if (!empty($communicationStyle)) { + if (CRM_Utils_Array::value('communication_style_id', $defaults)) { + $defaults['communication_style_display'] = $communicationStyle[CRM_Utils_Array::value('communication_style_id', $defaults)]; + } + else { + // Make sure the field is displayed as long as it is active, even if it is unset for this contact. + $defaults['communication_style_display'] = ''; + } + } + // to make contact type label available in the template - $contactType = array_key_exists('contact_sub_type', $defaults) ? $defaults['contact_sub_type'] : $defaults['contact_type']; $defaults['contact_type_label'] = CRM_Contact_BAO_ContactType::contactTypePairs(TRUE, $contactType, ', '); diff --git a/CRM/Core/BAO/OptionValue.php b/CRM/Core/BAO/OptionValue.php index fab3a17efd..9dfbb190e3 100644 --- a/CRM/Core/BAO/OptionValue.php +++ b/CRM/Core/BAO/OptionValue.php @@ -295,6 +295,7 @@ class CRM_Core_BAO_OptionValue extends CRM_Core_DAO_OptionValue { 'gender' => 'gender_id', 'individual_prefix' => 'prefix_id', 'individual_suffix' => 'suffix_id', + 'communication_style' => 'communication_style_id', // Not only Individuals -- but the code seems to be generic for all contact types, despite the naming... ); $contributions = array('payment_instrument' => 'payment_instrument_id'); $activities = array('activity_type' => 'activity_type_id'); diff --git a/CRM/Dedupe/Merger.php b/CRM/Dedupe/Merger.php index e3d2791416..49bc4fe0df 100644 --- a/CRM/Dedupe/Merger.php +++ b/CRM/Dedupe/Merger.php @@ -1272,6 +1272,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m $names['gender'] = array('newName' => 'gender_id', 'groupName' => 'gender'); $names['individual_prefix'] = array('newName' => 'prefix_id', 'groupName' => 'individual_prefix'); $names['individual_suffix'] = array('newName' => 'suffix_id', 'groupName' => 'individual_suffix'); + $names['communication_style'] = array('newName' => 'communication_style_id', 'groupName' => 'communication_style'); $names['addressee'] = array('newName' => 'addressee_id', 'groupName' => 'addressee'); $names['email_greeting'] = array('newName' => 'email_greeting_id', 'groupName' => 'email_greeting'); $names['postal_greeting'] = array('newName' => 'postal_greeting_id', 'groupName' => 'postal_greeting'); diff --git a/CRM/Event/BAO/Event.php b/CRM/Event/BAO/Event.php index bf38cb365c..47cada5957 100644 --- a/CRM/Event/BAO/Event.php +++ b/CRM/Event/BAO/Event.php @@ -1418,7 +1418,7 @@ WHERE civicrm_event.is_active = 1 $values[$index] = ''; } } - elseif (in_array(substr($name, 0, -3), array('gender', 'prefix', 'suffix'))) { + elseif (in_array(substr($name, 0, -3), array('gender', 'prefix', 'suffix', 'communication_style'))) { $values[$index] = CRM_Core_PseudoConstant::getLabel('CRM_Contact_DAO_Contact', $name, $params[$name]); } elseif (in_array($name, array( diff --git a/CRM/Export/BAO/Export.php b/CRM/Export/BAO/Export.php index d82899b468..62c9fafe8d 100644 --- a/CRM/Export/BAO/Export.php +++ b/CRM/Export/BAO/Export.php @@ -799,7 +799,7 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c elseif ($field == 'pledge_next_pay_amount') { $row[$field] = $dao->pledge_next_pay_amount + $dao->pledge_outstanding_amount; } - elseif (in_array(substr($field, 0, -3), array('gender', 'prefix', 'suffix'))) { + elseif (in_array(substr($field, 0, -3), array('gender', 'prefix', 'suffix', 'communication_style'))) { $row[$field] = CRM_Core_PseudoConstant::getLabel('CRM_Contact_DAO_Contact', $field, $dao->$field); } elseif (is_array($value) && $field == 'location') { @@ -971,6 +971,7 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c case 'gender': case 'preferred_communication_method': case 'preferred_mail_format': + case 'communication_style': $row[$field] = $i18n->crm_translate($fieldValue); break; diff --git a/CRM/Upgrade/Incremental/sql/4.5.alpha1.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.5.alpha1.mysql.tpl index dc95209664..3a0a94bf45 100644 --- a/CRM/Upgrade/Incremental/sql/4.5.alpha1.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/4.5.alpha1.mysql.tpl @@ -2,3 +2,20 @@ ALTER TABLE `civicrm_contact` ADD COLUMN `formal_title` varchar(64) COMMENT 'Formal (academic or similar) title in front of name. (Prof., Dr. etc.)' AFTER `suffix_id`; + +ALTER TABLE `civicrm_contact` + ADD COLUMN `communication_style_id` int(10) unsigned COMMENT 'Communication style (e.g. formal vs. familiar) to use with this contact. FK to communication styles in civicrm_option_value.' AFTER `formal_title`, + ADD INDEX `index_communication_style_id` (`communication_style_id`); + +INSERT INTO + `civicrm_option_group` (`name`, {localize field='title'}`title`{/localize}, `is_reserved`, `is_active`) +VALUES + ('communication_style', {localize}'{ts escape="sql"}Communication Style{/ts}'{/localize}, 1, 1); + +SELECT @option_group_id_communication_style := max(id) from civicrm_option_group where name = 'communication_style'; + +INSERT INTO + `civicrm_option_value` (`option_group_id`, `label`, `value`, `name`, `grouping`, `filter`, `is_default`, `weight`, `description`, `is_optgroup`, `is_reserved`, `is_active`, `component_id`, `visibility_id`) +VALUES + (@option_group_id_communication_style, {localize}'{ts escape="sql"}Formal{/ts}'{/localize} , 1, 'formal' , NULL, 0, 1, 1, NULL, 0, 0, 1, NULL, NULL), + (@option_group_id_communication_style, {localize}'{ts escape="sql"}Familiar{/ts}'{/localize}, 2, 'familiar', NULL, 0, 0, 2, NULL, 0, 0, 1, NULL, NULL); diff --git a/CRM/Utils/Address.php b/CRM/Utils/Address.php index 352927daba..e659b1949a 100644 --- a/CRM/Utils/Address.php +++ b/CRM/Utils/Address.php @@ -149,6 +149,7 @@ class CRM_Utils_Address { 'contact.organization_name' => CRM_Utils_Array::value('display_name', $fields), 'contact.legal_name' => CRM_Utils_Array::value('legal_name', $fields), 'contact.preferred_communication_method' => CRM_Utils_Array::value('preferred_communication_method', $fields), + 'contact.communication_style' => CRM_Utils_Array::value('communication_style', $fields), 'contact.addressee' => CRM_Utils_Array::value('addressee_display', $fields), 'contact.email_greeting' => CRM_Utils_Array::value('email_greeting_display', $fields), 'contact.postal_greeting' => CRM_Utils_Array::value('postal_greeting_display', $fields), diff --git a/CRM/Utils/Migrate/ExportJSON.php b/CRM/Utils/Migrate/ExportJSON.php index f9b9bddbef..cf27002b65 100644 --- a/CRM/Utils/Migrate/ExportJSON.php +++ b/CRM/Utils/Migrate/ExportJSON.php @@ -120,6 +120,7 @@ class CRM_Utils_Migrate_ExportJSON { 'status_id' => 'activity_status_id', 'priority_id' => 'activity_priority_id', 'medium_id' => 'encounter_medium', + 'communication_style_id' => 'communication_style', 'email_greeting' => 'email_greeting', 'postal_greeting' => 'postal_greeting', 'addressee_id' => 'addressee', diff --git a/CRM/Utils/Token.php b/CRM/Utils/Token.php index ed5e490bbe..5b32c627bb 100644 --- a/CRM/Utils/Token.php +++ b/CRM/Utils/Token.php @@ -1496,6 +1496,7 @@ class CRM_Utils_Token { 'individual_prefix' => 'prefix_id', 'individual_suffix' => 'suffix_id', 'gender' => 'gender_id', + 'communication_style' => 'communication_style_id', ); } diff --git a/templates/CRM/Contact/Form/Contact.hlp b/templates/CRM/Contact/Form/Contact.hlp index 924a32d0d1..2de028a8af 100644 --- a/templates/CRM/Contact/Form/Contact.hlp +++ b/templates/CRM/Contact/Form/Contact.hlp @@ -76,6 +76,14 @@

{ts}You can use an address belonging to an existing contact or create a new contact by selecting the desired contact type from the select field. If you link an individual's address to an organization, an employee-employer relationship will be automatically created. If you link an individual's address to a household, a household member relationship is created.{/ts}

{/htxt} +{htxt id="id-communication_style-title"} + {ts}Communication Style{/ts} +{/htxt} +{htxt id="id-communication_style"} +

{ts}Choose how you communicate with this contact, e.g. on formal or familiar terms.{/ts}

+

{ts}Depending on the CiviCRM setup, email and postal greetings (see below) may be automatically adapted accordingly; or the information can be used in other ways.{/ts}

+{/htxt} + {htxt id="id-greeting-title"} {ts}Greeting{/ts} {/htxt} diff --git a/templates/CRM/Contact/Form/Edit/CommunicationPreferences.tpl b/templates/CRM/Contact/Form/Edit/CommunicationPreferences.tpl index 5eaf323488..e6f9ba1689 100644 --- a/templates/CRM/Contact/Form/Edit/CommunicationPreferences.tpl +++ b/templates/CRM/Contact/Form/Edit/CommunicationPreferences.tpl @@ -32,6 +32,12 @@
+ {if !empty($form.communication_style_id)} + + {/if} {if !empty($form.email_greeting_id)} diff --git a/templates/CRM/Contact/Form/Inline/CommunicationPreferences.tpl b/templates/CRM/Contact/Form/Inline/CommunicationPreferences.tpl index 7e066f5288..70425e8a1e 100644 --- a/templates/CRM/Contact/Form/Inline/CommunicationPreferences.tpl +++ b/templates/CRM/Contact/Form/Inline/CommunicationPreferences.tpl @@ -72,6 +72,17 @@ {/if} + {if !empty($form.communication_style_id)} +
+
+ {$form.communication_style_id.label} {help id="id-communication_style" file="CRM/Contact/Form/Contact.hlp"} +
+
+ {$form.communication_style_id.html} +
+
+ {/if} + {if !empty($form.email_greeting_id)}
{$form.email_greeting_id.label}
diff --git a/templates/CRM/Contact/Page/Inline/CommunicationPreferences.tpl b/templates/CRM/Contact/Page/Inline/CommunicationPreferences.tpl index 0c4287c144..6c6e995434 100644 --- a/templates/CRM/Contact/Page/Inline/CommunicationPreferences.tpl +++ b/templates/CRM/Contact/Page/Inline/CommunicationPreferences.tpl @@ -60,6 +60,14 @@ {$preferred_mail_format}
+ {if isset($communication_style_display)} +
+
{ts}Communication Style{/ts}
+
+ {$communication_style_display} +
+
+ {/if}
{ts}Email Greeting{/ts}
diff --git a/xml/schema/Contact/Contact.xml b/xml/schema/Contact/Contact.xml index 292a3691a7..2ab3428a77 100644 --- a/xml/schema/Contact/Contact.xml +++ b/xml/schema/Contact/Contact.xml @@ -390,6 +390,22 @@ Formal (academic or similar) title in front of name. (Prof., Dr. etc.) 4.5 + + communication_style_id + Communication Style + int unsigned + + communication_style + + true + Communication style (e.g. formal vs. familiar) to use with this contact. FK to communication styles in civicrm_option_value. + 4.4 + + + index_communication_style_id + communication_style_id + 4.4 + greeting_type varchar diff --git a/xml/templates/civicrm_data.tpl b/xml/templates/civicrm_data.tpl index 29b44de746..121f4ffbf3 100644 --- a/xml/templates/civicrm_data.tpl +++ b/xml/templates/civicrm_data.tpl @@ -205,7 +205,8 @@ VALUES ('financial_account_type' , '{ts escape="sql"}Financial Account Type{/ts}' , 1, 1), ('financial_item_status' , '{ts escape="sql"}Financial Item Status{/ts}' , 1, 1), ('label_type' , '{ts escape="sql"}Label Type{/ts}' , 1, 1), - ('name_badge' , '{ts escape="sql"}Name Badge Format{/ts}' , 1, 1); + ('name_badge' , '{ts escape="sql"}Name Badge Format{/ts}' , 1, 1), + ('communication_style' , '{ts escape="sql"}Communication Style{/ts}' , 1, 1); SELECT @option_group_id_pcm := max(id) from civicrm_option_group where name = 'preferred_communication_method'; SELECT @option_group_id_act := max(id) from civicrm_option_group where name = 'activity_type'; @@ -280,6 +281,7 @@ SELECT @option_group_id_fat := max(id) from civicrm_option_group wher SELECT @option_group_id_financial_item_status := max(id) from civicrm_option_group where name = 'financial_item_status'; SELECT @option_group_id_label_type := max(id) from civicrm_option_group where name = 'label_type'; SELECT @option_group_id_name_badge := max(id) from civicrm_option_group where name = 'name_badge'; +SELECT @option_group_id_communication_style := max(id) from civicrm_option_group where name = 'communication_style'; SELECT @contributeCompId := max(id) FROM civicrm_component where name = 'CiviContribute'; @@ -891,7 +893,11 @@ VALUES (@option_group_id_label, '{ts escape="sql"}Avery L7160{/ts}', '{literal}{"paper-size":"a4","orientation":"portrait","font-name":"helvetica","font-size":9,"font-style":"","metric":"in","lMargin":0.28,"tMargin":0.6,"NX":3,"NY":7,"SpaceX":0.1,"SpaceY":0,"width":2.5,"height":1.5,"lPadding":0.20,"tPadding":0.20}{/literal}', 'L7160', 'Avery', NULL, 0, 8, NULL, 0, 1, 1, NULL, NULL), (@option_group_id_label, '{ts escape="sql"}Avery L7161{/ts}', '{literal}{"paper-size":"a4","orientation":"portrait","font-name":"helvetica","font-size":9,"font-style":"","metric":"in","lMargin":0.28,"tMargin":0.35,"NX":3,"NY":6,"SpaceX":0.1,"SpaceY":0,"width":2.5,"height":1.83,"lPadding":0.20,"tPadding":0.20}{/literal}', 'L7161', 'Avery', NULL, 0, 9, NULL, 0, 1, 1, NULL, NULL), (@option_group_id_label, '{ts escape="sql"}Avery L7162{/ts}', '{literal}{"paper-size":"a4","orientation":"portrait","font-name":"helvetica","font-size":9,"font-style":"","metric":"in","lMargin":0.18,"tMargin":0.51,"NX":2,"NY":8,"SpaceX":0.1,"SpaceY":0,"width":3.9,"height":1.33,"lPadding":0.20,"tPadding":0.20}{/literal}', 'L7162', 'Avery', NULL, 0, 10, NULL, 0, 1, 1, NULL, NULL), - (@option_group_id_label, '{ts escape="sql"}Avery L7163{/ts}', '{literal}{"paper-size":"a4","orientation":"portrait","font-name":"helvetica","font-size":9,"font-style":"","metric":"in","lMargin":0.18,"tMargin":0.6,"NX":2,"NY":7,"SpaceX":0.1,"SpaceY":0,"width":3.9,"height":1.5,"lPadding":0.20,"tPadding":0.20}{/literal}', 'L7163', 'Avery', NULL, 0, 11, NULL, 0, 1, 1, NULL, NULL); + (@option_group_id_label, '{ts escape="sql"}Avery L7163{/ts}', '{literal}{"paper-size":"a4","orientation":"portrait","font-name":"helvetica","font-size":9,"font-style":"","metric":"in","lMargin":0.18,"tMargin":0.6,"NX":2,"NY":7,"SpaceX":0.1,"SpaceY":0,"width":3.9,"height":1.5,"lPadding":0.20,"tPadding":0.20}{/literal}', 'L7163', 'Avery', NULL, 0, 11, NULL, 0, 1, 1, NULL, NULL), + +-- Communication Styles + (@option_group_id_communication_style, '{ts escape="sql"}Formal{/ts}' , 1, 'formal' , NULL, 0, 1, 1, NULL, 0, 0, 1, NULL, NULL), + (@option_group_id_communication_style, '{ts escape="sql"}Familiar{/ts}', 2, 'familiar', NULL, 0, 0, 2, NULL, 0, 0, 1, NULL, NULL); -- financial accounts SELECT @opval := value FROM civicrm_option_value WHERE name = 'Revenue' and option_group_id = @option_group_id_fat;
+ {$form.communication_style_id.label} {help id="id-communication_style" file="CRM/Contact/Form/Contact.hlp"} + {$form.communication_style_id.html} +
{$form.email_greeting_id.label}