<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
protected $_customGroupExtends = array(
'Contact', 'Individual', 'Household', 'Organization');
+ /**
+ *
+ */
+ /**
+ *
+ */
function __construct() {
$this->_autoIncludeIndexedFieldsAsOrderBys = 1;
$this->_columns = array(
'dao' => 'CRM_Core_DAO_Phone',
'fields' =>
array(
- 'phone' => NULL,
+ 'phone' => NULL,
'phone_ext' =>
array(
'title' => ts('Phone Extension')
foreach ($this->_columns as $tableName => $table) {
if (array_key_exists('fields', $table)) {
foreach ($table['fields'] as $fieldName => $field) {
- if (CRM_Utils_Array::value('required', $field) ||
- CRM_Utils_Array::value($fieldName, $this->_params['fields'])
- ) {
+ if (!empty($field['required']) || !empty($this->_params['fields'][$fieldName])) {
//isolate the select clause compoenent wise
if (in_array($table['alias'], $this->_component)) {
$select[$table['alias']][] = "{$field['dbAlias']} as {$tableName}_{$fieldName}";
}
foreach ($this->_component as $val) {
- if (CRM_Utils_Array::value($val, $select)) {
+ if (!empty($select[$val])) {
$this->_selectComponent[$val] = "SELECT " . implode(', ', $select[$val]) . " ";
unset($select[$val]);
}
$this->_select = "SELECT " . implode(', ', $select) . " ";
}
+ /**
+ * @param $fields
+ * @param $files
+ * @param $self
+ *
+ * @return array
+ */
static function formRule($fields, $files, $self) {
$errors = array();
return $errors;
$this->_from .= "{$group}";
foreach ($this->_component as $val) {
- if (CRM_Utils_Array::value('contribution_civireport', $this->_selectComponent)) {
+ if (!empty($this->_selectComponent['contribution_civireport'])) {
$this->_formComponent['contribution_civireport'] = " FROM
civicrm_contact {$this->_aliases['civicrm_contact']}
INNER JOIN civicrm_contribution {$this->_aliases['civicrm_contribution']}
{$group}
";
}
- if (CRM_Utils_Array::value('membership_civireport', $this->_selectComponent)) {
+ if (!empty($this->_selectComponent['membership_civireport'])) {
$this->_formComponent['membership_civireport'] = " FROM
civicrm_contact {$this->_aliases['civicrm_contact']}
INNER JOIN civicrm_membership {$this->_aliases['civicrm_membership']}
ON {$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_membership']}.contact_id
{$group} ";
}
- if (CRM_Utils_Array::value('participant_civireport', $this->_selectComponent)) {
+ if (!empty($this->_selectComponent['participant_civireport'])) {
$this->_formComponent['participant_civireport'] = " FROM
civicrm_contact {$this->_aliases['civicrm_contact']}
INNER JOIN civicrm_participant {$this->_aliases['civicrm_participant']}
{$group} ";
}
- if (CRM_Utils_Array::value('activity_civireport', $this->_selectComponent)) {
+ if (!empty($this->_selectComponent['activity_civireport'])) {
$activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
civicrm_case_contact.case_id = civicrm_case.id ";
}
- if (CRM_Utils_Array::value('relationship_civireport', $this->_selectComponent)) {
+ if (!empty($this->_selectComponent['relationship_civireport'])) {
$this->_formComponent['relationship_civireport'] = "FROM
civicrm_relationship {$this->_aliases['civicrm_relationship']}
$this->_where .= " GROUP BY {$this->_aliases['civicrm_contact']}.id ";
}
+ /**
+ * @return array
+ */
function clauseComponent() {
$selectedContacts = implode(',', $this->_contactSelected);
$contribution = $membership = $participant = NULL;
$eligibleResult = $rows = $tempArray = array();
foreach ($this->_component as $val) {
- if (CRM_Utils_Array::value($val, $this->_selectComponent) && ($val != 'activity_civireport' && $val != 'relationship_civireport')) {
+ if (!empty($this->_selectComponent[$val]) && ($val != 'activity_civireport' && $val != 'relationship_civireport')) {
$sql = "{$this->_selectComponent[$val]} {$this->_formComponent[$val]}
WHERE {$this->_aliases['civicrm_contact']}.id IN ( $selectedContacts )
GROUP BY {$this->_aliases['civicrm_contact']}.id,{$val}.id ";
}
}
- if (CRM_Utils_Array::value('relationship_civireport', $this->_selectComponent)) {
+ if (!empty($this->_selectComponent['relationship_civireport'])) {
$relTypes = CRM_Contact_BAO_Relationship::getContactRelationshipType(NULL, 'null', NULL, NULL, TRUE);
}
}
- if (CRM_Utils_Array::value('activity_civireport', $this->_selectComponent)) {
+ if (!empty($this->_selectComponent['activity_civireport'])) {
$componentClause = "civicrm_option_value.component_id IS NULL";
$componentsIn = NULL;
return $rows;
}
+ /**
+ * @param $rows
+ *
+ * @return array
+ */
function statistics(&$rows) {
$statistics = array();
}
//Override to set limit is 10
+ /**
+ * @param int $rowCount
+ */
function limit($rowCount = self::ROW_COUNT_LIMIT) {
parent::limit($rowCount);
}
//Override to set pager with limit is 10
+ /**
+ * @param int $rowCount
+ */
function setPager($rowCount = self::ROW_COUNT_LIMIT) {
parent::setPager($rowCount);
}
$this->endPostProcess();
}
+ /**
+ * @param $rows
+ */
function alterDisplay(&$rows) {
// custom code to alter rows
}
}
+ /**
+ * @param $componentRows
+ */
function alterComponentDisplay(&$componentRows) {
// custom code to alter rows
$activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE);