Beispiel #1
0
             } elseif ($DB->type == "ORACLE") {
                 if (!$DB->Query("ALTER TABLE B_SALE_DELIVERY_HANDLER RENAME TO B_SALE_DELIVERY_HANDLER_OLD", true)) {
                     $error .= "<br>" . $DB->GetErrorMessage();
                 }
             }
             if (!empty($error)) {
                 \CEventLog::Add(array("SEVERITY" => "ERROR", "AUDIT_TYPE_ID" => "SALE_CONVERTER_ERROR", "MODULE_ID" => "sale", "ITEM_ID" => "-", "DESCRIPTION" => $error));
             }
         } else {
             \CEventLog::Add(array("SEVERITY" => "ERROR", "AUDIT_TYPE_ID" => "SALE_CONVERTER_ERROR", "MODULE_ID" => "sale", "ITEM_ID" => "b_sale_delivery_handler", "DESCRIPTION" => implode('\\n', $res->getErrorMessages())));
         }
         file_put_contents($_SERVER["DOCUMENT_ROOT"] . '/bitrix/modules/sale_convert.txt', 'CSaleDeliveryHandler::convertToNew = ' . (microtime(true) - $start) . "\n", FILE_APPEND);
     }
     if ($DB->TableExists("b_sale_delivery2paysystem")) {
         $start = microtime(true);
         $res = CSaleDelivery::convertPSRelations();
         if (!$res->isSuccess()) {
             \CEventLog::Add(array("SEVERITY" => "ERROR", "AUDIT_TYPE_ID" => "SALE_CONVERTER_ERROR", "MODULE_ID" => "sale", "ITEM_ID" => "b_sale_delivery2paysystem", "DESCRIPTION" => implode('\\n', $res->getErrorMessages())));
         }
         file_put_contents($_SERVER["DOCUMENT_ROOT"] . '/bitrix/modules/sale_convert.txt', 'CSaleDelivery::convertPSRelations= ' . (microtime(true) - $start) . "\n", FILE_APPEND);
     }
 } catch (Exception $e) {
     \CEventLog::Add(array("SEVERITY" => "ERROR", "AUDIT_TYPE_ID" => "SALE_CONVERTER_ERROR", "MODULE_ID" => "sale", "ITEM_ID" => "-", "DESCRIPTION" => $e->getMessage()));
 }
 if (empty($error)) {
     $message = Loc::getMessage('SALE_CONVERTER_AJAX_STEP_STATUS_CONVERT');
     $result['NEXT_STEP'] = ++$ajax_step;
 } else {
     $message = Loc::getMessage('SALE_CONVERTER_AJAX_STEP_DELIVERY_CONVERT');
     $result['ERROR'] = true;
     $message .= "<br>" . $error;