本文整理汇总了PHP中CCrmContact::GetFields方法的典型用法代码示例。如果您正苦于以下问题:PHP CCrmContact::GetFields方法的具体用法?PHP CCrmContact::GetFields怎么用?PHP CCrmContact::GetFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCrmContact
的用法示例。
在下文中一共展示了CCrmContact::GetFields方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Add
public function Add($data)
{
if (($r = self::CheckAuth()) !== false) {
return $r;
}
$arFieldsInfo = CCrmContact::GetFields();
$arFields = array();
$arEl = $data->elementsByName('Field');
foreach ($arEl as $el) {
$children = $el->children();
$sFieldName = $el->getAttribute('id');
// Fix for issue #40193
if (!isset($arFieldsInfo[$sFieldName])) {
continue;
}
if (!is_null($children)) {
$arFields[$sFieldName] = array();
foreach ($children as $child) {
$arFields[$sFieldName][] = $child->content;
}
} else {
$arFields[$sFieldName] = $el->content;
}
}
CCrmFieldMulti::PrepareFields($arFields);
if (isset($arFields['PHOTO'])) {
$arFile = null;
if (CCrmUrlUtil::HasScheme($arFields['PHOTO']) && CCrmUrlUtil::IsSecureUrl($arFields['PHOTO'])) {
$arFile = CFile::MakeFileArray($arFields['PHOTO']);
if (is_array($arFile)) {
$arFile += array('MODULE_ID' => 'crm');
}
}
if (is_array($arFile)) {
$arFields['PHOTO'] = $arFile;
} else {
unset($arFields['PHOTO']);
}
}
$arUserFields = $GLOBALS['USER_FIELD_MANAGER']->GetUserFields(CCrmContact::$sUFEntityID);
foreach ($arUserFields as $FIELD_NAME => $arUserField) {
if ($arUserField['USER_TYPE']['BASE_TYPE'] == 'file') {
if (!isset($arFields[$FIELD_NAME])) {
continue;
}
if (is_array($arFields[$FIELD_NAME])) {
$arFiles = array();
foreach ($arFields[$FIELD_NAME] as $sFilePath) {
if (!(CCrmUrlUtil::HasScheme($sFilePath) && CCrmUrlUtil::IsSecureUrl($sFilePath))) {
continue;
}
$arFile = CFile::MakeFileArray($sFilePath);
if (is_array($arFile)) {
$arFile += array('MODULE_ID' => 'crm');
$arFiles[] = $arFile;
}
}
$arFields[$FIELD_NAME] = $arFiles;
} else {
$arFile = null;
$sFilePath = $arFields[$FIELD_NAME];
if (CCrmUrlUtil::HasScheme($sFilePath) && CCrmUrlUtil::IsSecureUrl($sFilePath)) {
$arFile = CFile::MakeFileArray($sFilePath);
if (is_array($arFile)) {
$arFile += array('MODULE_ID' => 'crm');
}
}
if (is_array($arFile)) {
$arFields[$FIELD_NAME] = $arFile;
} else {
unset($arFields[$FIELD_NAME]);
}
}
}
}
$CCrmContact = new CCrmContact();
return $CCrmContact->Add($arFields) ? 'ok' : new CSoapFault('CCrmLead::Add', htmlspecialcharsbx(strip_tags(nl2br($arFields['RESULT_MESSAGE']))));
}
示例2: GetMessage
}
}
if ($success) {
$DB->Commit();
} else {
$DB->Rollback();
$arResult['ERROR_MESSAGE'] = !empty($arFields['RESULT_MESSAGE']) ? $arFields['RESULT_MESSAGE'] : GetMessage('UNKNOWN_ERROR');
}
}
if (empty($arResult['ERROR_MESSAGE']) && !$CCrmBizProc->StartWorkflow($arResult['ELEMENT']['ID'], $arBizProcParametersValues)) {
$arResult['ERROR_MESSAGE'] = $CCrmBizProc->LAST_ERROR;
}
$ID = isset($arResult['ELEMENT']['ID']) ? $arResult['ELEMENT']['ID'] : 0;
if (!empty($arResult['ERROR_MESSAGE'])) {
ShowError($arResult['ERROR_MESSAGE']);
$arResult['ELEMENT'] = CCrmComponentHelper::PrepareEntityFields(array_merge(array('ID' => $ID), $arFields), CCrmContact::GetFields());
} else {
if (!isset($_POST['COMPANY_ID']) && isset($_POST['COMPANY_NAME'])) {
if (CCrmCompany::CheckCreatePermission()) {
$arFields = array('TITLE' => trim($_POST['COMPANY_NAME']), 'CONTACT_ID' => array($ID));
$CCrmCompany = new CCrmCompany();
$companyId = $CCrmCompany->Add($arFields);
$CCrmContact->UpdateCompanyId($ID, $companyId);
}
}
if (isset($_POST['apply'])) {
if (CCrmContact::CheckUpdatePermission($ID)) {
LocalRedirect(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_CONTACT_EDIT'], array('contact_id' => $ID)));
}
} elseif (isset($_POST['saveAndAdd'])) {
$redirectUrl = CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_CONTACT_EDIT'], array('contact_id' => 0));