當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CRM_Core_BAO_UFMatch::updateContactEmail方法代碼示例

本文整理匯總了PHP中CRM_Core_BAO_UFMatch::updateContactEmail方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_Core_BAO_UFMatch::updateContactEmail方法的具體用法?PHP CRM_Core_BAO_UFMatch::updateContactEmail怎麽用?PHP CRM_Core_BAO_UFMatch::updateContactEmail使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CRM_Core_BAO_UFMatch的用法示例。


在下文中一共展示了CRM_Core_BAO_UFMatch::updateContactEmail方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getEditHTML


//.........這裏部分代碼省略.........
  * @param boolean $reset     should we reset the form?
  * @param int     $profileID do we have the profile ID?
  *
  * @return string       the html for the form on success, otherwise empty string
  * @static
  * @access public
  */
 static function getEditHTML($userID, $title, $action = null, $register = false, $reset = false, $profileID = null, $doNotProcess = false, $ctype = null)
 {
     require_once "CRM/Core/Controller/Simple.php";
     $session =& CRM_Core_Session::singleton();
     if ($register) {
         $controller =& new CRM_Core_Controller_Simple('CRM_Profile_Form_Dynamic', ts('Dynamic Form Creator'), $action);
         if ($reset || $doNotProcess) {
             // hack to make sure we do not process this form
             $oldQFDefault = CRM_Utils_Array::value('_qf_default', $_POST);
             unset($_POST['_qf_default']);
             unset($_REQUEST['_qf_default']);
             if ($reset) {
                 $controller->reset();
             }
         }
         $controller->set('id', $userID);
         $controller->set('register', 1);
         $controller->set('skipPermission', 1);
         $controller->set('ctype', $ctype);
         $controller->process();
         if ($doNotProcess) {
             $controller->validate();
         }
         $controller->setEmbedded(true);
         //CRM-5839 - though we want to process form, get the control back.
         $controller->setSkipRedirection($doNotProcess ? false : true);
         $controller->run();
         // we are done processing so restore the POST/REQUEST vars
         if (($reset || $doNotProcess) && $oldQFDefault) {
             $_POST['_qf_default'] = $_REQUEST['_qf_default'] = $oldQFDefault;
         }
         $template =& CRM_Core_Smarty::singleton();
         return trim($template->fetch('CRM/Profile/Form/Dynamic.tpl'));
     } else {
         if (!$profileID) {
             // make sure we have a valid group
             $group =& new CRM_Core_DAO_UFGroup();
             $group->title = $title;
             if ($group->find(true)) {
                 $profileID = $group->id;
             }
         }
         if ($profileID) {
             // make sure profileID and ctype match if ctype exists
             if ($ctype) {
                 require_once 'CRM/Core/BAO/UFField.php';
                 $profileType = CRM_Core_BAO_UFField::getProfileType($profileID);
                 if (CRM_Contact_BAO_ContactType::isaSubType($profileType)) {
                     $profileType = CRM_Contact_BAO_ContactType::getBasicType($profileType);
                 }
                 if ($profileType != 'Contact' && $profileType != $ctype) {
                     return null;
                 }
             }
             $controller =& new CRM_Core_Controller_Simple('CRM_Profile_Form_Dynamic', ts('Dynamic Form Creator'), $action);
             if ($reset) {
                 $controller->reset();
             }
             $controller->set('gid', $profileID);
             $controller->set('id', $userID);
             $controller->set('register', 0);
             $controller->set('skipPermission', 1);
             if ($ctype) {
                 $controller->set('ctype', $ctype);
             }
             $controller->process();
             $controller->setEmbedded(true);
             //CRM-5846 - give the control back to drupal.
             $controller->setSkipRedirection($doNotProcess ? false : true);
             $controller->run();
             $template =& CRM_Core_Smarty::singleton();
             $templateFile = "CRM/Profile/Form/{$profileID}/Dynamic.tpl";
             if (!$template->template_exists($templateFile)) {
                 $templateFile = "CRM/Profile/Form/Dynamic.tpl";
             }
             return trim($template->fetch($templateFile));
         } else {
             require_once 'CRM/Contact/BAO/Contact/Location.php';
             $userEmail = CRM_Contact_BAO_Contact_Location::getEmailDetails($userID);
             // if post not empty then only proceed
             if (!empty($_POST)) {
                 // get the new email
                 $config =& CRM_Core_Config::singleton();
                 $email = CRM_Utils_Array::value('mail', $_POST);
                 if (CRM_Utils_Rule::email($email) && $email != $userEmail[1]) {
                     require_once 'CRM/Core/BAO/UFMatch.php';
                     CRM_Core_BAO_UFMatch::updateContactEmail($userID, $email);
                 }
             }
         }
     }
     return '';
 }
