* return string Querymode
*/
public static function getQueryMode($exportMode) {
+ $queryMode = CRM_Contact_BAO_Query::MODE_CONTACTS;
+
switch ($exportMode) {
case CRM_Export_Form_Select::CONTRIBUTE_EXPORT:
$queryMode = CRM_Contact_BAO_Query::MODE_CONTRIBUTE;
*
* return string component
*/
- public static function exportComponent($exportMode) {
+ public static function exportComponent($exportMode) {
switch ($exportMode) {
case CRM_Export_Form_Select::CONTRIBUTE_EXPORT:
$component = 'civicrm_contribution';
'name',
FALSE
);
- $queryMode = CRM_Contact_BAO_Query::MODE_CONTACTS;
$queryMode = self::getQueryMode($exportMode);
}
}
$returnProperties[self::defaultReturnProperty($exportMode)] = 1;
- if ($exportmode == CRM_Export_Form_Select::EVENT_EXPORT && !empty($returnProperties['participant_role'])) {
- unset($returnProperties['participant_role']);
- $returnProperties['participant_role_id'] = 1;
- }
}
else {
$primary = TRUE;
$excludeTrashed = FALSE;
}
}
- if (empty($where) && $excludeTrashed) {
- $where = "WHERE contact_a.is_deleted != 1";
+ $trashClause = $excludeTrashed ? "contact_a.is_deleted != 1" : "( 1 )";
+
+ if (empty($where)) {
+ $where = "WHERE $trashClause";
}
- elseif ($excludeTrashed) {
- $where .= " AND contact_a.is_deleted != 1";
+ else {
+ $where .= " AND $trashClause";
}
$queryString = "$select $from $where $having";
elseif ($field == 'provider_id' || $field == 'im_provider') {
$fieldValue = CRM_Utils_Array::value($fieldValue, $imProviders);
}
- elseif ($field == 'participant_role_id') {
- $participantRoles = CRM_Event_PseudoConstant::participantRole();
- $sep = CRM_Core_DAO::VALUE_SEPARATOR;
- $viewRoles = array();
- foreach (explode($sep, $iterationDAO->$field) as $k => $v) {
- $viewRoles[] = $participantRoles[$v];
- }
- $fieldValue = implode(',', $viewRoles);
- }
elseif ($field == 'master_id') {
$masterAddressId = NULL;
if (isset($iterationDAO->master_id)) {