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


PHP CRM_Contact_Form_Search::assign方法代碼示例

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


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

示例1: custom

 /**
  * Generate the custom Data Fields based for those with is_searchable = 1.
  *
  * @param CRM_Contact_Form_Search $form
  */
 public static function custom(&$form)
 {
     $form->add('hidden', 'hidden_custom', 1);
     $extends = array_merge(array('Contact', 'Individual', 'Household', 'Organization'), CRM_Contact_BAO_ContactType::subTypes());
     $groupDetails = CRM_Core_BAO_CustomGroup::getGroupDetail(NULL, TRUE, $extends);
     $form->assign('groupTree', $groupDetails);
     foreach ($groupDetails as $key => $group) {
         $_groupTitle[$key] = $group['name'];
         CRM_Core_ShowHideBlocks::links($form, $group['name'], '', '');
         foreach ($group['fields'] as $field) {
             $fieldId = $field['id'];
             $elementName = 'custom_' . $fieldId;
             if ($field['data_type'] == 'Date' && $field['is_search_range']) {
                 CRM_Core_Form_Date::buildDateRange($form, $elementName, 1, '_from', '_to', ts('From:'), FALSE);
             } else {
                 CRM_Core_BAO_CustomField::addQuickFormElement($form, $elementName, $fieldId, FALSE, FALSE, TRUE);
             }
         }
     }
 }
開發者ID:rameshrr99,項目名稱:civicrm-core,代碼行數:25,代碼來源:Criteria.php

示例2: custom

 /**
  * Generate the custom Data Fields based for those with is_searchable = 1.
  *
  * @param CRM_Contact_Form_Search $form
  */
 public static function custom(&$form)
 {
     $form->add('hidden', 'hidden_custom', 1);
     $extends = array_merge(array('Contact', 'Individual', 'Couple', 'Household', 'Organization'), CRM_Contact_BAO_ContactType::subTypes());
     $groupDetails = CRM_Core_BAO_CustomGroup::getGroupDetail(NULL, TRUE, $extends);
     $form->assign('groupTree', $groupDetails);
     foreach ($groupDetails as $key => $group) {
         $_groupTitle[$key] = $group['name'];
         CRM_Core_ShowHideBlocks::links($form, $group['name'], '', '');
         foreach ($group['fields'] as $field) {
             $fieldId = $field['id'];
             $elementName = 'custom_' . $fieldId;
             CRM_Core_BAO_CustomField::addQuickFormElement($form, $elementName, $fieldId, FALSE, TRUE);
         }
     }
 }
開發者ID:sdekok,項目名稱:civicrm-core,代碼行數:21,代碼來源:Criteria.php


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