本文整理汇总了PHP中CAdminList::AddUpdateError方法的典型用法代码示例。如果您正苦于以下问题:PHP CAdminList::AddUpdateError方法的具体用法?PHP CAdminList::AddUpdateError怎么用?PHP CAdminList::AddUpdateError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAdminList
的用法示例。
在下文中一共展示了CAdminList::AddUpdateError方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CAdminSorting
use Freetrix\Main\Localization\CultureTable;
use Freetrix\Main\Localization\Loc;
Loc::loadMessages(__FILE__);
$tableID = "tbl_culture";
$sorting = new CAdminSorting($tableID, "name", "asc");
$adminList = new CAdminList($tableID, $sorting);
/** @var $request Main\HttpRequest */
$request = Main\Context::getCurrent()->getRequest();
if ($adminList->EditAction() && $isAdmin) {
foreach ($request["FIELDS"] as $ID => $arFields) {
if (!$adminList->IsUpdated($ID)) {
continue;
}
$result = CultureTable::update($ID, $arFields);
if (!$result->isSuccess()) {
$adminList->AddUpdateError("(ID=" . $ID . ") " . implode("<br>", $result->getErrorMessages()), $ID);
}
}
}
if (($arID = $adminList->GroupAction()) && $isAdmin) {
if ($request['action_target'] == 'selected') {
$arID = array();
$data = CultureTable::getList();
while ($culture = $data->fetch()) {
$arID[] = $culture['ID'];
}
}
foreach ($arID as $ID) {
if (intval($ID) <= 0) {
continue;
}
示例2: isset
}
$DB->Commit();
}
}
$arID = $lAdmin->GroupAction();
$action = isset($_REQUEST["action"]) && is_string($_REQUEST["action"]) ? "{$_REQUEST['action']}" : "";
if (is_array($arID)) {
foreach ($arID as $ID) {
if (strlen($ID) <= 0 || intval($ID) <= 0) {
continue;
}
switch ($action) {
case "delete":
if (!CXDILFScheme::Delete($ID)) {
$e = $APPLICATION->GetException();
$lAdmin->AddUpdateError($e->GetString(), $ID);
}
break;
case "deactivate":
case "activate":
$cData = new CXDILFScheme();
$cData->Update($ID, array("ACTIVE" => $action == "deactivate" ? "N" : "Y"));
break;
default:
break;
}
}
}
$arHeaders = array(array("id" => "ID", "content" => GetMessage("LFP_SCHEME_LIST_ID"), "sort" => "ID", "align" => "right", "default" => true), array("id" => "NAME", "content" => GetMessage("LFP_SCHEME_LIST_NAME"), "sort" => "NAME", "align" => "left", "default" => true), array("id" => "ACTIVE", "content" => GetMessage("LFP_SCHEME_LIST_ACTIVE"), "sort" => "ACTIVE", "align" => "left", "default" => true), array("id" => "SORT", "content" => GetMessage("LFP_SCHEME_LIST_SORT"), "sort" => "SORT", "align" => "left", "default" => true), array("id" => "LID", "content" => GetMessage("LFP_SCHEME_LIST_LID"), "sort" => "LID", "align" => "left", "default" => true), array("id" => "TYPE", "content" => GetMessage("LFP_SCHEME_LIST_TYPE"), "sort" => "TYPE", "align" => "left", "default" => true));
$lAdmin->AddHeaders($arHeaders);
$rsData = CXDILFScheme::GetList(array($by => $order));
示例3: array
return true;
}
if (CheckFilter($arFilterFields)) {
$arFilter = array("ID" => $find_id, "TYPE" => $find_event_type, "TYPE_ID" => $find_type_id, "TIMESTAMP_1" => $find_timestamp_1, "TIMESTAMP_2" => $find_timestamp_2, "LANG" => $find_lid, "ACTIVE" => $find_active, "FROM" => $find != '' && $find_type == "from" ? $find : $find_from, "TO" => $find != '' && $find_type == "to" ? $find : $find_to, "BCC" => $find_bcc, "SUBJECT" => $find != '' && $find_type == "subject" ? $find : $find_subject, "BODY_TYPE" => $find_body_type, "BODY" => $find != '' && $find_type == "body" ? $find : $find_body);
}
// edit (Check rights before saving!)
if ($lAdmin->EditAction() && $isAdmin) {
foreach ($FIELDS as $ID => $arFields) {
if (!$lAdmin->IsUpdated($ID)) {
continue;
}
$DB->StartTransaction();
$ID = intval($ID);
$em = new CEventMessage();
if (!$em->Update($ID, $arFields)) {
$lAdmin->AddUpdateError(GetMessage("SAVE_ERROR") . $ID . ": " . $em->LAST_ERROR, $ID);
$DB->Rollback();
}
$DB->Commit();
}
}
// Actions
if (($arID = $lAdmin->GroupAction()) && $isAdmin) {
if ($_REQUEST['action_target'] == 'selected') {
$rsData = CEventMessage::GetList($by, $order, $arFilter);
while ($arRes = $rsData->Fetch()) {
$arID[] = $arRes['ID'];
}
}
foreach ($arID as $ID) {
if (strlen($ID) <= 0) {
示例4: array
);
}
if (array_key_exists("DETAIL_PICTURE", $arFields))
{
$arFields["DETAIL_PICTURE"] = CIBlock::makeFileArray(
$arFields["DETAIL_PICTURE"],
$_REQUEST["FIELDS_del"][$TYPE.$ID]["DETAIL_PICTURE"] === "Y",
$_REQUEST["FIELDS_descr"][$TYPE.$ID]["DETAIL_PICTURE"]
);
}
$DB->StartTransaction();
if(!$obS->Update($ID, $arFields, true, true, true))
{
$lAdmin->AddUpdateError(GetMessage("IBLIST_A_SAVE_ERROR", array("#ID#" => $ID, "#ERROR_MESSAGE#" => '<br>'.$obS->LAST_ERROR)), $TYPE.$ID);
$DB->Rollback();
}
else
{
$ipropValues = new \Bitrix\Iblock\InheritedProperty\sectionValues($IBLOCK_ID, $ID);
$ipropValues->clearValues();
$DB->Commit();
}
}
}
if($TYPE=="E")
{
$arRes = CIBlockElement::GetByID($ID);
$arRes = $arRes->Fetch();
示例5: foreach
if (strlen($filter_user) > 0) {
$arFilter["%USER_USER"] = $filter_user;
}
if (strlen($filter_active) > 0) {
$arFilter["ACTIVE"] = $filter_active;
}
if ($lAdmin->EditAction() && $saleModulePermissions >= "W") {
foreach ($FIELDS as $ID => $arFields) {
$DB->StartTransaction();
$ID = IntVal($ID);
if (!$lAdmin->IsUpdated($ID)) {
continue;
}
if (!CSaleUserCards::Update($ID, $arFields)) {
if ($ex = $APPLICATION->GetException()) {
$lAdmin->AddUpdateError($ex->GetString(), $ID);
} else {
$lAdmin->AddUpdateError(str_replace("#ID#", $ID, GetMessage("SCA_ERROR_UPDATE")), $ID);
}
$DB->Rollback();
}
$DB->Commit();
}
}
if (($arID = $lAdmin->GroupAction()) && $saleModulePermissions >= "W") {
if ($_REQUEST['action_target'] == 'selected') {
$arID = array();
$dbResultList = CSaleUserCards::GetList(array($by => $order), $arFilter, false, false, array("ID"));
while ($arResult = $dbResultList->Fetch()) {
$arID[] = $arResult['ID'];
}
示例6: array
InitBVar($find_comments_exact_match);
$arFilter = array("ID" => $find != '' && $find_type_f == "id" ? $find : $find_id, "ID_EXACT_MATCH" => $find_id_exact_match, "LAMP" => $find_lamp, "SITE" => $find_site, "VISITOR_COUNT_1" => $find_visitor_count_1, "VISITOR_COUNT_2" => $find_visitor_count_2, "SHOW_COUNT_1" => $find_show_count_1, "SHOW_COUNT_2" => $find_show_count_2, "CLICK_COUNT_1" => $find_click_count_1, "CLICK_COUNT_2" => $find_click_count_2, "CTR_1" => $find_ctr_1, "CTR_2" => $find_ctr_2, "GROUP" => $find_group, "GROUP_EXACT_MATCH" => $find_group_exact_match, "STATUS_SID" => $find_status_sid, "CONTRACT_ID" => $find_contract_id, "CONTRACT" => $find_contract, "CONTRACT_EXACT_MATCH" => $find_contract_exact_match, "TYPE_SID" => $find_type_sid, "TYPE" => $find_type, "TYPE_EXACT_MATCH" => $find_type_exact_match, "NAME" => $find != '' && $find_type_f == "name" ? $find : $find_name, "NAME_EXACT_MATCH" => $find_name_exact_match, "CODE" => $find != '' && $find_type_f == "code" ? $find : $find_code, "CODE_EXACT_MATCH" => $find_code_exact_match, "COMMENTS" => $find_comments, "COMMENTS_EXACT_MATCH" => $find_comments_exact_match);
if ($lAdmin->EditAction()) {
foreach ($FIELDS as $ID => $arFields) {
$ID = IntVal($ID);
$ifrsBanner = CAdvBanner::GetByID($ID);
if ($ifarBanner = $ifrsBanner->Fetch()) {
$ifCONTRACT_ID = $ifarBanner["CONTRACT_ID"];
}
if (is_array($arrPERM[$ifCONTRACT_ID]) && in_array("ADD", $arrPERM[$ifCONTRACT_ID])) {
$DB->StartTransaction();
if (!$lAdmin->IsUpdated($ID)) {
continue;
}
if (!CAdvBanner::Set($arFields, $ID)) {
$lAdmin->AddUpdateError(GetMessage("SAVE_ERROR") . $ID . ": " . $ob->LAST_ERROR, $ID);
$DB->Rollback();
}
$DB->Commit();
} else {
$lAdmin->AddUpdateError(GetMessage("ADV_NO_RIGHTS_EDIT"), $ID);
}
}
}
// обработка действий групповых и одиночных
if ($arID = $lAdmin->GroupAction()) {
if ($_REQUEST['action_target'] == 'selected') {
$arID = array();
$rsData = CAdvBanner::GetList($by, $order, $arFilter);
while ($arRes = $rsData->Fetch()) {
$arID[] = $arRes['ID'];
示例7: array
InitBVar($find_sid_exact_match);
InitBVar($find_description_exact_match);
$arFilter = array("ID" => $find_id, "ID_EXACT_MATCH" => $find_id_exact_match, "NAME" => $find_name, "NAME_EXACT_MATCH" => $find_name_exact_match, "SID" => $find_sid, "SID_EXACT_MATCH" => $find_sid_exact_match, "DESCRIPTION" => $find_description, "DESCRIPTION_EXACT_MATCH" => $find_description_exact_match, "SITE" => $find_site);
// "Save" button was pressed
if ($lAdmin->EditAction() && $FORM_RIGHT >= "W" && check_bitrix_sessid()) {
foreach ($FIELDS as $ID => $arFields) {
if (!$lAdmin->IsUpdated($ID)) {
continue;
}
$DB->StartTransaction();
$ID = IntVal($ID);
$F_RIGHT = CForm::GetPermission($ID);
if ($F_RIGHT >= 30) {
$arFieldsStore = array("TIMESTAMP_X" => $DB->GetNowFunction(), "C_SORT" => "'" . intval($arFields[C_SORT]) . "'");
if (!$DB->Update("b_form", $arFieldsStore, "WHERE ID='" . $ID . "'", $err_mess . __LINE__)) {
$lAdmin->AddUpdateError(GetMessage("SAVE_ERROR") . $ID . ": " . GetMessage("FORM_SAVE_ERROR"), $ID);
$DB->Rollback();
}
}
$DB->Commit();
}
}
// simgle and group actions processing
if (($arID = $lAdmin->GroupAction()) && $FORM_RIGHT == "W" && check_bitrix_sessid()) {
if ($_REQUEST['action_target'] == 'selected') {
$arID = array();
$rsData = CForm::GetList($by, $order, $arFilter, $is_filtered);
while ($arRes = $rsData->Fetch()) {
$arID[] = $arRes['ID'];
}
}
示例8: unset
} else {
unset($arFilter["SITE_ID"]);
}
if (StrLen($filter_active) > 0) {
$arFilter["ACTIVE"] = $filter_active == "Y" ? "Y" : "N";
}
if ($lAdmin->EditAction() && $saleModulePermissions >= "W") {
foreach ($FIELDS as $ID => $arFields) {
$DB->StartTransaction();
$ID = IntVal($ID);
if (!$lAdmin->IsUpdated($ID)) {
continue;
}
if (!CSaleAffiliatePlan::Update($ID, $arFields)) {
if ($ex = $APPLICATION->GetException()) {
$lAdmin->AddUpdateError($ex->GetString(), $ID);
} else {
$lAdmin->AddUpdateError(GetMessage("SAP1_ERROR_UPDATE_PLAN"), $ID);
}
$DB->Rollback();
}
$DB->Commit();
}
}
if (($arID = $lAdmin->GroupAction()) && $saleModulePermissions >= "W") {
if ($_REQUEST['action_target'] == 'selected') {
$arID = array();
$dbResultList = CSaleAffiliatePlan::GetList(array(), $arFilter, false, false, array("ID"));
while ($arResult = $dbResultList->Fetch()) {
$arID[] = $arResult['ID'];
}
示例9: IntVal
$ID = IntVal($ID);
if ($ID <= 0) {
continue;
}
if (!$lAdmin->IsUpdated($ID)) {
continue;
}
if (!$isAdmin) {
$db_fav = CFavorites::GetByID($ID);
if (($db_fav_arr = $db_fav->Fetch()) && $USER->GetID() != $db_fav_arr["USER_ID"]) {
continue;
}
}
if (!CFavorites::Update($ID, $arFields)) {
$e = $APPLICATION->GetException();
$lAdmin->AddUpdateError($e ? $e->GetString() : GetMessage("fav_list_err"), $ID);
}
}
}
if ($arID = $lAdmin->GroupAction()) {
if ($_REQUEST['action_target'] == 'selected') {
$rsData = CFavorites::GetList(array($by => $order), $arFilter);
while ($arRes = $rsData->Fetch()) {
$arID[] = $arRes['ID'];
}
}
foreach ($arID as $ID) {
$ID = IntVal($ID);
if ($ID <= 0) {
continue;
}
示例10: foreach
if ($bCatalog)
$boolMethodExist = method_exists('CCatalogProduct', 'IsExistProduct');
foreach ($_POST['FIELDS'] as $ID => $arFields) {
if (!$lAdmin->IsUpdated($ID))
continue;
$ID = IntVal($ID);
$arRes = CIBlockElement::GetByID($ID);
$arRes = $arRes->Fetch();
if (!$arRes)
continue;
if ($bWorkFlow) {
if (!CIBlockElementRights::UserHasRightTo($IBLOCK_ID, $ID, "element_edit")) {
$lAdmin->AddUpdateError(GetMessage("IBEL_A_UPDERR3") . " (ID:" . $ID . ")", $ID);
continue;
}
if (CIBlockElementRights::UserHasRightTo($IBLOCK_ID, $ID, "element_edit_any_wf_status"))
$STATUS_PERMISSION = true;
elseif ($arFields["WF_STATUS_ID"] > 0)
$STATUS_PERMISSION = CIBlockElement::WF_GetStatusPermission($arFields["WF_STATUS_ID"]) >= 1;
else
$STATUS_PERMISSION = CIBlockElement::WF_GetStatusPermission($arRes["WF_STATUS_ID"]) >= 2;
if (!$STATUS_PERMISSION) {
$lAdmin->AddUpdateError(GetMessage("IBEL_A_UPDERR_ACCESS", array("#ID#" => $ID)), $ID);
continue;
}
} elseif ($bBizproc) {
示例11: foreach
$filter["ACTIVE"] = $filter_active;
}
$USER_FIELD_MANAGER->AdminListAddFilter(CompanyTable::getUfId(), $filter);
if ($lAdmin->EditAction() && $saleModulePermissions >= 'W') {
foreach ($request->getPost('FIELDS') as $id => $arFields) {
$error = false;
$id = intval($id);
if ($id <= 0 || !$lAdmin->IsUpdated($id)) {
continue;
}
$reqFields = array('NAME');
// , 'LOCATION_ID'
foreach ($reqFields as $reqField) {
if (empty($arFields[$reqField])) {
$error = true;
$lAdmin->AddUpdateError('#' . $id . ' : ' . Loc::getMessage('SALE_COMPANY_ERROR_NO_' . $reqField), $id);
}
}
if (!$error) {
$arFields['DATE_MODIFY'] = new \Bitrix\Main\Type\DateTime();
$arFields['MODIFIED_BY'] = $USER->GetID();
$conn->startTransaction();
$res = CompanyTable::update($id, $arFields);
if (!$res->isSuccess()) {
$conn->rollbackTransaction();
$lAdmin->AddUpdateError(join("\n", $res->getErrorMessages()), $id);
continue;
}
$conn->commitTransaction();
}
}
示例12: intval
if (strlen($filter_name) > 0) {
$arFilter["~NAME"] = "%" . $filter_name . "%";
}
if (intval($filter_autoexecute) > 0) {
$arFilter["AUTO_EXECUTE"] = intval($filter_autoexecute);
}
if ($lAdmin->EditAction()) {
foreach ($FIELDS as $ID => $arFields) {
$ID = IntVal($ID);
if (!$lAdmin->IsUpdated($ID)) {
continue;
}
try {
CBPWorkflowTemplateLoader::Update($ID, $arFields);
} catch (Exception $e) {
$lAdmin->AddUpdateError(GetMessage("BPWFADM_ERR", array("#ID#" => $ID, "#ERROR_TEXT#" => $e->getMessage())), $ID);
}
}
}
if ($arID = $lAdmin->GroupAction()) {
if ($_REQUEST['action_target'] == 'selected') {
$arID = array();
$dbResultList = CBPWorkflowTemplateLoader::GetList(array(), $arFilter, false, false, array("ID"));
while ($arResult = $dbResultList->Fetch()) {
$arID[] = $arResult['ID'];
}
}
foreach ($arID as $ID) {
if (strlen($ID) <= 0) {
continue;
}
示例13:
//false,
array("nTopCount"=>1),
array("ID", "CANCELED", "ALLOW_DELIVERY", "DEDUCTED", "STATUS_ID")
);
if ($arOrderTmp = $dbOrderTmp->Fetch())
{
if (array_key_exists("CANCELED", $arFields)
&& ($arFields["CANCELED"] == "Y" || $arFields["CANCELED"] == "N")
&& $arFields["CANCELED"] != $arOrderTmp["CANCELED"])
{
if (CSaleOrder::CanUserCancelOrder($ID, $arUserGroups, $intUserID))
{
if (!CSaleOrder::CancelOrder($ID, $arFields["CANCELED"], ""))
{
if ($ex = $APPLICATION->GetException())
$lAdmin->AddUpdateError($ex->GetString(), $ID);
else
$lAdmin->AddUpdateError(GetMessage("SOA_ERROR_CANCEL"), $ID);
}
}
else
{
$lAdmin->AddUpdateError(GetMessage("SOA_PERMS_CANCEL"), $ID);
}
}
if (array_key_exists("ALLOW_DELIVERY", $arFields)
&& ($arFields["ALLOW_DELIVERY"] == "Y" || $arFields["ALLOW_DELIVERY"] == "N")
&& $arFields["ALLOW_DELIVERY"] != $arOrderTmp["ALLOW_DELIVERY"])
{
if (CSaleOrder::CanUserChangeOrderFlag($ID, "PERM_DELIVERY", $arUserGroups))
示例14: foreach
if (!$lAdmin->IsUpdated($id)) {
// if there were no data change on this row - do nothing with it
continue;
}
try {
$res = Helper::update($id, $arFields);
if (!empty($res['errors'])) {
foreach ($res['errors'] as &$error) {
$error = ' ' . $error;
}
unset($error);
throw new Main\SystemException(implode(',<br />', $res['errors']));
}
} catch (Main\SystemException $e) {
// todo: do smth
$lAdmin->AddUpdateError(Loc::getMessage('SALE_LOCATION_L_ITEM_SAVE_ERROR', array('#ITEM#' => $id)) . ": <br />" . $e->getMessage() . '<br />', $id);
$DB->Rollback();
}
$DB->Commit();
}
}
if (($ids = $lAdmin->GroupAction()) && $userIsAdmin) {
if ($_REQUEST['action_target'] == 'selected') {
// get all ids if they were not specified (user choice was "for all")
$ids = Helper::getIdsByFilter($listParams['filter']);
}
@set_time_limit(0);
foreach ($ids as $id) {
if (!($id = intval($id))) {
continue;
}
示例15: foreach
if (strlen($filter_active) > 0) {
$arFilter["ACTIVE"] = $filter_active;
}
if (strlen($filter_group_id) > 0) {
$arFilter["FORUM_GROUP_ID"] = $filter_group_id;
}
if (check_bitrix_sessid() && $forumModulePermissions >= "R") {
if ($lAdmin->EditAction()) {
foreach ($FIELDS as $ID => $arFields) {
$DB->StartTransaction();
$ID = IntVal($ID);
if (!$lAdmin->IsUpdated($ID)) {
continue;
}
if (!CForumNew::CanUserUpdateForum($ID, $USER->GetUserGroupArray(), $USER->GetID())) {
$lAdmin->AddUpdateError(GetMessage("FA_NO_PERMS2UPDATE") . " " . $ID . "", $ID);
continue;
}
if (!CForumNew::Update($ID, $arFields)) {
if ($ex = $APPLICATION->GetException()) {
$lAdmin->AddUpdateError($ex->GetString(), $ID);
} else {
$lAdmin->AddUpdateError(GetMessage("FA_ERROR_UPDATE") . " " . $ID . "", $ID);
}
$DB->Rollback();
}
$DB->Commit();
}
}
if ($arID = $lAdmin->GroupAction()) {
if ($_REQUEST['action_target'] == 'selected') {