Skip to content

Instantly share code, notes, and snippets.

@aclips
Last active February 5, 2020 07:51
Show Gist options
  • Save aclips/0f5700bf93407da6a335be397d29b771 to your computer and use it in GitHub Desktop.
Save aclips/0f5700bf93407da6a335be397d29b771 to your computer and use it in GitHub Desktop.
Bitrix24 get semantic deal stages (STAGE_SEMANTIC_ID)
<?
\Bitrix\Main\Loader::includeModule('crm');
$categoryID = 0;
$stages = \CCrmDeal::GetStages($categoryID);
$semanticStages = array_map(function($item) use ($categoryID){
$stage = $item['STATUS_ID'];
$semanticTitle = \CCrmDeal::GetStageSemantics($stage, $categoryID);
$semanticStageId = null;
switch ($semanticTitle)
{
case 'process':
$semanticStageId = 'P';
break;
case 'success':
$semanticStageId = 'S';
break;
case 'failure':
case 'apology':
$semanticStageId = 'F';
break;
}
return $semanticStageId;
}, $stages);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment