mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 01:05:39 +02:00
2013-06-17 Miguel de Dios <miguel.dedios@artica.es>
* godmode/alerts/configure_alert_action.php, godmode/alerts/alert_commands.php: fixed the duplicated the rows and did'nt hide the macros field rows. Fixes: #2294 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8337 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
cd25df8283
commit
002cf78783
@ -1,3 +1,11 @@
|
||||
2013-06-17 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* godmode/alerts/configure_alert_action.php,
|
||||
godmode/alerts/alert_commands.php: fixed the duplicated the rows
|
||||
and did'nt hide the macros field rows.
|
||||
|
||||
Fixes: #2294
|
||||
|
||||
2013-06-17 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/functions.php: fixed in the function "get_snmpwalk" the
|
||||
|
@ -104,7 +104,7 @@ if (is_ajax ()) {
|
||||
}
|
||||
else {
|
||||
$fields_rows[$i] =
|
||||
'<tr id="table1-field' . $i . '" class="datos">
|
||||
'<tr id="table_macros-field' . $i . '" class="datos">
|
||||
<td style="font-weight:bold;width:20%" class="datos">
|
||||
' . $fdesc . '
|
||||
</td>
|
||||
|
@ -173,12 +173,16 @@ $(document).ready (function () {
|
||||
|
||||
$("#id_command").change (function () {
|
||||
values = Array ();
|
||||
values.push ({name: "page",
|
||||
values.push({
|
||||
name: "page",
|
||||
value: "godmode/alerts/alert_commands"});
|
||||
values.push ({name: "get_alert_command",
|
||||
values.push({
|
||||
name: "get_alert_command",
|
||||
value: "1"});
|
||||
values.push ({name: "id",
|
||||
values.push({
|
||||
name: "id",
|
||||
value: this.value});
|
||||
|
||||
jQuery.get (<?php echo "'" . ui_get_full_url("ajax.php", false, false, false) . "'"; ?>,
|
||||
values,
|
||||
function (data, status) {
|
||||
@ -186,26 +190,38 @@ $(document).ready (function () {
|
||||
render_command_preview (original_command);
|
||||
command_description = js_html_entity_decode (data["description"]);
|
||||
render_command_description(command_description);
|
||||
|
||||
|
||||
for (i = 1; i <= 10; i++) {
|
||||
var old_value = '';
|
||||
var field_row = data["fields_rows"][i];
|
||||
|
||||
// Only keep the value if is provided from hidden (first time)
|
||||
if ($("[name=field"+i+"_value]").attr('id') == "hidden-field" + i + "_value") {
|
||||
if (($("[name=field" + i + "_value]").attr('id'))
|
||||
== ("hidden-field" + i + "_value")) {
|
||||
old_value = $("[name=field" + i + "_value]").val();
|
||||
}
|
||||
|
||||
// If the row is empty, hide de row
|
||||
if(data["fields_rows"][i] == '') {
|
||||
if (field_row == '') {
|
||||
$('#table_macros-field' + i).hide();
|
||||
}
|
||||
else {
|
||||
$('#table_macros-field'+i).replaceWith(data["fields_rows"][i]);
|
||||
$('#table_macros-field' + i).replaceWith(field_row);
|
||||
$("[name=field" + i + "_value]").val(old_value);
|
||||
|
||||
|
||||
// Add help hint only in first field
|
||||
if (i == 1) {
|
||||
var td_content = $('#table_macros-field'+i).find('td').eq(0);
|
||||
td_content.html(td_content.html() + $('#help_alert_macros_hint').html());
|
||||
var td_content = $('#table_macros-field' + i)
|
||||
.find('td').eq(0);
|
||||
|
||||
$(td_content)
|
||||
.html(
|
||||
$(td_content).html() + $('#help_alert_macros_hint').html());
|
||||
}
|
||||
$('#table_macros-field').show();
|
||||
|
||||
$('#table_macros-field' + i).show();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user