当前位置: 首页>>代码示例>>PHP>>正文


PHP CCatalogMeasure::delete方法代码示例

本文整理汇总了PHP中CCatalogMeasure::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP CCatalogMeasure::delete方法的具体用法?PHP CCatalogMeasure::delete怎么用?PHP CCatalogMeasure::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CCatalogMeasure的用法示例。


在下文中一共展示了CCatalogMeasure::delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: GetMessage

                        $errors[] = $exception->GetString();
                    } else {
                        $errors[] = GetMessage('CRM_MEASURE_ERR_CREATE');
                    }
                }
            }
            $fields['ID'] = $elementID;
            $arResult['ELEMENT'] = $fields;
        }
        if (!empty($errors)) {
            ShowError(implode("\n", $errors));
        } else {
            LocalRedirect(isset($_POST['apply']) ? CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_MEASURE_EDIT'], array('measure_id' => $elementID)) : CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_MEASURE_LIST']));
        }
    } elseif ($_SERVER['REQUEST_METHOD'] === 'GET' && isset($_GET['delete']) && $elementID > 0) {
        CCatalogMeasure::delete($elementID);
        LocalRedirect(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_MEASURE_LIST']));
    }
}
$arResult['FORM_ID'] = !empty($arParams['FORM_ID']) ? $arParams['FORM_ID'] : 'CRM_MEASURE_EDIT';
$arResult['GRID_ID'] = 'CRM_MEASURE_LIST';
$arResult['BACK_URL'] = $arParams['PATH_TO_MEASURE_LIST'];
$arResult['FIELDS'] = array();
$arResult['FIELDS']['tab_1'][] = array('id' => 'section_measure_info', 'name' => GetMessage('CRM_SECTION_MEASURE_INFO'), 'type' => 'section');
if ($isEditMode) {
    $arResult['FIELDS']['tab_1'][] = array('id' => 'ID', 'name' => GetMessage('CRM_MEASURE_FIELD_ID'), 'value' => isset($arResult['ELEMENT']['ID']), 'type' => 'label');
}
$arResult['FIELDS']['tab_1'][] = array('id' => 'IS_DEFAULT', 'name' => GetMessage('CRM_MEASURE_FIELD_IS_DEFAULT'), 'value' => isset($arResult['ELEMENT']['IS_DEFAULT']) ? $arResult['ELEMENT']['IS_DEFAULT'] : 'N', 'type' => 'checkbox');
$arResult['FIELDS']['tab_1'][] = array('id' => 'CODE', 'name' => GetMessage('CRM_MEASURE_FIELD_CODE'), 'value' => isset($arResult['ELEMENT']['CODE']) ? $arResult['ELEMENT']['CODE'] : '', 'type' => 'text', 'required' => true);
$arResult['FIELDS']['tab_1'][] = array('id' => 'MEASURE_TITLE', 'name' => GetMessage('CRM_MEASURE_FIELD_MEASURE_TITLE'), 'value' => isset($arResult['ELEMENT']['MEASURE_TITLE']) ? $arResult['ELEMENT']['MEASURE_TITLE'] : '', 'type' => 'text', 'required' => true);
$arResult['FIELDS']['tab_1'][] = array('id' => 'SYMBOL_RUS', 'name' => GetMessage('CRM_MEASURE_FIELD_SYMBOL_RUS'), 'value' => isset($arResult['ELEMENT']['SYMBOL_RUS']) ? $arResult['ELEMENT']['SYMBOL_RUS'] : '', 'type' => 'text');
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php

示例2: LocalRedirect

                        if (isset($arHead['editable']) && $arHead['editable'] == true && isset($arSrcData[$arHead['id']])) {
                            $arUpdateData[$arHead['id']] = $arSrcData[$arHead['id']];
                        }
                    }
                    if (!empty($arUpdateData)) {
                        CCatalogMeasure::update($ID, $arUpdateData);
                    }
                }
            }
        }
        if (!$actionData['AJAX_CALL']) {
            LocalRedirect($arParams['PATH_TO_MEASURE_LIST']);
        }
    } else {
        if ($actionData['NAME'] === 'delete' && isset($actionData['ID'])) {
            CCatalogMeasure::delete($actionData['ID']);
        }
        if (!$actionData['AJAX_CALL']) {
            LocalRedirect($arParams['PATH_TO_MEASURE_LIST']);
        }
    }
}
// <-- POST & GET actions processing
if (intval($arParams['MEASURE_COUNT']) <= 0) {
    $arParams['MEASURE_COUNT'] = 20;
}
$arNavParams = array('nPageSize' => $arParams['MEASURE_COUNT']);
$arNavigation = CDBResult::GetNavParams($arNavParams);
$gridOptions = new CCrmGridOptions($arResult['GRID_ID']);
$gridSorting = $gridOptions->GetSorting(array('sort' => array('CODE' => 'asc'), 'vars' => array('by' => 'by', 'order' => 'order')));
$arResult['SORT'] = $gridSorting['sort'];
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php


注:本文中的CCatalogMeasure::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。