当前位置: 首页>>代码示例>>PHP>>正文


PHP CRM_Utils_Mail::validOutBoundMail方法代码示例

本文整理汇总了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);
 }
开发者ID:FundingWorks,项目名称:civicrm-core,代码行数:47,代码来源:ActivityLinks.php

示例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);
 }
开发者ID:ksecor,项目名称:civicrm,代码行数:21,代码来源:ActivityLinks.php

示例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);
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:21,代码来源:ActivityLinks.php

示例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;
 }
开发者ID:nganivet,项目名称:civicrm-core,代码行数:27,代码来源:Task.php

示例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;
 }
开发者ID:bhirsch,项目名称:civicrm,代码行数:29,代码来源:Task.php

示例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;
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:34,代码来源:Task.php


注:本文中的CRM_Utils_Mail::validOutBoundMail方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。