mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
2013-06-18 Miguel de Dios <miguel.dedios@artica.es>
* operation/snmpconsole/snmp_view.php: fixed the urls and forms to set the filters. MERGED FROM THE BRANCH PANDORA_4.0 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8342 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
c4fa3c8efd
commit
effabbe24a
@ -1,3 +1,10 @@
|
|||||||
|
2013-06-18 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* operation/snmpconsole/snmp_view.php: fixed the urls and forms to
|
||||||
|
set the filters.
|
||||||
|
|
||||||
|
MERGED FROM THE BRANCH PANDORA_4.0
|
||||||
|
|
||||||
2013-06-17 Miguel de Dios <miguel.dedios@artica.es>
|
2013-06-17 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
* operation/agentes/networkmap.php: fixed to create networkmaps
|
* operation/agentes/networkmap.php: fixed to create networkmaps
|
||||||
|
@ -262,27 +262,29 @@ if ($search_string != '') {
|
|||||||
if ($free_search_string != '') {
|
if ($free_search_string != '') {
|
||||||
switch ($config["dbtype"]) {
|
switch ($config["dbtype"]) {
|
||||||
case "mysql":
|
case "mysql":
|
||||||
$whereSubquery .= ' AND (source LIKE "%' . $free_search_string . '%" OR
|
$whereSubquery .= '
|
||||||
oid LIKE "%' . $free_search_string . '%" OR
|
AND (source LIKE "%' . $free_search_string . '%" OR
|
||||||
oid_custom LIKE "%' . $free_search_string . '%" OR
|
oid LIKE "%' . $free_search_string . '%" OR
|
||||||
type_custom LIKE "%' . $free_search_string . '%" OR
|
oid_custom LIKE "%' . $free_search_string . '%" OR
|
||||||
value LIKE "%' . $free_search_string . '%" OR
|
type_custom LIKE "%' . $free_search_string . '%" OR
|
||||||
value_custom LIKE "%' . $free_search_string . '%" OR
|
value LIKE "%' . $free_search_string . '%" OR
|
||||||
id_usuario LIKE "%' . $free_search_string . '%" OR
|
value_custom LIKE "%' . $free_search_string . '%" OR
|
||||||
text LIKE "%' . $free_search_string . '%" OR
|
id_usuario LIKE "%' . $free_search_string . '%" OR
|
||||||
description LIKE "%' . $free_search_string . '%")';
|
text LIKE "%' . $free_search_string . '%" OR
|
||||||
|
description LIKE "%' . $free_search_string . '%")';
|
||||||
break;
|
break;
|
||||||
case "postgresql":
|
case "postgresql":
|
||||||
case "oracle":
|
case "oracle":
|
||||||
$whereSubquery .= ' AND (source LIKE \'%' . $free_search_string . '%\' OR
|
$whereSubquery .= '
|
||||||
oid LIKE \'%' . $free_search_string . '%\' OR
|
AND (source LIKE \'%' . $free_search_string . '%\' OR
|
||||||
oid_custom LIKE \'%' . $free_search_string . '%\' OR
|
oid LIKE \'%' . $free_search_string . '%\' OR
|
||||||
type_custom LIKE \'%' . $free_search_string . '%\' OR
|
oid_custom LIKE \'%' . $free_search_string . '%\' OR
|
||||||
value LIKE \'%' . $free_search_string . '%\' OR
|
type_custom LIKE \'%' . $free_search_string . '%\' OR
|
||||||
value_custom LIKE \'%' . $free_search_string . '%\' OR
|
value LIKE \'%' . $free_search_string . '%\' OR
|
||||||
id_usuario LIKE \'%' . $free_search_string . '%\' OR
|
value_custom LIKE \'%' . $free_search_string . '%\' OR
|
||||||
text LIKE \'%' . $free_search_string . '%\' OR
|
id_usuario LIKE \'%' . $free_search_string . '%\' OR
|
||||||
description LIKE \'%' . $free_search_string . '%\')';
|
text LIKE \'%' . $free_search_string . '%\' OR
|
||||||
|
description LIKE \'%' . $free_search_string . '%\')';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -393,8 +395,8 @@ $trapcount = db_get_sql ("
|
|||||||
FROM ttrap " .
|
FROM ttrap " .
|
||||||
$whereSubquery);
|
$whereSubquery);
|
||||||
|
|
||||||
$urlPagination = "index.php?" .
|
$url_snmp = "index.php?" .
|
||||||
"sec=estado&" .
|
"sec=snmpconsole&" .
|
||||||
"sec2=operation/snmpconsole/snmp_view&" .
|
"sec2=operation/snmpconsole/snmp_view&" .
|
||||||
"filter_agent=" . $filter_agent . "&" .
|
"filter_agent=" . $filter_agent . "&" .
|
||||||
"filter_oid=" . $filter_oid . "&" .
|
"filter_oid=" . $filter_oid . "&" .
|
||||||
@ -402,14 +404,15 @@ $urlPagination = "index.php?" .
|
|||||||
"filter_fired=" . $filter_fired . "&" .
|
"filter_fired=" . $filter_fired . "&" .
|
||||||
"filter_status=" . $filter_status . "&" .
|
"filter_status=" . $filter_status . "&" .
|
||||||
"search_string=" . $search_string . "&" .
|
"search_string=" . $search_string . "&" .
|
||||||
"pagination=" . $pagination . "&" .
|
|
||||||
"offset=" . $offset . "&" .
|
|
||||||
"refr=" . ((int)get_parameter('refr', 0)) . "&" .
|
"refr=" . ((int)get_parameter('refr', 0)) . "&" .
|
||||||
"pure=" . $config["pure"] . "&" .
|
"pure=" . $config["pure"] . "&" .
|
||||||
"search_string=" . $search_string;
|
"search_string=" . $search_string;
|
||||||
|
|
||||||
|
$urlPagination = $url_snmp . "&pagination=" . $pagination . "&offset=" . $offset;
|
||||||
|
|
||||||
ui_pagination ($trapcount, $urlPagination, $offset, $pagination);
|
ui_pagination ($trapcount, $urlPagination, $offset, $pagination);
|
||||||
|
|
||||||
echo '<form name="eventtable" method="POST" action="index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_view&pagination='.$pagination.'&offset='.$offset.'">';
|
echo '<form name="eventtable" method="POST" action="' . $url_snmp . '">';
|
||||||
|
|
||||||
$table->cellpadding = 4;
|
$table->cellpadding = 4;
|
||||||
$table->cellspacing = 4;
|
$table->cellspacing = 4;
|
||||||
@ -554,10 +557,10 @@ if ($traps !== false) {
|
|||||||
$data[8] = "";
|
$data[8] = "";
|
||||||
|
|
||||||
if (empty ($trap["status"]) && check_acl ($config["id_user"], 0, "IW")) {
|
if (empty ($trap["status"]) && check_acl ($config["id_user"], 0, "IW")) {
|
||||||
$data[8] .= '<a href="index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_view&check='.$trap["id_trap"].'">' . html_print_image("images/ok.png", true, array("border" => '0', "title" => __('Validate'))) . '</a> ';
|
$data[8] .= '<a href="' . $url_snmp . '&check='.$trap["id_trap"].'">' . html_print_image("images/ok.png", true, array("border" => '0', "title" => __('Validate'))) . '</a> ';
|
||||||
}
|
}
|
||||||
if (check_acl ($config["id_user"], 0, "IM")) {
|
if (check_acl ($config["id_user"], 0, "IM")) {
|
||||||
$data[8] .= '<a href="index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_view&delete='.$trap["id_trap"].'&offset='.$offset.'" onClick="javascript:return confirm(\''.__('Are you sure?').'\')">' . html_print_image("images/cross.png", true, array("border" => "0", "title" => __('Delete'))) . '</a> ';
|
$data[8] .= '<a href="' . $url_snmp . '&delete='.$trap["id_trap"].'&offset='.$offset.'" onClick="javascript:return confirm(\''.__('Are you sure?').'\')">' . html_print_image("images/cross.png", true, array("border" => "0", "title" => __('Delete'))) . '</a> ';
|
||||||
}
|
}
|
||||||
$data[8] .= '<a href="javascript: toggleVisibleExtendedInfo(' . $trap["id_trap"] . ');">' . html_print_image("images/eye.png", true, array("alt" => __('Show more'), "title" => __('Show more'))) .'</a>';
|
$data[8] .= '<a href="javascript: toggleVisibleExtendedInfo(' . $trap["id_trap"] . ');">' . html_print_image("images/eye.png", true, array("alt" => __('Show more'), "title" => __('Show more'))) .'</a>';
|
||||||
|
|
||||||
@ -567,11 +570,20 @@ if ($traps !== false) {
|
|||||||
|
|
||||||
//Hiden file for description
|
//Hiden file for description
|
||||||
$string = '<table style="border:solid 1px #D3D3D3;" width="90%" class="toggle">
|
$string = '<table style="border:solid 1px #D3D3D3;" width="90%" class="toggle">
|
||||||
<tr><td align="left" valign="top" width="15%" ><b>' . __('Custom data:') . '</b></td><td align="left" >' . $trap['oid_custom'] . '</td></tr>'
|
<tr>
|
||||||
. '<tr><td align="left" valign="top">' . '<b>' . __('OID:') . '</td><td align="left"> ' . $trap['oid'] . '</td></tr>';
|
<td align="left" valign="top" width="15%" ><b>' . __('Custom data:') . '</b></td>
|
||||||
|
<td align="left" >' . $trap['oid_custom'] . '</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="left" valign="top">' . '<b>' . __('OID:') . '</td>
|
||||||
|
<td align="left"> ' . $trap['oid'] . '</td>
|
||||||
|
</tr>';
|
||||||
|
|
||||||
if ($trap["description"] != "") {
|
if ($trap["description"] != "") {
|
||||||
$string .= '<tr><td align="left" valign="top">' . '<b>' . __('Description:') . '</td><td align="left">' . $trap['description'] . '</td></tr>';
|
$string .= '<tr>
|
||||||
|
<td align="left" valign="top">' . '<b>' . __('Description:') . '</td>
|
||||||
|
<td align="left">' . $trap['description'] . '</td>
|
||||||
|
</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($trap["type"] != "") {
|
if ($trap["type"] != "") {
|
||||||
@ -618,7 +630,7 @@ if ($traps !== false) {
|
|||||||
|
|
||||||
// No matching traps
|
// No matching traps
|
||||||
if ($idx == 0) {
|
if ($idx == 0) {
|
||||||
echo '<div class="nf">'.__('No matching traps found').'</div>';
|
echo '<div class="nf">' . __('No matching traps found') . '</div>';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
html_print_table ($table);
|
html_print_table ($table);
|
||||||
@ -667,33 +679,33 @@ echo '<div style="clear:both;"> </div>';
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<script language="JavaScript" type="text/javascript">
|
<script language="JavaScript" type="text/javascript">
|
||||||
<!--
|
<!--
|
||||||
function CheckAll() {
|
function CheckAll() {
|
||||||
for (var i = 0; i < document.eventtable.elements.length; i++) {
|
for (var i = 0; i < document.eventtable.elements.length; i++) {
|
||||||
var e = document.eventtable.elements[i];
|
var e = document.eventtable.elements[i];
|
||||||
if (e.type == 'checkbox' && e.name != 'allbox')
|
if (e.type == 'checkbox' && e.name != 'allbox')
|
||||||
e.checked = !e.checked;
|
e.checked = !e.checked;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function toggleDiv (divid) {
|
|
||||||
if (document.getElementById(divid).style.display == 'none') {
|
|
||||||
document.getElementById(divid).style.display = 'block';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
document.getElementById(divid).style.display = 'none';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleVisibleExtendedInfo(id_trap) {
|
|
||||||
display = $('.trap_info_' + id_trap).css('display');
|
|
||||||
|
|
||||||
if (display != 'none') {
|
function toggleDiv (divid) {
|
||||||
$('.trap_info_' + id_trap).css('display', 'none');
|
if (document.getElementById(divid).style.display == 'none') {
|
||||||
|
document.getElementById(divid).style.display = 'block';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
document.getElementById(divid).style.display = 'none';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
$('.trap_info_' + id_trap).css('display', '');
|
function toggleVisibleExtendedInfo(id_trap) {
|
||||||
|
display = $('.trap_info_' + id_trap).css('display');
|
||||||
|
|
||||||
|
if (display != 'none') {
|
||||||
|
$('.trap_info_' + id_trap).css('display', 'none');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$('.trap_info_' + id_trap).css('display', '');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
//-->
|
||||||
//-->
|
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user