當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CCrmStatus::Update方法代碼示例

本文整理匯總了PHP中CCrmStatus::Update方法的典型用法代碼示例。如果您正苦於以下問題:PHP CCrmStatus::Update方法的具體用法?PHP CCrmStatus::Update怎麽用?PHP CCrmStatus::Update使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CCrmStatus的用法示例。


在下文中一共展示了CCrmStatus::Update方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: innerUpdate

 protected function innerUpdate($ID, &$fields, &$errors, array $params = null)
 {
     if (!CCrmStatus::CheckUpdatePermission($ID)) {
         $errors[] = 'Access denied.';
         return false;
     }
     $dbResult = CCrmStatus::GetList(array(), array('ID' => $ID));
     $currentFields = $dbResult ? $dbResult->Fetch() : null;
     if (!is_array($currentFields)) {
         $errors[] = 'CRM Status is not found.';
         return false;
     }
     $entity = new CCrmStatus($currentFields['ENTITY_ID']);
     $result = $entity->Update($ID, $fields);
     if ($result === false) {
         $errors[] = $entity->GetLastError();
     }
     return $result !== false;
 }
開發者ID:mrdeadmouse,項目名稱:u136006,代碼行數:19,代碼來源:restservice.php

示例2: trim

            $iPrevSort = $arField['SORT'];
            if (substr($id, 0, 1) == 'n') {
                if (trim($arField['VALUE']) == "") {
                    continue;
                }
                $arAdd['NAME'] = trim($arField['VALUE']);
                $arAdd['SORT'] = $arField['SORT'];
                $CCrmStatus->Add($arAdd);
            } else {
                if (!isset($arField['VALUE']) || trim($arField['VALUE']) == "") {
                    $arCurrentData = $CCrmStatus->GetStatusById($id);
                    if ($arCurrentData['SYSTEM'] == 'N') {
                        $CCrmStatus->Delete($id);
                    } else {
                        $arUpdate['NAME'] = trim($arCurrentData['NAME_INIT']);
                        $CCrmStatus->Update($id, $arUpdate);
                    }
                } else {
                    $arCurrentData = $CCrmStatus->GetStatusById($id);
                    if (trim($arField['VALUE']) != $arCurrentData['NAME'] || intval($arField['SORT']) != $arCurrentData['SORT']) {
                        $arUpdate['NAME'] = trim($arField['VALUE']);
                        $arUpdate['SORT'] = $arField['SORT'];
                        $CCrmStatus->Update($id, $arUpdate);
                    }
                }
            }
        }
    }
    $arResult['ACTIVE_TAB'] = $_POST['ACTIVE_TAB'];
}
$ar = CCrmStatus::GetEntityTypes();
開發者ID:mrdeadmouse,項目名稱:u136006,代碼行數:31,代碼來源:component.php

示例3: isset

$action = isset($_REQUEST['ACTION']) ? $_REQUEST['ACTION'] : '';
if ($action === 'FIX_STATUSES') {
    if (COption::GetOptionString('crm', '~CRM_FIX_STATUSES', 'N') !== 'Y') {
        __CrmConfigStatusEndResonse(array('COMPLETED' => 'Y'));
    }
    $dbRes = $DB->Query("SELECT ENTITY_ID, STATUS_ID FROM b_crm_status WHERE SYSTEM = 'N' GROUP BY ENTITY_ID, STATUS_ID HAVING COUNT(*) > 1", false, 'FILE: ' . __FILE__ . '<br /> LINE: ' . __LINE__);
    $items = array();
    while ($arRes = $dbRes->Fetch()) {
        $items[] = $arRes;
    }
    foreach ($items as $item) {
        $entityID = isset($item['ENTITY_ID']) ? $item['ENTITY_ID'] : '';
        $statusID = isset($item['STATUS_ID']) ? (int) $item['STATUS_ID'] : 0;
        if ($entityID === '' || $statusID <= 0) {
            continue;
        }
        $dbRes = $DB->Query("SELECT ID, SORT, NAME, SYSTEM FROM b_crm_status WHERE ENTITY_ID = '{$entityID}' AND STATUS_ID = '{$statusID}'", false, 'FILE: ' . __FILE__ . '<br /> LINE: ' . __LINE__);
        $entity = new CCrmStatus($entityID);
        $isFirst = true;
        while ($arRes = $dbRes->Fetch()) {
            if ($isFirst) {
                $isFirst = false;
                continue;
            }
            $itemID = (int) $arRes['ID'];
            $error = $entity->Update($itemID, array('STATUS_ID' => $entity->GetNextStatusId(), 'SORT' => isset($arRes['SORT']) ? (int) $arRes['SORT'] : 10, 'SYSTEM' => isset($arRes['SYSTEM']) ? $arRes['SYSTEM'] : 'N', 'NAME' => isset($arRes['NAME']) ? $arRes['NAME'] : ''), array('ENABLE_STATUS_ID' => true));
        }
    }
    COption::RemoveOption('crm', '~CRM_FIX_STATUSES');
    __CrmConfigStatusEndResonse(array('COMPLETED' => 'Y'));
}
開發者ID:mrdeadmouse,項目名稱:u136006,代碼行數:31,代碼來源:ajax.php


注:本文中的CCrmStatus::Update方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。