Skip to content

Commit

Permalink
Merge pull request #9395 from seamuslee001/CRM-19641
Browse files Browse the repository at this point in the history
CRM-19641
  • Loading branch information
eileenmcnaughton authored Nov 15, 2016
2 parents 47494d2 + 78c187f commit 1d3a357
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions CRM/Case/XMLProcessor/Report.php
Original file line number Diff line number Diff line change
Expand Up @@ -666,10 +666,10 @@ public function getActivityTypeCustomSQL($activityTypeID, $dateFormat = NULL) {
$query = "
SELECT label, value
FROM civicrm_option_value
WHERE option_group_id = {$dao->optionGroupID}
WHERE option_group_id = %1
";

$option = CRM_Core_DAO::executeQuery($query);
$option = CRM_Core_DAO::executeQuery($query, array(1 => array($dao->optionGroupID, 'Positive')));
while ($option->fetch()) {
$dataType = $dao->dataType;
if ($dataType == 'Int' || $dataType == 'Float') {
Expand All @@ -688,8 +688,9 @@ public function getActivityTypeCustomSQL($activityTypeID, $dateFormat = NULL) {

foreach ($sql as $tableName => $values) {
$columnNames = implode(',', $values);
$tableName = CRM_Utils_Type::escape($tableName, 'MysqlColumnNameOrAlias');
$sql[$tableName] = "
SELECT '{$groupTitle[$tableName]}' as groupTitle, $columnNames
SELECT '" . CRM_Core_DAO::escapeString($groupTitle[$tableName]) . "' as groupTitle, $columnNames
FROM $tableName
WHERE entity_id = %1
";
Expand Down

0 comments on commit 1d3a357

Please sign in to comment.