当前位置: 首页>>代码示例>>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;未经允许,请勿转载。