コード例 #1
0
 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());
 }
コード例 #2
0
ファイル: index.php プロジェクト: Hawkart/megatv
 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);
 }
コード例 #3
0
$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') {
                ?>
コード例 #4
0
ファイル: migration_new.php プロジェクト: Hawkart/megatv
<?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>
                &nbsp;
                <input onclick="migrationExecuteStep('migration_execute', {version: '<?php 
            echo $aItem['version'];
            ?>
', action: 'up'});" value="<?php 
            echo GetMessage('SPRINT_MIGRATION_UP');
            ?>
" type="button">