projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #4768 from rohankatkar/CRM-10331Fix
[civicrm-core.git]
/
CRM
/
Contact
/
BAO
/
GroupContact.php
diff --git
a/CRM/Contact/BAO/GroupContact.php
b/CRM/Contact/BAO/GroupContact.php
index 28aefe2244df27c8cb55b56887efa5f6264a4920..b7d75d17cfc8a80f6a3a2da9af9004a70f0e9ff0 100644
(file)
--- a/
CRM/Contact/BAO/GroupContact.php
+++ b/
CRM/Contact/BAO/GroupContact.php
@@
-35,14
+35,14
@@
class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact {
/**
class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact {
/**
- *
c
lass constructor
+ *
C
lass constructor
*/
function __construct() {
parent::__construct();
}
/**
*/
function __construct() {
parent::__construct();
}
/**
- *
t
akes an associative array and creates a groupContact object
+ *
T
akes an associative array and creates a groupContact object
*
* the function extract all the params it needs to initialize the create a
* group object. the params array could contain additional unused name/value
*
* the function extract all the params it needs to initialize the create a
* group object. the params array could contain additional unused name/value
@@
-50,7
+50,7
@@
class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact {
*
* @param array $params (reference ) an assoc array of name/value pairs
*
*
* @param array $params (reference ) an assoc array of name/value pairs
*
- * @return
object
CRM_Contact_BAO_Group object
+ * @return CRM_Contact_BAO_Group object
* @access public
* @static
*/
* @access public
* @static
*/
@@
-93,8
+93,6
@@
class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact {
* @param array $params input parameters to find object
* @param array $values output values of the object
*
* @param array $params input parameters to find object
* @param array $values output values of the object
*
- * @internal param array $ids the array that holds all the db ids
- *
* @return array (reference) the values that could be potentially assigned to smarty
* @access public
* @static
* @return array (reference) the values that could be potentially assigned to smarty
* @access public
* @static
@@
-268,7
+266,7
@@
class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact {
}
/**
}
/**
- *
Function to g
et list of all the groups and groups for a contact
+ *
G
et list of all the groups and groups for a contact
*
* @param int $contactId contact id
*
*
* @param int $contactId contact id
*
@@
-311,7
+309,7
@@
class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact {
}
/**
}
/**
- *
Function to g
et the list of groups for contact based on status of group membership
+ *
G
et the list of groups for contact based on status of group membership
*
* @param int $contactId contact id
* @param string $status state of membership
*
* @param int $contactId contact id
* @param string $status state of membership
@@
-336,7
+334,8
@@
class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact {
$count = FALSE,
$ignorePermission = FALSE,
$onlyPublicGroups = FALSE,
$count = FALSE,
$ignorePermission = FALSE,
$onlyPublicGroups = FALSE,
- $excludeHidden = TRUE
+ $excludeHidden = TRUE,
+ $groupId = NULL
) {
if ($count) {
$select = 'SELECT count(DISTINCT civicrm_group_contact.id)';
) {
if ($count) {
$select = 'SELECT count(DISTINCT civicrm_group_contact.id)';
@@
-364,6
+363,10
@@
class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact {
$where .= ' AND civicrm_group_contact.status = %2';
$params[2] = array($status, 'String');
}
$where .= ' AND civicrm_group_contact.status = %2';
$params[2] = array($status, 'String');
}
+ if (!empty($groupId)) {
+ $where .= " AND civicrm_group.id = %3 ";
+ $params[3] = array($groupId, 'Integer');
+ }
$tables = array(
'civicrm_group_contact' => 1,
'civicrm_group' => 1,
$tables = array(
'civicrm_group_contact' => 1,
'civicrm_group' => 1,
@@
-496,7
+499,7
@@
SELECT *
}
/**
}
/**
- *
t
akes an associative array and creates / removes
+ *
T
akes an associative array and creates / removes
* contacts from the groups
*
*
* contacts from the groups
*
*
@@
-559,8
+562,8
@@
SELECT *
}
/**
}
/**
- * @param $contactID
- * @param $groupID
+ * @param
int
$contactID
+ * @param
int
$groupID
*
* @return bool
*/
*
* @return bool
*/
@@
-694,13
+697,11
@@
AND group_id IN ( $groupIDString )
/**
* Given an array of contact ids, add all the contacts to the group
*
/**
* Given an array of contact ids, add all the contacts to the group
*
- * @param
$contactIDs
- * @param
$groupID
+ * @param
array $contactIDs the array of contact ids to be added
+ * @param
int $groupID the id of the group
* @param string $method
* @param string $status
* @param null $tracking
* @param string $method
* @param string $status
* @param null $tracking
- * @internal param array $contactIds (reference ) the array of contact ids to be added
- * @internal param int $groupId the id of the group
*
* @return array (total, added, notAdded) count of contacts added to group
* @access public
*
* @return array (total, added, notAdded) count of contacts added to group
* @access public