本文整理汇总了PHP中CAdminList::AddGroupError方法的典型用法代码示例。如果您正苦于以下问题:PHP CAdminList::AddGroupError方法的具体用法?PHP CAdminList::AddGroupError怎么用?PHP CAdminList::AddGroupError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAdminList
的用法示例。
在下文中一共展示了CAdminList::AddGroupError方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: while
while ($arResult = $dbResultList->Fetch()) {
$arID[] = $arResult['ID'];
}
}
foreach ($arID as $ID) {
if (strlen($ID) <= 0) {
continue;
}
switch ($_REQUEST['action']) {
case "delete":
@set_time_limit(0);
$DB->StartTransaction();
if (!CSaleTaxRate::Delete($ID)) {
$DB->Rollback();
if ($ex = $APPLICATION->GetException()) {
$lAdmin->AddGroupError($ex->GetString(), $ID);
} else {
$lAdmin->AddGroupError(GetMessage("SALE_DELETE_ERROR"), $ID);
}
}
$DB->Commit();
break;
case "activate":
case "deactivate":
$arFields = array("ACTIVE" => $_REQUEST['action'] == "activate" ? "Y" : "N");
if (!CSaleTaxRate::Update($ID, $arFields)) {
if ($ex = $APPLICATION->GetException()) {
$lAdmin->AddGroupError($ex->GetString(), $ID);
} else {
$lAdmin->AddGroupError(GetMessage("ERROR_EDIT_TAX_RATE"), $ID);
}
示例2: CCloudStorageBucket
{
$obBucket = new CCloudStorageBucket($BUCKET_ID);
if ($obBucket->Init())
{
$name = $path.'/'.$item;
while($obBucket->FileExists($name))
{
$file_size = $obBucket->GetFileSize($name);
if ($obBucket->DeleteFile($name))
$obBucket->DecFileCounter($file_size);
$name = CTar::getNextName($name);
}
$e = $APPLICATION->GetException();
if(is_object($e))
$lAdmin->AddGroupError($e->GetString(), $ID);
}
else
$lAdmin->AddGroupError(GetMessage("MAIN_DUMP_ERR_INIT_CLOUD"), $ID);
}
}
else
{
while(file_exists(DOCUMENT_ROOT.$path.'/'.$item))
{
if ($strWarning_tmp = CFileMan::DeleteEx(Array($site, CFileMan::NormalizePath($path."/".$item))))
$lAdmin->AddGroupError($strWarning_tmp, $ID);
$item = CTar::getNextName($item);
}
}
示例3: while
while ($arRes = $rsData->Fetch()) {
$arID[] = $arRes['ID'];
}
}
foreach ($arID as $ID) {
if (strlen($ID) <= 0) {
continue;
}
$ID = IntVal($ID);
$emessage = new CEventMessage();
switch ($_REQUEST['action']) {
case "delete":
$DB->StartTransaction();
if (!$emessage->Delete($ID)) {
$DB->Rollback();
$lAdmin->AddGroupError(GetMessage("DELETE_ERROR"), $ID);
} else {
$DB->Commit();
}
break;
case "activate":
case "deactivate":
$arFields = array("ACTIVE" => $_REQUEST['action'] == "activate" ? "Y" : "N");
if (!$emessage->Update($ID, $arFields)) {
$lAdmin->AddGroupError(GetMessage("MAIN_EDIT_ERROR") . ':' . $emessage->LAST_ERROR, $ID);
}
break;
}
}
}
$rsData = CEventMessage::GetList($by, $order, $arFilter);
示例4: IntVal
{
$obUserField = new CUserTypeEntity;
foreach($FIELDS as $ID=>$arFields)
{
if(!$lAdmin->IsUpdated($ID))
continue;
//Rights check
if($USER_FIELD_MANAGER->GetRights(false, $ID) < "W")
continue;
//Update
$DB->StartTransaction();
$ID = IntVal($ID);
if(!$obUserField->Update($ID, $arFields))
{
if($e = $APPLICATION->GetException())
$lAdmin->AddGroupError(GetMessage("USERTYPE_UPDATE_ERROR")." ".$e->GetString(), $ID);
$DB->Rollback();
}
$DB->Commit();
}
}
if($arID = $lAdmin->GroupAction())
{
if($_REQUEST['action_target']=='selected')
{
$rsData = CUserTypeEntity::GetList(array($by=>$order), $arFilter);
while($arRes = $rsData->Fetch())
$arID[] = $arRes['ID'];
}
示例5: array
'UserGroups' => $USER->GetUserGroupArray(),
)
);
if ($bCanWrite)
$bPermissions = true;
}
else
{
$bPermissions = true;
}
if(!$bPermissions)
{
$lAdmin->AddGroupError(GetMessage("IBLIST_A_UPDERR_ACCESS", array("#ID#" => $ID)));
continue;
}
}
switch($_REQUEST['action'])
{
case "delete":
@set_time_limit(0);
if($TYPE=="S")
{
if(CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $ID, "section_delete"))
{
$DB->StartTransaction();
$APPLICATION->ResetException();
示例6: while
if ($_REQUEST['action_target'] == 'selected') {
$rsData = CCurrency::GetList($by, $order);
while ($arRes = $rsData->Fetch()) {
$arID[] = $arRes['ID'];
}
}
foreach ($arID as $ID) {
if (strlen($ID) <= 0) {
continue;
}
switch ($_REQUEST['action']) {
case "delete":
if ($CURRENCY_RIGHT == "W") {
if (!CCurrency::Delete($ID)) {
if ($ex = $APPLICATION->GetException()) {
$lAdmin->AddGroupError($ex->GetString(), $ID);
} else {
$lAdmin->AddGroupError(GetMessage("currency_err1"), $ID);
}
}
}
break;
}
}
}
$rsData = CCurrency::GetList($by, $order);
$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
$lAdmin->NavText($rsData->GetNavPrint(GetMessage("CURRENCY_TITLE")));
$arHeaders = array();
$arHeaders[] = array("id" => "CURRENCY", "content" => GetMessage('currency_curr'), "sort" => "CURRENCY", "default" => true);
示例7: array
$arID = array();
$dbResultList = CSupportTimetable::GetList(array($by => $order), $arFilter);
while ($arResult = $dbResultList->Fetch()) {
$arID[] = $arResult['ID'];
}
}
foreach ($arID as $ID) {
if (strlen($ID) <= 0) {
continue;
}
switch ($_REQUEST['action']) {
case "delete":
@set_time_limit(0);
if (!CSupportTimetable::Delete($ID)) {
if ($e = $APPLICATION->GetException()) {
$lAdmin->AddGroupError($e->GetString(), $ID);
}
}
break;
}
}
}
$arHeaders = array(array("id" => "ID", "content" => "ID", "sort" => "ID", "default" => true), array("id" => "NAME", "content" => GetMessage("SUP_NAME"), "sort" => "NAME", "default" => true), array("id" => "DESCRIPTION", "content" => GetMessage('SUP_DESCRIPTION'), "default" => true));
$USER_FIELD_MANAGER->AdminListAddHeaders("TIMETABLE", $arHeaders);
$lAdmin->AddHeaders($arHeaders);
$arVisibleColumns = $lAdmin->GetVisibleHeaderColumns();
$arSelectedFields = array("ID", "NAME", "DESCRIPTION");
foreach ($arVisibleColumns as $val) {
if (!in_array($val, $arSelectedFields)) {
$arSelectedFields[] = $val;
}
示例8: array
if (!empty($listID))
{
switch ($_REQUEST['action'])
{
case 'activate':
case 'deactivate':
Internals\DiscountCouponTable::disableCheckCouponsUse();
$fields = array(
'ACTIVE' => ($_REQUEST['action'] == 'activate' ? 'Y' : 'N')
);
foreach ($listID as &$couponID)
{
$result = Internals\DiscountCouponTable::update($couponID, $fields);
if (!$result->isSuccess())
{
$adminList->AddGroupError(implode('<br>', $result->getErrorMessages(), $couponID));
}
}
unset($couponID, $fields);
Internals\DiscountCouponTable::enableCheckCouponsUse();
break;
case 'delete':
if (empty($discountList))
{
$couponIterator = Internals\DiscountCouponTable::getList(array(
'select' => array('ID', 'DISCOUNT_ID'),
'filter' => array('ID' => $listID)
));
while ($coupon = $couponIterator->fetch())
{
$discountList[$coupon['DISCOUNT_ID']] = true;;
示例9: foreach
$arID[] = $arRes['ID'];
}
}
foreach ($arID as $ID) {
if (strlen($ID) <= 0) {
continue;
}
$ID = intval($ID);
switch ($_REQUEST['action']) {
case "delete":
@set_time_limit(0);
$DB->StartTransaction();
$cl = new CLQuestion();
if (!$cl->Delete($ID)) {
$DB->Rollback();
$lAdmin->AddGroupError(GetMessage("LEARNING_DELETE_ERROR"), $ID);
}
$DB->Commit();
break;
case "self":
case "deself":
// We shouldn't do this for text lessons
$rs = CLQuestion::GetByID($ID);
$arQuestionData = $rs->Fetch();
if ($arQuestionData) {
if ($arQuestionData['QUESTION_TYPE'] !== 'T') {
$cl = new CLQuestion();
$arFields = array("SELF" => $_REQUEST['action'] == "self" ? "Y" : "N");
if (!$cl->Update($ID, $arFields)) {
if ($e = $APPLICATION->GetException()) {
$lAdmin->AddGroupError(GetMessage("SAVE_ERROR") . $ID . ": " . $e->GetString(), $ID);
示例10: foreach
foreach ($arID as $ID) {
if (strlen($ID) <= 0) {
continue;
}
$ID = intval($ID);
switch ($_REQUEST['action']) {
case "delete":
$oAccess = CLearnAccess::GetInstance($USER->GetID());
if (!$oAccess->IsLessonAccessible(CCertification::LessonIdByCertId($ID), CLearnAccess::OP_LESSON_WRITE)) {
break;
}
@set_time_limit(0);
$DB->StartTransaction();
if (!CCertification::Delete($ID)) {
$DB->Rollback();
$lAdmin->AddGroupError(GetMessage("LEARNING_DELETE_ERROR"), $ID);
}
$DB->Commit();
break;
case "activate":
case "deactivate":
$cl = new CCertification();
$arFields = array("ACTIVE" => $_REQUEST['action'] == "activate" ? "Y" : "N");
if (!$cl->Update($ID, $arFields)) {
if ($e = $APPLICATION->GetException()) {
$lAdmin->AddGroupError(GetMessage("SAVE_ERROR") . $ID . ": " . $e->GetString(), $ID);
}
}
break;
}
}
示例11: basename
$arID[] = '0_' . basename($f);
}
closedir($dir);
}
}
if ($arAllBucket) {
foreach ($arAllBucket as $arBucket) {
if ($arCloudFiles = CBackup::GetBucketFileList($arBucket['ID'], BX_ROOT . '/backup/')) {
foreach ($arCloudFiles['file'] as $k => $v) {
$arID[] = $arBucket['ID'] . '_' . $v;
}
}
}
}
if ($bBitrixCloud) {
$lAdmin->AddGroupError(GetMessage("MAIN_DUMP_ERR_DELETE"), '');
}
}
$bBitrixCloudDelete = false;
foreach ($arID as $ID) {
if (strlen($ID) <= 0) {
continue;
}
switch ($_REQUEST['action']) {
case "delete":
if (preg_match('#^(-?[0-9]+)_(.+)$#', $ID, $regs)) {
$BUCKET_ID = $regs[1];
$item = $regs[2];
if ($BUCKET_ID == -1) {
if (!$bBitrixCloudDelete) {
$lAdmin->AddGroupError(GetMessage("MAIN_DUMP_ERR_DELETE"), $ID);
示例12: while
if ($_REQUEST['action_target'] == 'selected') {
$rsData = CIBlockType::GetList($arOrder, $arFilter);
while ($arRes = $rsData->Fetch()) {
$arID[] = $arRes['ID'];
}
}
foreach ($arID as $ID) {
if (strlen($ID) <= 0) {
continue;
}
switch ($_REQUEST['action']) {
case "delete":
$DB->StartTransaction();
if (!CIBlockType::Delete($ID)) {
$DB->Rollback();
$lAdmin->AddGroupError(GetMessage("IBLOCK_TYPE_ADMIN_ERR_DEL") . " ("" . htmlspecialcharsbx($ID) . "")", $ID);
}
$DB->Commit();
break;
}
}
}
// Fill list with data
$rsData = CIBlockType::GetList($arOrder, $arFilter);
$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
// Set page navigation
$lAdmin->NavText($rsData->GetNavPrint(GetMessage("IBLOCK_TYPE_ADMIN_NAV")));
// List headers/columns
$lAdmin->AddHeaders(array(array("id" => "ID", "content" => "ID", "sort" => "id", "default" => true), array("id" => "NAME", "content" => GetMessage("IBLOCK_TYPE_ADMIN_COL_NAME"), "default" => true), array("id" => "SORT", "content" => GetMessage("IBLOCK_TYPE_ADMIN_COL_SORT"), "sort" => "sort", "default" => true, "align" => "right"), array("id" => "SECTIONS", "content" => GetMessage("IBLOCK_TYPE_ADMIN_COL_SECT"), "default" => true, "align" => "center"), array("id" => "IN_RSS", "content" => GetMessage("IBLOCK_TYPE_ADMIN_COL_RSS"), "default" => true, "align" => "center"), array("id" => "EDIT_FILE_BEFORE", "content" => GetMessage("IBLOCK_TYPE_ADMIN_COL_EDIT_BEF")), array("id" => "EDIT_FILE_AFTER", "content" => GetMessage("IBLOCK_TYPE_ADMIN_COL_EDIT_AFT"))));
// Build elements list
示例13:
catch(Engine\YandexDirectException $e)
{
Adv\YandexBannerTable::setSkipRemoteUpdate(false);
}
foreach($bannersList as $bannerId)
{
try
{
$result = Adv\YandexBannerTable::delete($bannerId);
if(!$result->isSuccess())
{
$errorsList = $result->getErrorMessages();
foreach($errorsList as $errorMessage)
{
$adminList->AddGroupError($errorMessage, $bannerId);
}
}
}
catch(Engine\YandexDirectException $e)
{
if($e->getCode() == Engine\YandexDirect::ERROR_NOT_FOUND)
{
Adv\YandexBannerTable::setSkipRemoteUpdate(true);
$result = Adv\YandexBannerTable::delete($bannerId);
if(!$result->isSuccess())
{
$errorsList = $result->getErrorMessages();
foreach($errorsList as $errorMessage)
{
$adminList->AddGroupError($errorMessage, $bannerId);
示例14: while
while ($arRes = $rsData->Fetch()) {
$arID[] = $arRes['ID'];
}
}
foreach ($arID as $ID) {
if (strlen($ID) <= 0) {
continue;
}
$ID = IntVal($ID);
switch ($_REQUEST['action']) {
case "delete":
@set_time_limit(0);
$DB->StartTransaction();
if (!CSubscription::Delete($ID)) {
$DB->Rollback();
$lAdmin->AddGroupError(GetMessage("subscr_del_err"), $ID);
}
$DB->Commit();
break;
case "activate":
case "deactivate":
$ob = new CSubscription();
$arFields = array("ACTIVE" => $_REQUEST['action'] == "activate" ? "Y" : "N");
if (!$ob->Update($ID, $arFields)) {
$lAdmin->AddGroupError(GetMessage("subscr_save_error") . $ob->LAST_ERROR, $ID);
}
break;
case "confirm":
$ob = new CSubscription();
$arFields = array("CONFIRMED" => "Y");
if (!$ob->Update($ID, $arFields)) {
示例15: while
while ($arRes = $rsData->Fetch()) {
$arID[] = $arRes['ID'];
}
}
foreach ($arID as $ID) {
if (strlen($ID) <= 0) {
continue;
}
$ID = IntVal($ID);
switch ($_REQUEST['action']) {
case "delete":
@set_time_limit(0);
$DB->StartTransaction();
if (!CMailBox::Delete($ID)) {
$DB->Rollback();
$lAdmin->AddGroupError(GetMessage("MAIL_MBOX_ADM_DELERR"), $ID);
}
$DB->Commit();
break;
case "activate":
case "deactivate":
$arFields = array("ACTIVE" => $_REQUEST['action'] == "activate" ? "Y" : "N");
if (!CMailBox::Update($ID, $arFields)) {
if ($e = $APPLICATION->GetException()) {
$lAdmin->AddGroupError(GetMessage("SAVE_ERROR") . $ID . ": " . $e->GetString(), $ID);
}
}
break;
}
}
}