開發者ID:bhirsch,項目名稱:voipdev,代碼行數:101,代碼來源:UFGroup.php

示例2: getEditHTML


//.........這裏部分代碼省略.........
  *   the html for the form on success, otherwise empty string
  */
 public static function getEditHTML($userID, $title, $action = NULL, $register = FALSE, $reset = FALSE, $profileID = NULL, $doNotProcess = FALSE, $ctype = NULL)
 {
     if ($register) {
         $controller = new CRM_Core_Controller_Simple('CRM_Profile_Form_Dynamic', ts('Dynamic Form Creator'), $action);
         if ($reset || $doNotProcess) {
             // hack to make sure we do not process this form
             $oldQFDefault = CRM_Utils_Array::value('_qf_default', $_POST);
             unset($_POST['_qf_default']);
             unset($_REQUEST['_qf_default']);
             if ($reset) {
                 $controller->reset();
             }
         }
         $controller->set('id', $userID);
         $controller->set('register', 1);
         $controller->set('skipPermission', 1);
         $controller->set('ctype', $ctype);
         $controller->process();
         if ($doNotProcess || !empty($_POST)) {
             $controller->validate();
         }
         $controller->setEmbedded(TRUE);
         //CRM-5839 - though we want to process form, get the control back.
         $controller->setSkipRedirection($doNotProcess ? FALSE : TRUE);
         $controller->run();
         // we are done processing so restore the POST/REQUEST vars
         if (($reset || $doNotProcess) && $oldQFDefault) {
             $_POST['_qf_default'] = $_REQUEST['_qf_default'] = $oldQFDefault;
         }
         $template = CRM_Core_Smarty::singleton();
         // Hide CRM error messages if they are displayed using drupal form_set_error.
         if (!empty($_POST)) {
             $template->assign('suppressForm', TRUE);
         }
         return trim($template->fetch('CRM/Profile/Form/Dynamic.tpl'));
     } else {
         if (!$profileID) {
             // make sure we have a valid group
             $group = new CRM_Core_DAO_UFGroup();
             $group->title = $title;
             if ($group->find(TRUE)) {
                 $profileID = $group->id;
             }
         }
         if ($profileID) {
             // make sure profileID and ctype match if ctype exists
             if ($ctype) {
                 $profileType = CRM_Core_BAO_UFField::getProfileType($profileID);
                 if (CRM_Contact_BAO_ContactType::isaSubType($profileType)) {
                     $profileType = CRM_Contact_BAO_ContactType::getBasicType($profileType);
                 }
                 if ($profileType != 'Contact' && $profileType != $ctype) {
                     return NULL;
                 }
             }
             $controller = new CRM_Core_Controller_Simple('CRM_Profile_Form_Dynamic', ts('Dynamic Form Creator'), $action);
             if ($reset) {
                 $controller->reset();
             }
             $controller->set('gid', $profileID);
             $controller->set('id', $userID);
             $controller->set('register', 0);
             $controller->set('skipPermission', 1);
             if ($ctype) {
                 $controller->set('ctype', $ctype);
             }
             $controller->process();
             $controller->setEmbedded(TRUE);
             //CRM-5846 - give the control back to drupal.
             $controller->setSkipRedirection($doNotProcess ? FALSE : TRUE);
             $controller->run();
             $template = CRM_Core_Smarty::singleton();
             // Hide CRM error messages if they are displayed using drupal form_set_error.
             if (!empty($_POST) && CRM_Core_Config::singleton()->userFramework == 'Drupal') {
                 if (arg(0) == 'user' || arg(0) == 'admin' && arg(1) == 'people') {
                     $template->assign('suppressForm', TRUE);
                 }
             }
             $templateFile = "CRM/Profile/Form/{$profileID}/Dynamic.tpl";
             if (!$template->template_exists($templateFile)) {
                 $templateFile = 'CRM/Profile/Form/Dynamic.tpl';
             }
             return trim($template->fetch($templateFile));
         } else {
             $userEmail = CRM_Contact_BAO_Contact_Location::getEmailDetails($userID);
             // if post not empty then only proceed
             if (!empty($_POST)) {
                 // get the new email
                 $config = CRM_Core_Config::singleton();
                 $email = CRM_Utils_Array::value('mail', $_POST);
                 if (CRM_Utils_Rule::email($email) && $email != $userEmail[1]) {
                     CRM_Core_BAO_UFMatch::updateContactEmail($userID, $email);
                 }
             }
         }
     }
     return '';
 }
