INFRA-132 - Batch #1
[civicrm-core.git] / CRM / UF / Page / ProfileEditor.php
index c6656c29e4c7bd65df86739c988f21e0ceeb6188..0e5a84782b6ff0de4471ab6308c456c9e887877b 100644 (file)
@@ -19,7 +19,7 @@ class CRM_UF_Page_ProfileEditor extends CRM_Core_Page {
     $loaded = TRUE;
 
     CRM_Core_Resources::singleton()
-      ->addSettingsFactory(function(){
+      ->addSettingsFactory(function () {
         return array(
           'PseudoConstant' => array(
             'locationType' => CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id'),
@@ -114,6 +114,7 @@ class CRM_UF_Page_ProfileEditor extends CRM_Core_Page {
             $availableFields
           );
           break;
+
         case 'OrganizationModel':
           $civiSchema[$entityType] = self::convertCiviModelToBackboneModel(
             'Organization',
@@ -121,6 +122,7 @@ class CRM_UF_Page_ProfileEditor extends CRM_Core_Page {
             $availableFields
           );
           break;
+
         case 'HouseholdModel':
           $civiSchema[$entityType] = self::convertCiviModelToBackboneModel(
             'Household',
@@ -128,6 +130,7 @@ class CRM_UF_Page_ProfileEditor extends CRM_Core_Page {
             $availableFields
           );
           break;
+
         case 'ActivityModel':
           $civiSchema[$entityType] = self::convertCiviModelToBackboneModel(
             'Activity',
@@ -135,6 +138,7 @@ class CRM_UF_Page_ProfileEditor extends CRM_Core_Page {
             $availableFields
           );
           break;
+
         case 'ContributionModel':
           $civiSchema[$entityType] = self::convertCiviModelToBackboneModel(
             'Contribution',
@@ -142,6 +146,7 @@ class CRM_UF_Page_ProfileEditor extends CRM_Core_Page {
             $availableFields
           );
           break;
+
         case 'MembershipModel':
           $civiSchema[$entityType] = self::convertCiviModelToBackboneModel(
             'Membership',
@@ -149,6 +154,7 @@ class CRM_UF_Page_ProfileEditor extends CRM_Core_Page {
             $availableFields
           );
           break;
+
         case 'ParticipantModel':
           $civiSchema[$entityType] = self::convertCiviModelToBackboneModel(
             'Participant',
@@ -156,6 +162,7 @@ class CRM_UF_Page_ProfileEditor extends CRM_Core_Page {
             $availableFields
           );
           break;
+
         case 'CaseModel':
           $civiSchema[$entityType] = self::convertCiviModelToBackboneModel(
             'Case',
@@ -163,6 +170,7 @@ class CRM_UF_Page_ProfileEditor extends CRM_Core_Page {
             $availableFields
           );
           break;
+
         default:
           throw new CRM_Core_Exception("Unrecognized entity type: $entityType");
       }
@@ -181,7 +189,8 @@ class CRM_UF_Page_ProfileEditor extends CRM_Core_Page {
    *   A string to use in section headers.
    * @param array $availableFields
    *   List of fields that are allowed in profiles, e.g. $availableFields['my_field']['field_type'].
-   * @return array with keys 'sections' and 'schema'
+   * @return array
+   *   with keys 'sections' and 'schema'
    * @see js/model/crm.core.js
    * @see js/model/crm.mappedcore.js
    */
@@ -201,10 +210,12 @@ class CRM_UF_Page_ProfileEditor extends CRM_Core_Page {
         case 'Household':
           if ($field['field_type'] != $extends && $field['field_type'] != 'Contact'
             //CRM-15595 check if subtype
-            && !in_array($field['field_type'], CRM_Contact_BAO_ContactType::subTypes($extends))) {
+            && !in_array($field['field_type'], CRM_Contact_BAO_ContactType::subTypes($extends))
+          ) {
             continue 2;
           }
           break;
+
         default:
           if ($field['field_type'] != $extends) {
             continue 2;
@@ -218,7 +229,8 @@ class CRM_UF_Page_ProfileEditor extends CRM_Core_Page {
       if (in_array($fieldName, $locationFields)) {
         $result['schema'][$fieldName]['civiIsLocation'] = TRUE;
       }
-      if (in_array($fieldName, array('phone', 'phone_and_ext'))) { // FIXME what about phone_ext?
+      if (in_array($fieldName, array('phone', 'phone_and_ext'))) {
+        // FIXME what about phone_ext?
         $result['schema'][$fieldName]['civiIsPhone'] = TRUE;
       }
     }