Fix for CRM-15729
[civicrm-core.git] / CRM / Contact / Form / Edit / CommunicationPreferences.php
index 4991df9072e5df582f3cf7b3a5b16abda0a34c42..bcb691ae37badfbb3b4cf2d6f14c45d83fc3e9a0 100644 (file)
@@ -23,7 +23,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
@@ -45,7 +45,7 @@ class CRM_Contact_Form_Edit_CommunicationPreferences {
   static $greetings = array();
 
   /**
-   * Build the form object elements for Communication Preferences object
+   * Build the form object elements for Communication Preferences object.
    *
    * @param CRM_Core_Form $form
    *   Reference to the form object.
@@ -56,7 +56,6 @@ class CRM_Contact_Form_Edit_CommunicationPreferences {
     // since the pcm - preferred comminication method is logically
     // grouped hence we'll use groups of HTML_QuickForm
 
-
     // checkboxes for DO NOT phone, email, mail
     // we take labels from SelectValues
     $privacy = $commPreff = $commPreference = array();
@@ -118,7 +117,7 @@ class CRM_Contact_Form_Edit_CommunicationPreferences {
       if (!empty($greetingTokens)) {
         $form->addElement('select', $fields['field'], $fields['label'],
           array(
-            '' => ts('- select -')
+            '' => ts('- select -'),
           ) + $greetingTokens
         );
         //custom addressee
@@ -130,7 +129,7 @@ class CRM_Contact_Form_Edit_CommunicationPreferences {
   }
 
   /**
-   * Global form rule
+   * Global form rule.
    *
    * @param array $fields
    *   The input form values.
@@ -187,8 +186,7 @@ class CRM_Contact_Form_Edit_CommunicationPreferences {
     if ($form->_action & CRM_Core_Action::ADD) {
       foreach (CRM_Contact_BAO_Contact::$_greetingTypes as $greeting) {
         if (empty($defaults[$greeting . '_id'])) {
-          if ($defaultGreetingTypeId =
-            CRM_Contact_BAO_Contact_Utils::defaultGreeting($form->_contactType, $greeting)
+          if ($defaultGreetingTypeId = CRM_Contact_BAO_Contact_Utils::defaultGreeting($form->_contactType, $greeting)
           ) {
             $defaults[$greeting . '_id'] = $defaultGreetingTypeId;
           }
@@ -204,7 +202,7 @@ class CRM_Contact_Form_Edit_CommunicationPreferences {
   }
 
   /**
-   *  set array of greeting fields
+   *  set array of greeting fields.
    *
    * @param $contactType
    *
@@ -246,4 +244,5 @@ class CRM_Contact_Form_Edit_CommunicationPreferences {
 
     return self::$greetings[$contactType];
   }
+
 }