+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
* $Id$
*
*/
protected $_nonDisplayFields = array();
/**
- */
- /**
+ * Class constructor.
*/
public function __construct() {
// There could be multiple contacts. We not clear on which contact id to display.
/**
* Adding address fields with dbAlias for order clause.
+ *
+ * @param bool $orderBy
+ *
* @return array
- * address fields
+ * Address fields
*/
public function addressFields($orderBy = FALSE) {
$address = parent::addAddressFields(FALSE, TRUE);
CRM_Core_Error::fatal(ts('Current filter criteria didn\'t have any target contact to add to group'));
}
- $query = "{$this->_select}
+ $new_select = 'AS addtogroup_contact_id';
+ $select = str_ireplace('AS civicrm_contact_contact_target_id', $new_select, $this->_select);
+ $new_having = ' addtogroup_contact_id';
+ $having = str_ireplace(' civicrm_contact_contact_target_id', $new_having, $this->_having);
+ $query = "$select
FROM civireport_activity_temp_target tar
-GROUP BY civicrm_activity_id {$this->_having} {$this->_orderBy}";
+GROUP BY civicrm_activity_id $having {$this->_orderBy}";
$select = 'AS addtogroup_contact_id';
$query = str_ireplace('AS civicrm_contact_contact_target_id', $select, $query);
$dao = CRM_Core_DAO::executeQuery($query);
}
/**
- * @param $rows
+ * Alter display of rows.
+ *
+ * Iterate through the rows retrieved via SQL and make changes for display purposes,
+ * such as rendering contacts as links.
+ *
+ * @param array $rows
+ * Rows generated by SQL, with an array for each row.
*/
public function alterDisplay(&$rows) {
- // custom code to alter rows
-
$entryFound = FALSE;
$activityType = CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE);
$activityStatus = CRM_Core_PseudoConstant::activityStatus();
$viewLinks = FALSE;
- $seperator = CRM_Core_DAO::VALUE_SEPARATOR;
$context = CRM_Utils_Request::retrieve('context', 'String', $this, FALSE, 'report');
$actUrl = '';
}
}
- if (array_key_exists('civicrm_activity_details', $row)) {
+ if (array_key_exists('civicrm_activity_details', $row) && $this->_outputMode == 'html') {
if ($value = $row['civicrm_activity_details']) {
$fullDetails = $rows[$rowNum]['civicrm_activity_details'];
$rows[$rowNum]['civicrm_activity_details'] = substr($fullDetails, 0, strrpos(substr($fullDetails, 0, 80), ' '));