} } // save LocalRedirect(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_QUOTE_LIST'], array())); } } } elseif (isset($_GET['delete']) && check_bitrix_sessid()) { if ($bEdit) { $arResult['ERROR_MESSAGE'] = ''; if (!$CCrmQuote->cPerms->CheckEnityAccess('QUOTE', 'DELETE', $arEntityAttr[$arParams['ELEMENT_ID']])) { $arResult['ERROR_MESSAGE'] .= GetMessage('CRM_PERMISSION_DENIED') . '<br />'; } /*---bizproc---$bDeleteError = !$CCrmBizProc->Delete($arResult['ELEMENT']['ID'], $arEntityAttr[$arParams['ELEMENT_ID']]); if ($bDeleteError) $arResult['ERROR_MESSAGE'] .= $CCrmBizProc->LAST_ERROR;*/ if (empty($arResult['ERROR_MESSAGE']) && !$CCrmQuote->Delete($arResult['ELEMENT']['ID'])) { $arResult['ERROR_MESSAGE'] = GetMessage('CRM_DELETE_ERROR'); } if (empty($arResult['ERROR_MESSAGE'])) { LocalRedirect(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_QUOTE_LIST'])); } else { ShowError($arResult['ERROR_MESSAGE']); } return; } else { ShowError(GetMessage('CRM_DELETE_ERROR')); return; } } $arResult['BACK_URL'] = !empty($arResult['QUOTE_REFERER']) ? $arResult['QUOTE_REFERER'] : $arParams['PATH_TO_QUOTE_LIST']; $arResult['STATUS_LIST'] = array();
$arFilterDel = array(); if (!$actionData['ALL_ROWS']) { $arFilterDel = array('ID' => $actionData['ID']); } else { // Fix for issue #26628 $arFilterDel += $arFilter; } $obRes = CCrmQuote::GetList(array(), $arFilterDel, false, false, array('ID')); while ($arQuote = $obRes->Fetch()) { $ID = $arQuote['ID']; $arEntityAttr = $CCrmPerms->GetEntityAttr('QUOTE', array($ID)); if (!$CCrmPerms->CheckEnityAccess('QUOTE', 'DELETE', $arEntityAttr[$ID])) { continue; } $DB->StartTransaction(); if ($CCrmQuote->Delete($ID)) { $DB->Commit(); } else { $DB->Rollback(); } } } } elseif ($actionData['NAME'] == 'edit') { if (isset($actionData['FIELDS']) && is_array($actionData['FIELDS'])) { foreach ($actionData['FIELDS'] as $ID => $arSrcData) { $arEntityAttr = $CCrmPerms->GetEntityAttr('QUOTE', array($ID)); if (!$CCrmPerms->CheckEnityAccess('QUOTE', 'WRITE', $arEntityAttr[$ID])) { continue; } $arUpdateData = array(); reset($arResult['HEADERS']);