Merge remote-tracking branch 'upstream/4.4' into 4.4-master-2014-04-21-08-12-12
[civicrm-core.git] / api / v3 / Group.php
index 2328439294c8d5ed65d12501098b25df8af1c475..6cc7647ebcab2bdefdd7e066856a75a7995cb195 100644 (file)
@@ -1,11 +1,10 @@
 <?php
-// $Id$
 
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.3                                                |
+ | CiviCRM version 4.5                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013                                |
+ | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
  *
  * @package CiviCRM_APIv3
  * @subpackage API_Group
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
  * @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
  *
@@ -105,10 +99,11 @@ function civicrm_api3_group_get($params) {
   $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 (CRM_Utils_Array::value('group_id', $inputParams)) {
+  if (!empty($inputParams['group_id'])) {
     $inputParams['id'] = $inputParams['group_id'];
   }
   $groupObjects = CRM_Contact_BAO_Group::getGroups($inputParams, $returnProperties, $sort, $offset, $rowCount);