本文整理匯總了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;
}