//log the execution of script CRM_Core_Error::debug_log_message('CiviReportMail.php'); } function initialize() { require_once '../civicrm.config.php'; require_once 'CRM/Core/Config.php'; $config = CRM_Core_Config::singleton(); } function run() { require_once 'CRM/Core/Lock.php'; $lock = new CRM_Core_Lock('CiviReportMail'); if ($lock->isAcquired()) { // try to unset any time limits if (!ini_get('safe_mode')) { set_time_limit(0); } // if there are named sets of settings, use them - otherwise use the default (null) require_once 'CRM/Report/Utils/Report.php'; $result = CRM_Report_Utils_Report::processReport(); echo $result['messages']; } else { throw new Exception('Could not acquire lock, another CiviReportMail process is running'); } $lock->release(); } } session_start(); $obj = new CiviReportMail(); $obj->run();
if (!empty($instanceInfo['title'])) { $obj->assign('reportTitle', $instanceInfo['title']); } else { $obj->assign('reportTitle', $templateInfo['label']); } $wrapper =& new CRM_Utils_Wrapper(); $arguments['urlToSession'] = array(array('urlVar' => 'instanceId', 'type' => 'Positive', 'sessionVar' => 'instanceId', 'default' => 'null')); return $wrapper->run($templateInfo['name'], null, $arguments); } } } session_start(); require_once '../civicrm.config.php'; require_once 'CRM/Core/Config.php'; require_once 'CRM/Report/Page/Instance.php'; require_once 'CRM/Utils/Wrapper.php'; $config =& CRM_Core_Config::singleton(); CRM_Utils_System::authenticateScript(true); require_once 'CRM/Core/Lock.php'; $lock = new CRM_Core_Lock('CiviReportMail'); if ($lock->isAcquired()) { // try to unset any time limits if (!ini_get('safe_mode')) { set_time_limit(0); } // if there are named sets of settings, use them - otherwise use the default (null) CiviReportMail::processReport(); } else { throw new Exception('Could not acquire lock, another CiviReportMail process is running'); } $lock->release();