From 7a8b61ab71c12a947209a53fd6c8cf9d85fe6bf2 Mon Sep 17 00:00:00 2001 From: Deepak Srivastava Date: Tue, 4 Jun 2013 18:19:57 +0530 Subject: [PATCH] CRM-12623, improvements w.r.t custom table joins and notice fixes ---------------------------------------- * CRM-12623: Create CiviHR Report Template http://issues.civicrm.org/jira/browse/CRM-12623 --- CRM/Report/Form.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php index 0a17416244..73e7cf691c 100644 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@ -137,6 +137,7 @@ class CRM_Report_Form extends CRM_Core_Form { protected $_customGroupExtends = NULL; protected $_customGroupFilters = TRUE; protected $_customGroupGroupBy = FALSE; + protected $_customGroupJoin = 'LEFT JOIN'; /** * build tags filter @@ -2819,8 +2820,9 @@ ORDER BY cg.weight, cf.weight"; continue; } + $customJoin = is_array($this->_customGroupJoin) ? $this->_customGroupJoin[$table] : $this->_customGroupJoin; $this->_from .= " -LEFT JOIN $table {$this->_aliases[$table]} ON {$this->_aliases[$table]}.entity_id = {$this->_aliases[$extendsTable]}.id"; +{$customJoin} {$table} {$this->_aliases[$table]} ON {$this->_aliases[$table]}.entity_id = {$this->_aliases[$extendsTable]}.id"; // handle for ContactReference if (array_key_exists('fields', $prop)) { foreach ($prop['fields'] as $fieldName => $field) { @@ -2959,7 +2961,7 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a function selectedTables() { if (!$this->_selectedTables) { $orderByColumns = array(); - if (is_array($this->_params['order_bys'])) { + if (array_key_exists('order_bys', $this->_params) && is_array($this->_params['order_bys'])) { foreach ($this->_params['order_bys'] as $orderBy) { $orderByColumns[] = $orderBy['column']; } -- 2.25.1