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


PHP CRM_Core_BAO_UFGroup::getReservedProfiles方法代码示例

本文整理汇总了PHP中CRM_Core_BAO_UFGroup::getReservedProfiles方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_BAO_UFGroup::getReservedProfiles方法的具体用法?PHP CRM_Core_BAO_UFGroup::getReservedProfiles怎么用?PHP CRM_Core_BAO_UFGroup::getReservedProfiles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CRM_Core_BAO_UFGroup的用法示例。


在下文中一共展示了CRM_Core_BAO_UFGroup::getReservedProfiles方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: buildQuickForm

 function buildQuickForm(&$form)
 {
     // call to build contact autocomplete
     $attributes = array('width' => '200px');
     $form->add('text', "contact", ts('Select Contact'), $attributes);
     $form->addElement('hidden', "contact_select_id");
     if (CRM_Core_Permission::check('edit all contacts') || CRM_Core_Permission::check('add contacts')) {
         // build select for new contact
         require_once 'CRM/Core/BAO/UFGroup.php';
         $contactProfiles = CRM_Core_BAO_UFGroup::getReservedProfiles();
         $form->add('select', 'profiles', ts('Create New Contact'), array('' => ts('- create new contact -')) + $contactProfiles, false, array('onChange' => "if (this.value) newContact( this.value );"));
     }
 }
开发者ID:bhirsch,项目名称:voipdev,代码行数:13,代码来源:NewContact.php

示例2: buildQuickForm

 /**
  * Function used to build form element for new contact or select contact widget
  *
  * @param object   $form form object
  * @param int      $blocNo by default it is one, except for address block where it is
  * build for each block
  * @param array    $extrProfiles extra profiles that should be included besides reserved
  *
  * @access public
  *
  * @return void
  */
 static function buildQuickForm(&$form, $blockNo = 1, $extraProfiles = NULL, $required = FALSE, $prefix = '')
 {
     // call to build contact autocomplete
     $attributes = array('width' => '200px');
     $form->add('text', "{$prefix}contact[{$blockNo}]", ts('Select Contact'), $attributes, $required);
     $form->addElement('hidden', "{$prefix}contact_select_id[{$blockNo}]");
     if (CRM_Core_Permission::check('edit all contacts') || CRM_Core_Permission::check('add contacts')) {
         // build select for new contact
         $contactProfiles = CRM_Core_BAO_UFGroup::getReservedProfiles('Contact', $extraProfiles);
         $form->add('select', "{$prefix}profiles[{$blockNo}]", ts('Create New Contact'), array('' => ts('- create new contact -')) + $contactProfiles, FALSE, array('onChange' => "if (this.value) {  newContact{$prefix}{$blockNo}( this.value, {$blockNo}, '{$prefix}' );}"));
     }
     $form->assign('blockNo', $blockNo);
     $form->assign('prefix', $prefix);
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:26,代码来源:NewContact.php

示例3: getValidContactTypeList

 static function getValidContactTypeList($relType)
 {
     // string looks like 4_a_b
     $rel_parts = explode('_', $relType);
     $allRelationshipType = CRM_Core_PseudoConstant::relationshipType('label');
     $contactProfiles = CRM_Core_BAO_UFGroup::getReservedProfiles('Contact', NULL);
     if ($rel_parts[1] == 'a') {
         $leftType = $allRelationshipType[$rel_parts[0]]['contact_type_b'];
     } else {
         $leftType = $allRelationshipType[$rel_parts[0]]['contact_type_a'];
     }
     // Handle 'All Contacts' contact type for left side of relationship ($leftType is empty in this case)
     // In this case all reserved profiles are available
     if ($leftType == '') {
         $contactTypes = $contactProfiles;
     } else {
         $contactTypes = array();
         foreach ($contactProfiles as $key => $value) {
             $groupTypes = CRM_Core_BAO_UFGroup::profileGroups($key);
             if (in_array($leftType, $groupTypes)) {
                 $contactTypes = array($key => $value);
             }
         }
     }
     return $contactTypes;
 }
开发者ID:hguru,项目名称:224Civi,代码行数:26,代码来源:Relationship.php

示例4: getValidContactTypeList

 static function getValidContactTypeList($relType)
 {
     // string looks like 4_a_b
     $rel_parts = explode('_', $relType);
     $allRelationshipType = CRM_Core_PseudoConstant::relationshipType('label');
     $contactProfiles = CRM_Core_BAO_UFGroup::getReservedProfiles('Contact', NULL);
     if ($rel_parts[1] == 'a') {
         $leftType = $allRelationshipType[$rel_parts[0]]['contact_type_b'];
     } else {
         $leftType = $allRelationshipType[$rel_parts[0]]['contact_type_a'];
     }
     $contactTypes = array();
     foreach ($contactProfiles as $key => $value) {
         if (strpos($value, $leftType) !== FALSE) {
             $contactTypes = array($key => $value);
         }
     }
     return $contactTypes;
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:19,代码来源:Relationship.php


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