public function __construct($configName = '') { $configName = empty($configName) ? Module::getDbOption('config_name', '') : $configName; $this->versionConfig = new VersionConfig($configName); $this->versionTable = new VersionTable($this->getConfigVal('migration_table')); Module::setDbOption('config_name', $this->versionConfig->getConfigName()); }
function DoUninstall() { //launch upgrade when reinstalled module \Sprint\Migration\Module::setDbOption('upgrade_version', 'unknown'); DeleteDirFiles(__DIR__ . "/admin", $_SERVER["DOCUMENT_ROOT"] . "/bitrix/admin"); UnRegisterModule($this->MODULE_ID); }
$listView = $_POST["step_code"] == "migration_new" || $_POST["step_code"] == "migration_list"; if ($_SERVER["REQUEST_METHOD"] == "POST" && $listView && check_bitrix_sessid('send_sessid')) { /** @noinspection PhpIncludeInspection */ require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_js.php"; $search = !empty($_POST['search']) ? trim($_POST['search']) : ''; $search = Sprint\Migration\Locale::convertToUtf8IfNeed($search); $taskUrl = $versionManager->getConfigVal('tracker_task_url'); $webdir = $versionManager->getConfigVal('migration_webdir'); if ($_POST["step_code"] == "migration_new") { \Sprint\Migration\Module::setDbOption('admin_versions_view', 'new'); \Sprint\Migration\Module::setDbOption('admin_versions_search', $search); $versions = $versionManager->getVersions(array('status' => 'new', 'search' => $search)); } else { \Sprint\Migration\Module::setDbOption('admin_versions_view', 'list'); \Sprint\Migration\Module::setDbOption('admin_versions_search', $search); $versions = $versionManager->getVersions(array('status' => '', 'search' => $search)); } ?> <?php if (!empty($versions)) { ?> <table class="c-migration-list"> <?php foreach ($versions as $aItem) { ?> <tr> <td class="c-migration-list-l"> <?php if ($aItem['status'] == 'new') { ?>
<?php if ($_SERVER["REQUEST_METHOD"] == "POST" && $_POST["step_code"] == "migration_new" && check_bitrix_sessid('send_sessid')) { /** @noinspection PhpIncludeInspection */ require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_js.php"; \Sprint\Migration\Module::setDbOption('admin_versions_view', 'new'); $versions = $versionManager->getVersions('up'); ?> <?php if (!empty($versions)) { ?> <?php foreach ($versions as $aItem) { ?> <div class="c-migration-block"> <a href="#" onclick="migrationMigrationInfo('<?php echo $aItem['version']; ?> ');return false;" class="c-migration-item-is_new"><?php echo $aItem['version']; ?> </a> <input onclick="migrationExecuteStep('migration_execute', {version: '<?php echo $aItem['version']; ?> ', action: 'up'});" value="<?php echo GetMessage('SPRINT_MIGRATION_UP'); ?> " type="button">