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


PHP CCrmFieldMulti::CheckComplexFields方法代码示例

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


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

示例1: CheckFields

 public function CheckFields(&$arFields, $ID = false, $options = array())
 {
     global $APPLICATION, $USER_FIELD_MANAGER;
     $this->LAST_ERROR = '';
     if (($ID == false || isset($arFields['TITLE'])) && empty($arFields['TITLE'])) {
         $this->LAST_ERROR .= GetMessage('CRM_ERROR_FIELD_IS_MISSING', array('%FIELD_NAME%' => GetMessage('CRM_FIELD_TITLE'))) . "<br />";
     }
     if (isset($arFields['FM']) && is_array($arFields['FM'])) {
         $CCrmFieldMulti = new CCrmFieldMulti();
         if (!$CCrmFieldMulti->CheckComplexFields($arFields['FM'])) {
             $this->LAST_ERROR .= $CCrmFieldMulti->LAST_ERROR;
         }
     }
     if (isset($arFields['LOGO']) && is_array($arFields['LOGO'])) {
         if (($strError = CFile::CheckFile($arFields['LOGO'], 0, 0, CFile::GetImageExtensions())) != '') {
             $this->LAST_ERROR .= $strError . "<br />";
         }
     }
     $enableUserFildCheck = !(is_array($options) && isset($options['DISABLE_USER_FIELD_CHECK']) && $options['DISABLE_USER_FIELD_CHECK'] === true);
     if ($enableUserFildCheck) {
         // We have to prepare field data before check (issue #22966)
         CCrmEntityHelper::NormalizeUserFields($arFields, self::$sUFEntityID, $USER_FIELD_MANAGER, array('IS_NEW' => $ID == false));
         if (!$USER_FIELD_MANAGER->CheckFields(self::$sUFEntityID, $ID, $arFields)) {
             $e = $APPLICATION->GetException();
             $this->LAST_ERROR .= $e->GetString();
         }
     }
     if (strlen($this->LAST_ERROR) > 0) {
         return false;
     }
     return true;
 }
开发者ID:konvita2,项目名称:portal,代码行数:32,代码来源:crm_company.php

示例2: CheckFields

 public function CheckFields(&$arFields, $ID = false, $options = array())
 {
     global $APPLICATION, $USER_FIELD_MANAGER;
     $this->LAST_ERROR = '';
     if (($ID == false || isset($arFields['TITLE'])) && empty($arFields['TITLE'])) {
         $this->LAST_ERROR .= GetMessage('CRM_ERROR_FIELD_IS_MISSING', array('%FIELD_NAME%' => GetMessage('CRM_FIELD_TITLE'))) . "<br />";
     }
     if (is_string($arFields['OPPORTUNITY']) && $arFields['OPPORTUNITY'] !== '') {
         $arFields['OPPORTUNITY'] = str_replace(array(',', ' '), array('.', ''), $arFields['OPPORTUNITY']);
         //HACK: MSSQL returns '.00' for zero value
         if (strpos($arFields['OPPORTUNITY'], '.') === 0) {
             $arFields['OPPORTUNITY'] = '0' . $arFields['OPPORTUNITY'];
         }
         if (!preg_match('/^\\d{1,}(\\.\\d{1,})?$/', $arFields['OPPORTUNITY'])) {
             $this->LAST_ERROR .= GetMessage('CRM_LEAD_FIELD_OPPORTUNITY_INVALID') . "<br />";
         }
     }
     if (isset($arFields['FM']) && is_array($arFields['FM'])) {
         $CCrmFieldMulti = new CCrmFieldMulti();
         if (!$CCrmFieldMulti->CheckComplexFields($arFields['FM'])) {
             $this->LAST_ERROR .= $CCrmFieldMulti->LAST_ERROR;
         }
     }
     if (isset($arFields['BIRTHDATE']) && $arFields['BIRTHDATE'] !== '' && !CheckDateTime($arFields['BIRTHDATE'])) {
         $this->LAST_ERROR .= GetMessage('CRM_ERROR_FIELD_INCORRECT', array('%FIELD_NAME%' => self::GetFieldCaption('BIRTHDATE'))) . "<br />";
     }
     $enableUserFildCheck = !(is_array($options) && isset($options['DISABLE_USER_FIELD_CHECK']) && $options['DISABLE_USER_FIELD_CHECK'] === true);
     if ($enableUserFildCheck) {
         // We have to prepare field data before check (issue #22966)
         CCrmEntityHelper::NormalizeUserFields($arFields, self::$sUFEntityID, $USER_FIELD_MANAGER, array('IS_NEW' => $ID == false));
         if (!$USER_FIELD_MANAGER->CheckFields(self::$sUFEntityID, $ID, $arFields)) {
             $e = $APPLICATION->GetException();
             $this->LAST_ERROR .= $e->GetString();
         }
     }
     return $this->LAST_ERROR === '';
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:37,代码来源:crm_lead.php

示例3: CheckFields

 public function CheckFields(&$arFields, $ID = false, $options = array())
 {
     global $APPLICATION, $USER_FIELD_MANAGER;
     $this->LAST_ERROR = '';
     if (($ID == false || isset($arFields['NAME']) && isset($arFields['LAST_NAME'])) && (empty($arFields['NAME']) && empty($arFields['LAST_NAME']))) {
         $this->LAST_ERROR .= GetMessage('CRM_ERROR_REQUIRED_FIELDS') . "<br />";
     }
     if (isset($arFields['FM']) && is_array($arFields['FM'])) {
         $CCrmFieldMulti = new CCrmFieldMulti();
         if (!$CCrmFieldMulti->CheckComplexFields($arFields['FM'])) {
             $this->LAST_ERROR .= $CCrmFieldMulti->LAST_ERROR;
         }
     }
     if (isset($arFields['PHOTO']) && is_array($arFields['PHOTO'])) {
         if (($strError = CFile::CheckFile($arFields['PHOTO'], 0, 0, CFile::GetImageExtensions())) != '') {
             $this->LAST_ERROR .= $strError . "<br />";
         }
     }
     if (isset($arFields['BIRTHDATE']) && $arFields['BIRTHDATE'] !== '' && !CheckDateTime($arFields['BIRTHDATE'])) {
         $this->LAST_ERROR .= GetMessage('CRM_ERROR_FIELD_INCORRECT', array('%FIELD_NAME%' => self::GetFieldCaption('BIRTHDATE'))) . "<br />";
     }
     $enableUserFildCheck = !(is_array($options) && isset($options['DISABLE_USER_FIELD_CHECK']) && $options['DISABLE_USER_FIELD_CHECK'] === true);
     if ($enableUserFildCheck) {
         // We have to prepare field data before check (issue #22966)
         CCrmEntityHelper::NormalizeUserFields($arFields, self::$sUFEntityID, $USER_FIELD_MANAGER, array('IS_NEW' => $ID == false));
         if (!$USER_FIELD_MANAGER->CheckFields(self::$sUFEntityID, $ID, $arFields)) {
             $e = $APPLICATION->GetException();
             $this->LAST_ERROR .= $e->GetString();
         }
     }
     return $this->LAST_ERROR === '';
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:32,代码来源:crm_contact.php


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