2019-03-14 18:04:28 +01:00
|
|
|
/*
|
|
|
|
globals $, jQuery
|
|
|
|
*/
|
|
|
|
|
2014-06-26 17:00:43 +02:00
|
|
|
var correct_install_progress = true;
|
|
|
|
|
2020-01-22 11:10:02 +01:00
|
|
|
function form_upload(homeurl, current_package) {
|
2019-01-30 12:27:18 +01:00
|
|
|
var home_url = typeof homeurl !== "undefined" ? homeurl + "/" : "";
|
|
|
|
|
|
|
|
//Thanks to: http://tutorialzine.com/2013/05/mini-ajax-file-upload-form/
|
|
|
|
var ul = $("#form-offline_update ul");
|
|
|
|
|
|
|
|
$("#form-offline_update div").prop("id", "drop_file");
|
|
|
|
$("#drop_file").html(
|
|
|
|
drop_the_package_here_or +
|
|
|
|
" <a>" +
|
|
|
|
browse_it +
|
|
|
|
"</a>" +
|
|
|
|
'<input name="upfile" type="file" id="file-upfile" accept=".oum" class="sub file" />'
|
|
|
|
);
|
|
|
|
$("#drop_file a").click(function() {
|
|
|
|
// Simulate a click on the file input button to show the file browser dialog
|
|
|
|
$(this)
|
|
|
|
.parent()
|
|
|
|
.find("input")
|
|
|
|
.click();
|
|
|
|
});
|
|
|
|
|
|
|
|
// Initialize the jQuery File Upload plugin
|
|
|
|
$("#form-offline_update").fileupload({
|
|
|
|
url:
|
|
|
|
home_url +
|
|
|
|
"ajax.php?page=include/ajax/update_manager.ajax&upload_file=true",
|
|
|
|
|
|
|
|
// This element will accept file drag/drop uploading
|
|
|
|
dropZone: $("#drop_file"),
|
|
|
|
|
|
|
|
// This function is called when a file is added to the queue;
|
|
|
|
// either via the browse button, or via drag/drop:
|
|
|
|
add: function(e, data) {
|
|
|
|
$("#drop_file").slideUp();
|
|
|
|
|
|
|
|
var tpl = $(
|
|
|
|
"<li>" +
|
|
|
|
'<input type="text" id="input-progress" ' +
|
|
|
|
'value="0" data-width="55" data-height="55" ' +
|
2019-06-04 14:08:07 +02:00
|
|
|
'data-fgColor="#82b92e" data-readOnly="1" ' +
|
2019-01-30 12:27:18 +01:00
|
|
|
'data-bgColor="#3E4043" />' +
|
|
|
|
"<p></p><span></span>" +
|
|
|
|
"</li>"
|
|
|
|
);
|
|
|
|
|
|
|
|
// Append the file name and file size
|
|
|
|
tpl
|
|
|
|
.find("p")
|
|
|
|
.text(data.files[0].name)
|
|
|
|
.append("<i>" + formatFileSize(data.files[0].size) + "</i>");
|
|
|
|
|
|
|
|
// Add the HTML to the UL element
|
|
|
|
ul.html("");
|
|
|
|
data.context = tpl.appendTo(ul);
|
|
|
|
|
|
|
|
// Initialize the knob plugin
|
|
|
|
tpl.find("input").val(0);
|
|
|
|
tpl.find("input").knob({
|
|
|
|
draw: function() {
|
|
|
|
$(this.i).val(this.cv + "%");
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
// Listen for clicks on the cancel icon
|
|
|
|
tpl.find("span").click(function() {
|
|
|
|
if (tpl.hasClass("working") && typeof jqXHR != "undefined") {
|
|
|
|
jqXHR.abort();
|
|
|
|
}
|
|
|
|
|
|
|
|
tpl.fadeOut(function() {
|
|
|
|
tpl.remove();
|
|
|
|
$("#drop_file").slideDown();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
// Automatically upload the file once it is added to the queue
|
|
|
|
data.context.addClass("working");
|
|
|
|
var jqXHR = data.submit();
|
|
|
|
},
|
|
|
|
|
|
|
|
progress: function(e, data) {
|
|
|
|
// Calculate the completion percentage of the upload
|
|
|
|
var progress = parseInt((data.loaded / data.total) * 100, 10);
|
|
|
|
|
|
|
|
// Update the hidden input field and trigger a change
|
|
|
|
// so that the jQuery knob plugin knows to update the dial
|
|
|
|
data.context
|
|
|
|
.find("input")
|
|
|
|
.val(progress)
|
|
|
|
.change();
|
|
|
|
|
|
|
|
if (progress == 100) {
|
|
|
|
data.context.removeClass("working");
|
|
|
|
// Class loading while the zip is extracted
|
|
|
|
data.context.addClass("loading");
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
fail: function(e, data) {
|
|
|
|
// Something has gone wrong!
|
|
|
|
data.context.removeClass("working");
|
|
|
|
data.context.removeClass("loading");
|
|
|
|
data.context.addClass("error");
|
|
|
|
},
|
|
|
|
|
|
|
|
done: function(e, data) {
|
|
|
|
var res = JSON.parse(data.result);
|
|
|
|
|
|
|
|
if (res.status == "success") {
|
|
|
|
data.context.removeClass("loading");
|
|
|
|
data.context.addClass("suc");
|
|
|
|
|
|
|
|
ul.find("li")
|
|
|
|
.find("span")
|
|
|
|
.unbind("click");
|
|
|
|
|
|
|
|
// Transform the file input zone to show messages
|
|
|
|
$("#drop_file").prop("id", "log_zone");
|
|
|
|
|
|
|
|
// Success messages
|
|
|
|
$("#log_zone").html(
|
|
|
|
"<div>" + the_package_has_been_uploaded_successfully + "</div>"
|
|
|
|
);
|
|
|
|
$("#log_zone").append(
|
|
|
|
"<div>" + remember_that_this_package_will + "</div>"
|
|
|
|
);
|
|
|
|
$("#log_zone").append(
|
|
|
|
"<div>" + click_on_the_file_below_to_begin + "</div>"
|
|
|
|
);
|
|
|
|
|
|
|
|
// Show messages
|
|
|
|
$("#log_zone").slideDown(400, function() {
|
|
|
|
$("#log_zone").height(75);
|
|
|
|
$("#log_zone").css("overflow", "auto");
|
|
|
|
});
|
|
|
|
|
|
|
|
// Bind the the begin of the installation to the package li
|
|
|
|
ul.find("li").css("cursor", "pointer");
|
|
|
|
ul.find("li").click(function() {
|
|
|
|
ul.find("li").unbind("click");
|
|
|
|
ul.find("li").css("cursor", "default");
|
|
|
|
|
|
|
|
// Change the log zone to show the copied files
|
|
|
|
$("#log_zone").html("");
|
|
|
|
$("#log_zone").slideUp(200, function() {
|
|
|
|
$("#log_zone").slideDown(200, function() {
|
|
|
|
$("#log_zone").height(200);
|
|
|
|
$("#log_zone").css("overflow", "auto");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
// Changed the data that shows the file li
|
|
|
|
data.context.find("p").text(updating + "...");
|
|
|
|
data.context
|
|
|
|
.find("input")
|
|
|
|
.val(0)
|
|
|
|
.change();
|
|
|
|
|
|
|
|
// Begin the installation
|
2020-01-22 11:10:02 +01:00
|
|
|
install_package(res.package, homeurl, current_package);
|
2019-01-30 12:27:18 +01:00
|
|
|
});
|
|
|
|
} else {
|
|
|
|
// Something has gone wrong!
|
|
|
|
data.context.removeClass("loading");
|
|
|
|
data.context.addClass("error");
|
|
|
|
ul.find("li")
|
|
|
|
.find("span")
|
|
|
|
.click(function() {
|
|
|
|
window.location.reload();
|
|
|
|
});
|
|
|
|
|
|
|
|
// Transform the file input zone to show messages
|
|
|
|
$("#drop_file").prop("id", "log_zone");
|
|
|
|
|
|
|
|
// Error messages
|
|
|
|
$("#log_zone").html("<div>" + res.message + "</div>");
|
|
|
|
|
|
|
|
// Show error messages
|
|
|
|
$("#log_zone").slideDown(400, function() {
|
|
|
|
$("#log_zone").height(75);
|
|
|
|
$("#log_zone").css("overflow", "auto");
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
// Prevent the default action when a file is dropped on the window
|
|
|
|
$(document).on("drop_file dragover", function(e) {
|
|
|
|
e.preventDefault();
|
|
|
|
});
|
2014-06-09 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php, general/login_page.php: improved
the source code style.
* godmode/setup/os.builder.php: fixed the form.
* godmode/update_manager_xxx/*, godmode/menu.php,
include/functions_update_manager.php,
include/ajax/update_manager.ajax.php,
include/graphs/functions_gd.php, include/graphs/functions_flot.php,
include/config_process.php, include/javascript/update_manager.js,
include/javascript/jquery.knob.js,
include/javascript/jquery.iframe-transport.js,
include/javascript/jquery.fileupload.js, images/check-cross.png:
first version of new update manager.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10144 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-06-09 15:33:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Helper function that formats the file sizes
|
|
|
|
function formatFileSize(bytes) {
|
2019-01-30 12:27:18 +01:00
|
|
|
if (typeof bytes !== "number") {
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
|
|
|
if (bytes >= 1000000000) {
|
|
|
|
return (bytes / 1000000000).toFixed(2) + " GB";
|
|
|
|
}
|
|
|
|
|
|
|
|
if (bytes >= 1000000) {
|
|
|
|
return (bytes / 1000000).toFixed(2) + " MB";
|
|
|
|
}
|
|
|
|
|
|
|
|
return (bytes / 1000).toFixed(2) + " KB";
|
2014-06-09 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php, general/login_page.php: improved
the source code style.
* godmode/setup/os.builder.php: fixed the form.
* godmode/update_manager_xxx/*, godmode/menu.php,
include/functions_update_manager.php,
include/ajax/update_manager.ajax.php,
include/graphs/functions_gd.php, include/graphs/functions_flot.php,
include/config_process.php, include/javascript/update_manager.js,
include/javascript/jquery.knob.js,
include/javascript/jquery.iframe-transport.js,
include/javascript/jquery.fileupload.js, images/check-cross.png:
first version of new update manager.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10144 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-06-09 15:33:55 +02:00
|
|
|
}
|
|
|
|
|
2020-01-22 11:10:02 +01:00
|
|
|
function install_package(package, homeurl, current_package) {
|
2019-01-30 12:27:18 +01:00
|
|
|
var home_url = typeof homeurl !== "undefined" ? homeurl + "/" : "";
|
|
|
|
|
|
|
|
$(
|
|
|
|
"<div id='pkg_apply_dialog' class='dialog ui-dialog-content' title='" +
|
|
|
|
package_available +
|
|
|
|
"'></div>"
|
|
|
|
).dialog({
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
|
|
|
width: 600,
|
|
|
|
height: 250,
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
text: ok_button,
|
|
|
|
click: function() {
|
|
|
|
$(this).dialog("close");
|
|
|
|
|
|
|
|
var parameters = {};
|
|
|
|
parameters["page"] = "include/ajax/update_manager.ajax";
|
|
|
|
parameters["search_minor"] = 1;
|
|
|
|
parameters["package"] = package;
|
|
|
|
parameters["ent"] = 1;
|
|
|
|
parameters["offline"] = 1;
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
|
|
|
url: home_url + "ajax.php",
|
|
|
|
data: parameters,
|
|
|
|
dataType: "json",
|
|
|
|
success: function(data) {
|
|
|
|
if (data["have_minor"]) {
|
|
|
|
$(
|
|
|
|
"<div id='mr_dialog2' class='dialog ui-dialog-content' title='" +
|
|
|
|
mr_available +
|
|
|
|
"'></div>"
|
|
|
|
).dialog({
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
|
|
|
width: 600,
|
|
|
|
height: 270,
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
text: apply_mr_button,
|
|
|
|
click: function() {
|
|
|
|
var err = [];
|
|
|
|
err = apply_minor_release(
|
|
|
|
data["mr"],
|
|
|
|
package,
|
|
|
|
1,
|
|
|
|
1,
|
|
|
|
home_url
|
|
|
|
);
|
|
|
|
|
|
|
|
if (!err["error"]) {
|
|
|
|
if (err["message"] == "bad_mr_filename") {
|
|
|
|
$("#mr_dialog2").dialog("close");
|
|
|
|
$(
|
|
|
|
"<div id='bad_message' class='dialog ui-dialog-content' title='" +
|
|
|
|
mr_available +
|
|
|
|
"'></div>"
|
|
|
|
).dialog({
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
|
|
|
width: 600,
|
|
|
|
height: 270,
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
text: apply_button,
|
|
|
|
click: function() {
|
|
|
|
$(this).dialog("close");
|
|
|
|
|
|
|
|
$(
|
|
|
|
"<div id='accept_package_mr_fail' class='dialog ui-dialog-content' title='" +
|
|
|
|
mr_available +
|
|
|
|
"'></div>"
|
|
|
|
).dialog({
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
|
|
|
width: 600,
|
|
|
|
height: 250,
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
text: ok_button,
|
|
|
|
click: function() {
|
|
|
|
$(this).dialog("close");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
|
|
|
var dialog_accept_package_mr_fail_text =
|
2019-04-24 12:45:07 +02:00
|
|
|
"<div class='update_popup'>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_accept_package_mr_fail_text =
|
|
|
|
dialog_accept_package_mr_fail_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<div class='update_text'><h3>INFO</h3>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_accept_package_mr_fail_text =
|
|
|
|
dialog_accept_package_mr_fail_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<p>" +
|
2019-01-30 12:27:18 +01:00
|
|
|
mr_not_accepted_code_yes +
|
|
|
|
"</p></div>";
|
2019-04-24 12:45:07 +02:00
|
|
|
dialog_accept_package_mr_fail_text =
|
|
|
|
dialog_accept_package_mr_fail_text +
|
|
|
|
"<div class='update_icon'><img src='" +
|
|
|
|
home_url +
|
|
|
|
"images/icon_info_mr.png'></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_accept_package_mr_fail_text =
|
|
|
|
dialog_accept_package_mr_fail_text +
|
|
|
|
"</div>";
|
|
|
|
|
|
|
|
$("#accept_package_mr_fail").html(
|
|
|
|
dialog_accept_package_mr_fail_text
|
|
|
|
);
|
|
|
|
$("#accept_package_mr_fail").dialog("open");
|
|
|
|
|
|
|
|
var parameters = {};
|
|
|
|
parameters["page"] =
|
|
|
|
"include/ajax/update_manager.ajax";
|
|
|
|
parameters["install_package"] = 1;
|
|
|
|
parameters["package"] = package;
|
|
|
|
parameters["accept"] = 1;
|
|
|
|
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.removeClass("suc");
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.addClass("loading");
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
|
|
|
url: home_url + "ajax.php",
|
|
|
|
data: parameters,
|
|
|
|
dataType: "json",
|
|
|
|
success: function(data) {
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.removeClass("loading");
|
|
|
|
if (data.status == "success") {
|
|
|
|
$(
|
|
|
|
"<div id='success_pkg' class='dialog ui-dialog-content' title='" +
|
|
|
|
package_available +
|
|
|
|
"'></div>"
|
|
|
|
).dialog({
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
|
|
|
width: 600,
|
|
|
|
height: 250,
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
text: ok_button,
|
|
|
|
click: function() {
|
|
|
|
$(this).dialog("close");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
2019-04-24 12:45:07 +02:00
|
|
|
var dialog_success_pkg_text =
|
|
|
|
"<div class='update_popup'>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_success_pkg_text =
|
|
|
|
dialog_success_pkg_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<div class='update_text'><h3>SUCCESS</h3>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_success_pkg_text =
|
|
|
|
dialog_success_pkg_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<p>" +
|
2019-01-30 12:27:18 +01:00
|
|
|
package_success +
|
|
|
|
"</p></div>";
|
2019-04-24 12:45:07 +02:00
|
|
|
dialog_success_pkg_text =
|
|
|
|
dialog_success_pkg_text +
|
|
|
|
"<div class='update_icon'><img src='" +
|
|
|
|
home_url +
|
|
|
|
"images/icon_success_mr.png'></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_success_pkg_text =
|
|
|
|
dialog_success_pkg_text + "</div>";
|
|
|
|
|
|
|
|
$("#success_pkg").html(
|
|
|
|
dialog_success_pkg_text
|
|
|
|
);
|
|
|
|
$("#success_pkg").dialog("open");
|
|
|
|
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.addClass("suc");
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.find("p")
|
|
|
|
.html(package_updated_successfully)
|
|
|
|
.append(
|
|
|
|
"<i>" +
|
|
|
|
if_there_are_any_database_change +
|
|
|
|
"</i>"
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
$(
|
|
|
|
"<div id='error_pkg' class='dialog ui-dialog-content' title='" +
|
|
|
|
package_available +
|
|
|
|
"'></div>"
|
|
|
|
).dialog({
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
|
|
|
width: 600,
|
|
|
|
height: 250,
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
text: ok_button,
|
|
|
|
click: function() {
|
|
|
|
$(this).dialog("close");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
2019-04-24 12:45:07 +02:00
|
|
|
var dialog_error_pkg_text =
|
|
|
|
"<div class='update_popup'>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_error_pkg_text =
|
|
|
|
dialog_error_pkg_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<div class='update_text'><h3>ERROR</h3>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_error_pkg_text =
|
|
|
|
dialog_error_pkg_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<p>" +
|
2019-01-30 12:27:18 +01:00
|
|
|
package_error +
|
|
|
|
"</p></div>";
|
2019-04-24 12:45:07 +02:00
|
|
|
dialog_error_pkg_text =
|
|
|
|
dialog_error_pkg_text +
|
|
|
|
"<div class='update_icon'><img src='" +
|
|
|
|
home_url +
|
|
|
|
"images/icon_error_mr.png'></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_error_pkg_text =
|
|
|
|
dialog_error_pkg_text + "</div>";
|
|
|
|
|
|
|
|
$("#error_pkg").html(
|
|
|
|
dialog_error_pkg_text
|
|
|
|
);
|
|
|
|
$("#error_pkg").dialog("open");
|
|
|
|
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.addClass("error");
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.find("p")
|
|
|
|
.html(package_not_updated)
|
|
|
|
.append(
|
|
|
|
"<i>" + data.message + "</i>"
|
|
|
|
);
|
|
|
|
}
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.css("cursor", "pointer");
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.click(function() {
|
|
|
|
window.location.reload();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
// Check the status of the update
|
|
|
|
check_install_package(package, homeurl);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text: cancel_button,
|
|
|
|
click: function() {
|
|
|
|
$(this).dialog("close");
|
|
|
|
|
|
|
|
$(
|
|
|
|
"<div id='cancel_pkg' class='dialog ui-dialog-content' title='" +
|
|
|
|
package_available +
|
|
|
|
"'></div>"
|
|
|
|
).dialog({
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
|
|
|
width: 600,
|
|
|
|
height: 220,
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
text: ok_button,
|
|
|
|
click: function() {
|
|
|
|
$(this).dialog("close");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
2019-04-24 12:45:07 +02:00
|
|
|
var dialog_cancel_pkg_text =
|
|
|
|
"<div class='update_popup'>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_cancel_pkg_text =
|
|
|
|
dialog_cancel_pkg_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<div class='update_text'><h3>INFO</h3>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_cancel_pkg_text =
|
|
|
|
dialog_cancel_pkg_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<p>" +
|
2019-01-30 12:27:18 +01:00
|
|
|
package_cancel +
|
|
|
|
"</p></div>";
|
2019-04-24 12:45:07 +02:00
|
|
|
dialog_cancel_pkg_text =
|
|
|
|
dialog_cancel_pkg_text +
|
|
|
|
"<div class='update_icon'><img src='" +
|
|
|
|
home_url +
|
|
|
|
"images/icon_info_mr.png'></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_cancel_pkg_text =
|
|
|
|
dialog_cancel_pkg_text + "</div>";
|
|
|
|
|
|
|
|
$("#cancel_pkg").html(
|
|
|
|
dialog_cancel_pkg_text
|
|
|
|
);
|
|
|
|
$("#cancel_pkg").dialog("open");
|
|
|
|
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.removeClass("loading");
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.addClass("error");
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.find("p")
|
|
|
|
.html(mr_not_accepted)
|
|
|
|
.append("<i>" + data.message + "</i>");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
2019-04-24 12:45:07 +02:00
|
|
|
var dialog_bad_message_text =
|
|
|
|
"<div class='update_popup'>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_bad_message_text =
|
|
|
|
dialog_bad_message_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<div class='update_text'><h3>ERROR</h3>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_bad_message_text =
|
|
|
|
dialog_bad_message_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<p>" +
|
2019-01-30 12:27:18 +01:00
|
|
|
bad_mr_file +
|
|
|
|
"</p></div>";
|
2019-04-24 12:45:07 +02:00
|
|
|
dialog_bad_message_text =
|
|
|
|
dialog_bad_message_text +
|
|
|
|
"<div class='update_icon'><img src='" +
|
|
|
|
home_url +
|
|
|
|
"images/icon_error_mr.png'></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_bad_message_text =
|
|
|
|
dialog_bad_message_text + "</div>";
|
|
|
|
|
|
|
|
$("#bad_message").html(dialog_bad_message_text);
|
|
|
|
$("#bad_message").dialog("open");
|
|
|
|
} else {
|
|
|
|
$("#mr_dialog2").dialog("close");
|
|
|
|
$(
|
|
|
|
"<div id='success_mr' class='dialog ui-dialog-content' title='" +
|
|
|
|
mr_available +
|
|
|
|
"'></div>"
|
|
|
|
).dialog({
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
|
|
|
width: 600,
|
|
|
|
height: 250,
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
text: ok_button,
|
|
|
|
click: function() {
|
|
|
|
$(this).dialog("close");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
2019-04-24 12:45:07 +02:00
|
|
|
var dialog_success_mr_text =
|
|
|
|
"<div class='update_popup'>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_success_mr_text =
|
|
|
|
dialog_success_mr_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<div class='update_text'><h3>SUCCESS</h3>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_success_mr_text =
|
|
|
|
dialog_success_mr_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<p>" +
|
2019-01-30 12:27:18 +01:00
|
|
|
mr_success +
|
|
|
|
"</p></div>";
|
2019-04-24 12:45:07 +02:00
|
|
|
dialog_success_mr_text =
|
|
|
|
dialog_success_mr_text +
|
|
|
|
"<div class='update_icon'><img src='" +
|
|
|
|
home_url +
|
|
|
|
"images/icon_success_mr.png'></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_success_mr_text =
|
|
|
|
dialog_success_mr_text + "</div>";
|
|
|
|
|
|
|
|
$("#success_mr").html(dialog_success_mr_text);
|
|
|
|
$("#success_mr").dialog("open");
|
|
|
|
|
|
|
|
var parameters = {};
|
|
|
|
parameters["page"] =
|
|
|
|
"include/ajax/update_manager.ajax";
|
|
|
|
parameters["install_package"] = 1;
|
|
|
|
parameters["package"] = package;
|
|
|
|
parameters["accept"] = 1;
|
|
|
|
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.removeClass("suc");
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.addClass("loading");
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
|
|
|
url: home_url + "ajax.php",
|
|
|
|
data: parameters,
|
|
|
|
dataType: "json",
|
|
|
|
success: function(data) {
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.removeClass("loading");
|
|
|
|
if (data.status == "success") {
|
|
|
|
$(
|
|
|
|
"<div id='success_pkg' class='dialog ui-dialog-content' title='" +
|
|
|
|
package_available +
|
|
|
|
"'></div>"
|
|
|
|
).dialog({
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
|
|
|
width: 600,
|
|
|
|
height: 250,
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
text: ok_button,
|
|
|
|
click: function() {
|
|
|
|
$(this).dialog("close");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
2019-04-24 12:45:07 +02:00
|
|
|
var dialog_success_pkg_text =
|
|
|
|
"<div class='update_popup'>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_success_pkg_text =
|
|
|
|
dialog_success_pkg_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<div class='update_text'><h3>SUCCESS</h3>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_success_pkg_text =
|
|
|
|
dialog_success_pkg_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<p>" +
|
2019-01-30 12:27:18 +01:00
|
|
|
package_success +
|
|
|
|
"</p></div>";
|
2019-04-24 12:45:07 +02:00
|
|
|
dialog_success_pkg_text =
|
|
|
|
dialog_success_pkg_text +
|
|
|
|
"<div class='update_icon'><img src='" +
|
|
|
|
home_url +
|
|
|
|
"images/icon_success_mr.png'></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_success_pkg_text =
|
|
|
|
dialog_success_pkg_text + "</div>";
|
|
|
|
|
|
|
|
$("#success_pkg").html(
|
|
|
|
dialog_success_pkg_text
|
|
|
|
);
|
|
|
|
$("#success_pkg").dialog("open");
|
|
|
|
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.addClass("suc");
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.find("p")
|
|
|
|
.html(package_updated_successfully)
|
|
|
|
.append(
|
|
|
|
"<i>" +
|
|
|
|
if_there_are_any_database_change +
|
|
|
|
"</i>"
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
$(
|
|
|
|
"<div id='error_pkg' class='dialog ui-dialog-content' title='" +
|
|
|
|
package_available +
|
|
|
|
"'></div>"
|
|
|
|
).dialog({
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
|
|
|
width: 600,
|
|
|
|
height: 250,
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
text: ok_button,
|
|
|
|
click: function() {
|
|
|
|
$(this).dialog("close");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
2019-04-24 12:45:07 +02:00
|
|
|
var dialog_error_pkg_text =
|
|
|
|
"<div class='update_popup'>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_error_pkg_text =
|
|
|
|
dialog_error_pkg_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<div class='update_text'><h3>ERROR</h3>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_error_pkg_text =
|
|
|
|
dialog_error_pkg_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<p>" +
|
2019-01-30 12:27:18 +01:00
|
|
|
package_error +
|
|
|
|
"</p></div>";
|
2019-04-24 12:45:07 +02:00
|
|
|
dialog_error_pkg_text =
|
|
|
|
dialog_error_pkg_text +
|
|
|
|
"<div class='update_icon'><img src='" +
|
|
|
|
home_url +
|
|
|
|
"images/icon_error_mr.png'></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_error_pkg_text =
|
|
|
|
dialog_error_pkg_text + "</div>";
|
|
|
|
|
|
|
|
$("#error_pkg").html(dialog_error_pkg_text);
|
|
|
|
$("#error_pkg").dialog("open");
|
|
|
|
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.addClass("error");
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.find("p")
|
|
|
|
.html(package_not_updated)
|
|
|
|
.append("<i>" + data.message + "</i>");
|
|
|
|
}
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.css("cursor", "pointer");
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.click(function() {
|
|
|
|
window.location.reload();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
// Check the status of the update
|
|
|
|
check_install_package(package, homeurl);
|
|
|
|
|
|
|
|
remove_rr_file(data["mr"], home_url);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$("#mr_dialog2").dialog("close");
|
|
|
|
$(
|
|
|
|
"<div id='error_mr' class='dialog ui-dialog-content' title='" +
|
|
|
|
mr_available +
|
|
|
|
"'></div>"
|
|
|
|
).dialog({
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
|
|
|
width: 600,
|
|
|
|
height: 250,
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
text: ok_button,
|
|
|
|
click: function() {
|
|
|
|
$(this).dialog("close");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
2019-04-24 12:45:07 +02:00
|
|
|
var dialog_error_mr_text =
|
|
|
|
"<div class='update_popup'>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_error_mr_text =
|
|
|
|
dialog_error_mr_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<div class='update_text'><h3>ERROR</h3>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_error_mr_text =
|
|
|
|
dialog_error_mr_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<p>" +
|
2019-01-30 12:27:18 +01:00
|
|
|
mr_error +
|
|
|
|
"</p></div>";
|
2019-04-24 12:45:07 +02:00
|
|
|
dialog_error_mr_text =
|
|
|
|
dialog_error_mr_text +
|
|
|
|
"<div class='update_icon'><img src='" +
|
|
|
|
home_url +
|
|
|
|
"images/icon_error_mr.png'></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_error_mr_text =
|
|
|
|
dialog_error_mr_text + "</div>";
|
|
|
|
|
|
|
|
$("#error_mr").html(dialog_error_mr_text);
|
|
|
|
$("#error_mr").dialog("open");
|
|
|
|
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.addClass("error");
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.find("p")
|
|
|
|
.html(error_in_mr)
|
|
|
|
.append("<i>" + data.message + "</i>");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text: cancel_button,
|
|
|
|
click: function() {
|
|
|
|
$("#mr_dialog2").dialog("close");
|
|
|
|
|
|
|
|
$(
|
|
|
|
"<div id='cancel_mr' class='dialog ui-dialog-content' title='" +
|
|
|
|
mr_available +
|
|
|
|
"'></div>"
|
|
|
|
).dialog({
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
|
|
|
width: 600,
|
|
|
|
height: 220,
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
text: ok_button,
|
|
|
|
click: function() {
|
|
|
|
$(this).dialog("close");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
2019-04-24 12:45:07 +02:00
|
|
|
var dialog_cancel_mr_text =
|
|
|
|
"<div class='update_popup'>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_cancel_mr_text =
|
|
|
|
dialog_cancel_mr_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<div class='update_text'><h3>INFO</h3>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_cancel_mr_text =
|
|
|
|
dialog_cancel_mr_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<p>" +
|
2019-01-30 12:27:18 +01:00
|
|
|
mr_cancel +
|
|
|
|
"</p></div>";
|
2019-04-24 12:45:07 +02:00
|
|
|
dialog_cancel_mr_text =
|
|
|
|
dialog_cancel_mr_text +
|
|
|
|
"<div class='update_icon'><img src='" +
|
|
|
|
home_url +
|
|
|
|
"images/icon_info_mr.png'></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_cancel_mr_text =
|
|
|
|
dialog_cancel_mr_text + "</div>";
|
|
|
|
|
|
|
|
$("#cancel_mr").html(dialog_cancel_mr_text);
|
|
|
|
$("#cancel_mr").dialog("open");
|
|
|
|
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.removeClass("loading");
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.addClass("error");
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.find("p")
|
|
|
|
.html(mr_not_accepted)
|
|
|
|
.append("<i>" + data.message + "</i>");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
2019-04-24 12:45:07 +02:00
|
|
|
$("button:contains(Apply MR)")
|
|
|
|
.attr("id", "apply_rr_button")
|
|
|
|
.addClass("success_button");
|
2019-01-30 12:27:18 +01:00
|
|
|
$("button:contains(Cancel)").attr("id", "cancel_rr_button");
|
|
|
|
|
2019-04-24 12:45:07 +02:00
|
|
|
var dialog_have_mr_text = "<div class='update_popup'>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_have_mr_text =
|
|
|
|
dialog_have_mr_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<div class='update_text'><h3>" +
|
2019-01-30 12:27:18 +01:00
|
|
|
mr_available_header +
|
2019-04-24 12:45:07 +02:00
|
|
|
"</h3>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_have_mr_text =
|
2019-04-24 12:45:07 +02:00
|
|
|
dialog_have_mr_text + "<p>" + text1_mr_file + "</p>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_have_mr_text =
|
|
|
|
dialog_have_mr_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<p>" +
|
2019-01-30 12:27:18 +01:00
|
|
|
text2_mr_file +
|
2019-04-24 12:45:07 +02:00
|
|
|
'<a href="index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list">' +
|
2019-01-30 12:27:18 +01:00
|
|
|
text3_mr_file +
|
|
|
|
"</a>" +
|
|
|
|
text4_mr_file +
|
|
|
|
"</p></div>";
|
2019-04-24 12:45:07 +02:00
|
|
|
dialog_have_mr_text =
|
|
|
|
dialog_have_mr_text +
|
|
|
|
"<div class='update_icon'><img src='" +
|
|
|
|
home_url +
|
|
|
|
"images/icon_warning_db.png'></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_have_mr_text = dialog_have_mr_text + "</div>";
|
|
|
|
|
|
|
|
$("#mr_dialog2").html(dialog_have_mr_text);
|
|
|
|
$("#mr_dialog2").dialog("open");
|
|
|
|
} else {
|
|
|
|
$("#pkg_apply_dialog").dialog("close");
|
|
|
|
|
|
|
|
var parameters = {};
|
|
|
|
parameters["page"] = "include/ajax/update_manager.ajax";
|
|
|
|
parameters["install_package"] = 1;
|
|
|
|
parameters["package"] = package;
|
|
|
|
parameters["accept"] = 1;
|
|
|
|
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.removeClass("suc");
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.addClass("loading");
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
|
|
|
url: home_url + "ajax.php",
|
|
|
|
data: parameters,
|
|
|
|
dataType: "json",
|
|
|
|
success: function(data) {
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.removeClass("loading");
|
|
|
|
if (data.status == "success") {
|
|
|
|
$(
|
|
|
|
"<div id='success_pkg' class='dialog ui-dialog-content' title='" +
|
|
|
|
package_available +
|
|
|
|
"'></div>"
|
|
|
|
).dialog({
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
|
|
|
width: 600,
|
|
|
|
height: 250,
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
text: ok_button,
|
|
|
|
click: function() {
|
|
|
|
$(this).dialog("close");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
2019-04-24 12:45:07 +02:00
|
|
|
var dialog_success_pkg_text =
|
|
|
|
"<div class='update_popup'>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_success_pkg_text =
|
|
|
|
dialog_success_pkg_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<div class='update_text'><h3>SUCCESS</h3>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_success_pkg_text =
|
|
|
|
dialog_success_pkg_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<p>" +
|
2019-01-30 12:27:18 +01:00
|
|
|
package_success +
|
|
|
|
"</p></div>";
|
2019-04-24 12:45:07 +02:00
|
|
|
dialog_success_pkg_text =
|
|
|
|
dialog_success_pkg_text +
|
|
|
|
"<div class='update_icon'><img src='" +
|
|
|
|
home_url +
|
|
|
|
"images/icon_success_mr.png'></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_success_pkg_text =
|
|
|
|
dialog_success_pkg_text + "</div>";
|
|
|
|
|
|
|
|
$("#success_pkg").html(dialog_success_pkg_text);
|
|
|
|
$("#success_pkg").dialog("open");
|
|
|
|
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.addClass("suc");
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.find("p")
|
|
|
|
.html(package_updated_successfully)
|
|
|
|
.append(
|
|
|
|
"<i>" + if_there_are_any_database_change + "</i>"
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
$(
|
|
|
|
"<div id='error_pkg' class='dialog ui-dialog-content' title='" +
|
|
|
|
package_available +
|
|
|
|
"'></div>"
|
|
|
|
).dialog({
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
|
|
|
width: 600,
|
|
|
|
height: 250,
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
text: ok_button,
|
|
|
|
click: function() {
|
|
|
|
$(this).dialog("close");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
2019-04-24 12:45:07 +02:00
|
|
|
var dialog_error_pkg_text = "<div class='update_popup'>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_error_pkg_text =
|
|
|
|
dialog_error_pkg_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<div class='update_text'><h3>ERROR</h3>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_error_pkg_text =
|
|
|
|
dialog_error_pkg_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<p>" +
|
2019-01-30 12:27:18 +01:00
|
|
|
package_error +
|
|
|
|
"</p></div>";
|
2019-04-24 12:45:07 +02:00
|
|
|
dialog_error_pkg_text =
|
|
|
|
dialog_error_pkg_text +
|
|
|
|
"<div class='update_icon'><img src='" +
|
|
|
|
home_url +
|
|
|
|
"images/icon_error_mr.png'></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_error_pkg_text = dialog_error_pkg_text + "</div>";
|
|
|
|
|
|
|
|
$("#error_pkg").html(dialog_error_pkg_text);
|
|
|
|
$("#error_pkg").dialog("open");
|
|
|
|
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.addClass("error");
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.find("p")
|
|
|
|
.html(package_not_updated)
|
|
|
|
.append("<i>" + data.message + "</i>");
|
|
|
|
}
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.css("cursor", "pointer");
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.click(function() {
|
|
|
|
window.location.reload();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
// Check the status of the update
|
|
|
|
check_install_package(package, homeurl);
|
|
|
|
|
|
|
|
remove_rr_file_to_extras(home_url);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text: cancel_button,
|
|
|
|
click: function() {
|
|
|
|
$(this).dialog("close");
|
|
|
|
|
|
|
|
$(
|
|
|
|
"<div id='cancel_pkg' class='dialog ui-dialog-content' title='" +
|
|
|
|
package_available +
|
|
|
|
"'></div>"
|
|
|
|
).dialog({
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
|
|
|
width: 600,
|
|
|
|
height: 220,
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
text: ok_button,
|
|
|
|
click: function() {
|
|
|
|
$(this).dialog("close");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
2019-04-24 12:45:07 +02:00
|
|
|
var dialog_cancel_pkg_text = "<div class='update_popup'>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_cancel_pkg_text =
|
2019-04-24 12:45:07 +02:00
|
|
|
dialog_cancel_pkg_text + "<div class='update_text'><h3>INFO</h3>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_cancel_pkg_text =
|
2019-04-24 12:45:07 +02:00
|
|
|
dialog_cancel_pkg_text + "<p>" + package_cancel + "</p></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_cancel_pkg_text =
|
|
|
|
dialog_cancel_pkg_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<div class='update_icon'><img src='" +
|
|
|
|
home_url +
|
|
|
|
"images/icon_info_mr.png'></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_cancel_pkg_text = dialog_cancel_pkg_text + "</div>";
|
|
|
|
|
|
|
|
$("#cancel_pkg").html(dialog_cancel_pkg_text);
|
|
|
|
$("#cancel_pkg").dialog("open");
|
|
|
|
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.removeClass("loading");
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.addClass("error");
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.find("p")
|
|
|
|
.html(package_not_accepted)
|
|
|
|
.append("<i>" + data.message + "</i>");
|
|
|
|
|
|
|
|
var parameters = {};
|
|
|
|
parameters["page"] = "include/ajax/update_manager.ajax";
|
|
|
|
parameters["install_package"] = 1;
|
|
|
|
parameters["package"] = package;
|
|
|
|
parameters["accept"] = 0;
|
|
|
|
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.removeClass("suc");
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.addClass("loading");
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
|
|
|
url: home_url + "ajax.php",
|
|
|
|
data: parameters,
|
|
|
|
dataType: "json",
|
|
|
|
success: function(data) {
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.removeClass("loading");
|
|
|
|
if (data.status == "success") {
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.addClass("suc");
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.find("p")
|
|
|
|
.html(package_updated_successfully)
|
|
|
|
.append("<i>" + if_there_are_any_database_change + "</i>");
|
|
|
|
} else {
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.addClass("error");
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.find("p")
|
|
|
|
.html(package_not_updated)
|
|
|
|
.append("<i>" + data.message + "</i>");
|
|
|
|
}
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.css("cursor", "pointer");
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.click(function() {
|
|
|
|
window.location.reload();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
// Check the status of the update
|
|
|
|
check_install_package(package, homeurl);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
2019-04-24 12:45:07 +02:00
|
|
|
var dialog_text = "<div class='update_popup'>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_text =
|
|
|
|
dialog_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<div class='update_text'><h3>" +
|
2019-01-30 12:27:18 +01:00
|
|
|
text1_package_file +
|
2019-04-24 12:45:07 +02:00
|
|
|
"</h3>";
|
|
|
|
dialog_text = dialog_text + "<p>" + text2_package_file + "</p></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_text =
|
|
|
|
dialog_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<div class='update_icon'><img src='" +
|
|
|
|
home_url +
|
|
|
|
"images/icon_info_mr.png'></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_text = dialog_text + "</div>";
|
|
|
|
|
|
|
|
$("#pkg_apply_dialog").html(dialog_text);
|
|
|
|
$("#pkg_apply_dialog").dialog("open");
|
2020-01-22 11:10:02 +01:00
|
|
|
|
|
|
|
const number_update = package.match(/package_(\d+).oum/);
|
|
|
|
|
|
|
|
if (number_update === null || number_update[1] != current_package - 0 + 1) {
|
|
|
|
$(
|
|
|
|
"<div id='warning_pkg' class='dialog ui-dialog-content' title='" +
|
|
|
|
package_available +
|
|
|
|
"'></div>"
|
|
|
|
).dialog({
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
|
|
|
width: 600,
|
|
|
|
height: 250,
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
text: ok_button,
|
|
|
|
click: function() {
|
|
|
|
$(this).dialog("close");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
|
|
|
var dialog_warning = "<div class='update_popup'>";
|
|
|
|
dialog_warning =
|
|
|
|
dialog_warning +
|
|
|
|
"<div class='update_text'><h3>" +
|
|
|
|
text1_warning +
|
|
|
|
"</h3>";
|
|
|
|
dialog_warning = dialog_warning + "<p>" + text2_warning + "</p></div>";
|
|
|
|
dialog_warning =
|
|
|
|
dialog_warning +
|
|
|
|
"<div class='update_icon'><img src='" +
|
|
|
|
home_url +
|
|
|
|
"images/icono_warning_mr.png'></div>";
|
|
|
|
dialog_warning = dialog_warning + "</div>";
|
|
|
|
|
|
|
|
$("#warning_pkg").html(dialog_warning);
|
|
|
|
}
|
2014-06-09 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php, general/login_page.php: improved
the source code style.
* godmode/setup/os.builder.php: fixed the form.
* godmode/update_manager_xxx/*, godmode/menu.php,
include/functions_update_manager.php,
include/ajax/update_manager.ajax.php,
include/graphs/functions_gd.php, include/graphs/functions_flot.php,
include/config_process.php, include/javascript/update_manager.js,
include/javascript/jquery.knob.js,
include/javascript/jquery.iframe-transport.js,
include/javascript/jquery.fileupload.js, images/check-cross.png:
first version of new update manager.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10144 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-06-09 15:33:55 +02:00
|
|
|
}
|
|
|
|
|
2015-06-30 12:59:23 +02:00
|
|
|
function check_install_package(package, homeurl) {
|
2019-01-30 12:27:18 +01:00
|
|
|
var home_url = typeof homeurl !== "undefined" ? (homeurl += "/") : "";
|
|
|
|
|
|
|
|
var parameters = {};
|
|
|
|
parameters["page"] = "include/ajax/update_manager.ajax";
|
|
|
|
parameters["check_install_package"] = 1;
|
|
|
|
parameters["package"] = package;
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
|
|
|
url: home_url + "ajax.php",
|
|
|
|
data: parameters,
|
|
|
|
dataType: "json",
|
|
|
|
success: function(data) {
|
2019-03-14 18:04:28 +01:00
|
|
|
// Print the updated files and take the scroll to the bottom.
|
|
|
|
$("#log_zone").append(data.info);
|
2019-01-30 12:27:18 +01:00
|
|
|
$("#log_zone").scrollTop($("#log_zone").prop("scrollHeight"));
|
|
|
|
|
2019-03-14 18:04:28 +01:00
|
|
|
// Change the progress bar.
|
2019-01-30 12:27:18 +01:00
|
|
|
if (
|
|
|
|
$("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.hasClass("suc")
|
|
|
|
) {
|
|
|
|
$("#form-offline_update")
|
|
|
|
.find("ul")
|
|
|
|
.find("li")
|
|
|
|
.find("input")
|
|
|
|
.val(100)
|
|
|
|
.trigger("change");
|
|
|
|
} else {
|
|
|
|
$("#form-offline_update")
|
|
|
|
.find("ul")
|
|
|
|
.find("li")
|
|
|
|
.find("input")
|
|
|
|
.val(data["progress"])
|
|
|
|
.trigger("change");
|
|
|
|
}
|
|
|
|
|
2019-03-14 18:04:28 +01:00
|
|
|
// The class loading is present until the update ends.
|
2019-01-30 12:27:18 +01:00
|
|
|
var isInstalling = $("#form-offline_update ul")
|
|
|
|
.find("li")
|
|
|
|
.hasClass("loading");
|
|
|
|
if (data.progress < 100 && isInstalling) {
|
2019-03-14 18:04:28 +01:00
|
|
|
// Recursive call to check the update status.
|
2019-01-30 12:27:18 +01:00
|
|
|
check_install_package(package, homeurl);
|
|
|
|
}
|
2019-03-14 18:04:28 +01:00
|
|
|
|
2019-03-20 13:35:24 +01:00
|
|
|
if (!isInstalling) {
|
|
|
|
//Check if exist remove files.
|
|
|
|
delete_desired_files(homeurl);
|
|
|
|
}
|
2019-01-30 12:27:18 +01:00
|
|
|
}
|
|
|
|
});
|
2014-06-10 14:57:17 +02:00
|
|
|
}
|
|
|
|
|
2015-06-30 12:59:23 +02:00
|
|
|
function check_online_free_packages(homeurl) {
|
2019-01-30 12:27:18 +01:00
|
|
|
var home_url = typeof homeurl !== "undefined" ? homeurl + "/" : "";
|
|
|
|
|
|
|
|
$("#box_online .checking_package").show();
|
|
|
|
|
|
|
|
var parameters = {};
|
|
|
|
parameters["page"] = "include/ajax/update_manager.ajax";
|
|
|
|
parameters["check_online_free_packages"] = 1;
|
|
|
|
|
|
|
|
jQuery.post(
|
|
|
|
home_url + "ajax.php",
|
|
|
|
parameters,
|
|
|
|
function(data) {
|
|
|
|
$("#box_online .checking_package").hide();
|
|
|
|
|
|
|
|
$("#box_online .loading").hide();
|
|
|
|
$("#box_online .content").html(data);
|
|
|
|
},
|
|
|
|
"html"
|
|
|
|
);
|
2014-06-10 14:57:17 +02:00
|
|
|
}
|
|
|
|
|
2015-06-30 12:59:23 +02:00
|
|
|
function update_last_package(package, version, homeurl) {
|
2019-01-30 12:27:18 +01:00
|
|
|
var home_url = typeof homeurl !== "undefined" ? homeurl + "/" : "";
|
|
|
|
|
|
|
|
version_update = version;
|
|
|
|
|
|
|
|
$("#box_online .content").html("");
|
|
|
|
$("#box_online .loading").show();
|
2019-02-13 12:21:31 +01:00
|
|
|
$("#box_online .downloading_package").show();
|
2019-01-30 12:27:18 +01:00
|
|
|
|
|
|
|
var parameters = {};
|
|
|
|
parameters["page"] = "include/ajax/update_manager.ajax";
|
|
|
|
parameters["update_last_free_package"] = 1;
|
|
|
|
parameters["package"] = package;
|
|
|
|
parameters["version"] = version;
|
|
|
|
parameters["accept"] = 0;
|
|
|
|
|
|
|
|
jQuery.post(
|
|
|
|
home_url + "ajax.php",
|
|
|
|
parameters,
|
|
|
|
function(data) {
|
|
|
|
if (data["in_progress"]) {
|
2019-02-13 12:21:31 +01:00
|
|
|
$("#box_online .downloading_package").hide();
|
2019-01-30 12:27:18 +01:00
|
|
|
|
|
|
|
$("#box_online .content").html(data["message"]);
|
|
|
|
|
|
|
|
var parameters2 = {};
|
|
|
|
parameters2["page"] = "include/ajax/update_manager.ajax";
|
|
|
|
parameters2["unzip_free_package"] = 1;
|
|
|
|
parameters2["package"] = package;
|
|
|
|
parameters2["version"] = version;
|
|
|
|
|
|
|
|
jQuery.post(
|
|
|
|
home_url + "ajax.php",
|
|
|
|
parameters2,
|
|
|
|
function(data) {
|
|
|
|
if (data["correct"]) {
|
2019-02-13 12:21:31 +01:00
|
|
|
$("#box_online .downloading_package").hide();
|
2019-01-30 12:27:18 +01:00
|
|
|
|
|
|
|
$("#box_online .content").html(data["message"]);
|
|
|
|
|
|
|
|
install_free_package_prev_step(package, version, home_url);
|
|
|
|
} else {
|
|
|
|
$("#box_online .content").html(data["message"]);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"json"
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
$("#box_online .content").html(data["message"]);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"json"
|
|
|
|
);
|
2017-03-16 18:07:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function check_progress_update(homeurl) {
|
2019-01-30 12:27:18 +01:00
|
|
|
var home_url = typeof homeurl !== "undefined" ? homeurl + "/" : "";
|
|
|
|
|
|
|
|
if (stop_check_progress) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
var parameters = {};
|
|
|
|
parameters["page"] = "include/ajax/update_manager.ajax";
|
|
|
|
parameters["check_update_free_package"] = 1;
|
|
|
|
|
|
|
|
jQuery.post(
|
|
|
|
home_url + "ajax.php",
|
|
|
|
parameters,
|
|
|
|
function(data) {
|
|
|
|
if (stop_check_progress) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (data["correct"]) {
|
|
|
|
if (data["end"]) {
|
|
|
|
//$("#box_online .content").html(data['message']);
|
|
|
|
} else {
|
|
|
|
$("#box_online .progressbar").show();
|
|
|
|
|
|
|
|
$("#box_online .progressbar .progressbar_img").attr(
|
|
|
|
"src",
|
|
|
|
data["progressbar"]
|
|
|
|
);
|
|
|
|
|
|
|
|
setTimeout(function() {
|
|
|
|
check_progress_update(homeurl);
|
|
|
|
}, 1000);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
correct_install_progress = false;
|
|
|
|
$("#box_online .content").html(data["message"]);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"json"
|
|
|
|
);
|
2017-03-16 18:07:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function install_free_package_prev_step(package, version, homeurl) {
|
2019-01-30 12:27:18 +01:00
|
|
|
var home_url = typeof homeurl !== "undefined" ? homeurl + "/" : "";
|
|
|
|
|
|
|
|
$(
|
|
|
|
"<div id='pkg_apply_dialog' class='dialog ui-dialog-content' title='" +
|
|
|
|
package_available +
|
|
|
|
"'></div>"
|
|
|
|
).dialog({
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
|
|
|
width: 600,
|
|
|
|
height: 250,
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
text: ok_button,
|
|
|
|
click: function() {
|
|
|
|
$(this).dialog("close");
|
|
|
|
|
|
|
|
var parameters = {};
|
|
|
|
parameters["page"] = "include/ajax/update_manager.ajax";
|
|
|
|
parameters["search_minor"] = 1;
|
|
|
|
parameters["ent"] = 0;
|
|
|
|
parameters["package"] = package;
|
|
|
|
parameters["offline"] = 0;
|
|
|
|
|
|
|
|
jQuery.post(
|
|
|
|
home_url + "ajax.php",
|
|
|
|
parameters,
|
|
|
|
function(data) {
|
|
|
|
$("#box_online .downloading_package").hide();
|
|
|
|
if (data["have_minor"]) {
|
|
|
|
$(
|
|
|
|
"<div id='mr_dialog2' class='dialog ui-dialog-content' title='" +
|
|
|
|
mr_available +
|
|
|
|
"'></div>"
|
|
|
|
).dialog({
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
|
|
|
width: 600,
|
|
|
|
height: 270,
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
text: apply_mr_button,
|
|
|
|
click: function() {
|
|
|
|
var err = [];
|
|
|
|
err = apply_minor_release(
|
|
|
|
data["mr"],
|
|
|
|
package,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
home_url
|
|
|
|
);
|
|
|
|
if (!err["error"]) {
|
|
|
|
if (err["message"] == "bad_mr_filename") {
|
|
|
|
$("#mr_dialog2").dialog("close");
|
|
|
|
$(
|
|
|
|
"<div id='bad_message' class='dialog ui-dialog-content' title='" +
|
|
|
|
mr_available +
|
|
|
|
"'></div>"
|
|
|
|
).dialog({
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
|
|
|
width: 600,
|
|
|
|
height: 270,
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
text: apply_button,
|
|
|
|
click: function() {
|
|
|
|
$(this).dialog("close");
|
|
|
|
|
|
|
|
$(
|
|
|
|
"<div id='accept_package_mr_fail' class='dialog ui-dialog-content' title='" +
|
|
|
|
mr_available +
|
|
|
|
"'></div>"
|
|
|
|
).dialog({
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
|
|
|
width: 600,
|
|
|
|
height: 250,
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
text: ok_button,
|
|
|
|
click: function() {
|
|
|
|
$(this).dialog("close");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
|
|
|
var dialog_accept_package_mr_fail_text =
|
2019-04-24 12:45:07 +02:00
|
|
|
"<div class='update_popup'>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_accept_package_mr_fail_text =
|
|
|
|
dialog_accept_package_mr_fail_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<div class='update_text'><h3>INFO</h3>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_accept_package_mr_fail_text =
|
|
|
|
dialog_accept_package_mr_fail_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<p>" +
|
2019-01-30 12:27:18 +01:00
|
|
|
mr_not_accepted_code_yes +
|
|
|
|
"</p></div>";
|
2019-04-24 12:45:07 +02:00
|
|
|
dialog_accept_package_mr_fail_text =
|
|
|
|
dialog_accept_package_mr_fail_text +
|
|
|
|
"<div class='update_icon'><img src='" +
|
|
|
|
home_url +
|
|
|
|
"images/icon_info_mr.png'></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_accept_package_mr_fail_text =
|
|
|
|
dialog_accept_package_mr_fail_text +
|
|
|
|
"</div>";
|
|
|
|
|
|
|
|
$("#accept_package_mr_fail").html(
|
|
|
|
dialog_accept_package_mr_fail_text
|
|
|
|
);
|
|
|
|
$("#accept_package_mr_fail").dialog("open");
|
|
|
|
|
|
|
|
var parameters2 = {};
|
|
|
|
parameters2["page"] =
|
|
|
|
"include/ajax/update_manager.ajax";
|
|
|
|
parameters2["update_last_free_package"] = 1;
|
|
|
|
parameters2["package"] = package;
|
|
|
|
parameters2["version"] = version;
|
|
|
|
|
|
|
|
jQuery.post(
|
|
|
|
home_url + "ajax.php",
|
|
|
|
parameters2,
|
|
|
|
function(data) {
|
|
|
|
if (data["in_progress"]) {
|
|
|
|
$(
|
|
|
|
"#box_online .download_package"
|
|
|
|
).hide();
|
|
|
|
|
|
|
|
$("#box_online .content").html(
|
|
|
|
data["message"]
|
|
|
|
);
|
|
|
|
|
|
|
|
install_free_package(
|
|
|
|
package,
|
|
|
|
version,
|
|
|
|
homeurl
|
|
|
|
);
|
|
|
|
setTimeout(function() {
|
|
|
|
check_progress_update(homeurl);
|
|
|
|
}, 1000);
|
|
|
|
} else {
|
|
|
|
$("#box_online .content").html(
|
|
|
|
data["message"]
|
|
|
|
);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"json"
|
|
|
|
);
|
|
|
|
|
|
|
|
remove_rr_file_to_extras(home_url);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text: cancel_button,
|
|
|
|
click: function() {
|
|
|
|
$(this).dialog("close");
|
|
|
|
|
|
|
|
$(this).dialog("close");
|
|
|
|
|
|
|
|
$(
|
|
|
|
"<div id='cancel_pkg' class='dialog ui-dialog-content' title='" +
|
|
|
|
package_available +
|
|
|
|
"'></div>"
|
|
|
|
).dialog({
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
|
|
|
width: 600,
|
|
|
|
height: 220,
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
text: ok_button,
|
|
|
|
click: function() {
|
|
|
|
$(this).dialog("close");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
2019-04-24 12:45:07 +02:00
|
|
|
var dialog_cancel_pkg_text =
|
|
|
|
"<div class='update_popup'>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_cancel_pkg_text =
|
|
|
|
dialog_cancel_pkg_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<div class='update_text'><h3>INFO</h3>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_cancel_pkg_text =
|
|
|
|
dialog_cancel_pkg_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<p>" +
|
2019-01-30 12:27:18 +01:00
|
|
|
package_cancel +
|
|
|
|
"</p></div>";
|
2019-04-24 12:45:07 +02:00
|
|
|
dialog_cancel_pkg_text =
|
|
|
|
dialog_cancel_pkg_text +
|
|
|
|
"<div class='update_icon'><img src='" +
|
|
|
|
home_url +
|
|
|
|
"images/icon_info_mr.png'></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_cancel_pkg_text =
|
|
|
|
dialog_cancel_pkg_text + "</div>";
|
|
|
|
|
|
|
|
$("#cancel_pkg").html(
|
|
|
|
dialog_cancel_pkg_text
|
|
|
|
);
|
|
|
|
$("#cancel_pkg").dialog("open");
|
|
|
|
|
|
|
|
$("#box_online .content").html(
|
|
|
|
package_not_accepted
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
2019-04-24 12:45:07 +02:00
|
|
|
var dialog_bad_message_text =
|
|
|
|
"<div class='update_popup'>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_bad_message_text =
|
|
|
|
dialog_bad_message_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<div class='update_text'><h3>ERROR</h3>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_bad_message_text =
|
|
|
|
dialog_bad_message_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<p>" +
|
2019-01-30 12:27:18 +01:00
|
|
|
bad_mr_file +
|
|
|
|
"</p></div>";
|
2019-04-24 12:45:07 +02:00
|
|
|
dialog_bad_message_text =
|
|
|
|
dialog_bad_message_text +
|
|
|
|
"<div class='update_icon'><img src='" +
|
|
|
|
home_url +
|
|
|
|
"images/icon_error_mr.png'></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_bad_message_text =
|
|
|
|
dialog_bad_message_text + "</div>";
|
|
|
|
|
|
|
|
$("#bad_message").html(dialog_bad_message_text);
|
|
|
|
$("#bad_message").dialog("open");
|
|
|
|
} else {
|
|
|
|
$("#mr_dialog2").dialog("close");
|
|
|
|
$(
|
|
|
|
"<div id='success_mr' class='dialog ui-dialog-content' title='" +
|
|
|
|
mr_available +
|
|
|
|
"'></div>"
|
|
|
|
).dialog({
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
|
|
|
width: 600,
|
|
|
|
height: 250,
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
text: ok_button,
|
|
|
|
click: function() {
|
|
|
|
$(this).dialog("close");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
2019-04-24 12:45:07 +02:00
|
|
|
var dialog_success_mr_text =
|
|
|
|
"<div class='update_popup'>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_success_mr_text =
|
|
|
|
dialog_success_mr_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<div class='update_text'><h3>SUCCESS</h3>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_success_mr_text =
|
|
|
|
dialog_success_mr_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<p>" +
|
2019-01-30 12:27:18 +01:00
|
|
|
mr_success +
|
|
|
|
"</p></div>";
|
2019-04-24 12:45:07 +02:00
|
|
|
dialog_success_mr_text =
|
|
|
|
dialog_success_mr_text +
|
|
|
|
"<div class='update_icon'><img src='" +
|
|
|
|
home_url +
|
|
|
|
"images/icon_success_mr.png'></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_success_mr_text =
|
|
|
|
dialog_success_mr_text + "</div>";
|
|
|
|
|
|
|
|
$("#success_mr").html(dialog_success_mr_text);
|
|
|
|
$("#success_mr").dialog("open");
|
|
|
|
|
|
|
|
var parameters2 = {};
|
|
|
|
parameters2["page"] =
|
|
|
|
"include/ajax/update_manager.ajax";
|
|
|
|
parameters2["update_last_free_package"] = 1;
|
|
|
|
parameters2["package"] = package;
|
|
|
|
parameters2["version"] = version;
|
|
|
|
|
|
|
|
jQuery.post(
|
|
|
|
home_url + "ajax.php",
|
|
|
|
parameters2,
|
|
|
|
function(data) {
|
|
|
|
if (data["in_progress"]) {
|
|
|
|
$("#box_online .download_package").hide();
|
|
|
|
|
|
|
|
$("#box_online .content").html(
|
|
|
|
data["message"]
|
|
|
|
);
|
|
|
|
|
|
|
|
install_free_package(
|
|
|
|
package,
|
|
|
|
version,
|
|
|
|
homeurl
|
|
|
|
);
|
|
|
|
setTimeout(function() {
|
|
|
|
check_progress_update(homeurl);
|
|
|
|
}, 1000);
|
|
|
|
} else {
|
|
|
|
$("#box_online .content").html(
|
|
|
|
data["message"]
|
|
|
|
);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"json"
|
|
|
|
);
|
|
|
|
|
|
|
|
remove_rr_file_to_extras(home_url);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$("#mr_dialog2").dialog("close");
|
|
|
|
$(
|
|
|
|
"<div id='error_mr' class='dialog ui-dialog-content' title='" +
|
|
|
|
mr_available +
|
|
|
|
"'></div>"
|
|
|
|
).dialog({
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
|
|
|
width: 600,
|
|
|
|
height: 250,
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
text: ok_button,
|
|
|
|
click: function() {
|
|
|
|
$(this).dialog("close");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
2019-04-24 12:45:07 +02:00
|
|
|
var dialog_error_mr_text =
|
|
|
|
"<div class='update_popup'>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_error_mr_text =
|
|
|
|
dialog_error_mr_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<div class='update_text'><h3>ERROR</h3>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_error_mr_text =
|
|
|
|
dialog_error_mr_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<p>" +
|
2019-01-30 12:27:18 +01:00
|
|
|
mr_error +
|
|
|
|
"</p></div>";
|
2019-04-24 12:45:07 +02:00
|
|
|
dialog_error_mr_text =
|
|
|
|
dialog_error_mr_text +
|
|
|
|
"<div class='update_icon'><img src='" +
|
|
|
|
home_url +
|
|
|
|
"images/icon_error_mr.png'></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_error_mr_text =
|
|
|
|
dialog_error_mr_text + "</div>";
|
|
|
|
|
|
|
|
$("#error_mr").html(dialog_error_mr_text);
|
|
|
|
$("#error_mr").dialog("open");
|
|
|
|
|
|
|
|
$("#box_online .content").html(mr_error);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text: cancel_button,
|
|
|
|
click: function() {
|
|
|
|
$(this).dialog("close");
|
|
|
|
|
|
|
|
$(
|
|
|
|
"<div id='cancel_mr' class='dialog ui-dialog-content' title='" +
|
|
|
|
mr_available +
|
|
|
|
"'></div>"
|
|
|
|
).dialog({
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
|
|
|
width: 600,
|
|
|
|
height: 220,
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
text: ok_button,
|
|
|
|
click: function() {
|
|
|
|
$(this).dialog("close");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
2019-04-24 12:45:07 +02:00
|
|
|
var dialog_cancel_mr_text =
|
|
|
|
"<div class='update_popup'>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_cancel_mr_text =
|
|
|
|
dialog_cancel_mr_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<div class='update_text'><h3>INFO</h3>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_cancel_mr_text =
|
|
|
|
dialog_cancel_mr_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<p>" +
|
2019-01-30 12:27:18 +01:00
|
|
|
mr_cancel +
|
|
|
|
"</p></div>";
|
2019-04-24 12:45:07 +02:00
|
|
|
dialog_cancel_mr_text =
|
|
|
|
dialog_cancel_mr_text +
|
|
|
|
"<div class='update_icon'><img src='" +
|
|
|
|
home_url +
|
|
|
|
"images/icon_info_mr.png'></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_cancel_mr_text =
|
|
|
|
dialog_cancel_mr_text + "</div>";
|
|
|
|
|
|
|
|
$("#cancel_mr").html(dialog_cancel_mr_text);
|
|
|
|
$("#cancel_mr").dialog("open");
|
|
|
|
|
|
|
|
$("#box_online .loading").hide();
|
|
|
|
$("#box_online .downloading_package").hide();
|
|
|
|
$("#box_online .content").html("MR not accepted");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
2019-04-24 12:45:07 +02:00
|
|
|
$("button:contains(Apply MR)")
|
|
|
|
.attr("id", "apply_rr_button")
|
|
|
|
.addClass("success_button");
|
2019-01-30 12:27:18 +01:00
|
|
|
$("button:contains(Cancel)").attr("id", "cancel_rr_button");
|
|
|
|
|
2019-04-24 12:45:07 +02:00
|
|
|
var dialog_have_mr_text = "<div class='update_popup'>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_have_mr_text =
|
|
|
|
dialog_have_mr_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<div class='update_text'><h3>" +
|
2019-01-30 12:27:18 +01:00
|
|
|
mr_available_header +
|
2019-04-24 12:45:07 +02:00
|
|
|
"</h3>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_have_mr_text =
|
2019-04-24 12:45:07 +02:00
|
|
|
dialog_have_mr_text + "<p>" + text1_mr_file + "</p>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_have_mr_text =
|
|
|
|
dialog_have_mr_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<p>" +
|
2019-01-30 12:27:18 +01:00
|
|
|
text2_mr_file +
|
2019-04-24 12:45:07 +02:00
|
|
|
'<a href="index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list">' +
|
2019-01-30 12:27:18 +01:00
|
|
|
text3_mr_file +
|
|
|
|
"</a>" +
|
|
|
|
text4_mr_file +
|
|
|
|
"</p></div>";
|
2019-04-24 12:45:07 +02:00
|
|
|
dialog_have_mr_text =
|
|
|
|
dialog_have_mr_text +
|
|
|
|
"<div class='update_icon'><img src='" +
|
|
|
|
home_url +
|
|
|
|
"images/icon_warning_db.png'></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_have_mr_text = dialog_have_mr_text + "</div>";
|
|
|
|
|
|
|
|
$("#mr_dialog2").html(dialog_have_mr_text);
|
|
|
|
$("#mr_dialog2").dialog("open");
|
|
|
|
} else {
|
|
|
|
var parameters2 = {};
|
|
|
|
parameters2["page"] = "include/ajax/update_manager.ajax";
|
|
|
|
parameters2["update_last_free_package"] = 1;
|
|
|
|
parameters2["package"] = package;
|
|
|
|
parameters2["version"] = version;
|
|
|
|
|
|
|
|
jQuery.post(
|
|
|
|
home_url + "ajax.php",
|
|
|
|
parameters2,
|
|
|
|
function(data) {
|
|
|
|
if (data["in_progress"]) {
|
|
|
|
$("#box_online .download_package").hide();
|
|
|
|
|
|
|
|
$("#box_online .content").html(data["message"]);
|
|
|
|
|
|
|
|
install_free_package(package, version, homeurl);
|
|
|
|
setTimeout(function() {
|
|
|
|
check_progress_update(homeurl);
|
|
|
|
}, 1000);
|
|
|
|
} else {
|
|
|
|
$("#box_online .content").html(data["message"]);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"json"
|
|
|
|
);
|
|
|
|
|
|
|
|
remove_rr_file_to_extras(home_url);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"json"
|
|
|
|
);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
text: cancel_button,
|
|
|
|
click: function() {
|
|
|
|
$(this).dialog("close");
|
|
|
|
|
|
|
|
$(
|
|
|
|
"<div id='cancel_pkg' class='dialog ui-dialog-content' title='" +
|
|
|
|
package_available +
|
|
|
|
"'></div>"
|
|
|
|
).dialog({
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
|
|
|
width: 600,
|
|
|
|
height: 220,
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
text: ok_button,
|
|
|
|
click: function() {
|
|
|
|
$(this).dialog("close");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
2019-04-24 12:45:07 +02:00
|
|
|
var dialog_cancel_pkg_text = "<div class='update_popup'>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_cancel_pkg_text =
|
2019-04-24 12:45:07 +02:00
|
|
|
dialog_cancel_pkg_text + "<div class='update_text'><h3>INFO</h3>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_cancel_pkg_text =
|
2019-04-24 12:45:07 +02:00
|
|
|
dialog_cancel_pkg_text + "<p>" + package_cancel + "</p></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_cancel_pkg_text =
|
|
|
|
dialog_cancel_pkg_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<div class='update_icon'><img src='" +
|
|
|
|
home_url +
|
|
|
|
"images/icon_info_mr.png'></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_cancel_pkg_text = dialog_cancel_pkg_text + "</div>";
|
|
|
|
|
|
|
|
$("#cancel_pkg").html(dialog_cancel_pkg_text);
|
|
|
|
$("#cancel_pkg").dialog("open");
|
|
|
|
|
|
|
|
$("#box_online .loading").hide();
|
|
|
|
$("#box_online .progressbar").hide();
|
|
|
|
$("#box_online .content").html(package_cancel);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
2019-04-24 12:45:07 +02:00
|
|
|
var dialog_text = "<div class='update_popup'>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_text =
|
|
|
|
dialog_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<div class='update_text'><h3>" +
|
2019-01-30 12:27:18 +01:00
|
|
|
text1_package_file +
|
2019-04-24 12:45:07 +02:00
|
|
|
"</h3>";
|
|
|
|
dialog_text = dialog_text + "<p>" + text2_package_file + "</p></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_text =
|
|
|
|
dialog_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<div class='update_icon'><img src='" +
|
|
|
|
home_url +
|
|
|
|
"images/icon_info_mr.png'></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_text = dialog_text + "</div>";
|
|
|
|
|
|
|
|
$("#pkg_apply_dialog").html(dialog_text);
|
|
|
|
$("#pkg_apply_dialog").dialog("open");
|
2014-06-10 14:57:17 +02:00
|
|
|
}
|
|
|
|
|
2015-06-30 12:59:23 +02:00
|
|
|
function install_free_package(package, version, homeurl) {
|
2019-01-30 12:27:18 +01:00
|
|
|
var home_url = typeof homeurl !== "undefined" ? homeurl + "/" : "";
|
|
|
|
|
|
|
|
var parameters = {};
|
|
|
|
parameters["page"] = "include/ajax/update_manager.ajax";
|
|
|
|
parameters["install_free_package"] = 1;
|
|
|
|
parameters["package"] = package;
|
|
|
|
parameters["version"] = version;
|
|
|
|
|
|
|
|
jQuery.ajax({
|
|
|
|
data: parameters,
|
|
|
|
type: "POST",
|
|
|
|
url: home_url + "ajax.php",
|
|
|
|
timeout: 600000,
|
|
|
|
dataType: "json",
|
|
|
|
error: function(data) {
|
|
|
|
$(
|
|
|
|
"<div id='error_pkg' class='dialog ui-dialog-content' title='" +
|
|
|
|
package_available +
|
|
|
|
"'></div>"
|
|
|
|
).dialog({
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
|
|
|
width: 600,
|
|
|
|
height: 250,
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
text: ok_button,
|
|
|
|
click: function() {
|
|
|
|
$(this).dialog("close");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
2019-04-24 12:45:07 +02:00
|
|
|
var dialog_error_pkg_text = "<div class='update_popup'>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_error_pkg_text =
|
2019-04-24 12:45:07 +02:00
|
|
|
dialog_error_pkg_text + "<div class='update_text'><h3>ERROR</h3>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_error_pkg_text =
|
2019-04-24 12:45:07 +02:00
|
|
|
dialog_error_pkg_text + "<p>" + data["message"] + "</p></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_error_pkg_text =
|
|
|
|
dialog_error_pkg_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<div class='update_icon'><img src='" +
|
|
|
|
home_url +
|
|
|
|
"images/icon_error_mr.png'></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_error_pkg_text = dialog_error_pkg_text + "</div>";
|
|
|
|
|
|
|
|
$("#error_pkg").html(dialog_error_pkg_text);
|
|
|
|
$("#error_pkg").dialog("open");
|
|
|
|
|
|
|
|
correct_install_progress = false;
|
|
|
|
stop_check_progress = 1;
|
|
|
|
|
|
|
|
$("#box_online .loading").hide();
|
|
|
|
$("#box_online .progressbar").hide();
|
|
|
|
$("#box_online .content").html(unknown_error_update_manager);
|
|
|
|
},
|
|
|
|
success: function(data) {
|
|
|
|
if (correct_install_progress) {
|
|
|
|
if (data["status"] == "success") {
|
|
|
|
$(
|
|
|
|
"<div id='success_pkg' class='dialog ui-dialog-content' title='" +
|
|
|
|
package_available +
|
|
|
|
"'></div>"
|
|
|
|
).dialog({
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
|
|
|
width: 600,
|
|
|
|
height: 250,
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
text: ok_button,
|
|
|
|
click: function() {
|
|
|
|
$(this).dialog("close");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
2019-04-24 12:45:07 +02:00
|
|
|
var dialog_success_pkg_text = "<div class='update_popup'>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_success_pkg_text =
|
|
|
|
dialog_success_pkg_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<div class='update_text'><h3>SUCCESS</h3>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_success_pkg_text =
|
2019-04-24 12:45:07 +02:00
|
|
|
dialog_success_pkg_text + "<p>" + data["message"] + "</p></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_success_pkg_text =
|
|
|
|
dialog_success_pkg_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<div class='update_icon'><img src='" +
|
|
|
|
home_url +
|
|
|
|
"images/icon_success_mr.png'></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_success_pkg_text = dialog_success_pkg_text + "</div>";
|
|
|
|
|
|
|
|
$("#success_pkg").html(dialog_success_pkg_text);
|
|
|
|
$("#success_pkg").dialog("open");
|
|
|
|
|
|
|
|
$("#pkg_version").text(version);
|
|
|
|
|
|
|
|
$("#box_online .loading").hide();
|
|
|
|
$("#box_online .progressbar").hide();
|
|
|
|
$("#box_online .content").html(data["message"]);
|
|
|
|
stop_check_progress = 1;
|
|
|
|
} else {
|
|
|
|
$(
|
|
|
|
"<div id='error_pkg' class='dialog ui-dialog-content' title='" +
|
|
|
|
package_available +
|
|
|
|
"'></div>"
|
|
|
|
).dialog({
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
|
|
|
width: 600,
|
|
|
|
height: 250,
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
text: ok_button,
|
|
|
|
click: function() {
|
|
|
|
$(this).dialog("close");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
2019-04-24 12:45:07 +02:00
|
|
|
var dialog_error_pkg_text = "<div class='update_popup'>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_error_pkg_text =
|
2019-04-24 12:45:07 +02:00
|
|
|
dialog_error_pkg_text + "<div class='update_text'><h3>ERROR</h3>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_error_pkg_text =
|
2019-04-24 12:45:07 +02:00
|
|
|
dialog_error_pkg_text + "<p>" + data["message"] + "</p></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_error_pkg_text =
|
|
|
|
dialog_error_pkg_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<div class='update_icon'><img src='" +
|
|
|
|
home_url +
|
|
|
|
"images/icon_error_mr.png'></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_error_pkg_text = dialog_error_pkg_text + "</div>";
|
|
|
|
|
|
|
|
$("#error_pkg").html(dialog_error_pkg_text);
|
|
|
|
$("#error_pkg").dialog("open");
|
|
|
|
|
|
|
|
$("#box_online .loading").hide();
|
|
|
|
$("#box_online .progressbar").hide();
|
|
|
|
$("#box_online .content").html(data["message"]);
|
|
|
|
stop_check_progress = 1;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
stop_check_progress = 1;
|
|
|
|
|
|
|
|
$(
|
|
|
|
"<div id='error_pkg' class='dialog ui-dialog-content' title='" +
|
|
|
|
package_available +
|
|
|
|
"'></div>"
|
|
|
|
).dialog({
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
|
|
|
width: 600,
|
|
|
|
height: 250,
|
|
|
|
buttons: [
|
|
|
|
{
|
|
|
|
text: ok_button,
|
|
|
|
click: function() {
|
|
|
|
$(this).dialog("close");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
|
2019-04-24 12:45:07 +02:00
|
|
|
var dialog_error_pkg_text = "<div class='update_popup'>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_error_pkg_text =
|
2019-04-24 12:45:07 +02:00
|
|
|
dialog_error_pkg_text + "<div class='update_text'><h3>ERROR</h3>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_error_pkg_text =
|
2019-04-24 12:45:07 +02:00
|
|
|
dialog_error_pkg_text + "<p>" + data["message"] + "</p></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_error_pkg_text =
|
|
|
|
dialog_error_pkg_text +
|
2019-04-24 12:45:07 +02:00
|
|
|
"<div class='update_icon'><img src='" +
|
|
|
|
home_url +
|
|
|
|
"images/icon_error_mr.png'></div>";
|
2019-01-30 12:27:18 +01:00
|
|
|
dialog_error_pkg_text = dialog_error_pkg_text + "</div>";
|
|
|
|
|
|
|
|
$("#error_pkg").html(dialog_error_pkg_text);
|
|
|
|
$("#error_pkg").dialog("open");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2017-03-13 15:52:30 +01:00
|
|
|
}
|
|
|
|
|
2019-01-30 12:27:18 +01:00
|
|
|
function apply_minor_release(n_mr, pkg, ent, off, homeurl) {
|
|
|
|
var home_url = typeof homeurl !== "undefined" ? homeurl + "/" : "";
|
|
|
|
var error = [];
|
|
|
|
error["error"] = false;
|
|
|
|
$("#mr_dialog2").empty();
|
|
|
|
$.each(n_mr, function(i, mr) {
|
|
|
|
var params = {};
|
|
|
|
params["updare_rr"] = 1;
|
|
|
|
params["number"] = mr;
|
|
|
|
params["ent"] = ent;
|
|
|
|
params["package"] = pkg;
|
|
|
|
params["offline"] = off;
|
|
|
|
params["page"] = "include/ajax/rolling_release.ajax";
|
|
|
|
|
|
|
|
jQuery.ajax({
|
|
|
|
data: params,
|
|
|
|
async: false,
|
|
|
|
dataType: "html",
|
|
|
|
type: "POST",
|
|
|
|
url: home_url + "ajax.php",
|
|
|
|
success: function(data) {
|
|
|
|
$("#mr_dialog2").append("</div style='max-height:50px'>");
|
|
|
|
if (data == "bad_mr_filename") {
|
|
|
|
error["error"] = false;
|
|
|
|
error["message"] = "bad_mr_filename";
|
|
|
|
} else if (data != "") {
|
|
|
|
$("#mr_dialog2").empty();
|
|
|
|
$("#mr_dialog2").html(data);
|
|
|
|
error["error"] = true;
|
|
|
|
} else {
|
2019-04-24 12:45:07 +02:00
|
|
|
$("#mr_dialog2").append("<p>- " + applying_mr + " #" + mr + "</p>");
|
2019-01-30 12:27:18 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
if (error["error"]) {
|
|
|
|
return false;
|
|
|
|
} else if (error["message"] == "bad_mr_filename") {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
$("#mr_dialog2").append("</div>");
|
|
|
|
$(".ui-dialog-buttonset").empty();
|
|
|
|
|
|
|
|
return error;
|
2017-03-21 10:39:28 +01:00
|
|
|
}
|
|
|
|
|
2019-01-30 12:27:18 +01:00
|
|
|
function remove_rr_file(number, homeurl) {
|
|
|
|
var home_url = typeof homeurl !== "undefined" ? homeurl + "/" : "";
|
|
|
|
var params = {};
|
|
|
|
params["remove_rr"] = 1;
|
|
|
|
params["number"] = number;
|
|
|
|
params["page"] = "include/ajax/rolling_release.ajax";
|
|
|
|
|
|
|
|
jQuery.ajax({
|
|
|
|
data: params,
|
|
|
|
dataType: "html",
|
|
|
|
type: "POST",
|
|
|
|
url: home_url + "ajax.php",
|
|
|
|
success: function(data) {}
|
|
|
|
});
|
2017-03-21 14:48:12 +01:00
|
|
|
}
|
|
|
|
|
2019-01-30 12:27:18 +01:00
|
|
|
function remove_rr_file_to_extras(homeurl) {
|
|
|
|
var home_url = typeof homeurl !== "undefined" ? homeurl + "/" : "";
|
|
|
|
var params = {};
|
|
|
|
params["remove_rr_extras"] = 1;
|
|
|
|
params["page"] = "include/ajax/rolling_release.ajax";
|
|
|
|
|
|
|
|
jQuery.ajax({
|
|
|
|
data: params,
|
|
|
|
dataType: "html",
|
|
|
|
type: "POST",
|
|
|
|
url: home_url + "ajax.php",
|
|
|
|
success: function(data) {}
|
|
|
|
});
|
|
|
|
}
|
2019-03-14 18:04:28 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function delete files desired and add extras/delete_files.txt.
|
|
|
|
*
|
|
|
|
* @param string homeurl Url.
|
|
|
|
*/
|
|
|
|
function delete_desired_files(homeurl) {
|
|
|
|
var home_url = typeof homeurl !== "undefined" ? homeurl + "/" : "";
|
|
|
|
|
|
|
|
var parameters = {
|
|
|
|
page: "include/ajax/update_manager.ajax",
|
|
|
|
delete_desired_files: 1
|
|
|
|
};
|
|
|
|
|
|
|
|
jQuery.ajax({
|
|
|
|
data: parameters,
|
|
|
|
type: "POST",
|
|
|
|
url: home_url + "ajax.php",
|
|
|
|
dataType: "json",
|
|
|
|
success: function(data) {
|
2019-03-15 12:19:02 +01:00
|
|
|
var translation = data.translation;
|
2019-03-14 18:04:28 +01:00
|
|
|
// Print the deleted files.
|
2019-03-15 12:19:02 +01:00
|
|
|
// Print title.
|
2019-03-14 18:04:28 +01:00
|
|
|
$("#log_zone").append(
|
2019-03-15 12:19:02 +01:00
|
|
|
"</br></br><span class='log_zone_line bolder';>" +
|
|
|
|
translation.title +
|
2019-03-14 18:04:28 +01:00
|
|
|
": </span></br></br>"
|
|
|
|
);
|
2019-03-15 12:19:02 +01:00
|
|
|
$.each(data.status_list, function(key, value) {
|
2019-03-14 18:04:28 +01:00
|
|
|
var log_zone_line_class = "log_zone_line ";
|
|
|
|
var msg = "";
|
|
|
|
switch (value.status) {
|
|
|
|
case -1:
|
|
|
|
//Not exits file.
|
2019-03-15 12:19:02 +01:00
|
|
|
msg = translation.not_file;
|
2019-03-14 18:04:28 +01:00
|
|
|
break;
|
|
|
|
case 0:
|
|
|
|
//File or directory deleted successfully.
|
|
|
|
if (value.type === "f") {
|
|
|
|
log_zone_line_class += "";
|
|
|
|
} else {
|
2019-03-15 12:19:02 +01:00
|
|
|
log_zone_line_class += "bolder";
|
2019-03-14 18:04:28 +01:00
|
|
|
}
|
|
|
|
|
2019-03-15 12:19:02 +01:00
|
|
|
msg = value.path;
|
2019-03-14 18:04:28 +01:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
//Problem delete file or directory.
|
|
|
|
if (value.type === "f") {
|
|
|
|
log_zone_line_class += "log_zone_line_error";
|
|
|
|
} else {
|
2019-03-15 12:19:02 +01:00
|
|
|
log_zone_line_class += "log_zone_line_error bolder";
|
2019-03-14 18:04:28 +01:00
|
|
|
}
|
|
|
|
|
2019-03-15 12:19:02 +01:00
|
|
|
msg = value.path + " ( " + translation.not_deleted + " ) ";
|
2019-03-14 18:04:28 +01:00
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
//Not found file or directory.
|
|
|
|
if (value.type === "f") {
|
|
|
|
log_zone_line_class += "log_zone_line_error";
|
|
|
|
} else {
|
2019-03-15 12:19:02 +01:00
|
|
|
log_zone_line_class += "log_zone_line_error bolder";
|
2019-03-14 18:04:28 +01:00
|
|
|
}
|
|
|
|
|
2019-03-15 12:19:02 +01:00
|
|
|
msg = value.path + " ( " + translation.not_found + " ) ";
|
2019-03-14 18:04:28 +01:00
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
//Don`t read file deleet_files.txt.
|
2019-03-15 12:19:02 +01:00
|
|
|
log_zone_line_class += "log_zone_line_error bolder";
|
|
|
|
msg = translation.not_read;
|
2019-03-14 18:04:28 +01:00
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
//"deleted" folder could not be created.
|
2019-03-15 12:19:02 +01:00
|
|
|
log_zone_line_class += "log_zone_line_error bolder";
|
|
|
|
msg = value.path + " ( " + translation.folder_deleted_f + " ) ";
|
2019-03-14 18:04:28 +01:00
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
//"deleted" folder was created.
|
2019-03-15 12:19:02 +01:00
|
|
|
log_zone_line_class += "bolder";
|
|
|
|
msg = translation.folder_deleted_t;
|
2019-03-14 18:04:28 +01:00
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
//The "delete files" could not be the "delete" folder.
|
2019-03-15 12:19:02 +01:00
|
|
|
log_zone_line_class += "log_zone_line_error bolder";
|
|
|
|
msg = value.path + " ( " + translation.move_file_f + " ) ";
|
2019-03-14 18:04:28 +01:00
|
|
|
break;
|
|
|
|
case 7:
|
|
|
|
//The "delete files" is moved to the "delete" folder.
|
2019-03-15 12:19:02 +01:00
|
|
|
log_zone_line_class += "bolder";
|
|
|
|
msg = translation.move_file_d;
|
2019-03-14 18:04:28 +01:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
// It can not come without state.
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
//Print line.
|
|
|
|
$("#log_zone").append(
|
|
|
|
"<span class='" + log_zone_line_class + "' >" + msg + "</span><br>"
|
|
|
|
);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|