<tr> <td align="right" width="40%"><?php echo GetMessage("CPAD_CSP_STAGE"); ?> :</td> <td width="60%"> <select name="stage"> <option value=""><?php echo GetMessage("CPAD_CSP_STAGE_N"); ?> </option> <? $stages = CCrmStatus::GetStatus('DEAL_STAGE'); foreach ($stages as $stageId => $stage) { $s = CCrmDeal::GetStageSemantics($stageId); if ($s != 'process') continue; ?><option value="<?php echo $stageId; ?> "<?php echo $arCurrentValues["stage"] == $stageId ? " selected" : ""; ?> ><?php echo str_replace("#NAME#", $stage['NAME'], GetMessage("CPAD_CSP_STAGE_P")); ?> </option><? } ?> </select>
public function OnExternalEvent($arEventParameters = array()) { if ($this->executionStatus != CBPActivityExecutionStatus::Closed) { if ($this->DealId != $arEventParameters[0]['ID']) return; if (!isset($arEventParameters[0]['STAGE_ID'])) return; $stageSemantics = CCrmDeal::GetStageSemantics($arEventParameters[0]['STAGE_ID']); if ($this->WaitForState != $arEventParameters[0]['STAGE_ID'] && $stageSemantics == 'process') { return; } $this->StageSemantics = $stageSemantics; $this->Unsubscribe($this); $this->workflow->CloseActivity($this); } }