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


PHP CRM_Contact_DAO_RelationshipType::addDisplayEnums方法代码示例

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


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

示例1: browse

 /**
  * browse all entities.
  *
  * @param int $action
  *
  * @return void
  * @access public
  */
 function browse()
 {
     $n = func_num_args();
     $action = $n > 0 ? func_get_arg(0) : NULL;
     $sort = $n > 0 ? func_get_arg(1) : NULL;
     $links =& $this->links();
     if ($action == NULL) {
         if (!empty($links)) {
             $action = array_sum(array_keys($links));
         }
     }
     if ($action & CRM_Core_Action::DISABLE) {
         $action -= CRM_Core_Action::DISABLE;
     }
     if ($action & CRM_Core_Action::ENABLE) {
         $action -= CRM_Core_Action::ENABLE;
     }
     $baoString = $this->getBAOName();
     $object = new $baoString();
     $values = array();
     /*
      * lets make sure we get the stuff sorted by name if it exists
      */
     $fields =& $object->fields();
     $key = '';
     if (CRM_Utils_Array::value('title', $fields)) {
         $key = 'title';
     } elseif (CRM_Utils_Array::value('label', $fields)) {
         $key = 'label';
     } elseif (CRM_Utils_Array::value('name', $fields)) {
         $key = 'name';
     }
     if (trim($sort)) {
         $object->orderBy($sort);
     } elseif ($key) {
         $object->orderBy($key . ' asc');
     }
     // find all objects
     $object->find();
     while ($object->fetch()) {
         if (!isset($object->mapping_type_id) || $object->mapping_type_id != 1) {
             $permission = CRM_Core_Permission::EDIT;
             if ($key) {
                 $permission = $this->checkPermission($object->id, $object->{$key});
             }
             if ($permission) {
                 $values[$object->id] = array();
                 CRM_Core_DAO::storeValues($object, $values[$object->id]);
                 CRM_Contact_DAO_RelationshipType::addDisplayEnums($values[$object->id]);
                 // populate action links
                 $this->action($object, $action, $values[$object->id], $links, $permission);
                 if (isset($object->mapping_type_id)) {
                     $mappintTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Mapping', 'mapping_type_id');
                     $values[$object->id]['mapping_type'] = $mappintTypes[$object->mapping_type_id];
                 }
             }
         }
     }
     $this->assign('rows', $values);
 }
开发者ID:hguru,项目名称:224Civi,代码行数:68,代码来源:Basic.php

示例2: browse

 /**
  * browse all entities.
  *
  * @param int $action
  *
  * @return void
  * @access public
  */
 function browse($action = null, $sort)
 {
     $links =& $this->links();
     if ($action == null) {
         if (!empty($links)) {
             $action = array_sum(array_keys($links));
         }
     }
     if ($action & CRM_Core_Action::DISABLE) {
         $action -= CRM_Core_Action::DISABLE;
     }
     if ($action & CRM_Core_Action::ENABLE) {
         $action -= CRM_Core_Action::ENABLE;
     }
     eval('$object =& new ' . $this->getBAOName() . '( );');
     $values = array();
     /*
      * lets make sure we get the stuff sorted by name if it exists
      */
     $fields =& $object->fields();
     $key = '';
     if (CRM_Utils_Array::value('title', $fields)) {
         $key = 'title';
     } else {
         if (CRM_Utils_Array::value('label', $fields)) {
             $key = 'label';
         } else {
             if (CRM_Utils_Array::value('name', $fields)) {
                 $key = 'name';
             }
         }
     }
     if (trim($sort)) {
         $object->orderBy($sort);
     } else {
         if ($key) {
             $object->orderBy($key . ' asc');
         }
     }
     // find all objects
     $object->find();
     while ($object->fetch()) {
         if (!isset($object->mapping_type_id) || $object->mapping_type_id != 1) {
             // "1 for Search Builder"
             $permission = CRM_Core_Permission::EDIT;
             if ($key) {
                 $permission = $this->checkPermission($object->id, $object->{$key});
             }
             if ($permission) {
                 $values[$object->id] = array();
                 CRM_Core_DAO::storeValues($object, $values[$object->id]);
                 require_once 'CRM/Contact/DAO/RelationshipType.php';
                 CRM_Contact_DAO_RelationshipType::addDisplayEnums($values[$object->id]);
                 // populate action links
                 $this->action($object, $action, $values[$object->id], $links, $permission);
                 if (isset($object->mapping_type_id)) {
                     require_once 'CRM/Core/PseudoConstant.php';
                     $mappintTypes = CRM_Core_PseudoConstant::mappingTypes();
                     $values[$object->id]['mapping_type'] = $mappintTypes[$object->mapping_type_id];
                 }
             }
             $this->assign('rows', $values);
         }
     }
 }
开发者ID:bhirsch,项目名称:voipdev,代码行数:73,代码来源:Basic.php

示例3: browse

 /**
  * browse all entities.
  *
  * @param int $action
  *
  * @return void
  * @access public
  */
 function browse($action = null)
 {
     $links =& $this->links();
     if ($action == null) {
         $action = array_sum(array_keys($links));
     }
     if ($action & CRM_CORE_ACTION_DISABLE) {
         $action -= CRM_CORE_ACTION_DISABLE;
     }
     if ($action & CRM_CORE_ACTION_ENABLE) {
         $action -= CRM_CORE_ACTION_ENABLE;
     }
     eval('$object =& new ' . $this->getBAOName() . '( );');
     $values = array();
     /*
      * lets make sure we get the stuff sorted by name if it exists
      */
     $fields =& $object->fields();
     $key = '';
     if (CRM_Utils_Array::value('title', $fields)) {
         $key = 'title';
     } else {
         if (CRM_Utils_Array::value('label', $fields)) {
             $key = 'label';
         } else {
             if (CRM_Utils_Array::value('name', $fields)) {
                 $key = 'name';
             }
         }
     }
     if ($key) {
         $object->orderBy($key . ' asc');
     }
     // set the domain_id parameter
     $config =& CRM_Core_Config::singleton();
     $object->domain_id = $config->domainID();
     // find all objects
     $object->find();
     while ($object->fetch()) {
         $permission = CRM_CORE_PERMISSION_EDIT;
         if ($key) {
             $permission = $this->checkPermission($object->id, $object->{$key});
         }
         if ($permission) {
             $values[$object->id] = array();
             CRM_Core_DAO::storeValues($object, $values[$object->id]);
             CRM_Contact_DAO_RelationshipType::addDisplayEnums($values[$object->id]);
             // populate action links
             CRM_Core_Page_Basic::action($object, $action, $values[$object->id], $links, $permission);
         }
     }
     $this->assign('rows', $values);
 }
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:61,代码来源:Basic.php


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