Added more changes to um online open with mr

This commit is contained in:
Arturo Gonzalez 2017-03-16 18:23:07 +01:00
parent b9702a5b00
commit 01b9572edc
5 changed files with 33 additions and 12 deletions

View File

@ -22,6 +22,13 @@ if (is_ajax ()) {
if ($updare_rr) {
$number = get_parameter('number');
$package = get_parameter('package');
$ent = get_parameter('ent');
if (!$ent) {
$dir = $config['attachment_store'] . "/last_package/downloads/extras/mr";
}
else {
$dir = sys_get_temp_dir() . "/pandora_oum/" . $package . "/extras/mr";
}
$dir = sys_get_temp_dir() . "/pandora_oum/" . $package . "/extras/mr";
$file = "$dir/$number.sql";

View File

@ -358,12 +358,14 @@ if ($check_online_free_packages) {
if ($search_minor) {
$package = get_parameter('package', '');
$have_minor_releases = db_check_minor_relase_available_to_um($package);
$ent = get_parameter('ent', false);
$have_minor_releases = db_check_minor_relase_available_to_um($package, $ent);
$return['have_minor'] = false;
if ($have_minor_releases) {
$return['have_minor'] = true;
$size_mr = get_number_of_mr($package);
$size_mr = get_number_of_mr($package, $ent);
$return['mr'] = $size_mr;
}
@ -522,9 +524,7 @@ if ($unzip_free_package) {
if ($install_free_package) {
$version = get_parameter('version', '');
if ($result)
update_manager_set_current_package($version);
update_manager_set_current_package($version);
sleep(3);

View File

@ -2683,10 +2683,16 @@ function update_config_token ($cfgtoken, $cfgvalue) {
}
}
function get_number_of_mr($package) {
function get_number_of_mr($package, $ent) {
global $config;
$dir = sys_get_temp_dir() . "/pandora_oum/" . $package . "/extras/mr";
if (!$ent) {
$dir = $config['attachment_store'] . "/last_package/downloads/extras/mr";
}
else {
$dir = sys_get_temp_dir() . "/pandora_oum/" . $package . "/extras/mr";
}
$mr_size = array();
if (file_exists($dir) && is_dir($dir)) {

View File

@ -1720,10 +1720,15 @@ function db_check_minor_relase_available () {
*
* @return bool Return if minor release is available or not
*/
function db_check_minor_relase_available_to_um ($package) {
function db_check_minor_relase_available_to_um ($package, $ent) {
global $config;
$dir = sys_get_temp_dir() . "/pandora_oum/" . $package . "/extras/mr";
if (!$ent) {
$dir = $config['attachment_store'] . "/last_package/downloads/extras/mr";
}
else {
$dir = sys_get_temp_dir() . "/pandora_oum/" . $package . "/extras/mr";
}
$have_minor_release = false;

View File

@ -231,7 +231,7 @@ function install_package (package, homeurl) {
buttons: {
"Apply MR": function () {
var err = [];
err = apply_minor_release(data['mr']);
err = apply_minor_release(data['mr'], 1);
if (!err['error']) {
if (err['message'] == 'bad_mr_filename') {
@ -955,6 +955,8 @@ function install_free_package_prev_step(package, version, homeurl) {
var parameters = {};
parameters['page'] = 'include/ajax/update_manager.ajax';
parameters['search_minor'] = 1;
parameters['ent'] = 0;
parameters['package'] = package;
jQuery.post(
home_url + "ajax.php",
@ -977,7 +979,7 @@ function install_free_package_prev_step(package, version, homeurl) {
buttons: {
"Apply MR": function () {
var err = [];
err = apply_minor_release(data['mr']);
err = apply_minor_release(data['mr'], 0);
if (!err['error']) {
if (err['message'] == 'bad_mr_filename') {
@ -1461,7 +1463,7 @@ function install_free_package(package, version, homeurl) {
});
}
function apply_minor_release (n_mr) {
function apply_minor_release (n_mr, ent) {
var error = [];
error['error'] = false;
$('#mr_dialog2').empty();
@ -1469,6 +1471,7 @@ function apply_minor_release (n_mr) {
var params = {};
params["updare_rr"] = 1;
params["number"] = mr;
params["ent"] = ent;
params["page"] = "include/ajax/rolling_release.ajax";
jQuery.ajax ({