#13061 dont show more lts message checkbox

This commit is contained in:
Jonathan 2024-03-18 09:38:29 +01:00
parent 921505f360
commit 0dd0927633
4 changed files with 59 additions and 2 deletions

View File

@ -40,6 +40,17 @@ if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user
return;
}
if (is_ajax()) {
$stopShowingModal = get_parameter('stopShowingModal', 0);
if ($stopShowingModal === '1') {
config_update_value('stop_lts_modal', 1);
} else {
config_update_value('stop_lts_modal', 0);
}
return;
}
require_once $config['homedir'].'/vendor/autoload.php';
$php_version = phpversion();
@ -83,7 +94,9 @@ if ($php_version_array[0] < 7) {
</div>
</div>
</div>
<?php
if ($config['stop_lts_modal'] === '0') {
?>
<script type="text/javascript">
$(document).ready(function() {
// Lts Updates.
@ -100,12 +113,36 @@ if ($php_version_array[0] < 7) {
buttons: [{
text: "OK",
click: function() {
var no_show_more = $('#checkbox-no_show_more').is(':checked');
if (no_show_more === true){
$.ajax({
url: 'ajax.php',
data: {
page: 'godmode/update_manager/modal_lts_update',
stopShowingModal: 1,
},
type: 'POST',
async: false,
dataType: 'json'
});
}
$(this).dialog("close");
}
}],
open: function(event, ui) {
$(".ui-dialog-titlebar-close").hide();
$("div.ui-dialog-buttonset").addClass('flex-rr-sb-important');
$("div.ui-dialog-buttonset").append(`
<div class="welcome-wizard-buttons">
<label class="flex-row-center">
<input type="checkbox" id="checkbox-no_show_more" class="welcome-wizard-do-not-show"/>
<?php echo __('Do not show anymore'); ?>
</label>
</div>
`);
}
});
});
</script>
</script>
<?php
}

View File

@ -242,6 +242,10 @@ if (!$action_update_url_update_manager) {
$result = config_update_value('identification_reminder', $identification_reminder);
}
if ($result && $lts_updates === 1) {
config_update_value('stop_lts_modal', '0');
}
ui_print_result_message(
$result,
__('Succesful Update the url config vars.'),

View File

@ -3143,6 +3143,10 @@ function config_process_config()
config_update_value('default_assign_tags', '');
}
if (!isset($config['stop_lts_modal'])) {
config_update_value('stop_lts_modal', 0);
}
if (!isset($config['default_no_hierarchy'])) {
config_update_value('default_no_hierarchy', 0);
}

View File

@ -943,6 +943,18 @@ select:-internal-list-box {
align-items: center;
}
.flex-rr-sb {
display: flex;
flex-direction: row-reverse;
justify-content: space-between;
}
.flex-rr-sb-important {
display: flex !important;
flex-direction: row-reverse !important;
justify-content: space-between !important;
}
.flex-row-vcenter {
display: flex;
flex-direction: row;