/*
+--------------------------------------------------------------------+
- | 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$
*
*/
class CRM_Report_Utils_Report {
+ /**
+ * @param null $instanceID
+ *
+ * @return null|string
+ */
static function getValueFromUrl($instanceID = NULL) {
if ($instanceID) {
$optionVal = CRM_Core_DAO::getFieldValue('CRM_Report_DAO_ReportInstance',
return $optionVal;
}
+ /**
+ * @param null $instanceID
+ *
+ * @return array|bool
+ */
static function getValueIDFromUrl($instanceID = NULL) {
$optionVal = self::getValueFromUrl($instanceID);
return FALSE;
}
+ /**
+ * @param $optionVal
+ *
+ * @return mixed
+ */
static function getInstanceIDForValue($optionVal) {
static $valId = array();
return $valId[$optionVal];
}
+ /**
+ * @param null $path
+ *
+ * @return mixed
+ */
static function getInstanceIDForPath($path = NULL) {
static $valId = array();
return CRM_Utils_Array::value($path, $valId);
}
+ /**
+ * @param $urlValue
+ * @param string $query
+ * @param bool $absolute
+ * @param null $instanceID
+ * @param array $drilldownReport
+ *
+ * @return bool|string
+ */
static function getNextUrl($urlValue, $query = 'reset=1', $absolute = FALSE, $instanceID = NULL, $drilldownReport = array()) {
if ($instanceID) {
$drilldownInstanceID = false;
}
// get instance count for a template
+ /**
+ * @param $optionVal
+ *
+ * @return int|null|string
+ */
static function getInstanceCount($optionVal) {
if (empty($optionVal)) return 0;
return $count;
}
+ /**
+ * @param $fileContent
+ * @param null $instanceID
+ * @param string $outputMode
+ * @param array $attachments
+ *
+ * @return bool
+ */
static function mailReport($fileContent, $instanceID = NULL, $outputMode = 'html', $attachments = array(
)) {
if (!$instanceID) {
$params['toEmail'] = CRM_Utils_Array::value('email_to', $instanceInfo);
$params['cc'] = CRM_Utils_Array::value('email_cc', $instanceInfo);
$params['subject'] = CRM_Utils_Array::value('email_subject', $instanceInfo);
- if (!CRM_Utils_Array::value('attachments', $instanceInfo)) {
+ if (empty($instanceInfo['attachments'])) {
$instanceInfo['attachments'] = array();
}
$params['attachments'] = array_merge(CRM_Utils_Array::value('attachments', $instanceInfo), $attachments);
return CRM_Utils_Mail::send($params);
}
+ /**
+ * @param $form
+ * @param $rows
+ */
static function export2csv(&$form, &$rows) {
//Mark as a CSV file.
header('Content-Type: text/csv');
return $csv;
}
+ /**
+ * @return mixed
+ */
static function getInstanceID() {
$config = CRM_Core_Config::singleton();
}
}
+ /**
+ * @return string
+ */
static function getInstancePath() {
$config = CRM_Core_Config::singleton();
$arg = explode('/', $_GET[$config->userFrameworkURLVar]);
}
}
+ /**
+ * @param $instanceId
+ *
+ * @return bool
+ */
static function isInstancePermissioned($instanceId) {
if (!$instanceId) {
return TRUE;
*
* @instanceId string $str the report instance to check
*
+ * @param $instanceId
+ *
* @return boolean true if yes, else false
* @static
* @access public
return TRUE;
}
+ /**
+ * @param $params
+ *
+ * @return array
+ */
static function processReport($params) {
$instanceId = CRM_Utils_Array::value('instanceId', $params);
return $query_string;
}
+ /**
+ * @param $reportUrl
+ *
+ * @return mixed
+ */
static function getInstanceList($reportUrl) {
static $instanceDetails = array();