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


PHP CRM_Core_BAO_UFField::setIsActive方法代碼示例

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


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

示例1: setUFField

 /**
  * Enable/disable profile field given a custom field id
  *
  * @param int $customFieldId
  *   Custom field id.
  * @param bool $is_active
  *   Set the is_active field.
  *
  * @return void
  */
 public static function setUFField($customFieldId, $is_active)
 {
     //find the profile id given custom field
     $ufField = new CRM_Core_DAO_UFField();
     $ufField->field_name = "custom_" . $customFieldId;
     $ufField->find();
     while ($ufField->fetch()) {
         //enable/ disable profile
         CRM_Core_BAO_UFField::setIsActive($ufField->id, $is_active);
     }
 }
開發者ID:kidaa30,項目名稱:yes,代碼行數:21,代碼來源:UFField.php

示例2: run

 /**
  * Run the page.
  *
  * This method is called after the page is created. It checks for the  
  * type of action and executes that action. 
  *
  * @return void
  * @access public
  *
  */
 function run()
 {
     // get the group id
     $this->_gid = CRM_Utils_Request::retrieve('gid', $this, false, 0);
     if ($this->_gid) {
         require_once 'CRM/Core/BAO/UFGroup.php';
         $groupTitle = CRM_Core_BAO_UFGroup::getTitle($this->_gid);
         $this->assign('gid', $this->_gid);
         $this->assign('groupTitle', $groupTitle);
         CRM_Utils_System::setTitle(ts('%1 - CiviCRM Profile Fields', array(1 => $groupTitle)));
     }
     // get the requested action
     $action = CRM_Utils_Request::retrieve('action', $this, false, 'browse');
     // default to 'browse'
     // assign vars to templates
     $this->assign('action', $action);
     $id = CRM_Utils_Request::retrieve('id', $this, false, 0);
     // what action to take ?
     if ($action & (CRM_CORE_ACTION_UPDATE | CRM_CORE_ACTION_ADD | CRM_CORE_ACTION_VIEW | CRM_CORE_ACTION_DELETE)) {
         $this->edit($action);
         // no browse for edit/update/view/delete
     } else {
         if ($action & CRM_CORE_ACTION_PREVIEW) {
             $this->preview($id, $this->_gid);
         } else {
             require_once 'CRM/Core/BAO/UFField.php';
             if ($action & CRM_CORE_ACTION_DISABLE) {
                 CRM_Core_BAO_UFField::setIsActive($id, 0);
             } else {
                 if ($action & CRM_CORE_ACTION_ENABLE) {
                     CRM_Core_BAO_UFField::setIsActive($id, 1);
                 }
             }
             $this->browse();
         }
     }
     // Call the parents run method
     parent::run();
 }
開發者ID:bhirsch,項目名稱:voipdrupal-4.7-1.0,代碼行數:49,代碼來源:Field.php


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