本文整理汇总了PHP中CRM_Utils_Mail::validOutBoundMail方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Utils_Mail::validOutBoundMail方法的具体用法?PHP CRM_Utils_Mail::validOutBoundMail怎么用?PHP CRM_Utils_Mail::validOutBoundMail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Utils_Mail
的用法示例。
在下文中一共展示了CRM_Utils_Mail::validOutBoundMail方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: commonBuildQuickForm
/**
* @param $self
*/
public static function commonBuildQuickForm($self)
{
$contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $self);
if (!$contactId) {
$contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, FALSE, NULL, $_REQUEST);
}
$urlParams = "action=add&reset=1&cid={$contactId}&selectedChild=activity&atype=";
$activityTypes = $urls = array();
$emailTypeId = CRM_Core_OptionGroup::getValue('activity_type', 'Email', 'name');
$letterTypeId = CRM_Core_OptionGroup::getValue('activity_type', 'Print PDF Letter', 'name');
$SMSId = CRM_Core_OptionGroup::getValue('activity_type', 'Text Message (SMS)', 'label');
if (CRM_Utils_Mail::validOutBoundMail() && $contactId) {
list($name, $email, $doNotEmail, $onHold, $isDeseased) = CRM_Contact_BAO_Contact::getContactDetails($contactId);
if (!$doNotEmail && $email && !$isDeseased) {
$activityTypes = array($emailTypeId => ts('Send an Email'));
}
}
if ($contactId && CRM_SMS_BAO_Provider::activeProviderCount()) {
// Check for existence of a mobile phone and ! do not SMS privacy setting
$mobileTypeID = CRM_Core_OptionGroup::getValue('phone_type', 'Mobile', 'name');
list($name, $phone, $doNotSMS) = CRM_Contact_BAO_Contact_Location::getPhoneDetails($contactId, $mobileTypeID);
if (!$doNotSMS && $phone) {
$sendSMS = array($SMSId => ts('Send SMS'));
$activityTypes += $sendSMS;
}
}
// this returns activity types sorted by weight
$otherTypes = CRM_Core_PseudoConstant::activityType(FALSE);
$activityTypes += $otherTypes;
foreach (array_keys($activityTypes) as $typeId) {
if ($typeId == $emailTypeId) {
$urls[$typeId] = CRM_Utils_System::url('civicrm/activity/email/add', "{$urlParams}{$typeId}", FALSE, NULL, FALSE);
} elseif ($typeId == $SMSId) {
$urls[$typeId] = CRM_Utils_System::url('civicrm/activity/sms/add', "{$urlParams}{$typeId}", FALSE, NULL, FALSE);
} elseif ($typeId == $letterTypeId) {
$urls[$typeId] = CRM_Utils_System::url('civicrm/activity/pdf/add', "{$urlParams}{$typeId}", FALSE, NULL, FALSE);
} else {
$urls[$typeId] = CRM_Utils_System::url('civicrm/activity/add', "{$urlParams}{$typeId}", FALSE, NULL, FALSE);
}
}
$self->assign('activityTypes', $activityTypes);
$self->assign('urls', $urls);
$self->assign('suppressForm', TRUE);
}
示例2: buildQuickForm
public function buildQuickForm()
{
$this->applyFilter('__ALL__', 'trim');
$contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
$urlParams = "action=add&reset=1&cid={$contactId}&selectedChild=activity&atype=";
$url = CRM_Utils_System::url('civicrm/contact/view/activity', $urlParams, false, null, false);
$activityType = CRM_Core_PseudoConstant::activityType(false);
$this->assign('emailSetting', false);
require_once 'CRM/Utils/Mail.php';
if (CRM_Utils_Mail::validOutBoundMail() && $contactId) {
$this->assign('emailSetting', true);
require_once 'CRM/Contact/BAO/Contact.php';
list($name, $email, $doNotEmail, $onHold, $isDeseased) = CRM_Contact_BAO_Contact::getContactDetails($contactId);
if (!$doNotEmail && $email && !$isDeseased) {
$activityType += array('3' => ts('Send an Email'));
}
}
$this->applyFilter('__ALL__', 'trim');
$this->add('select', 'other_activity', ts('Other Activities'), array('' => ts('- new activity -')) + $activityType, false, array('onchange' => "if (this.value) window.location='{$url}'+ this.value; else return false"));
$this->assign('suppressForm', true);
}
示例3: buildQuickForm
public function buildQuickForm()
{
$contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
$urlParams = "action=add&reset=1&cid={$contactId}&selectedChild=activity&atype=";
$url = CRM_Utils_System::url('civicrm/contact/view/activity', $urlParams, false, null, false);
$activityTypes = array();
require_once 'CRM/Utils/Mail.php';
if (CRM_Utils_Mail::validOutBoundMail() && $contactId) {
require_once 'CRM/Contact/BAO/Contact.php';
list($name, $email, $doNotEmail, $onHold, $isDeseased) = CRM_Contact_BAO_Contact::getContactDetails($contactId);
if (!$doNotEmail && $email && !$isDeseased) {
$activityTypes = array('3' => ts('Send an Email'));
}
}
// this returns activity types sorted by weight
$otherTypes = CRM_Core_PseudoConstant::activityType(false);
$activityTypes += $otherTypes;
$this->assign('activityTypes', $activityTypes);
$this->assign('url', $url);
$this->assign('suppressForm', true);
}
示例4: array
/**
* These tasks are the core set of tasks that the user can perform
* on a contact / group of contacts
*
* @return array
* the set of tasks for a group of contacts
*/
public static function &taskTitles()
{
self::initTasks();
$titles = array();
foreach (self::$_tasks as $id => $value) {
$titles[$id] = $value['title'];
}
// hack unset update saved search
unset($titles[self::SAVE_SEARCH_UPDATE]);
if (!CRM_Utils_Mail::validOutBoundMail()) {
unset($titles[self::EMAIL_CONTACTS]);
unset($titles[self::CREATE_MAILING]);
}
// CRM-6806
if (!CRM_Core_Permission::check('access deleted contacts') || !CRM_Core_Permission::check('delete contacts')) {
unset($titles[self::DELETE_PERMANENTLY]);
}
asort($titles);
return $titles;
}
示例5: array
/**
* These tasks are the core set of tasks that the user can perform
* on a contact / group of contacts
*
* @return array the set of tasks for a group of contacts
* @static
* @access public
*/
static function &taskTitles()
{
self::initTasks();
$titles = array();
foreach (self::$_tasks as $id => $value) {
$titles[$id] = $value['title'];
}
// hack unset update saved search and print contacts
unset($titles[14]);
unset($titles[15]);
$config =& CRM_Core_Config::singleton();
require_once 'CRM/Utils/Mail.php';
if (!CRM_Utils_Mail::validOutBoundMail()) {
unset($titles[6]);
unset($titles[20]);
}
if (!in_array('CiviSMS', $config->enableComponents)) {
unset($titles[7]);
}
return $titles;
}
示例6: array
/**
* These tasks are the core set of tasks that the user can perform
* on a contact / group of contacts
*
* @return array the set of tasks for a group of contacts
* @static
* @access public
*/
static function &taskTitles()
{
self::initTasks();
$titles = array();
foreach (self::$_tasks as $id => $value) {
$titles[$id] = $value['title'];
}
// hack unset update saved search and print contacts
unset($titles[14]);
unset($titles[15]);
$config = CRM_Core_Config::singleton();
require_once 'CRM/Utils/Mail.php';
if (!CRM_Utils_Mail::validOutBoundMail()) {
unset($titles[6]);
unset($titles[20]);
}
if (!in_array('CiviSMS', $config->enableComponents)) {
unset($titles[7]);
}
// CRM-6806
if (!CRM_Core_Permission::check('access deleted contacts') || !CRM_Core_Permission::check('delete contacts')) {
unset($titles[self::DELETE_PERMANENTLY]);
}
asort($titles);
return $titles;
}