<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.6 |
+ | CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | 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
- * $Id$
- *
+ * @copyright CiviCRM LLC (c) 2004-2015
*/
class CRM_Report_BAO_ReportInstance extends CRM_Report_DAO_ReportInstance {
if (!$instanceID || !isset($params['id'])) {
$params['is_reserved'] = CRM_Utils_Array::value('is_reserved', $params, FALSE);
$params['domain_id'] = CRM_Utils_Array::value('domain_id', $params, CRM_Core_Config::domainID());
+ // CRM-17256 set created_id on report creation.
+ $params['created_id'] = isset($params['created_id']) ? $params['created_id'] : CRM_Core_Session::getLoggedInContactID();
}
if ($instanceID) {
$chart = "&charts=" . $params['charts'];
}
$limitResult = NULL;
- if (CRM_Utils_Array::value('row_count', $params)) {
+ if (!empty($params['row_count'])) {
$limitResult = '&rowCount=' . $params['row_count'];
}
$dashletParams['name'] = "report/{$instance->id}";
}
/**
+ * Retrieve instance.
+ *
* @param array $params
- * @param $defaults
+ * @param array $defaults
*
* @return CRM_Report_DAO_ReportInstance|null
*/