public function getTextTotals($count, $limit = 0)
 {
     self::includeLangFile();
     if (!is_int($count)) {
         $count = (int) $count;
     }
     if (!is_int($limit)) {
         $limit = (int) $limit;
     }
     $exceeded = $limit > 0 && $count > $limit;
     if ($exceeded) {
         $count = $limit;
     }
     return GetMessage($exceeded ? 'CRM_DUP_CRITERION_PERS_ENTITY_TOTAL_EXCEEDED' : 'CRM_DUP_CRITERION_PERS_ENTITY_TOTAL', array('#DESCR#' => $this->getMatchDescription(), '#QTY#' => Duplicate::entityCountToText($count)));
 }
示例#2
0
                        $info['EMAIL'] = $multiFields['EMAIL'];
                    }
                }
                $dupInfo['ENTITIES'][] =& $info;
                unset($info);
            }
            unset($entity);
            $criterion = $dup->getCriterion();
            if ($criterion instanceof \Bitrix\Crm\Integrity\DuplicateCriterion) {
                $dupInfo['CRITERION'] = array('TYPE_NAME' => $criterion->getTypeName(), 'MATCHES' => $criterion->getMatches());
            }
            $dupInfos[] =& $dupInfo;
            unset($dupInfo);
        }
        unset($dup);
        $groupResults[] = array('DUPLICATES' => &$dupInfos, 'GROUP_ID' => isset($group['GROUP_ID']) ? $group['GROUP_ID'] : '', 'FIELD_ID' => isset($group['FIELD_ID']) ? $group['FIELD_ID'] : '', 'HASH_CODE' => isset($group['HASH_CODE']) ? intval($group['HASH_CODE']) : 0, 'ENTITY_TOTAL_TEXT' => \Bitrix\Crm\Integrity\Duplicate::entityCountToText($totalEntities));
        unset($dupInfos);
    }
    unset($group);
    __CrmCompanyEditEndResonse(array('GROUP_RESULTS' => $groupResults));
} elseif ($action === 'FIND_LOCALITIES') {
    $localityType = isset($_POST['LOCALITY_TYPE']) ? $_POST['LOCALITY_TYPE'] : 'COUNTRY';
    $needle = isset($_POST['NEEDLE']) ? $_POST['NEEDLE'] : '';
    if ($localityType === 'COUNTRY') {
        $result = \Bitrix\Crm\EntityAddress::getCountries(array('CAPTION' => $needle));
        __CrmCompanyEditEndResonse(array('DATA' => array('ITEMS' => $result)));
    } else {
        __CrmCompanyEditEndResonse(array('ERROR' => "Locality '{$localityType}' is not supported in current context."));
    }
} else {
    __CrmCompanyEditEndResonse(array('ERROR' => "Action '{$action}' is not supported in current context."));
 public function getTextTotals($count, $limit = 0)
 {
     self::includeLangFile();
     if (!is_int($count)) {
         $count = (int) $count;
     }
     if (!is_int($limit)) {
         $limit = (int) $limit;
     }
     $exceeded = $limit > 0 && $count > $limit;
     if ($exceeded) {
         $count = $limit;
     }
     /*
      * CRM_DUP_CRITERION_COMM_PHONE_ENTITY_TOTAL
      * CRM_DUP_CRITERION_COMM_PHONE_ENTITY_TOTAL_EXCEEDED
      * CRM_DUP_CRITERION_COMM_EMAIL_ENTITY_TOTAL
      * CRM_DUP_CRITERION_COMM_EMAIL_ENTITY_TOTAL_EXCEEDED
      */
     return GetMessage($exceeded ? "CRM_DUP_CRITERION_COMM_{$this->communicationType}_ENTITY_TOTAL_EXCEEDED" : "CRM_DUP_CRITERION_COMM_{$this->communicationType}_ENTITY_TOTAL", array('#DESCR#' => $this->getMatchDescription(), '#QTY#' => Duplicate::entityCountToText($count)));
 }