<?php
-// $Id$
/*
+--------------------------------------------------------------------+
* @version $Id: Group.php 30171 2010-10-14 09:11:27Z mover $
*/
-/**
- * Include utility functions
- */
-require_once 'CRM/Contact/BAO/Group.php';
-
/**
* create/update group
*
return civicrm_api3_create_success($values, $params, 'group', 'create', $group);
}
}
-/*
+
+/**
* Adjust Metadata for Create action
*
* The metadata is used for setting defaults, documentation & validation
*/
function civicrm_api3_group_get($params) {
- $options = _civicrm_api3_get_options_from_params($params, TRUE, 'get');
+ $options = _civicrm_api3_get_options_from_params($params, TRUE, 'group', 'get');
$sort = CRM_Utils_Array::value('sort', $options, NULL);
$offset = CRM_Utils_Array::value('offset', $options);
$rowCount = CRM_Utils_Array::value('limit', $options);
$inputParams = CRM_Utils_Array::value('input_params', $options, array());
if(is_array($returnProperties) && !empty($returnProperties)){
// group function takes $returnProperties in non standard format & doesn't add id
+ unset($returnProperties['group_id']);
$returnProperties['id'] = 1;
$returnProperties = array_keys($returnProperties);
}
+ if (!empty($inputParams['group_id'])) {
+ $inputParams['id'] = $inputParams['group_id'];
+ }
$groupObjects = CRM_Contact_BAO_Group::getGroups($inputParams, $returnProperties, $sort, $offset, $rowCount);
if (empty($groupObjects)) {
return civicrm_api3_create_success(FALSE);