Last active
February 5, 2020 07:51
-
-
Save aclips/0f5700bf93407da6a335be397d29b771 to your computer and use it in GitHub Desktop.
Bitrix24 get semantic deal stages (STAGE_SEMANTIC_ID)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
\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