Exemplo n.º 1
0
 if ($_REQUEST['action_target'] == 'selected') {
     $arID = array();
     $dbResultList = CSaleDelivery::GetList(array($by => $order), $arFilter, false, false, array("ID"));
     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 (!CSaleDelivery::Delete($ID)) {
                 $DB->Rollback();
                 if ($ex = $APPLICATION->GetException()) {
                     $lAdmin->AddGroupError($ex->GetString(), $ID);
                 } else {
                     $lAdmin->AddGroupError(GetMessage("SDAN_ERROR_DELETE"), $ID);
                 }
             }
             $DB->Commit();
             break;
         case "activate":
         case "deactivate":
             $arFields = array("ACTIVE" => $_REQUEST['action'] == "activate" ? "Y" : "N");
             if (!CSaleDelivery::Update($ID, $arFields)) {
                 if ($ex = $APPLICATION->GetException()) {
                     $lAdmin->AddGroupError($ex->GetString(), $ID);