Merge branch '42-rendimiento-del-shortcut-bar-integria-4409' into 'develop'
delete shortcut bar See merge request !115
This commit is contained in:
commit
25f734c3bc
|
@ -1,408 +0,0 @@
|
|||
<?php
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
|
||||
// Please see http://pandorafms.org for full contribution list
|
||||
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; version 2
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
global $config;
|
||||
|
||||
// Login check
|
||||
check_login ();
|
||||
|
||||
require_once("include/functions_reporting.php");
|
||||
require_once("include/functions_events.php");
|
||||
|
||||
if (is_ajax()) {
|
||||
|
||||
$save_item_shorcut = (bool) get_parameter("save_item_shorcut");
|
||||
$update_shortcut_state = (bool) get_parameter('update_shortcut_state');
|
||||
$get_alerts_fired = (bool) get_parameter('get_alerts_fired');
|
||||
$get_critical_events = (bool) get_parameter('get_critical_events');
|
||||
$get_opened_incidents = (bool) get_parameter('get_opened_incidents');
|
||||
|
||||
if ($save_item_shorcut) {
|
||||
$result = false;
|
||||
$data = get_parameter("data", '');
|
||||
$id_user = get_parameter('id_user', 0);
|
||||
|
||||
if ($config['id_user'] != $id_user) return;
|
||||
|
||||
$shortcut_data = db_get_value('shortcut_data', 'tusuario', 'id_user', $id_user);
|
||||
if ($shortcut_data !== false) {
|
||||
$serialize = $shortcut_data;
|
||||
$unserialize = json_decode($serialize, true);
|
||||
|
||||
$unserialize['item_shorcut'][] = $data;
|
||||
$shortcut_data = array();
|
||||
$shortcut_data['shortcut_data'] = json_encode($unserialize);
|
||||
|
||||
db_process_sql_update('tusuario', $shortcut_data, array('id_user' => $id_user));
|
||||
}
|
||||
|
||||
echo json_encode($result);
|
||||
return;
|
||||
}
|
||||
|
||||
// Update if shortcut is visible or hidden
|
||||
if ($update_shortcut_state) {
|
||||
$value = (int) get_parameter('value');
|
||||
$result = db_process_sql_update('tusuario', array('shortcut' => $value), array('id_user' => $config['id_user']));
|
||||
|
||||
echo json_encode($result);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get critical events (realtime update)
|
||||
if ($get_alerts_fired) {
|
||||
echo sc_get_alerts_fired();
|
||||
return;
|
||||
}
|
||||
|
||||
// Get critical events (realtime update)
|
||||
if ($get_critical_events) {
|
||||
echo sc_get_critical_events();
|
||||
return;
|
||||
}
|
||||
|
||||
// Select only opened incidents
|
||||
if ($get_opened_incidents) {
|
||||
echo sc_get_opened_incidents();
|
||||
return;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
function sc_get_alerts_fired () {
|
||||
global $config;
|
||||
|
||||
$data_reporting = reporting_get_group_stats();
|
||||
|
||||
return $data_reporting['monitor_alerts_fired'];
|
||||
}
|
||||
|
||||
function sc_get_critical_events () {
|
||||
global $config;
|
||||
|
||||
$own_info = get_user_info ($config['id_user']);
|
||||
|
||||
if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM"))
|
||||
$own_groups = array_keys(users_get_groups($config['id_user'], "IR"));
|
||||
else
|
||||
$own_groups = array_keys(users_get_groups($config['id_user'], "IR", false));
|
||||
|
||||
// Get events in the last 8 hours
|
||||
$shortcut_events_update = events_get_agent (false, 28800, time(), false, false, false, false,
|
||||
false, false, $own_groups, true);
|
||||
if ($shortcut_events_update == false)
|
||||
$shortcut_events_update = array();
|
||||
|
||||
$critical_events_update = 0;
|
||||
foreach ($shortcut_events_update as $event_update) {
|
||||
if ($event_update['criticity'] == 4 and $event_update['estado'] == 0) {
|
||||
$critical_events_update++;
|
||||
}
|
||||
}
|
||||
|
||||
return $critical_events_update;
|
||||
}
|
||||
|
||||
function sc_get_opened_incidents () {
|
||||
global $config;
|
||||
|
||||
$own_info = get_user_info ($config['id_user']);
|
||||
|
||||
if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM")) {
|
||||
$sql = "SELECT count(*) total_incidents
|
||||
FROM tincidencia
|
||||
WHERE estado = 0
|
||||
ORDER BY actualizacion";
|
||||
$result_incidents_update = db_get_all_rows_sql ($sql);
|
||||
}
|
||||
else {
|
||||
$own_groups = array_keys(users_get_groups($config['id_user'], "IR", false));
|
||||
$sql = "SELECT count(*) total_incidents
|
||||
FROM tincidencia
|
||||
WHERE id_grupo IN (".implode (",",array_keys ($own_groups)).")
|
||||
AND estado = 0
|
||||
ORDER BY actualizacion";
|
||||
if (!empty($own_groups)) {
|
||||
$result_incidents_update = db_get_all_rows_sql($sql);
|
||||
}
|
||||
else {
|
||||
$result_incidents_update = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ($result_incidents_update === false)
|
||||
$shortcut_incidents = 0;
|
||||
else
|
||||
$shortcut_incidents = $result_incidents_update[0]['total_incidents'];
|
||||
|
||||
return $shortcut_incidents;
|
||||
}
|
||||
|
||||
|
||||
$shortcut_state = db_get_value_filter('shortcut', 'tusuario', array('id_user' => $config['id_user']));
|
||||
|
||||
// If shortcut bar is disabled return to index.php
|
||||
if ($shortcut_state == 0)
|
||||
return;
|
||||
|
||||
$own_info = get_user_info ($config['id_user']);
|
||||
|
||||
$shortcut_html = "<div id='shortcut_container'>";
|
||||
$shortcut_html .= "<div id='shortcut_button'>";
|
||||
$shortcut_html .= html_print_image("images/control_play.png", true, array("title" => __("Press here to activate shortcut bar")));
|
||||
$shortcut_html .= "</div>";
|
||||
$shortcut_html .= "<div id='shortcut_bar'>";
|
||||
|
||||
$num_shortcut_items = 0;
|
||||
|
||||
// Alerts item
|
||||
if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM") || check_acl ($config['id_user'], 0, "AR")) {
|
||||
$alerts_fired = sc_get_alerts_fired();
|
||||
|
||||
$shortcut_html .= "<a class='shortcut_item' href='index.php?sec=estado&sec2=operation/agentes/alerts_status&refr=120&filter=fired&filter_button=Filter'>";
|
||||
$shortcut_html .= html_print_image("images/op_alerts.png", true, array("title" => __("Alerts fired"), "style" => "margin-bottom: 0px;"));
|
||||
$shortcut_html .= " ";
|
||||
$shortcut_html .= "<span id='shortcut_alerts_fired' title='" . __('Alerts fired') . "'>" . $alerts_fired . "</span>";
|
||||
$shortcut_html .= "</a>";
|
||||
|
||||
$num_shortcut_items++;
|
||||
}
|
||||
|
||||
// Events item
|
||||
if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM") || check_acl ($config['id_user'], 0, "IR")) {
|
||||
$critical_events = sc_get_critical_events();
|
||||
|
||||
$shortcut_html .= "<a class='shortcut_item' href='index.php?sec=eventos&sec2=operation/events/events&status=3&severity=4&event_view_hr=8&id_group=0&group_rep=1&filter_only_alert=-1'>";
|
||||
$shortcut_html .= html_print_image("images/op_events.png", true, array("title" => __("Critical events"), "style" => "margin-bottom: 0px;"));
|
||||
$shortcut_html .= " ";
|
||||
$shortcut_html .= "<span id='shortcut_critical_events' title='" . __('Critical events') . "'>" . $critical_events . "</span>";
|
||||
$shortcut_html .= "</a>";
|
||||
|
||||
$num_shortcut_items++;
|
||||
}
|
||||
|
||||
// Calculate opened incidents (id integria incidents are not enabled)
|
||||
$shortcut_incidents = sc_get_opened_incidents();
|
||||
|
||||
$shortcut_html .= "<a class='shortcut_item' href='index.php?sec=incidencias&sec2=operation/incidents/incident&estado=0'>";
|
||||
$shortcut_html .= html_print_image("images/incidents.png", true, array("title" => __("Incidents opened"), "style" => "margin-bottom: 0px;"));
|
||||
$shortcut_html .= " ";
|
||||
$shortcut_html .= "<span id='shortcut_incidents_opened' title='" . __('Incidents opened') . "'>" . $shortcut_incidents . "</span>";
|
||||
$shortcut_html .= "</a>";
|
||||
|
||||
$num_shortcut_items++;
|
||||
|
||||
if ($num_shortcut_items > 0) {
|
||||
$shortcut_html .= "<span class='shortcut_item' href='javascript:;'>";
|
||||
$shortcut_html .= "<span>|</span>";
|
||||
$shortcut_html .= "</span>";
|
||||
}
|
||||
|
||||
$shortcut_html .= "<a class='shortcut_item' href='index.php?sec=reporting&sec2=operation/reporting/custom_reporting'>";
|
||||
$shortcut_html .= html_print_image("images/op_reporting.png", true, array("title" => __("View reports"), "style" => "margin-bottom: 0px;"));
|
||||
$shortcut_html .= "</a>";
|
||||
$num_shortcut_items++;
|
||||
|
||||
$shortcut_html .= "<a class='shortcut_item' href='index.php?sec=workspace&sec2=operation/messages/message_list'>";
|
||||
$shortcut_html .= html_print_image("images/email_mc.png", true, array("title" => __("Create new message"), "style" => "margin-bottom: 0px;"));
|
||||
$shortcut_html .= "</a>";
|
||||
$num_shortcut_items++;
|
||||
|
||||
//Quick access
|
||||
// $shortcut_data = db_get_value('shortcut_data', 'tusuario', 'id_user', $config['id_user']);
|
||||
// if (!empty($shortcut_data)) {
|
||||
// $serialize = $shortcut_data;
|
||||
// $unserialize = json_decode($serialize, true);
|
||||
|
||||
// $items = $unserialize['item_shorcut'];
|
||||
// }
|
||||
// else {
|
||||
// $items = array();
|
||||
// }
|
||||
// $shortcut_html .= "<div id='shortcut_icons_box' style='font-size: 9pt; color:#696969; font-weight: bold; display: inline; float: right; padding-right: 20px;'>" .
|
||||
// __("Shortcut: ");
|
||||
// $shortcut_html .= "<ul style='display: inline; font-size: 9pt; color:#000;'>";
|
||||
// foreach ($items as $item) {
|
||||
// $shortcut_html .= "<li style='display: inline; padding-right: 10px;'>" . io_safe_output($item) . "</li>";
|
||||
// }
|
||||
// $shortcut_html .= "</ul>";
|
||||
|
||||
$shortcut_html .= "</div>";
|
||||
$shortcut_html .= "</div>";
|
||||
|
||||
echo $shortcut_html;
|
||||
|
||||
// Login in Console and shortcut bar is disabled
|
||||
// This will show and hide the shortcut value in Javascript code
|
||||
if (isset($_POST['nick']) and $shortcut_state != 2) {
|
||||
html_print_input_hidden("login_console", 1);
|
||||
}
|
||||
else {
|
||||
html_print_input_hidden("login_console", 0);
|
||||
}
|
||||
|
||||
html_print_input_hidden("shortcut_id_user", $config['id_user']);
|
||||
|
||||
?>
|
||||
|
||||
<script type='text/javascript'>
|
||||
$(function() {
|
||||
|
||||
if (<?php echo json_encode((int) $shortcut_state); ?> < 2) {
|
||||
$('#shortcut_bar').hide();
|
||||
|
||||
$('#shortcut_button>img')
|
||||
.css('transform', 'rotate(-90deg)')
|
||||
.css('-o-transform', 'rotate(-90deg)')
|
||||
.css('-ms-transform', 'rotate(-90deg)')
|
||||
.css('-moz-transform', 'rotate(-90deg)')
|
||||
.css('-webkit-transform', 'rotate(-90deg)');
|
||||
}
|
||||
else {
|
||||
$('#shortcut_button>img')
|
||||
.css('transform', 'rotate(90deg)')
|
||||
.css('-o-transform', 'rotate(90deg)')
|
||||
.css('-ms-transform', 'rotate(90deg)')
|
||||
.css('-moz-transform', 'rotate(90deg)')
|
||||
.css('-webkit-transform', 'rotate(90deg)');
|
||||
}
|
||||
|
||||
|
||||
$('#shortcut_button').click (function () {
|
||||
if ($('#shortcut_bar').is(":visible")) {
|
||||
$('#shortcut_bar').slideUp();
|
||||
|
||||
$('#shortcut_button>img')
|
||||
.css('transform', 'rotate(-90deg)')
|
||||
.css('-o-transform', 'rotate(-90deg)')
|
||||
.css('-ms-transform', 'rotate(-90deg)')
|
||||
.css('-moz-transform', 'rotate(-90deg)')
|
||||
.css('-webkit-transform', 'rotate(-90deg)');
|
||||
|
||||
jQuery.post (
|
||||
"ajax.php",
|
||||
{
|
||||
"page" : "general/shortcut_bar",
|
||||
"update_shortcut_state" : 1,
|
||||
"value" : 1
|
||||
},
|
||||
function (data) {}
|
||||
);
|
||||
}
|
||||
else {
|
||||
$('#shortcut_bar').slideDown();
|
||||
|
||||
$('#shortcut_button>img')
|
||||
.css('transform', 'rotate(90deg)')
|
||||
.css('-o-transform', 'rotate(90deg)')
|
||||
.css('-ms-transform', 'rotate(90deg)')
|
||||
.css('-moz-transform', 'rotate(90deg)')
|
||||
.css('-webkit-transform', 'rotate(90deg)');
|
||||
|
||||
jQuery.post (
|
||||
"ajax.php",
|
||||
{
|
||||
"page" : "general/shortcut_bar",
|
||||
"update_shortcut_state" : 1,
|
||||
"value" : 2
|
||||
},
|
||||
function (data) {}
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var id_user = $('#hidden-shortcut_id_user').val();
|
||||
|
||||
function shortcut_check_alerts() {
|
||||
jQuery.post (
|
||||
"ajax.php",
|
||||
{
|
||||
"page" : "general/shortcut_bar",
|
||||
"get_alerts_fired": 1
|
||||
},
|
||||
function (data) {
|
||||
$('#shortcut_alerts_fired').html(data);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function shortcut_check_events() {
|
||||
jQuery.post (
|
||||
"ajax.php",
|
||||
{
|
||||
"page" : "general/shortcut_bar",
|
||||
"get_critical_events": 1
|
||||
},
|
||||
function (data) {
|
||||
$('#shortcut_critical_events').html(data);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function shortcut_check_incidents() {
|
||||
jQuery.post (
|
||||
"ajax.php",
|
||||
{
|
||||
"page" : "general/shortcut_bar",
|
||||
"get_opened_incidents": 1
|
||||
},
|
||||
function (data) {
|
||||
$('#shortcut_incidents_opened').html(data);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
$(document).ready (function () {
|
||||
setInterval("shortcut_check_alerts()", (10 * 1000)); //10 seconds between ajax request
|
||||
setInterval("shortcut_check_events()", (10 * 1000)); //10 seconds between ajax request
|
||||
setInterval("shortcut_check_incidents()", (10 * 1000)); //10 seconds between ajax request
|
||||
|
||||
//To make a link as item for drag only put "item_drag_shortcut" as class.
|
||||
|
||||
//TODO: In the future show better as icons and the handle some icon.
|
||||
//TODO: Remove the class "item_drag_shortcut" for avoid drag.
|
||||
//TODO: Method for remove items.
|
||||
|
||||
$("#shortcut_icons_box").droppable({
|
||||
drop: function( event, ui ) {
|
||||
var item = ui.draggable.clone();
|
||||
//unescape for avoid change returns
|
||||
var content_item = unescape($('<div id="content_item"></div>').html(item).html()); //hack
|
||||
|
||||
//Add the element
|
||||
$("<li style='display: inline; padding-right: 10px;'></li>").html(item).appendTo($("#shortcut_icons_box > ul"));
|
||||
|
||||
jQuery.post ('ajax.php',
|
||||
{"page": "general/shortcut_bar",
|
||||
"save_item_shorcut": 1,
|
||||
"id_user": "<?php echo $config['id_user'];?>",
|
||||
"data": content_item
|
||||
},
|
||||
function (data) {
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
$(".item_drag_shortcut").draggable({
|
||||
appendTo: 'body',
|
||||
helper: "clone",
|
||||
scroll: false
|
||||
});
|
||||
});
|
||||
</script>
|
|
@ -2917,43 +2917,6 @@ td.empty_field {
|
|||
width: 96%;
|
||||
}
|
||||
|
||||
/* Shortcut bar */
|
||||
|
||||
#shortcut_container {
|
||||
position: fixed;
|
||||
margin: 0px !important;
|
||||
bottom: 0px;
|
||||
left: 0px;
|
||||
z-index: 9001;
|
||||
}
|
||||
|
||||
#shortcut_bar {
|
||||
background-color: #333;
|
||||
border-top: 1px solid #808080;
|
||||
border-right: 1px solid #808080;
|
||||
border-top-right-radius: 5px;
|
||||
}
|
||||
|
||||
#shortcut_button {
|
||||
display: inline-block;
|
||||
background-color: #333;
|
||||
border: 1px solid #808080;
|
||||
border-bottom: none;
|
||||
border-top-left-radius: 15px;
|
||||
border-top-right-radius: 15px;
|
||||
}
|
||||
|
||||
.shortcut_item {
|
||||
padding: 2px 10px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.shortcut_item>span {
|
||||
color: #eee;
|
||||
font-weight: bold;
|
||||
font-size: 9pt;
|
||||
}
|
||||
|
||||
/* Policies styles */
|
||||
|
||||
table#policy_modules td * {
|
||||
|
|
|
@ -2909,43 +2909,6 @@ td.empty_field {
|
|||
width: 96%;
|
||||
}
|
||||
|
||||
/* Shortcut bar */
|
||||
|
||||
#shortcut_container {
|
||||
position: fixed;
|
||||
margin: 0px !important;
|
||||
bottom: 0px;
|
||||
left: 0px;
|
||||
z-index: 9001;
|
||||
}
|
||||
|
||||
#shortcut_bar {
|
||||
background-color: #333;
|
||||
border-top: 1px solid #808080;
|
||||
border-right: 1px solid #808080;
|
||||
border-top-right-radius: 5px;
|
||||
}
|
||||
|
||||
#shortcut_button {
|
||||
display: inline-block;
|
||||
background-color: #333;
|
||||
border: 1px solid #808080;
|
||||
border-bottom: none;
|
||||
border-top-left-radius: 15px;
|
||||
border-top-right-radius: 15px;
|
||||
}
|
||||
|
||||
.shortcut_item {
|
||||
padding: 2px 10px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.shortcut_item>span {
|
||||
color: #eee;
|
||||
font-weight: bold;
|
||||
font-size: 9pt;
|
||||
}
|
||||
|
||||
/* Policies styles */
|
||||
|
||||
table#policy_modules td * {
|
||||
|
|
|
@ -2912,43 +2912,6 @@ td.empty_field {
|
|||
width: 96%;
|
||||
}
|
||||
|
||||
/* Shortcut bar */
|
||||
|
||||
#shortcut_container {
|
||||
position: fixed;
|
||||
margin: 0px !important;
|
||||
bottom: 0px;
|
||||
left: 0px;
|
||||
z-index: 9001;
|
||||
}
|
||||
|
||||
#shortcut_bar {
|
||||
background-color: #333;
|
||||
border-top: 1px solid #808080;
|
||||
border-right: 1px solid #808080;
|
||||
border-top-right-radius: 5px;
|
||||
}
|
||||
|
||||
#shortcut_button {
|
||||
display: inline-block;
|
||||
background-color: #333;
|
||||
border: 1px solid #808080;
|
||||
border-bottom: none;
|
||||
border-top-left-radius: 15px;
|
||||
border-top-right-radius: 15px;
|
||||
}
|
||||
|
||||
.shortcut_item {
|
||||
padding: 2px 10px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.shortcut_item>span {
|
||||
color: #eee;
|
||||
font-weight: bold;
|
||||
font-size: 9pt;
|
||||
}
|
||||
|
||||
/* Policies styles */
|
||||
|
||||
table#policy_modules td * {
|
||||
|
|
|
@ -831,9 +831,6 @@ else {
|
|||
require("general/logon_ok.php");
|
||||
}
|
||||
}
|
||||
if ($config["pure"] == 0) {
|
||||
require("general/shortcut_bar.php");
|
||||
}
|
||||
}
|
||||
|
||||
if ($config["pure"] == 0) {
|
||||
|
|
|
@ -53,30 +53,6 @@ else {
|
|||
$view_mode = true;
|
||||
}
|
||||
|
||||
if (is_ajax ()) {
|
||||
|
||||
$shortcut_update = get_parameter("shortcut_update", 0);
|
||||
|
||||
// Update of user to show/don't show shortcut bar
|
||||
if ($shortcut_update) {
|
||||
|
||||
// First we get the actual state
|
||||
$shortcut_value = db_get_value_filter('shortcut', 'tusuario', array('id_user' => $id));
|
||||
|
||||
//Deactivate shorcut var
|
||||
if ($shortcut_value == 1) {
|
||||
db_process_sql_update('tusuario', array('shortcut' => 0), array('id_user' => $id));
|
||||
}
|
||||
// Activate shortcut var
|
||||
else {
|
||||
db_process_sql_update('tusuario', array('shortcut' => 1), array('id_user' => $id));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Header
|
||||
if ($meta) {
|
||||
user_meta_print_header();
|
||||
|
@ -110,7 +86,6 @@ if (isset ($_GET["modified"]) && !$view_mode) {
|
|||
}
|
||||
|
||||
$upd_info["flash_chart"] = get_parameter ("flash_charts", $config["flash_charts"]);
|
||||
$upd_info["shortcut"] = get_parameter ("shortcut_bar", 0);
|
||||
$upd_info["section"] = get_parameter ("section", $user_info["section"]);
|
||||
$upd_info["data_section"] = get_parameter ("data_section", '');
|
||||
$dashboard = get_parameter('dashboard', '');
|
||||
|
@ -296,10 +271,7 @@ $id_usr = $config['id_user'];
|
|||
|
||||
if (!$meta) {
|
||||
$data = array();
|
||||
$data[0] = '<span style="width:50%;float:left;">'.__('Shortcut bar') . ui_print_help_tip(__('This will activate a shortcut bar with alerts, events, messages... information'), true).'</span>';
|
||||
$data[0] .= $jump . '<span style="width:20%;float:left;line-height:20px;">'.html_print_checkbox('shortcut_bar', 1, $user_info["shortcut"], true).'</span>';
|
||||
|
||||
$data[1] = '<span style="width:40%;float:left;">'.__('Home screen'). ui_print_help_tip(__('User can customize the home page. By default, will display \'Agent Detail\'. Example: Select \'Other\' and type sec=estado&sec2=operation/agentes/estado_agente to show agent detail view'), true).'</span>';
|
||||
$data[0] = '<span style="width:40%;float:left;">'.__('Home screen'). ui_print_help_tip(__('User can customize the home page. By default, will display \'Agent Detail\'. Example: Select \'Other\' and type sec=estado&sec2=operation/agentes/estado_agente to show agent detail view'), true).'</span>';
|
||||
$values = array (
|
||||
'Default' =>__('Default'),
|
||||
'Visual console'=>__('Visual console'),
|
||||
|
@ -312,7 +284,7 @@ if (!$meta) {
|
|||
$values['Dashboard'] = __('Dashboard');
|
||||
}
|
||||
|
||||
$data[1] .= $jump . '<span style="width:20%;float:left;line-height:20px;">'.html_print_select($values, 'section', io_safe_output($user_info["section"]), 'show_data_section();', '', -1, true, false, false).'</span>';
|
||||
$data[0] .= $jump . '<span style="width:20%;float:left;line-height:20px;">'.html_print_select($values, 'section', io_safe_output($user_info["section"]), 'show_data_section();', '', -1, true, false, false).'</span>';
|
||||
|
||||
if (enterprise_installed()) {
|
||||
$dashboards = get_user_dashboards ($config['id_user']);
|
||||
|
@ -325,7 +297,7 @@ if (!$meta) {
|
|||
$dashboards_aux[$dashboard['name']] = $dashboard['name'];
|
||||
}
|
||||
}
|
||||
$data[1] .= html_print_select ($dashboards_aux, 'dashboard', $user_info["data_section"], '', '', '', true);
|
||||
$data[0] .= html_print_select ($dashboards_aux, 'dashboard', $user_info["data_section"], '', '', '', true);
|
||||
}
|
||||
|
||||
$layouts = visual_map_get_user_layouts ($config['id_user'], true);
|
||||
|
@ -338,17 +310,17 @@ if (!$meta) {
|
|||
$layouts_aux[$layout] = $layout;
|
||||
}
|
||||
}
|
||||
$data[1] .= html_print_select ($layouts_aux, 'visual_console', $user_info["data_section"], '', '', '', true);
|
||||
$data[1] .= html_print_input_text ('data_section', $user_info["data_section"], '', 60, 255, true, false);
|
||||
$data[0] .= html_print_select ($layouts_aux, 'visual_console', $user_info["data_section"], '', '', '', true);
|
||||
$data[0] .= html_print_input_text ('data_section', $user_info["data_section"], '', 60, 255, true, false);
|
||||
|
||||
|
||||
|
||||
// User only can change skins if has more than one group
|
||||
$data[2] = '';
|
||||
$data[1] = '';
|
||||
if (function_exists('skins_print_select')) {
|
||||
if (count($usr_groups) > 1) {
|
||||
$data[2] = '<span style="width:30%;float:left;">'.__('Skin').'</span>';
|
||||
$data[2] .= $jump . skins_print_select($id_usr,'skin', $user_info['id_skin'], '', __('None'), 0, true);
|
||||
$data[1] = '<span style="width:30%;float:left;">'.__('Skin').'</span>';
|
||||
$data[1] .= $jump . skins_print_select($id_usr,'skin', $user_info['id_skin'], '', __('None'), 0, true);
|
||||
}
|
||||
}
|
||||
$table->rowclass[] = '';
|
||||
|
@ -506,6 +478,7 @@ unset($table);
|
|||
if (!defined('METACONSOLE'))
|
||||
echo '<h4>'.__('Profiles/Groups assigned to this user').'</h4>';
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox data';
|
||||
if (defined('METACONSOLE')) {
|
||||
|
|
Loading…
Reference in New Issue