function DoUninstall() { global $APPLICATION; CAgent::RemoveAgent("ICrmOrderActions::uploadOrdersAgent();", $this->MODULE_ID); CAgent::RemoveAgent("ICrmOrderActions::orderHistoryAgent();", $this->MODULE_ID); CAgent::RemoveAgent("ICrmOrderActions::orderAgent();", $this->MODULE_ID); COption::RemoveOption($this->MODULE_ID, $this->CRM_API_HOST_OPTION); COption::RemoveOption($this->MODULE_ID, $this->CRM_API_KEY_OPTION); COption::RemoveOption($this->MODULE_ID, $this->CRM_DELIVERY_TYPES_ARR); COption::RemoveOption($this->MODULE_ID, $this->CRM_PAYMENT_TYPES); COption::RemoveOption($this->MODULE_ID, $this->CRM_PAYMENT_STATUSES); COption::RemoveOption($this->MODULE_ID, $this->CRM_PAYMENT); COption::RemoveOption($this->MODULE_ID, $this->CRM_ORDER_LAST_ID); COption::RemoveOption($this->MODULE_ID, $this->CRM_ORDER_SITES); COption::RemoveOption($this->MODULE_ID, $this->CRM_ORDER_PROPS); COption::RemoveOption($this->MODULE_ID, $this->CRM_LEGAL_DETAILS); COption::RemoveOption($this->MODULE_ID, $this->CRM_CONTRAGENT_TYPE); COption::RemoveOption($this->MODULE_ID, $this->CRM_CUSTOM_FIELDS); COption::RemoveOption($this->MODULE_ID, $this->CRM_SITES_LIST); COption::RemoveOption($this->MODULE_ID, $this->CRM_ORDER_DISCHARGE); COption::RemoveOption($this->MODULE_ID, $this->CRM_ORDER_FAILED_IDS); COption::RemoveOption($this->MODULE_ID, $this->CRM_ORDER_HISTORY_DATE); COption::RemoveOption($this->MODULE_ID, $this->CRM_CATALOG_BASE_PRICE); COption::RemoveOption($this->MODULE_ID, $this->CRM_CATALOG_IBLOCKS); UnRegisterModuleDependences("sale", "OnSalePayOrder", $this->MODULE_ID, "ICrmOrderEvent", "onSalePayOrder"); UnRegisterModuleDependences("sale", "OnSaleCancelOrder", $this->MODULE_ID, "ICrmOrderEvent", "onSaleCancelOrder"); UnRegisterModuleDependences("sale", "OnOrderNewSendEmail", $this->MODULE_ID, "ICrmOrderEvent", "onSendOrderMail"); UnRegisterModuleDependences("sale", "OnOrderUpdate", $this->MODULE_ID, "ICrmOrderEvent", "onUpdateOrder"); UnRegisterModuleDependences("sale", "OnBeforeOrderAdd", $this->MODULE_ID, "ICrmOrderEvent", "onBeforeOrderAdd"); UnRegisterModuleDependences("sale", "OnBeforeOrderAccountNumberSet", $this->MODULE_ID, "ICrmOrderEvent", "onBeforeOrderAccountNumberSet"); UnRegisterModuleDependences("sale", "OnSaleBeforeReserveOrder", $this->MODULE_ID, "ICrmOrderEvent", "onSaleBeforeReserveOrder"); UnRegisterModuleDependences("sale", "OnSaleReserveOrder", $this->MODULE_ID, "ICrmOrderEvent", "onSaleReserveOrder"); if (CModule::IncludeModule("catalog")) { if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/bitrix/php_interface/include/catalog_export/' . $this->INTARO_CRM_EXPORT . '_run.php')) { $dbProfile = CCatalogExport::GetList(array(), array("FILE_NAME" => $this->INTARO_CRM_EXPORT)); while ($arProfile = $dbProfile->Fetch()) { if ($arProfile["DEFAULT_PROFILE"] != "Y") { CAgent::RemoveAgent("CCatalogExport::PreGenerateExport(" . $arProfile['ID'] . ");", "catalog"); CCatalogExport::Delete($arProfile['ID']); } } } } $this->DeleteFiles(); UnRegisterModule($this->MODULE_ID); $APPLICATION->IncludeAdminFile(GetMessage('MODULE_UNINSTALL_TITLE'), $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/' . $this->MODULE_ID . '/install/unstep1.php'); }
$fp = fopen($_SERVER["DOCUMENT_ROOT"] . "/bitrix/crontab/crontab.cfg", "wb"); fwrite($fp, $cfg_data); fclose($fp); $arRetval = array(); @exec("crontab " . $_SERVER["DOCUMENT_ROOT"] . "/bitrix/crontab/crontab.cfg", $arRetval, $return_var); if (intval($return_var) != 0) { $strErrorMessage .= GetMessage("CES_ERROR_ADD2CRON") . " \n"; if (is_array($arRetval) && !empty($arRetval)) { $strErrorMessage .= implode("\n", $arRetval) . "\n"; } else { $strErrorMessage .= GetMessage("CES_ERROR_UNKNOWN") . "\n"; } } } } CCatalogExport::Delete($PROFILE_ID); } } elseif ($_REQUEST["ACTION"] == "EXPORT_SETUP" && $bCanEdit) { if (strlen($arReportsList[$strActFileName]["FILE_SETUP"]) > 0) { $STEP = intval($_REQUEST["STEP"]); if (isset($_POST['backButton'])) { $STEP -= 2; } if ($STEP <= 0) { $STEP = 1; } $FINITE = false; ob_start(); $APPLICATION->SetTitle($arReportsList[$strActFileName]["TITLE"]); // compatibility hack! $CATALOG_RIGHT = 'W';