コード例 #1
0
ファイル: component.php プロジェクト: mrdeadmouse/u136006
                        $arUpdate['NAME'] = trim($arField['VALUE']);
                        $arUpdate['SORT'] = $arField['SORT'];
                        $CCrmStatus->Update($id, $arUpdate);
                    }
                }
            }
        }
    }
    $arResult['ACTIVE_TAB'] = $_POST['ACTIVE_TAB'];
}
$ar = CCrmStatus::GetEntityTypes();
foreach ($ar as $entityId => $arEntityType) {
    $arResult['HEADERS'][$entityId] = $arEntityType['NAME'];
    $arResult['ROWS'][$entityId] = array();
}
$res = CCrmStatus::GetList(array('SORT' => 'ASC'));
while ($ar = $res->Fetch()) {
    $arResult['ROWS'][$ar['ENTITY_ID']][$ar['ID']] = $ar;
}
/*
 * We can add here some elements to status list of own type(s)
 * TODO: transfer to GetList
 */
$events = GetModuleEvents("crm", "OnCrmStatusGetList");
while ($arEvent = $events->Fetch()) {
    $arStatuses = ExecuteModuleEventEx($arEvent);
    foreach ($arStatuses as $key => $arStatus) {
        $arResult['ROWS'][$arStatus['ENTITY_ID']][$arStatus['ID']] = $arStatus;
    }
}
/**/
コード例 #2
0
ファイル: restservice.php プロジェクト: mrdeadmouse/u136006
 public function getEntityItems($entityID)
 {
     if (!CCrmStatus::CheckReadPermission(0)) {
         throw new RestException('Access denied.');
     }
     if ($entityID === '') {
         throw new RestException('The parameter entityId is not defined or invalid.');
     }
     //return CCrmStatus::GetStatusList($entityID);
     $dbResult = CCrmStatus::GetList(array('sort' => 'asc'), array('ENTITY_ID' => strtoupper($entityID)));
     if (!$dbResult) {
         return array();
     }
     $result = array();
     while ($fields = $dbResult->Fetch()) {
         $result[] = array('NAME' => $fields['NAME'], 'SORT' => intval($fields['SORT']), 'STATUS_ID' => $fields['STATUS_ID']);
     }
     return $result;
 }