Fixed mr and um mix in um online open

This commit is contained in:
Arturo Gonzalez 2017-03-24 11:22:30 +01:00
parent b574a92f35
commit 277a3b656d
4 changed files with 9 additions and 16 deletions

View File

@ -27,7 +27,7 @@ if (is_ajax ()) {
$ent = get_parameter('ent'); $ent = get_parameter('ent');
$offline = get_parameter('offline'); $offline = get_parameter('offline');
if (!$ent) { if (!$ent) {
$dir = $config['attachment_store'] . "/last_package/downloads/pandora_console/extras/mr"; $dir = $config['attachment_store'] . "/downloads/pandora_console/extras/mr";
} }
else { else {
if ($offline) { if ($offline) {
@ -38,7 +38,6 @@ if (is_ajax ()) {
} }
} }
$file = "$dir/$number.sql"; $file = "$dir/$number.sql";
$dangerous_query = false; $dangerous_query = false;
$mr_file = fopen($file, "r"); $mr_file = fopen($file, "r");
while (!feof($mr_file)) { while (!feof($mr_file)) {

View File

@ -2687,7 +2687,7 @@ function get_number_of_mr($package, $ent, $offline) {
global $config; global $config;
if (!$ent) { if (!$ent) {
$dir = $config['attachment_store'] . "/last_package/downloads/pandora_console/extras/mr"; $dir = $config['attachment_store'] . "/downloads/pandora_console/extras/mr";
} }
else { else {
if ($offline) { if ($offline) {

View File

@ -1724,7 +1724,7 @@ function db_check_minor_relase_available_to_um ($package, $ent, $offline) {
global $config; global $config;
if (!$ent) { if (!$ent) {
$dir = $config['attachment_store'] . "/last_package/downloads/pandora_console/extras/mr"; $dir = $config['attachment_store'] . "/downloads/pandora_console/extras/mr";
} }
else { else {
if ($offline) { if ($offline) {
@ -1736,7 +1736,6 @@ function db_check_minor_relase_available_to_um ($package, $ent, $offline) {
} }
$have_minor_release = false; $have_minor_release = false;
if (file_exists($dir) && is_dir($dir)) { if (file_exists($dir) && is_dir($dir)) {
if (is_readable($dir)) { if (is_readable($dir)) {
$files = scandir($dir); // Get all the files from the directory ordered by asc $files = scandir($dir); // Get all the files from the directory ordered by asc

View File

@ -872,7 +872,6 @@ function update_last_package(package, version, homeurl) {
parameters, parameters,
function (data) { function (data) {
if (data['in_progress']) { if (data['in_progress']) {
$("#box_online .loading").hide();
$("#box_online .download_package").hide(); $("#box_online .download_package").hide();
$("#box_online .content").html(data['message']); $("#box_online .content").html(data['message']);
@ -888,7 +887,6 @@ function update_last_package(package, version, homeurl) {
parameters2, parameters2,
function (data) { function (data) {
if (data['correct']) { if (data['correct']) {
$("#box_online .loading").hide();
$("#box_online .download_package").hide(); $("#box_online .download_package").hide();
$("#box_online .content").html(data['message']); $("#box_online .content").html(data['message']);
@ -981,9 +979,7 @@ function install_free_package_prev_step(package, version, homeurl) {
home_url + "ajax.php", home_url + "ajax.php",
parameters, parameters,
function (data) { function (data) {
$("#box_online .loading").hide();
$("#box_online .downloading_package").hide(); $("#box_online .downloading_package").hide();
if (data['have_minor']) { if (data['have_minor']) {
$("<div id='mr_dialog2' class='dialog ui-dialog-content' title='" + mr_available + "'></div>").dialog ({ $("<div id='mr_dialog2' class='dialog ui-dialog-content' title='" + mr_available + "'></div>").dialog ({
resizable: true, resizable: true,
@ -999,7 +995,6 @@ function install_free_package_prev_step(package, version, homeurl) {
"Apply MR": function () { "Apply MR": function () {
var err = []; var err = [];
err = apply_minor_release(data['mr'], package, 0, 0); err = apply_minor_release(data['mr'], package, 0, 0);
if (!err['error']) { if (!err['error']) {
if (err['message'] == 'bad_mr_filename') { if (err['message'] == 'bad_mr_filename') {
$("#mr_dialog2").dialog("close"); $("#mr_dialog2").dialog("close");
@ -1054,7 +1049,6 @@ function install_free_package_prev_step(package, version, homeurl) {
parameters2, parameters2,
function (data) { function (data) {
if (data['in_progress']) { if (data['in_progress']) {
$("#box_online .loading").hide();
$("#box_online .download_package").hide(); $("#box_online .download_package").hide();
$("#box_online .content").html(data['message']); $("#box_online .content").html(data['message']);
@ -1070,6 +1064,8 @@ function install_free_package_prev_step(package, version, homeurl) {
}, },
"json" "json"
); );
remove_rr_file_to_extras();
}, },
"Cancel": function () { "Cancel": function () {
$(this).dialog("close"); $(this).dialog("close");
@ -1155,7 +1151,6 @@ function install_free_package_prev_step(package, version, homeurl) {
parameters2, parameters2,
function (data) { function (data) {
if (data['in_progress']) { if (data['in_progress']) {
$("#box_online .loading").hide();
$("#box_online .download_package").hide(); $("#box_online .download_package").hide();
$("#box_online .content").html(data['message']); $("#box_online .content").html(data['message']);
@ -1172,7 +1167,7 @@ function install_free_package_prev_step(package, version, homeurl) {
"json" "json"
); );
remove_rr_file(data['mr']); remove_rr_file_to_extras();
} }
} }
else { else {
@ -1252,7 +1247,7 @@ function install_free_package_prev_step(package, version, homeurl) {
dialog_have_mr_text = dialog_have_mr_text + "<p style='font-family:Verdana; font-size:12pt;'>" + text2_mr_file + "<a style='font-family:Verdana bold; font-size:12pt; color:#82B92E'href=\"index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list\">" + text3_mr_file + "</a>" + text4_mr_file + "</p></div>"; dialog_have_mr_text = dialog_have_mr_text + "<p style='font-family:Verdana; font-size:12pt;'>" + text2_mr_file + "<a style='font-family:Verdana bold; font-size:12pt; color:#82B92E'href=\"index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list\">" + text3_mr_file + "</a>" + text4_mr_file + "</p></div>";
dialog_have_mr_text = dialog_have_mr_text + "</div>"; dialog_have_mr_text = dialog_have_mr_text + "</div>";
$('#mr_dialog2').html(dialog_have_mr_mr_text); $('#mr_dialog2').html(dialog_have_mr_text);
$('#mr_dialog2').dialog('open'); $('#mr_dialog2').dialog('open');
} }
else { else {
@ -1267,7 +1262,6 @@ function install_free_package_prev_step(package, version, homeurl) {
parameters2, parameters2,
function (data) { function (data) {
if (data['in_progress']) { if (data['in_progress']) {
$("#box_online .loading").hide();
$("#box_online .download_package").hide(); $("#box_online .download_package").hide();
$("#box_online .content").html(data['message']); $("#box_online .content").html(data['message']);
@ -1286,7 +1280,8 @@ function install_free_package_prev_step(package, version, homeurl) {
remove_rr_file_to_extras(); remove_rr_file_to_extras();
} }
} },
"json"
); );
}, },
"Cancel": function () { "Cancel": function () {