/*
+--------------------------------------------------------------------+
- | 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 $_summary = NULL;
+ /**
+ *
+ */
+ /**
+ *
+ */
function __construct() {
self::validRelationships();
$config = CRM_Core_Config::singleton();
'no_display' => TRUE,
'required' => TRUE,
),
+ 'contact_type' =>
+ array(
+ 'title' => ts('Contact Type'),
+ ),
+ 'contact_sub_type' =>
+ array(
+ 'title' => ts('Contact SubType'),
+ ),
),
'filters' =>
array(
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])) {
if ($tableName == 'civicrm_address') {
$this->_addressField = TRUE;
}
$this->_emailField = TRUE;
}
- if (CRM_Utils_Array::value('statistics', $field)) {
+ if (!empty($field['statistics'])) {
foreach ($field['statistics'] as $stat => $label) {
$select[] = "{$field['dbAlias']} as {$tableName}_{$fieldName}_{$stat}";
$this->_columnHeaders["{$tableName}_{$fieldName}_{$stat}"]['title'] = $label;
$this->_orderBy = " ORDER BY {$this->_aliases['civicrm_contact_organization']}.organization_name, {$this->_aliases['civicrm_relationship']}.$this->orgContact, {$this->_aliases['civicrm_contact']}.sort_name, {$this->_aliases['civicrm_relationship']}.$this->otherContact";
}
+ /**
+ * @param $rows
+ *
+ * @return array
+ */
function statistics(&$rows) {
$statistics = parent::statistics($rows);
$params = array('contact_type_b' => 'Organization', 'version' => 3);
$typesA = &civicrm_api('relationship_type', 'get', $params);
- if (!CRM_Utils_Array::value('is_error', $typesA)) {
+ if (empty($typesA['is_error'])) {
foreach ($typesA['values'] as $rel) {
$relationTypes[$rel['id']][$rel['id'] . '_b_a'] = $rel['label_b_a'];
}
$params = array('contact_type_a' => 'Organization', 'version' => 3);
$typesB = &civicrm_api('relationship_type', 'get', $params);
- if (!CRM_Utils_Array::value('is_error', $typesB)) {
+ if (empty($typesB['is_error'])) {
foreach ($typesB['values'] as $rel) {
$relationTypes[$rel['id']][$rel['id'] . '_a_b'] = $rel['label_a_b'];
}
}
}
+ /**
+ * @param $rows
+ */
function alterDisplay(&$rows) {
// custom code to alter rows
$type = substr($this->_params['relationship_type_id_value'], -3);
}
// convert Organization display name to links
- if (array_key_exists('civicrm_contact_organization_organization_name', $row) &&
- CRM_Utils_Array::value('civicrm_contact_organization_organization_name',
- $rows[$rowNum]
- ) &&
+ if (array_key_exists('civicrm_contact_organization_organization_name', $row) && !empty($rows[$rowNum]
+['civicrm_contact_organization_organization_name']) &&
array_key_exists('civicrm_contact_organization_id', $row)
) {
$url = CRM_Utils_System::url('civicrm/contact/view',