本文整理汇总了PHP中CCrmFieldMulti::GetEntityNameByComplex方法的典型用法代码示例。如果您正苦于以下问题:PHP CCrmFieldMulti::GetEntityNameByComplex方法的具体用法?PHP CCrmFieldMulti::GetEntityNameByComplex怎么用?PHP CCrmFieldMulti::GetEntityNameByComplex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCrmFieldMulti
的用法示例。
在下文中一共展示了CCrmFieldMulti::GetEntityNameByComplex方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: IntVal
die;
}
$arResult['ENTITY_ID'] = $arParams['ENTITY_ID'];
$arResult['ELEMENT_ID'] = IntVal($arParams['ELEMENT_ID']);
$arResult['TYPE_ID'] = $arParams['TYPE_ID'];
$arResult['READ_ONLY'] = isset($arParams['READ_ONLY']) ? $arParams['READ_ONLY'] : false;
$arResult['VALUES'] = array();
if (isset($arParams['VALUES'][$arParams['TYPE_ID']]) && !empty($arParams['VALUES'][$arParams['TYPE_ID']])) {
foreach ($arParams['VALUES'][$arParams['TYPE_ID']] as $ID => $arValue) {
if (substr($ID, 0, 1) == 'n' && $arValue['VALUE'] == '') {
continue;
}
$arResult['VALUES'][$ID]['ID'] = $ID;
$arResult['VALUES'][$ID]['VALUE'] = $arValue['VALUE'];
$arResult['VALUES'][$ID]['VALUE_TYPE'] = $arValue['VALUE_TYPE'];
$arResult['VALUES'][$ID]['COMPLEX_ID'] = $arParams['TYPE_ID'] . '_' . $arValue['VALUE_TYPE'];
$arResult['VALUES'][$ID]['COMPLEX_NAME'] = CCrmFieldMulti::GetEntityNameByComplex($arParams['TYPE_ID'] . '_' . $arValue['VALUE_TYPE']);
$arResult['VALUES'][$ID]['TEMPLATE'] = CCrmFieldMulti::GetTemplateByComplex($arParams['TYPE_ID'] . '_' . $arValue['VALUE_TYPE'], $arValue['VALUE']);
}
} elseif ($arResult['ELEMENT_ID'] > 0) {
$res = CCrmFieldMulti::GetList(array('ID' => 'asc'), array('ENTITY_ID' => $arResult['ENTITY_ID'], 'ELEMENT_ID' => $arResult['ELEMENT_ID'], 'TYPE_ID' => $arResult['TYPE_ID']));
while ($ar = $res->Fetch()) {
$arResult['VALUES'][$ar['ID']]['ID'] = $ar['ID'];
$arResult['VALUES'][$ar['ID']]['VALUE'] = $ar['VALUE'];
$arResult['VALUES'][$ar['ID']]['VALUE_TYPE'] = $ar['VALUE_TYPE'];
$arResult['VALUES'][$ar['ID']]['COMPLEX_ID'] = $ar['COMPLEX_ID'];
$arResult['VALUES'][$ar['ID']]['COMPLEX_NAME'] = CCrmFieldMulti::GetEntityNameByComplex($ar['COMPLEX_ID']);
$arResult['VALUES'][$ar['ID']]['TEMPLATE'] = CCrmFieldMulti::GetTemplateByComplex($ar['COMPLEX_ID'], $ar['VALUE']);
}
}
$this->IncludeComponentTemplate();
示例2: PreparePrintableValue
protected static function PreparePrintableValue($arDocumentID, $fieldName, $arFieldType, $fieldValue)
{
global $USER_FIELD_MANAGER, $APPLICATION;
if (empty($arDocumentID)) {
throw new CBPArgumentNullException('documentId');
}
$result = $fieldValue;
switch ($arFieldType['Type']) {
case 'date':
case 'datetime':
if (is_array($fieldValue)) {
$result = array();
foreach ($fieldValue as $_fieldValue) {
$result[] = empty($_fieldValue) ? FormatDate('x', MakeTimeStamp($_fieldValue)) : '';
}
} else {
$result = !empty($fieldValue) ? FormatDate('x', MakeTimeStamp($fieldValue)) : '';
}
break;
case 'user':
if (!is_array($fieldValue)) {
$fieldValue = array($fieldValue);
}
$result = CBPHelper::UsersArrayToString($fieldValue, null, $arDocumentID["DOCUMENT_TYPE"]);
break;
case 'bool':
if (is_array($fieldValue)) {
$result = array();
foreach ($fieldValue as $r) {
$result[] = strtoupper($r) != "N" && !empty($r) ? GetMessage('BPVDX_YES') : GetMessage('BPVDX_NO');
}
} else {
$result = strtoupper($fieldValue) != "N" && !empty($fieldValue) ? GetMessage('BPVDX_YES') : GetMessage('BPVDX_NO');
}
break;
case 'file':
if (is_array($fieldValue)) {
$result = array();
foreach ($fieldValue as $r) {
$r = intval($r);
$dbImg = CFile::GetByID($r);
if ($arImg = $dbImg->Fetch()) {
$result[] = "[url=/bitrix/tools/bizproc_show_file.php?f=" . htmlspecialcharsbx($arImg["FILE_NAME"]) . "&i=" . $r . "]" . htmlspecialcharsbx($arImg["ORIGINAL_NAME"]) . "[/url]";
}
}
} else {
$fieldValue = intval($fieldValue);
$dbImg = CFile::GetByID($fieldValue);
if ($arImg = $dbImg->Fetch()) {
$result = "[url=/bitrix/tools/bizproc_show_file.php?f=" . htmlspecialcharsbx($arImg["FILE_NAME"]) . "&i=" . $fieldValue . "]" . htmlspecialcharsbx($arImg["ORIGINAL_NAME"]) . "[/url]";
}
}
break;
case 'select':
if (is_array($arFieldType["Options"])) {
if (is_array($fieldValue)) {
$result = array();
foreach ($fieldValue as $r) {
if (array_key_exists($r, $arFieldType["Options"])) {
$result[] = $arFieldType["Options"][$r];
}
}
} else {
if (array_key_exists($fieldValue, $arFieldType["Options"])) {
$result = $arFieldType["Options"][$fieldValue];
}
}
}
break;
case 'web':
case 'im':
case 'email':
case 'phone':
$result = array();
if (is_array($fieldValue) && !CBPHelper::IsAssociativeArray($fieldValue)) {
$fieldValue = $fieldValue[0];
}
if (is_array($fieldValue) && is_array($fieldValue[strtoupper($arFieldType['Type'])])) {
foreach ($fieldValue[strtoupper($arFieldType['Type'])] as $val) {
if (!empty($val)) {
$result[] = CCrmFieldMulti::GetEntityNameByComplex(strtoupper($arFieldType['Type']) . '_' . $val['VALUE_TYPE'], false) . ': ' . $val['VALUE'];
}
}
}
break;
}
if (strpos($arFieldType['Type'], 'UF:') === 0) {
$sType = str_replace('UF:', '', $arFieldType['Type']);
if ($sType === 'crm') {
$options = isset($arFieldType['Options']) && is_array($arFieldType['Options']) ? $arFieldType['Options'] : array();
$defaultTypeName = '';
foreach ($options as $typeName => $flag) {
if ($flag === 'Y') {
$defaultTypeName = $typeName;
break;
}
}
if ($defaultTypeName === '') {
$defaultTypeName = 'LEAD';
}
//.........这里部分代码省略.........
示例3: GetMessage
$sBodyEvent .= GetMessage('CRM_SUBSCRIBE_FROM') . ': ' . $arFields['FROM_FIELD'] . "\n\r";
$sBodyEvent .= GetMessage('CRM_SUBSCRIBE_TO') . ': ' . $arFields['BCC_FIELD'] . "\n\r\n\r";
$sBodyEvent .= $_POST['COMMENTS'];
if (!empty($arEntity)) {
$CCrmEvent->Add(array('ENTITY' => $arEntity, 'EVENT_ID' => 'MESSAGE', 'EVENT_TEXT_1' => $sBodyEvent, 'FILES' => !empty($_FILES['ATTACH']) ? $_FILES['ATTACH'] : array()));
}
// Try add event to entity of context
if ($arResult['FORM_ENTITY_TYPE'] !== $arResult['ENTITY_TYPE'] && $arResult['FORM_ENTITY_ID'] !== $arResult['ENTITY_ID']) {
$CCrmEvent->Add(array('ENTITY' => array($arResult['FORM_ENTITY_ID'] => array('ENTITY_TYPE' => $arResult['FORM_ENTITY_TYPE'], 'ENTITY_ID' => $arResult['FORM_ENTITY_ID'])), 'EVENT_ID' => 'MESSAGE', 'EVENT_TEXT_1' => $sBodyEvent, 'FILES' => !empty($_FILES['ATTACH']) ? $_FILES['ATTACH'] : array()));
}
}
$arResult['EVENT_PAGE'] = CHTTP::urlAddParams($_POST['EVENT_PAGE'], array('CRM_' . trim($arResult['FORM_ENTITY_TYPE']) . '_' . trim($arParams['FORM_TYPE']) . '_active_tab' => !empty($_REQUEST['TAB_ID']) ? $_REQUEST['TAB_ID'] : 'tab_event'));
}
// check if only one is selected form the entity of a choice on which mailbox to send
$arResult['EMAIL'] = array();
if (count($arResult['ENTITY_ID']) == 1 && $arResult['ENTITY_ID'][0] > 0) {
$arFilter = array('ENTITY_ID' => $arResult['ENTITY_TYPE'], 'TYPE_ID' => 'EMAIL', 'ELEMENT_ID' => $arResult['ENTITY_ID']);
$obRes = CCrmFieldMulti::GetList(array('COMPLEX_ID' => 'desc', 'ID' => 'asc'), $arFilter);
while ($arRow = $obRes->Fetch()) {
$arResult['EMAIL']['REFERENCE'][] = CCrmFieldMulti::GetEntityNameByComplex($arRow['COMPLEX_ID']) . ': ' . $arRow['VALUE'];
$arResult['EMAIL']['REFERENCE_ID'][] = $arRow['VALUE'];
}
if (isset($arResult['EMAIL']['REFERENCE'])) {
if (count($arResult['EMAIL']['REFERENCE']) == 0) {
$arResult['ERROR_MESSAGE'] = GetMessage('CRM_SUBSCRIBE_EMPTY_EMAIL');
}
} else {
$arResult['ERROR_MESSAGE'] = GetMessage('CRM_SUBSCRIBE_EMPTY_EMAIL');
}
}
$this->IncludeComponentTemplate();