本文整理汇总了PHP中CCrmCompany::CheckFields方法的典型用法代码示例。如果您正苦于以下问题:PHP CCrmCompany::CheckFields方法的具体用法?PHP CCrmCompany::CheckFields怎么用?PHP CCrmCompany::CheckFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCrmCompany
的用法示例。
在下文中一共展示了CCrmCompany::CheckFields方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CCrmCompany
if ($currentPhotoID > 0) {
$allowedFileIDs[] = $currentLogoID;
}
}
if (!in_array($logoID, $allowedFileIDs, true)) {
$logoID = 0;
}
}
if ($logoID > 0) {
$fields['LOGO'] = $logoID;
}
if (isset($data['FM']) && is_array($data['FM']) && !empty($data['FM'])) {
$fields['FM'] = $data['FM'];
}
$entity = new CCrmCompany(false);
if (!$entity->CheckFields($fields, !$isNew ? $ID : false, array('DISABLE_USER_FIELD_CHECK' => true))) {
__CrmMobileCompanyEditEndResonse(array('ERROR' => strip_tags(preg_replace("/<br[^>]*>/", "\n", $entity->LAST_ERROR))));
} else {
//$DB->StartTransaction();
$successed = false;
if ($isNew) {
$ID = $entity->Add($fields, true, array('DISABLE_USER_FIELD_CHECK' => true, 'REGISTER_SONET_EVENT' => true));
$successed = $ID !== false;
if ($successed) {
$contactID = isset($data['CONTACT_ID']) ? intval($data['CONTACT_ID']) : 0;
if ($contactID > 0 && CCrmContact::Exists($contactID)) {
$dbContacts = CCrmContact::GetListEx(array(), array('=ID' => $contactID, 'CHECK_PERMISSIONS' => 'N'), false, false, array('COMPANY_ID'));
$contact = $dbContacts ? $dbContacts->Fetch() : null;
if (is_array($contact)) {
$contactCompanyID = isset($contact['COMPANY_ID']) ? intval($contact['COMPANY_ID']) : 0;
if ($contactCompanyID !== $ID) {
示例2: array
if (isset($_POST['CONTACT_ID'])) {
$contactIDs = is_array($_POST['CONTACT_ID']) ? $_POST['CONTACT_ID'] : array();
foreach ($contactIDs as $k => $v) {
if (!CCrmContact::CheckReadPermission($v)) {
unset($contactIDs[$k]);
}
}
$arFields['CONTACT_ID'] = $contactIDs;
}
$USER_FIELD_MANAGER->EditFormAddFields(CCrmCompany::$sUFEntityID, $arFields);
$originID = isset($_REQUEST['origin_id']) ? $_REQUEST['origin_id'] : '';
if ($originID !== '') {
$arFields['ORIGIN_ID'] = $originID;
}
$arResult['ERROR_MESSAGE'] = '';
if (!$CCrmCompany->CheckFields($arFields, $bEdit ? $arResult['ELEMENT']['ID'] : false)) {
if (!empty($CCrmCompany->LAST_ERROR)) {
$arResult['ERROR_MESSAGE'] .= $CCrmCompany->LAST_ERROR;
} else {
$arResult['ERROR_MESSAGE'] .= GetMessage('UNKNOWN_ERROR');
}
}
if (($arBizProcParametersValues = $CCrmBizProc->CheckFields($bEdit ? $arResult['ELEMENT']['ID'] : false, false, $arResult['ELEMENT']['ASSIGNED_BY'], $bEdit ? array($arResult['ELEMENT']['ID'] => $arEntityAttr[$arResult['ELEMENT']['ID']]) : null)) === false) {
$arResult['ERROR_MESSAGE'] .= $CCrmBizProc->LAST_ERROR;
}
if (empty($arResult['ERROR_MESSAGE'])) {
$ID = isset($arResult['ELEMENT']['ID']) ? $arResult['ELEMENT']['ID'] : 0;
$DB->StartTransaction();
$bSuccess = false;
if ($bEdit) {
$bSuccess = $CCrmCompany->Update($ID, $arFields, true, true, array('REGISTER_SONET_EVENT' => true));
示例3: CCrmContact
$CCrmContact = new CCrmContact(false);
if ($bConvertContact && $CCrmContact->CheckFields($arFields['CONTACT']) == false) {
$bVarsFromForm = true;
if (!empty($CCrmContact->LAST_ERROR)) {
$arResult['ERROR_MESSAGE'] .= $CCrmContact->LAST_ERROR;
} else {
$arResult['ERROR_MESSAGE'] .= GetMessage('UNKNOWN_ERROR') . '<br />';
}
} else {
if (!$bConvertContact && $iContactId <= 0) {
$arResult['ERROR_MESSAGE'] .= GetMessage('CRM_CONTACT_ERROR') . '<br />';
}
}
if (!$CrmPerms->HavePerm('COMPANY', BX_CRM_PERM_NONE, 'ADD')) {
$CCrmCompany = new CCrmCompany(false);
if ($bConvertCompany && empty($arResult['ERROR_MESSAGE']) && $CCrmCompany->CheckFields($arFields['COMPANY']) == false) {
$bVarsFromForm = true;
if (!empty($CCrmCompany->LAST_ERROR)) {
$arResult['ERROR_MESSAGE'] .= $CCrmCompany->LAST_ERROR;
} else {
$arResult['ERROR_MESSAGE'] .= GetMessage('UNKNOWN_ERROR') . '<br />';
}
}
/* else if (!$bConvertCompany && $iCompanyId <= 0)
$arResult['ERROR_MESSAGE'] .= GetMessage('CRM_COMPANY_ERROR').'<br />';*/
}
if (!$CrmPerms->HavePerm('DEAL', BX_CRM_PERM_NONE, 'ADD')) {
$CCrmDeal = new CCrmDeal(false);
if ($bConvertDeal) {
$prodJson = isset($_POST['DEAL_PRODUCT_DATA']) ? strval($_POST['DEAL_PRODUCT_DATA']) : '';
$arFields['DEAL']['PRODUCT_ROWS'] = isset($prodJson[0]) ? CUtil::JsObjectToPhp($prodJson, true) : array();