From 277a3b656d1e91dacfc2bed764c12190b483bf8a Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Fri, 24 Mar 2017 11:22:30 +0100 Subject: [PATCH] Fixed mr and um mix in um online open --- .../include/ajax/rolling_release.ajax.php | 3 +-- pandora_console/include/functions.php | 2 +- pandora_console/include/functions_db.php | 3 +-- .../include/javascript/update_manager.js | 17 ++++++----------- 4 files changed, 9 insertions(+), 16 deletions(-) diff --git a/pandora_console/include/ajax/rolling_release.ajax.php b/pandora_console/include/ajax/rolling_release.ajax.php index e44c4cccdf..0af275d497 100644 --- a/pandora_console/include/ajax/rolling_release.ajax.php +++ b/pandora_console/include/ajax/rolling_release.ajax.php @@ -27,7 +27,7 @@ if (is_ajax ()) { $ent = get_parameter('ent'); $offline = get_parameter('offline'); if (!$ent) { - $dir = $config['attachment_store'] . "/last_package/downloads/pandora_console/extras/mr"; + $dir = $config['attachment_store'] . "/downloads/pandora_console/extras/mr"; } else { if ($offline) { @@ -38,7 +38,6 @@ if (is_ajax ()) { } } $file = "$dir/$number.sql"; - $dangerous_query = false; $mr_file = fopen($file, "r"); while (!feof($mr_file)) { diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 06fb6f9edb..3ce4eed8da 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -2687,7 +2687,7 @@ function get_number_of_mr($package, $ent, $offline) { global $config; if (!$ent) { - $dir = $config['attachment_store'] . "/last_package/downloads/pandora_console/extras/mr"; + $dir = $config['attachment_store'] . "/downloads/pandora_console/extras/mr"; } else { if ($offline) { diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index 5dc6e6ad87..e682e1e138 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -1724,7 +1724,7 @@ function db_check_minor_relase_available_to_um ($package, $ent, $offline) { global $config; if (!$ent) { - $dir = $config['attachment_store'] . "/last_package/downloads/pandora_console/extras/mr"; + $dir = $config['attachment_store'] . "/downloads/pandora_console/extras/mr"; } else { if ($offline) { @@ -1736,7 +1736,6 @@ function db_check_minor_relase_available_to_um ($package, $ent, $offline) { } $have_minor_release = false; - if (file_exists($dir) && is_dir($dir)) { if (is_readable($dir)) { $files = scandir($dir); // Get all the files from the directory ordered by asc diff --git a/pandora_console/include/javascript/update_manager.js b/pandora_console/include/javascript/update_manager.js index 03d2dda856..b5fdde9121 100644 --- a/pandora_console/include/javascript/update_manager.js +++ b/pandora_console/include/javascript/update_manager.js @@ -872,7 +872,6 @@ function update_last_package(package, version, homeurl) { parameters, function (data) { if (data['in_progress']) { - $("#box_online .loading").hide(); $("#box_online .download_package").hide(); $("#box_online .content").html(data['message']); @@ -888,7 +887,6 @@ function update_last_package(package, version, homeurl) { parameters2, function (data) { if (data['correct']) { - $("#box_online .loading").hide(); $("#box_online .download_package").hide(); $("#box_online .content").html(data['message']); @@ -981,9 +979,7 @@ function install_free_package_prev_step(package, version, homeurl) { home_url + "ajax.php", parameters, function (data) { - $("#box_online .loading").hide(); $("#box_online .downloading_package").hide(); - if (data['have_minor']) { $("
").dialog ({ resizable: true, @@ -999,7 +995,6 @@ function install_free_package_prev_step(package, version, homeurl) { "Apply MR": function () { var err = []; err = apply_minor_release(data['mr'], package, 0, 0); - if (!err['error']) { if (err['message'] == 'bad_mr_filename') { $("#mr_dialog2").dialog("close"); @@ -1054,7 +1049,6 @@ function install_free_package_prev_step(package, version, homeurl) { parameters2, function (data) { if (data['in_progress']) { - $("#box_online .loading").hide(); $("#box_online .download_package").hide(); $("#box_online .content").html(data['message']); @@ -1070,6 +1064,8 @@ function install_free_package_prev_step(package, version, homeurl) { }, "json" ); + + remove_rr_file_to_extras(); }, "Cancel": function () { $(this).dialog("close"); @@ -1155,7 +1151,6 @@ function install_free_package_prev_step(package, version, homeurl) { parameters2, function (data) { if (data['in_progress']) { - $("#box_online .loading").hide(); $("#box_online .download_package").hide(); $("#box_online .content").html(data['message']); @@ -1172,7 +1167,7 @@ function install_free_package_prev_step(package, version, homeurl) { "json" ); - remove_rr_file(data['mr']); + remove_rr_file_to_extras(); } } else { @@ -1252,7 +1247,7 @@ function install_free_package_prev_step(package, version, homeurl) { dialog_have_mr_text = dialog_have_mr_text + "

" + text2_mr_file + "" + text3_mr_file + "" + text4_mr_file + "

"; dialog_have_mr_text = dialog_have_mr_text + ""; - $('#mr_dialog2').html(dialog_have_mr_mr_text); + $('#mr_dialog2').html(dialog_have_mr_text); $('#mr_dialog2').dialog('open'); } else { @@ -1267,7 +1262,6 @@ function install_free_package_prev_step(package, version, homeurl) { parameters2, function (data) { if (data['in_progress']) { - $("#box_online .loading").hide(); $("#box_online .download_package").hide(); $("#box_online .content").html(data['message']); @@ -1286,7 +1280,8 @@ function install_free_package_prev_step(package, version, homeurl) { remove_rr_file_to_extras(); } - } + }, + "json" ); }, "Cancel": function () {