本文整理汇总了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);
}
示例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);
}
}
}
示例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);
}