Merge branch 'ent-13061-limitar-el-aviso-de-lts-versions-del-warp-offline' into 'develop'

Ent 13061 limitar el aviso de lts versions del warp offline

See merge request artica/pandorafms!7037
This commit is contained in:
Rafael Ameijeiras 2024-03-26 11:31:02 +00:00
commit 469445a320
5 changed files with 66 additions and 2 deletions

View File

@ -2,6 +2,9 @@ START TRANSACTION;
DROP TABLE tskin;
ALTER TABLE `tusuario`
ADD COLUMN `stop_lts_modal` TINYINT NOT NULL DEFAULT 0 AFTER `session_max_time_expire`;
-- START MIGRATION MSSQL --
SET @current_app_type = 12;
SET @short_name = 'pandorafms.mssql';

View File

@ -40,6 +40,19 @@ 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') {
db_process_sql_update(
'tusuario',
['stop_lts_modal' => '1'],
['id_user' => $config['id_user']],
);
}
return;
}
require_once $config['homedir'].'/vendor/autoload.php';
$php_version = phpversion();
@ -83,7 +96,10 @@ if ($php_version_array[0] < 7) {
</div>
</div>
</div>
<?php
$stop_lts_modal = db_get_value('stop_lts_modal', 'tusuario', 'id_user', $config['id_user']);
if ($stop_lts_modal === '0') {
?>
<script type="text/javascript">
$(document).ready(function() {
// Lts Updates.
@ -100,12 +116,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,14 @@ if (!$action_update_url_update_manager) {
$result = config_update_value('identification_reminder', $identification_reminder);
}
if ($result && $lts_updates === 1) {
db_process_sql_update(
'tusuario',
['stop_lts_modal' => '0'],
['id_user' => $config['id_user']],
);
}
ui_print_result_message(
$result,
__('Succesful Update the url config vars.'),

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;

View File

@ -1326,6 +1326,7 @@ CREATE TABLE IF NOT EXISTS `tusuario` (
`allowed_ip_list` TEXT,
`auth_token_secret` VARCHAR(45) DEFAULT NULL,
`session_max_time_expire` INT NOT NULL DEFAULT 0,
`stop_lts_modal` TINYINT NOT NULL DEFAULT 0,
CONSTRAINT `fk_filter_id` FOREIGN KEY (`id_filter`) REFERENCES tevent_filter (`id_filter`) ON DELETE SET NULL,
UNIQUE KEY `id_user` (`id_user`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;