diff --git a/CRM/Core/BAO/UFGroup.php b/CRM/Core/BAO/UFGroup.php index 4bd03f4..63c7873 100644 --- a/CRM/Core/BAO/UFGroup.php +++ b/CRM/Core/BAO/UFGroup.php @@ -2859,7 +2859,7 @@ public static function commonSendMail($contactID, &$values) { * * @return array */ - public static function checkFieldsEmptyValues($gid, $cid, $params, $skipCheck = FALSE) { + public function checkFieldsEmptyValues($gid, $cid, $params, $skipCheck = FALSE) { if ($gid) { if (CRM_Core_BAO_UFGroup::filterUFGroups($gid, $cid) || $skipCheck) { $values = array(); diff --git a/CRM/Core/Page/AJAX/Location.php b/CRM/Core/Page/AJAX/Location.php index 324ba08..dd688ae 100644 --- a/CRM/Core/Page/AJAX/Location.php +++ b/CRM/Core/Page/AJAX/Location.php @@ -1,7 +1,7 @@ actionLinks())); + $action = array_sum(array_keys(self::actionLinks())); // update enable/disable links depending on uf_group properties. if ($value['is_active']) { @@ -351,10 +351,13 @@ public function browse($action = NULL) { $groupTypes = self::extractGroupTypes($value['group_type']); // drop Create, Edit and View mode links if profile group_type is one of the following: - $groupComponents = array('Contribution', 'Membership', 'Activity', 'Participant', 'Case', 'Grant'); - $componentFound = array_intersect($groupComponents, array_keys($groupTypes)); - if (!empty($componentFound)) { + // Contribution, Membership, Activity, Participant, Case, Grant + $isMixedProfile = CRM_Core_BAO_UFField::checkProfileType($id); + if ($isMixedProfile) { $action -= CRM_Core_Action::ADD; + $action -= CRM_Core_Action::ADVANCED; + $action -= CRM_Core_Action::BASIC; + $action -= CRM_Core_Action::PROFILE; } $ufGroup[$id]['group_type'] = self::formatGroupTypes($groupTypes); diff --git a/CRM/UF/Page/ProfileEditor.php b/CRM/UF/Page/ProfileEditor.php index b54a866..be6740e 100644 --- a/CRM/UF/Page/ProfileEditor.php +++ b/CRM/UF/Page/ProfileEditor.php @@ -243,9 +243,11 @@ public static function getSchema($entityTypes) { public static function convertCiviModelToBackboneModel($extends, $title, $availableFields) { $locationFields = CRM_Core_BAO_UFGroup::getLocationFields(); + // schema in format array($fieldName => $fieldSchema) + // sections in format array($sectionName => $section) $result = array( - 'schema' => array(), // array($fieldName => $fieldSchema) - 'sections' => array(), // array($sectionName => $section) + 'schema' => array(), + 'sections' => array(), ); // build field list @@ -267,8 +269,9 @@ public static function convertCiviModelToBackboneModel($extends, $title, $availa continue 2; } } + // FIXME: type set to "Text" $result['schema'][$fieldName] = array( - 'type' => 'Text', // FIXME, + 'type' => 'Text', 'title' => $field['title'], 'civiFieldType' => $field['field_type'], );