開發者ID:rollox,項目名稱:civicrm-core,代碼行數:101,代碼來源:UFGroup.php

示例3: getEditHTML

 /**
  * get the html for the form that represents this particular group
  *
  * @param int     $userID    the user id that we are actually editing
  * @param string  $title     the title of the group we are interested in
  * @param int     $action    the action of the form
  * @param boolean $register  is this the registration form
  * @param boolean $reset     should we reset the form?
  * @param int     $profileID do we have the profile ID?
  *
  * @return string       the html for the form on success, otherwise empty string
  * @static
  * @access public
  */
 function getEditHTML($userID, $title, $action = null, $register = false, $reset = false, $profileID = null)
 {
     $session =& CRM_Core_Session::singleton();
     if ($register) {
         $controller =& new CRM_Core_Controller_Simple('CRM_Profile_Form_Dynamic', ts('Dynamic Form Creator'), $action);
         if ($reset) {
             // hack to make sure we do not process this form
             $oldQFDefault = $_POST['_qf_default'];
             unset($_POST['_qf_default']);
             unset($_REQUEST['_qf_default']);
             $controller->reset();
         }
         $controller->set('id', $userID);
         $controller->set('register', 1);
         $controller->process();
         $controller->setEmbedded(true);
         $controller->run();
         // we are done processing so restore the POST/REQUEST vars
         if ($reset) {
             $_POST['_qf_default'] = $_REQUEST['_qf_default'] = $oldQFDefault;
         }
         $template =& CRM_Core_Smarty::singleton();
         return trim($template->fetch('CRM/Profile/Form/Dynamic.tpl'));
     } else {
         if (!$profileID) {
             // make sure we have a valid group
             $group =& new CRM_Core_DAO_UFGroup();
             $group->title = $title;
             $group->domain_id = CRM_Core_Config::domainID();
             if ($group->find(true)) {
                 $profileID = $group->id;
             }
         }
         if ($profileID) {
             require_once 'CRM/Core/Controller/Simple.php';
             $controller =& new CRM_Core_Controller_Simple('CRM_Profile_Form_Dynamic', ts('Dynamic Form Creator'), $action);
             if ($reset) {
                 $controller->reset();
             }
             $controller->set('gid', $profileID);
             $controller->set('id', $userID);
             $controller->set('register', 0);
             $controller->process();
             $controller->setEmbedded(true);
             $controller->run();
             $template =& CRM_Core_Smarty::singleton();
             return trim($template->fetch('CRM/Profile/Form/Dynamic.tpl'));
         } else {
             // fix for CRM 701
             require_once 'CRM/Contact/BAO/Contact.php';
             $userEmail = CRM_Contact_BAO_Contact::getEmailDetails($userID);
             // if post not empty then only proceed
             if (!empty($_POST)) {
                 if (CRM_Utils_Rule::email($_POST['edit']['mail']) && $_POST['edit']['mail'] != $userEmail[1]) {
                     require_once 'CRM/Core/BAO/UFMatch.php';
                     CRM_Core_BAO_UFMatch::updateContactEmail($userID, $_POST['edit']['mail']);
                 }
             }
         }
     }
     return '';
 }
開發者ID:bhirsch,項目名稱:voipdrupal-4.7-1.0,代碼行數:76,代碼來源:UFGroup.php


注:本文中的CRM_Core_BAO_UFMatch::updateContactEmail方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。