Skip to content
This repository has been archived by the owner on Jul 19, 2022. It is now read-only.

Commit

Permalink
GEP-84, updated core file
Browse files Browse the repository at this point in the history
  • Loading branch information
pradpnayak committed Mar 30, 2016
1 parent 783da7e commit 04e0324
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CRM/Core/BAO/UFGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion CRM/Core/Page/AJAX/Location.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
Expand Down
13 changes: 8 additions & 5 deletions CRM/UF/Page/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class CRM_UF_Page_Group extends CRM_Core_Page {
*
* @return array
*/
public function &actionLinks() {
public static function &actionLinks() {
// check if variable _actionsLinks is populated
if (!self::$_actionLinks) {
// helper variable for nicer formatting
Expand Down Expand Up @@ -331,7 +331,7 @@ public function browse($action = NULL) {
$ufGroup[$id]['is_reserved'] = $value['is_reserved'];

// form all action links
$action = array_sum(array_keys($this->actionLinks()));
$action = array_sum(array_keys(self::actionLinks()));

// update enable/disable links depending on uf_group properties.
if ($value['is_active']) {
Expand All @@ -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);
Expand Down
9 changes: 6 additions & 3 deletions CRM/UF/Page/ProfileEditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'],
);
Expand Down

0 comments on commit 04e0324

Please sign in to comment.