本文整理汇总了PHP中CCrmDeal::PrepareConversionPermissionFlags方法的典型用法代码示例。如果您正苦于以下问题:PHP CCrmDeal::PrepareConversionPermissionFlags方法的具体用法?PHP CCrmDeal::PrepareConversionPermissionFlags怎么用?PHP CCrmDeal::PrepareConversionPermissionFlags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCrmDeal
的用法示例。
在下文中一共展示了CCrmDeal::PrepareConversionPermissionFlags方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getJavaScriptDescriptions
/**
* @return array Array of strings
*/
public static function getJavaScriptDescriptions($checkPermissions = false)
{
$result = array();
$descriptions = self::getAllDescriptions();
if (!$checkPermissions) {
$isInvoicePermitted = true;
$isQuotePermitted = true;
} else {
$flags = array();
\CCrmDeal::PrepareConversionPermissionFlags(0, $flags);
$isInvoicePermitted = $flags['CAN_CONVERT_TO_INVOICE'];
$isQuotePermitted = $flags['CAN_CONVERT_TO_QUOTE'];
}
if ($isInvoicePermitted && $isQuotePermitted) {
foreach ($descriptions as $schemeID => $description) {
$result[self::resolveName($schemeID)] = $description;
}
} else {
$schemes = array();
if ($isInvoicePermitted) {
$schemes[] = self::INVOICE;
}
if ($isQuotePermitted) {
$schemes[] = self::QUOTE;
}
foreach ($schemes as $schemeID) {
$result[self::resolveName($schemeID)] = $descriptions[$schemeID];
}
}
return $result;
}