本文整理汇总了PHP中CRM_Mailing_BAO_Mailing::report方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Mailing_BAO_Mailing::report方法的具体用法?PHP CRM_Mailing_BAO_Mailing::report怎么用?PHP CRM_Mailing_BAO_Mailing::report使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Mailing_BAO_Mailing
的用法示例。
在下文中一共展示了CRM_Mailing_BAO_Mailing::report方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: civicrm_api3_job_rapportagenamailings_mail
/**
* Send a email to ?? with the mailing report of one mailing
*
* @param type $mailing_id
*/
function civicrm_api3_job_rapportagenamailings_mail($mailing_id)
{
global $base_root;
// create a new Cor Page
$page = new CRM_Core_Page();
$page->_mailing_id = $mailing_id;
// create a new template
$template = CRM_Core_Smarty::singleton();
// from CRM/Mailing/Page/Report.php
// check that the user has permission to access mailing id
CRM_Mailing_BAO_Mailing::checkPermission($mailing_id);
$report = CRM_Mailing_BAO_Mailing::report($mailing_id);
//get contents of mailing
CRM_Mailing_BAO_Mailing::getMailingContent($report, $page);
$subject = ts('Mailing Gereed: %1', array(1 => $report['mailing']['name']));
$template->assign('report', $report);
// inlcude $base_root
$template->assign('base_root', $base_root);
$template->assign('subject', $subject);
// from CRM/Core/page.php
// only print
$template->assign('tplFile', 'CRM/Rapportagenamailings/Page/RapportMailing.tpl');
$content = $template->fetch('CRM/common/print.tpl');
CRM_Utils_System::appendTPLFile('CRM/Rapportagenamailings/Page/RapportMailing.tpl', $content, $page->overrideExtraTemplateFileName());
//its time to call the hook.
CRM_Utils_Hook::alterContent($content, 'page', 'CRM/Rapportagenamailings/Page/RapportMailing.tpl', $page);
//echo $content;
// send mail
$params = array('from' => 'frontoffice@vnv.nl', 'toName' => 'Front Office VnV', 'toEmail' => 'frontoffice@vnv.nl', 'subject' => $subject, 'text' => $subject, 'html' => $content, 'replyTo' => 'frontoffice@vnv.nl');
CRM_Utils_Mail::send($params);
}
示例2: run
function run()
{
$this->_mailing_id = CRM_Utils_Request::retrieve('mid', 'Positive', $this);
// check that the user has permission to access mailing id
CRM_Mailing_BAO_Mailing::checkPermission($this->_mailing_id);
$report = CRM_Mailing_BAO_Mailing::report($this->_mailing_id);
//get contents of mailing
CRM_Mailing_BAO_Mailing::getMailingContent($report, $this);
//assign backurl
$context = CRM_Utils_Request::retrieve('context', 'String', $this);
$cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
if ($context == 'activitySelector') {
$backUrl = CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$cid}&selectedChild=activity");
$backUrlTitle = ts('Back to Activities');
} elseif ($context == 'activity') {
$atype = CRM_Utils_Request::retrieve('atype', 'Positive', $this);
$aid = CRM_Utils_Request::retrieve('aid', 'Positive', $this);
$backUrl = CRM_Utils_System::url('civicrm/activity/view', "atype={$atype}&action=view&reset=1&id={$aid}&cid={$cid}&context=activity");
$backUrlTitle = ts('Back to Activity');
} elseif ($context == 'mailing') {
$backUrl = CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$cid}&selectedChild=mailing");
$backUrlTitle = ts('Back to Mailing');
} else {
$backUrl = CRM_Utils_System::url('civicrm/mailing', 'reset=1');
$backUrlTitle = ts('Back to CiviMail');
}
$this->assign('backUrl', $backUrl);
$this->assign('backUrlTitle', $backUrlTitle);
$this->assign('report', $report);
CRM_Utils_System::setTitle(ts('CiviMail Report: %1', array(1 => $report['mailing']['name'])));
return CRM_Core_Page::run();
}
示例3: run
function run()
{
$this->_mailing_id = CRM_Utils_Request::retrieve('mid', $this);
require_once 'CRM/Mailing/BAO/Mailing.php';
$report =& CRM_Mailing_BAO_Mailing::report($this->_mailing_id);
$this->assign('report', $report);
CRM_Utils_System::setTitle(ts('CiviMail Report: %1', array(1 => $report['mailing']['name'])));
parent::run();
}
示例4: preProcess
/**
* Function to set variables up before form is built
*
* @return void
* @access public
*/
public function preProcess()
{
//get the activity values
$activityId = CRM_Utils_Request::retrieve('id', 'Positive', $this);
$context = CRM_Utils_Request::retrieve('context', 'String', $this);
$cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
//check for required permissions, CRM-6264
if ($activityId && !CRM_Activity_BAO_Activity::checkPermission($activityId, CRM_Core_Action::VIEW)) {
CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
}
$session = CRM_Core_Session::singleton();
if (!in_array($context, array('home', 'dashlet', 'dashletFullscreen'))) {
$url = CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$cid}&selectedChild=activity");
} else {
$url = CRM_Utils_System::url('civicrm/dashboard', 'reset=1');
}
$session->pushUserContext($url);
$defaults = array();
$params = array('id' => $activityId);
CRM_Activity_BAO_Activity::retrieve($params, $defaults);
//set activity type name and description to template
list($activityTypeName, $activityTypeDescription) = CRM_Core_BAO_OptionValue::getActivityTypeDetails($defaults['activity_type_id']);
$this->assign('activityTypeName', $activityTypeName);
$this->assign('activityTypeDescription', $activityTypeDescription);
if (CRM_Utils_Array::value('mailingId', $defaults)) {
$this->_mailing_id = CRM_Utils_Array::value('source_record_id', $defaults);
$mailingReport = CRM_Mailing_BAO_Mailing::report($this->_mailing_id, TRUE);
CRM_Mailing_BAO_Mailing::getMailingContent($mailingReport, $this);
$this->assign('mailingReport', $mailingReport);
$full_open_report = CRM_Mailing_Event_BAO_Opened::getRows($this->_mailing_id, NULL, FALSE, NULL, NULL, NULL, $cid);
$this->assign('openreport', $full_open_report);
$click_thru_report = CRM_Mailing_Event_BAO_TrackableURLOpen::getRows($this->_mailing_id, NULL, FALSE, NULL, NULL, NULL, NULL, $cid);
$this->assign('clickreport', $click_thru_report);
}
foreach ($defaults as $key => $value) {
if (substr($key, -3) != '_id') {
$values[$key] = $value;
}
}
//get the campaign
if ($campaignId = CRM_Utils_Array::value('campaign_id', $defaults)) {
$campaigns = CRM_Campaign_BAO_Campaign::getCampaigns($campaignId);
$values['campaign'] = $campaigns[$campaignId];
}
if ($engagementLevel = CRM_Utils_Array::value('engagement_level', $defaults)) {
$engagementLevels = CRM_Campaign_PseudoConstant::engagementLevel();
$values['engagement_level'] = CRM_Utils_Array::value($engagementLevel, $engagementLevels, $engagementLevel);
}
$values['attachment'] = CRM_Core_BAO_File::attachmentInfo('civicrm_activity', $activityId);
$this->assign('values', $values);
}
示例5: preProcess
/**
* Function to set variables up before form is built
*
* @return void
* @access public
*/
public function preProcess()
{
//get the activity values
$activityId = CRM_Utils_Request::retrieve('id', 'Positive', $this);
$context = CRM_Utils_Request::retrieve('context', 'String', $this);
$cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
//check for required permissions, CRM-6264
if ($activityId && !CRM_Activity_BAO_Activity::checkPermission($activityId, CRM_Core_Action::VIEW)) {
CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
}
$session = CRM_Core_Session::singleton();
if ($context != 'home') {
$url = CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$cid}&selectedChild=activity");
} else {
$url = CRM_Utils_System::url('civicrm/dashboard', 'reset=1');
}
$session->pushUserContext($url);
$params = array('id' => $activityId);
CRM_Activity_BAO_Activity::retrieve($params, $defaults);
//set activity type name and description to template
require_once 'CRM/Core/BAO/OptionValue.php';
list($activityTypeName, $activityTypeDescription) = CRM_Core_BAO_OptionValue::getActivityTypeDetails($defaults['activity_type_id']);
$this->assign('activityTypeName', $activityTypeName);
$this->assign('activityTypeDescription', $activityTypeDescription);
if (CRM_Utils_Array::value('mailingId', $defaults)) {
$this->_mailing_id = CRM_Utils_Array::value('source_record_id', $defaults);
require_once 'CRM/Mailing/BAO/Mailing.php';
$mailingReport =& CRM_Mailing_BAO_Mailing::report($this->_mailing_id, true);
CRM_Mailing_BAO_Mailing::getMailingContent($mailingReport, $this);
$this->assign('mailingReport', $mailingReport);
}
foreach ($defaults as $key => $value) {
if (substr($key, -3) != '_id') {
$values[$key] = $value;
}
}
require_once 'CRM/Core/BAO/File.php';
$values['attachment'] = CRM_Core_BAO_File::attachmentInfo('civicrm_activity', $activityId);
$this->assign('values', $values);
}
示例6: run
function run()
{
$this->_mailing_id = CRM_Utils_Request::retrieve('mid', 'Positive', $this);
// check that the user has permission to access mailing id
require_once 'CRM/Mailing/BAO/Mailing.php';
CRM_Mailing_BAO_Mailing::checkPermission($this->_mailing_id);
require_once 'CRM/Mailing/BAO/Mailing.php';
$report =& CRM_Mailing_BAO_Mailing::report($this->_mailing_id);
// #6835 Email Mutithreading
//if ( count($report['jobs']) > 1 ) {
// CRM_Core_Error::statusBounce(ts('Selected Mailing has more than one live job.'));
//}
//get contents of mailing
CRM_Mailing_BAO_Mailing::getMailingContent($report, $this);
//assign backurl
$context = CRM_Utils_Request::retrieve('context', 'String', $this);
$cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
if ($context == 'activitySelector') {
$backUrl = CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$cid}&selectedChild=activity");
$backUrlTitle = ts('Back to Activities');
} else {
if ($context == 'activity') {
$atype = CRM_Utils_Request::retrieve('atype', 'Positive', $this);
$aid = CRM_Utils_Request::retrieve('aid', 'Positive', $this);
$backUrl = CRM_Utils_System::url('civicrm/activity/view', "atype={$atype}&action=view&reset=1&id={$aid}&cid={$cid}&context=activity");
$backUrlTitle = ts('Back to Activity');
} else {
$backUrl = CRM_Utils_System::url('civicrm/mailing', 'reset=1');
$backUrlTitle = ts('Back to CiviMail');
}
}
$this->assign('backUrl', $backUrl);
$this->assign('backUrlTitle', $backUrlTitle);
$this->assign('report', $report);
CRM_Utils_System::setTitle(ts('CiviMail Report: %1', array(1 => $report['mailing']['name'])));
parent::run();
}
示例7: run
/**
* @return string
*/
public function run()
{
$this->_mailing_id = CRM_Utils_Request::retrieve('mid', 'Positive', $this);
//CRM-15979 - check if abtest exist for mailing then redirect accordingly
$abtest = CRM_Mailing_BAO_MailingAB::getABTest($this->_mailing_id);
if (!empty($abtest) && !empty($abtest->id)) {
CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/a/', NULL, TRUE, '/abtest/' . $abtest->id));
}
// check that the user has permission to access mailing id
CRM_Mailing_BAO_Mailing::checkPermission($this->_mailing_id);
$report = CRM_Mailing_BAO_Mailing::report($this->_mailing_id);
// get contents of mailing
CRM_Mailing_BAO_Mailing::getMailingContent($report, $this);
// assign backurl
$context = CRM_Utils_Request::retrieve('context', 'String', $this);
$cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
if ($context == 'activitySelector') {
$backUrl = CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$cid}&selectedChild=activity");
$backUrlTitle = ts('Back to Activities');
} elseif ($context == 'activity') {
$atype = CRM_Utils_Request::retrieve('atype', 'Positive', $this);
$aid = CRM_Utils_Request::retrieve('aid', 'Positive', $this);
$backUrl = CRM_Utils_System::url('civicrm/activity/view', "atype={$atype}&action=view&reset=1&id={$aid}&cid={$cid}&context=activity");
$backUrlTitle = ts('Back to Activity');
} elseif ($context == 'mailing') {
$backUrl = CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$cid}&selectedChild=mailing");
$backUrlTitle = ts('Back to Mailing');
} else {
$backUrl = CRM_Utils_System::url('civicrm/mailing', 'reset=1');
$backUrlTitle = ts('Back to CiviMail');
}
$this->assign('backUrl', $backUrl);
$this->assign('backUrlTitle', $backUrlTitle);
$this->assign('report', $report);
CRM_Utils_System::setTitle(ts('CiviMail Report: %1', array(1 => $report['mailing']['name'])));
$this->assign('public_url', CRM_Mailing_BAO_Mailing::getPublicViewUrl($this->_mailing_id));
return CRM_Core_Page::run();
}