ent-9067 fixed notification system

This commit is contained in:
edu.corral 2022-06-16 16:19:33 +02:00
parent 4ee4590690
commit a0f7c9e6a2
2 changed files with 1 additions and 99 deletions

View File

@ -1056,23 +1056,6 @@ function notifications_print_dropdown_element($message_info)
$action = 'show_modal(this.id);';
$target = '';
$body_preview = __('Click here to get more information');
preg_match(
'/LTS\s+(\d*)/',
io_safe_output($message_info['subject']),
$array_version
);
if (empty($array_version) === false
&& isset($array_version[1]) === true
) {
$version = (int) $array_version[1];
$result = notifications_curl_new_version_description($version);
if (empty($result) === false) {
$title = explode('\n', $result);
hd($title, true);
$action = 'show_modal_lts("'.base64_encode(io_safe_output($message_info['subject'])).'","'.base64_encode($result).'")';
}
}
break;
default:
@ -1133,45 +1116,3 @@ function notifications_print_dropdown_element($message_info)
$body_preview
);
}
function notifications_curl_new_version_description(int $version)
{
global $config;
$pandora_license = db_get_value('value', 'tupdate_settings', '`key`', 'customer_key');
$params = [
'action' => 'newer_packages',
'puid' => $config['pandora_uid'],
'build' => ($version - 1),
'current_package' => ($version - 1),
'license' => $pandora_license,
'limit_count' => 1,
'language' => $config['language'],
'timezone' => $config['timezone'],
'version' => 'v7.0NG.'.$config['current_package'],
'email' => '',
'format' => 'lts',
];
$defaults = [
CURLOPT_URL => $config['url_update_manager'],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $params,
CURLOPT_RETURNTRANSFER => 1,
];
$ch = curl_init();
curl_setopt_array($ch, $defaults);
$result = curl_exec($ch);
curl_close($ch);
$result = json_decode($result, true);
if (isset($result[0]['description']) === false) {
$result = '';
} else {
$result = $result[0]['description'];
}
return $result;
}

View File

@ -1536,6 +1536,7 @@ require 'include/php_to_js_values.php';
draggable: true,
modal: true,
width: 800,
height: 600,
buttons: [{
text: "OK",
click: function() {
@ -1565,46 +1566,6 @@ require 'include/php_to_js_values.php';
);
}
function show_modal_lts(title, description) {
notifications_hide();
// Launch modal.
try {
$('#um_msg_receiver').prop('title', atob(title));
$('#um_msg_receiver')
.empty()
.html('<div style="width:700px;height:500px">'+
'<pre>'+atob(description)+'</pre>'
+'</div>');
$("#um_msg_receiver").dialog({
resizable: true,
draggable: true,
modal: true,
width: 800,
height: 600,
overflow: 'auto',
buttons: [{
text: "OK",
click: function() {
$(this).dialog("close");
}
}],
overlay: {
opacity: 0.5,
background: "black"
},
closeOnEscape: false,
open: function(event, ui) {
$(".ui-dialog-titlebar-close").hide();
}
});
}
catch (error) {
console.log(error);
}
}
//Dynamically assign footer position and width.
function adjustFooter() {
/*