本文整理汇总了PHP中CCrmOwnerType类的典型用法代码示例。如果您正苦于以下问题:PHP CCrmOwnerType类的具体用法?PHP CCrmOwnerType怎么用?PHP CCrmOwnerType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CCrmOwnerType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: save
protected static function save()
{
$ary = array();
foreach (self::$items as $entityTypeID => $time) {
$ary[\CCrmOwnerType::ResolveName($entityTypeID)] = $time->format(\DateTime::ISO8601);
}
Main\Config\Option::set('crm', 'crm_uf_history', serialize($ary), '');
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:8,代码来源:userfieldhistory.php
示例2: __CrmDedupeListErrorText
function __CrmDedupeListErrorText(Merger\EntityMergerException $e)
{
__IncludeLang(dirname(__FILE__) . '/lang/' . LANGUAGE_ID . '/' . basename(__FILE__));
$entityTypeID = $e->getEntityTypeID();
$entityID = $e->getEntityID();
$code = $e->getCode();
if ($code === Merger\EntityMergerException::GENERAL) {
return GetMessage('CRM_DEDUPE_LIST_MERGE_GENERAL_ERROR');
} elseif ($code === Merger\EntityMergerException::NOT_FOUND) {
return GetMessage('CRM_DEDUPE_LIST_MERGE_ERROR_NOT_FOUND', array('#ID#' => $entityID));
}
$title = CCrmOwnerType::GetCaption($entityTypeID, $entityID, false);
if (strlen($title) > 20) {
$title = substr($title, 0, 17) . '...';
}
if ($code === Merger\EntityMergerException::READ_DENIED) {
return GetMessage('CRM_DEDUPE_LIST_MERGE_ERROR_READ_DENIED', array('#TITLE#' => $title, '#ID#' => $entityID));
} elseif ($code === Merger\EntityMergerException::UPDATE_DENIED) {
return GetMessage('CRM_DEDUPE_LIST_MERGE_ERROR_UPDATE_DENIED', array('#TITLE#' => $title, '#ID#' => $entityID));
} elseif ($code === Merger\EntityMergerException::DELETE_DENIED) {
return GetMessage('CRM_DEDUPE_LIST_MERGE_ERROR_DELETE_DENIED', array('#TITLE#' => $title, '#ID#' => $entityID));
} elseif ($code === Merger\EntityMergerException::UPDATE_FAILED) {
return GetMessage('CRM_DEDUPE_LIST_MERGE_ERROR_UPDATE_FAILED', array('#TITLE#' => $title, '#ID#' => $entityID));
} elseif ($code === Merger\EntityMergerException::DELETE_FAILED) {
return GetMessage('CRM_DEDUPE_LIST_MERGE_ERROR_DELETE_FAILED', array('#TITLE#' => $title, '#ID#' => $entityID));
}
return $e->getMessage();
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:28,代码来源:ajax.php
示例3: GetDocumentNames
public static function GetDocumentNames($ownerTypeID, $ownerID)
{
if (!(IsModuleInstalled('bizproc') && CModule::IncludeModule('bizproc'))) {
return false;
}
$ownerTypeID = intval($ownerTypeID);
$ownerID = intval($ownerID);
$docName = self::ResolveDocumentName($ownerTypeID);
if ($docName === '') {
return array();
}
$ownerTypeName = CCrmOwnerType::ResolveName($ownerTypeID);
if ($ownerTypeName === '') {
return array();
}
/*$arDocumentStates = CBPDocument::GetDocumentStates(
array('crm', $docName, $ownerTypeName),
array('crm', $docName, $ownerTypeName.'_'.$ownerID)
);*/
$arDocumentStates = CBPStateService::GetDocumentStates(array('crm', $docName, $ownerTypeName . '_' . $ownerID));
$result = array();
foreach ($arDocumentStates as $arDocumentState) {
if ($arDocumentState['ID'] !== '' && $arDocumentState['TEMPLATE_NAME'] !== '') {
$result[] = $arDocumentState['TEMPLATE_NAME'];
}
}
return $result;
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:28,代码来源:crm_bizproc_helper.php
示例4: execute
public function execute(array $contextData = null)
{
/** @var DealConverter $converter */
$converter = $this->converter;
if (is_array($contextData) && !empty($contextData)) {
$converter->setContextData(array_merge($converter->getContextData(), $contextData));
}
$result = false;
try {
$converter->initialize();
do {
$converter->executePhase();
} while ($converter->moveToNextPhase());
$resultData = $converter->getResultData();
if (isset($resultData[\CCrmOwnerType::InvoiceName])) {
$this->redirectUrl = \CCrmOwnerType::GetEditUrl(\CCrmOwnerType::Invoice, $resultData[\CCrmOwnerType::InvoiceName], false);
} elseif (isset($resultData[\CCrmOwnerType::QuoteName])) {
$this->redirectUrl = \CCrmOwnerType::GetEditUrl(\CCrmOwnerType::Quote, $resultData[\CCrmOwnerType::QuoteName], false);
}
$result = true;
} catch (EntityConversionException $e) {
$this->exception = $e;
if ($e->getTargetType() === EntityConversionException::TARG_DST) {
$this->redirectUrl = \CCrmOwnerType::GetEditUrl($e->getDestinationEntityTypeID(), 0, false) . '?conv_deal_id=' . $converter->getEntityID();
}
} catch (\Exception $e) {
$this->errorText = $e->getMessage();
}
$this->save();
return $result;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:dealconversionwizard.php
示例5: __construct
public function __construct($entityTypeID, $seedID, $targID, $typeID)
{
if (!is_int($entityTypeID)) {
$entityTypeID = (int) $entityTypeID;
}
if (!\CCrmOwnerType::IsDefined($entityTypeID)) {
throw new Main\ArgumentException('Is not defined', 'entityTypeID');
}
$this->entityTypeID = $entityTypeID;
if (!is_int($seedID)) {
$seedID = (int) $seedID;
}
if ($seedID <= 0) {
throw new Main\ArgumentException('Must be greater than zero', 'seedID');
}
$this->seedID = $seedID;
if (!is_int($targID)) {
$targID = (int) $targID;
}
if ($targID <= 0) {
throw new Main\ArgumentException('Must be greater than zero', 'targID');
}
$this->targID = $targID;
if (!is_int($typeID)) {
$typeID = (int) $typeID;
}
if (!self::isTypeDefined($typeID)) {
throw new Main\ArgumentException('Is not defined', 'typeID');
}
$this->typeID = $typeID;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:entitymergecollision.php
示例6: __construct
public function __construct($dstEntityTypeID, $srcEntityTypeID, $srcEntityID)
{
parent::__construct($dstEntityTypeID);
$this->srcEntityTypeID = $srcEntityTypeID;
$this->srcEntityTypeName = \CCrmOwnerType::ResolveName($srcEntityTypeID);
$this->srcEntityID = $srcEntityID;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:7,代码来源:entityconversionfileviewer.php
示例7: CheckImportPermission
public static function CheckImportPermission($enitityType, $userPermissions = null)
{
$enitityTypeName = is_numeric($enitityType) ? CCrmOwnerType::ResolveName($enitityType) : strtoupper(strval($enitityType));
if (!$userPermissions) {
$userPermissions = self::GetUserPermissions();
}
return !$userPermissions->HavePerm($enitityTypeName, BX_CRM_PERM_NONE, 'IMPORT');
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:8,代码来源:crm_authorization_helper.php
示例8: __construct
protected function __construct($entityTypeID)
{
if (!is_int($entityTypeID)) {
throw new Main\ArgumentTypeException('entityTypeID', 'integer');
}
if (!\CCrmOwnerType::IsDefined($entityTypeID)) {
throw new Main\NotSupportedException("Entity ID: '{$entityTypeID}' is not supported in current context");
}
$this->entityTypeID = $entityTypeID;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:10,代码来源:duplicatechecker.php
示例9: createMap
/**
* Create conversion map for destination entity type
* @static
* @param int $entityTypeID Destination Entity Type ID
* @return EntityConversionMap
*/
public static function createMap($entityTypeID)
{
if (!is_int($entityTypeID)) {
$entityTypeID = (int) $entityTypeID;
}
if (!\CCrmOwnerType::IsDefined($entityTypeID)) {
throw new Main\ArgumentOutOfRangeException('dstEntityTypeID', \CCrmOwnerType::FirstOwnerType, \CCrmOwnerType::LastOwnerType);
}
if ($entityTypeID !== \CCrmOwnerType::Deal && $entityTypeID !== \CCrmOwnerType::Invoice) {
$dstEntityTypeName = \CCrmOwnerType::ResolveName($entityTypeID);
throw new Main\NotSupportedException("Entity type: '{$dstEntityTypeName}' is not supported in current context");
}
$map = new EntityConversionMap(\CCrmOwnerType::Quote, $entityTypeID);
if ($entityTypeID === \CCrmOwnerType::Deal) {
//region Deal Map Static Field Bindings
$map->createItem('TITLE');
$map->createItem('COMMENTS');
$map->createItem('ASSIGNED_BY_ID');
$map->createItem('OPENED');
$map->createItem('OPPORTUNITY');
$map->createItem('CURRENCY_ID');
$map->createItem('TAX_VALUE');
$map->createItem('EXCH_RATE');
$map->createItem('LOCATION_ID');
$map->createItem('LEAD_ID');
$map->createItem('COMPANY_ID');
$map->createItem('CONTACT_ID');
$map->createItem('PRODUCT_ROWS');
//endregion
//region Invoice Map User Field Bindings
$intersections = UserFieldSynchronizer::getIntersection(\CCrmOwnerType::Quote, \CCrmOwnerType::Deal);
foreach ($intersections as $intersection) {
$map->createItem($intersection['SRC_FIELD_NAME'], $intersection['DST_FIELD_NAME']);
}
//endregion
}
if ($entityTypeID === \CCrmOwnerType::Invoice) {
//region Invoice Map Static Field Bindings
$map->createItem('TITLE', 'ORDER_TOPIC');
$map->createItem('COMPANY_ID', 'UF_COMPANY_ID');
$map->createItem('CONTACT_ID', 'UF_CONTACT_ID');
$map->createItem('DEAL_ID', 'UF_DEAL_ID');
$map->createItem('ASSIGNED_BY_ID', 'RESPONSIBLE_ID');
$map->createItem('COMMENTS');
$map->createItem('PRODUCT_ROWS');
//endregion
//region Invoice Map User Field Bindings
$intersections = UserFieldSynchronizer::getIntersection(\CCrmOwnerType::Quote, \CCrmOwnerType::Invoice);
foreach ($intersections as $intersection) {
$map->createItem($intersection['SRC_FIELD_NAME'], $intersection['DST_FIELD_NAME']);
}
//endregion
}
return $map;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:61,代码来源:quoteconversionmapper.php
示例10: internalize
public function internalize(array $params)
{
$this->items = array();
foreach ($params as $k => $v) {
$entityTypeID = \CCrmOwnerType::ResolveID($k);
if ($entityTypeID !== \CCrmOwnerType::Undefined) {
$item = new EntityConversionConfigItem($entityTypeID);
$item->internalize($v);
$this->addItem($item);
}
}
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:12,代码来源:entityconversionconfig.php
示例11: createDuplicate
/**
* @return Duplicate
*/
public function createDuplicate($entityTypeID, $rootEntityID, $userID, $enablePermissionCheck, $enableRanking, $limit = 0)
{
if ($entityTypeID !== \CCrmOwnerType::Lead && $entityTypeID !== \CCrmOwnerType::Contact && $entityTypeID !== \CCrmOwnerType::Company) {
throw new Main\NotSupportedException("Entity type: '" . \CCrmOwnerType::ResolveName($entityTypeID) . "' is not supported in current context");
}
/** @var Duplicate $dup **/
$dup = new Duplicate($this, array());
$query = static::createQuery();
$query->addSelect('ENTITY_ID');
$query->addFilter('=ENTITY_TYPE_ID', $entityTypeID);
static::setQueryFilter($query, $this->getMatches());
if ($enablePermissionCheck) {
$permissions = isset($params['PERMISSIONS']) ? $params['PERMISSIONS'] : null;
if ($permissions === null) {
$permissions = \CCrmPerms::GetUserPermissions($userID);
}
$permissionSql = \CCrmPerms::BuildSql(\CCrmOwnerType::ResolveName($entityTypeID), '', 'READ', array('RAW_QUERY' => true, 'PERMS' => $permissions));
if ($permissionSql === false) {
//Access denied;
return null;
}
if ($permissionSql !== '') {
$query->addFilter('@ENTITY_ID', new Main\DB\SqlExpression($permissionSql));
}
}
if ($limit > 0) {
$query->setLimit($limit);
}
if ($rootEntityID > 0) {
$dup->setRootEntityID($rootEntityID);
$query->addFilter('!ENTITY_ID', $rootEntityID);
$query->addFilter('!@ENTITY_ID', DuplicateIndexMismatch::prepareQueryField($this, $entityTypeID, $rootEntityID, $userID));
}
$dbResult = $query->exec();
$rankings = array();
while ($fields = $dbResult->fetch()) {
$entityID = isset($fields['ENTITY_ID']) ? intval($fields['ENTITY_ID']) : 0;
if ($entityID <= 0) {
continue;
}
$entity = new DuplicateEntity($entityTypeID, $entityID);
if ($enableRanking) {
$rankings[] = $entity->getRanking();
}
$dup->addEntity($entity);
}
$this->onAfterDuplicateCreated($dup, $entityTypeID, $userID, $enablePermissionCheck, $enableRanking, $rankings);
if ($enableRanking) {
DuplicateEntityRanking::initializeBulk($rankings, array('CHECK_PERMISSIONS' => $enablePermissionCheck, 'USER_ID' => $userID));
}
return $dup;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:55,代码来源:duplicatecriterion.php
示例12: preparePermissionSql
protected function preparePermissionSql()
{
if ($this->permissionSql !== null) {
return $this->permissionSql;
}
$userID = $this->getUserID();
if (\CCrmPerms::IsAdmin($userID)) {
$this->permissionSql = '';
} else {
$this->permissionSql = \CCrmPerms::BuildSql(\CCrmOwnerType::ResolveName($this->getEntityTypeID()), '', 'READ', array('RAW_QUERY' => true, 'PERMS' => \CCrmPerms::GetUserPermissions($userID)));
}
return $this->permissionSql;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:13,代码来源:dedupedatasource.php
示例13: setEntityTypeID
public function setEntityTypeID($entityTypeID)
{
if (!is_integer($entityTypeID)) {
$entityTypeID = intval($entityTypeID);
}
if (!\CCrmOwnerType::IsDefined($entityTypeID)) {
$entityTypeID = \CCrmOwnerType::Undefined;
}
if ($this->entityTypeID === $entityTypeID) {
return;
}
$this->entityTypeID = $entityTypeID;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:13,代码来源:dedupeparams.php
示例14: ParseEntityKey
public static function ParseEntityKey($key, &$entityInfo)
{
if (preg_match(self::$ENTITY_KEY, strval($key), $match) !== 1) {
$entityInfo = array();
return false;
}
$entityTypeAbbr = strtoupper($match[1]);
$entityID = intval($match[2]);
$entityTypeID = CCrmOwnerType::ResolveID($entityTypeAbbr);
$entityTypeName = CCrmOwnerType::ResolveName($entityTypeID);
$entityInfo = array('ENTITY_TYPE_ABBR' => $entityTypeAbbr, 'ENTITY_TYPE_ID' => $entityTypeID, 'ENTITY_TYPE_NAME' => $entityTypeName, 'ENTITY_ID' => $entityID);
return true;
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:13,代码来源:entity_helper.php
示例15: GetDefaultGrigID
public static function GetDefaultGrigID($entityTypeID)
{
$entityTypeID = (int) $entityTypeID;
if (!CCrmOwnerType::IsDefined($entityTypeID)) {
return '';
}
if ($entityTypeID === CCrmOwnerType::Lead) {
return 'CRM_LEAD_LIST_V12';
} elseif ($entityTypeID === CCrmOwnerType::Deal) {
return 'CRM_DEAL_LIST_V12';
} elseif ($entityTypeID === CCrmOwnerType::Contact) {
return 'CRM_CONTACT_LIST_V12';
} elseif ($entityTypeID === CCrmOwnerType::Company) {
return 'CRM_COMPANY_LIST_V12';
}
return '';
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:17,代码来源:crm_grids.php
示例16: deleteByEntity
public static function deleteByEntity($entityTypeID, $entityID)
{
if (!is_int($entityTypeID)) {
$entityTypeID = (int) $entityTypeID;
}
if (!\CCrmOwnerType::IsDefined($entityTypeID)) {
throw new Main\ArgumentException("Is not defined or invalid", 'entityTypeID');
}
if (!is_int($entityID)) {
$entityID = (int) $entityID;
}
if ($entityID <= 0) {
throw new Main\ArgumentException("Must be greater than zero", 'entityID');
}
$connection = Main\Application::getConnection();
$connection->queryExecute("DELETE FROM b_crm_dp_index_mismatch WHERE ENTITY_TYPE_ID = {$entityTypeID} AND L_ENTITY_ID = {$entityID}");
$connection->queryExecute("DELETE FROM b_crm_dp_index_mismatch WHERE ENTITY_TYPE_ID = {$entityTypeID} AND R_ENTITY_ID = {$entityID}");
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:18,代码来源:duplicateindexmismatch.php
示例17: create
/** Create new entity merger by specified entity type ID
* @static
* @param int $entityTypeID
* @param int $currentUserID
* @param bool $enablePermissionCheck
* @return EntityMerger
*/
public static function create($entityTypeID, $currentUserID, $enablePermissionCheck = false)
{
if (!is_int($entityTypeID)) {
$entityTypeID = (int) $entityTypeID;
}
if (!\CCrmOwnerType::IsDefined($entityTypeID)) {
throw new Main\ArgumentException('Is not defined', 'entityTypeID');
}
if ($entityTypeID === \CCrmOwnerType::Lead) {
return new LeadMerger($currentUserID, $enablePermissionCheck);
} elseif ($entityTypeID === \CCrmOwnerType::Contact) {
return new ContactMerger($currentUserID, $enablePermissionCheck);
} elseif ($entityTypeID === \CCrmOwnerType::Company) {
return new CompanyMerger($currentUserID, $enablePermissionCheck);
} else {
throw new Main\NotSupportedException("Entity type: '" . \CCrmOwnerType::ResolveName($entityTypeID) . "' is not supported in current context");
}
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:25,代码来源:entitymergerfactory.php
示例18: enabledFor
public function enabledFor($entityTypeID, $enable)
{
if (!is_int($entityTypeID)) {
throw new Main\ArgumentTypeException('entityTypeID', 'integer');
}
if (!\CCrmOwnerType::IsDefined($entityTypeID)) {
throw new Main\NotSupportedException("Entity ID: '{$entityTypeID}' is not supported in current context");
}
if (!is_bool($enable)) {
if (is_numeric($enable)) {
$enable = $enable > 0;
} elseif (is_string($enable)) {
$enable = strtoupper($enable) === 'Y';
} else {
$enable = false;
}
}
$this->settings['enableFor'][\CCrmOwnerType::ResolveName($entityTypeID)] = $enable ? 'Y' : 'N';
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:19,代码来源:duplicatecontrol.php
示例19: canRead
public function canRead($userId)
{
if ($this->canRead !== null) {
return $this->canRead;
}
/** @noinspection PhpDynamicAsStaticMethodCallInspection */
if (\CSocNetUser::isCurrentUserModuleAdmin()) {
$this->canRead = true;
return $this->canRead;
}
if ($comment = $this->loadLogCommentData()) {
if (strpos($comment["EVENT_ID"], "crm_") === 0) {
$queryLog = \CSocNetLog::getList(array(), array("ID" => intval($comment["LOG_ID"])), false, false, array("ID", "ENTITY_TYPE", "ENTITY_ID"));
if (($log = $queryLog->fetch()) && Loader::includeModule("crm")) {
$userPermissions = \CCrmPerms::getUserPermissions($userId);
if ($log["ENTITY_TYPE"] == "CRMACTIVITY") {
$bindings = \CCRMActivity::getBindings($log["ENTITY_ID"]);
foreach ($bindings as $binding) {
if (\CCrmAuthorizationHelper::checkReadPermission(\CCrmOwnerType::resolveName($binding["OWNER_TYPE_ID"]), $binding["OWNER_ID"], $userPermissions)) {
$this->canRead = true;
return $this->canRead;
}
}
} else {
if (\CCrmAuthorizationHelper::checkReadPermission(\CCrmLiveFeedEntity::resolveEntityTypeID($log["ENTITY_TYPE"]), $log["ENTITY_ID"], $userPermissions)) {
$this->canRead = true;
return $this->canRead;
} elseif (intval($comment["LOG_ID"]) > 0 && \CSocNetLogRights::checkForUser($comment["LOG_ID"], $userId)) {
$this->canRead = true;
return $this->canRead;
}
}
}
} elseif (intval($comment["LOG_ID"]) > 0 && \CSocNetLogRights::checkForUser($comment["LOG_ID"], $userId)) {
$this->canRead = true;
return $this->canRead;
}
}
$this->canRead = false;
return $this->canRead;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:41,代码来源:sonetcommentconnector.php
示例20: PrepareTemplate
public static function PrepareTemplate($template, $entityTypeID, $entityID, $contentTypeID = 0)
{
$template = strval($template);
if ($template === '') {
return '';
}
$entityTypeName = CCrmOwnerType::ResolveName($entityTypeID);
$entityID = intval($entityID);
if ($entityTypeName === '' || $entityID <= 0) {
return $template;
}
$matches = null;
$result = preg_match_all('/#' . $entityTypeName . '\\.[^#]+#/i', $template, $matches, PREG_OFFSET_CAPTURE);
if (!(is_int($result) && $result > 0)) {
return $template;
}
$mapper = self::ResolveMapper($entityTypeID, $entityID);
if ($mapper === null) {
return $template;
}
$contentTypeID = intval($contentTypeID);
if (!CCrmContentType::IsDefined($contentTypeID)) {
$contentTypeID = CCrmContentType::PlainText;
}
$mapper->SetContentType($contentTypeID);
$replaceKeys = array();
$replaceValues = array();
foreach ($matches[0] as &$match) {
$key = $match[0];
if (isset($replacements[$key])) {
continue;
}
$path = substr($key, 1, strlen($key) - 2);
$replaceKeys[] = $key;
$replaceValues[] = $mapper->MapPath($path);
}
unset($match);
return !empty($replaceKeys) ? str_replace($replaceKeys, $replaceValues, $template) : $template;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:39,代码来源:template_manager.php
注:本文中的CCrmOwnerType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论