本文整理汇总了PHP中CCrmStatus::GetStatusByStatusId方法的典型用法代码示例。如果您正苦于以下问题:PHP CCrmStatus::GetStatusByStatusId方法的具体用法?PHP CCrmStatus::GetStatusByStatusId怎么用?PHP CCrmStatus::GetStatusByStatusId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCrmStatus
的用法示例。
在下文中一共展示了CCrmStatus::GetStatusByStatusId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Add
public function Add($arFields, $bPermCheck = true)
{
$err_mess = self::err_mess() . '<br />Function: Add<br />Line: ';
$db_events = GetModuleEvents('crm', 'OnBeforeCrmAddEvent');
while ($arEvent = $db_events->Fetch()) {
$arFields = ExecuteModuleEventEx($arEvent, array($arFields));
}
if (isset($arFields['ENTITY']) && is_array($arFields['ENTITY'])) {
foreach ($arFields['ENTITY'] as $key => $arEntity) {
if (!(isset($arEntity['ENTITY_TYPE']) && isset($arEntity['ENTITY_ID']))) {
unset($arEntity['ENTITY'][$key]);
}
}
} else {
if (isset($arFields['ENTITY_TYPE']) && isset($arFields['ENTITY_ID'])) {
$arFields['ENTITY'] = array(array('ENTITY_TYPE' => $arFields['ENTITY_TYPE'], 'ENTITY_ID' => $arFields['ENTITY_ID'], 'ENTITY_FIELD' => isset($arFields['ENTITY_FIELD']) ? $arFields['ENTITY_FIELD'] : ''));
} else {
return false;
}
}
if (isset($arFields['EVENT_ID'])) {
$CCrmStatus = new CCrmStatus('EVENT_TYPE');
$ar = $CCrmStatus->GetStatusByStatusId($arFields['EVENT_ID']);
$arFields['EVENT_NAME'] = isset($ar['NAME']) ? $ar['NAME'] : '';
}
if (!$this->CheckFields($arFields)) {
return false;
}
if (!isset($arFields['EVENT_TYPE'])) {
$arFields['EVENT_TYPE'] = 0;
}
$arFiles = array();
if (isset($arFields['FILES']) && !empty($arFields['FILES'])) {
$arFields['~FILES'] = array();
if (isset($arFields['FILES'][0])) {
$arFields['~FILES'] = $arFields['FILES'];
} else {
foreach ($arFields['FILES'] as $type => $ar) {
foreach ($ar as $key => $value) {
$arFields['~FILES'][$key][$type] = $value;
}
}
}
foreach ($arFields['~FILES'] as &$arFile) {
$arFile['del'] = 'N';
$arFile['MODULE_ID'] = 'crm';
$fid = intval(CFile::SaveFile($arFile, 'crm'));
if ($fid > 0) {
$arFiles[] = $fid;
}
}
unset($arFile);
}
$arFields_i = array('ASSIGNED_BY_ID' => (int) (isset($arFields['USER_ID']) ? intval($arFields['USER_ID']) : $this->currentUserID), 'CREATED_BY_ID' => (int) (isset($arFields['USER_ID']) ? intval($arFields['USER_ID']) : $this->currentUserID), 'EVENT_ID' => isset($arFields['EVENT_ID']) ? $arFields['EVENT_ID'] : '', 'EVENT_NAME' => $arFields['EVENT_NAME'], 'EVENT_TYPE' => intval($arFields['EVENT_TYPE']), 'EVENT_TEXT_1' => isset($arFields['EVENT_TEXT_1']) ? $arFields['EVENT_TEXT_1'] : '', 'EVENT_TEXT_2' => isset($arFields['EVENT_TEXT_2']) ? $arFields['EVENT_TEXT_2'] : '', 'FILES' => serialize($arFiles));
if (isset($arFields['DATE_CREATE']) && !empty($arFields['DATE_CREATE'])) {
$arFields_i['DATE_CREATE'] = $arFields['DATE_CREATE'];
} else {
$arFields_i['~DATE_CREATE'] = $this->cdb->GetNowFunction();
}
$EVENT_ID = $this->cdb->Add('b_crm_event', $arFields_i, array("FILES"), 'FILE: ' . __FILE__ . '<br /> LINE: ' . __LINE__);
$this->AddRelation($EVENT_ID, $arFields['ENTITY'], $bPermCheck);
$db_events = GetModuleEvents('crm', 'OnAfterCrmAddEvent');
while ($arEvent = $db_events->Fetch()) {
ExecuteModuleEventEx($arEvent, array($EVENT_ID, $arFields));
}
return $EVENT_ID;
}