diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 446dda50eb..a67381fd56 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,12 @@ +2011-02-21 Miguel de Dios + + * godmode/reporting/visual_console_builder.elements.php: fixed the show + icons for "label" and "icon", show tooltip on the type icons, hidde some + fields as type of row. And now the image field show to icon type item and + of course update too. + + Fixes: #3188080 + 2011-02-21 Miguel de Dios * godmode/reporting/visual_console_builder.editor.js: fixed the update the diff --git a/pandora_console/godmode/reporting/visual_console_builder.elements.php b/pandora_console/godmode/reporting/visual_console_builder.elements.php index 5fe45cef54..11c5b5b096 100644 --- a/pandora_console/godmode/reporting/visual_console_builder.elements.php +++ b/pandora_console/godmode/reporting/visual_console_builder.elements.php @@ -104,58 +104,105 @@ foreach ($layoutDatas as $layoutData) { switch ($layoutData['type']) { case STATIC_GRAPH: - $table->data[$i + 1]['icon'] = print_image('images/camera.png', true); + $table->data[$i + 1]['icon'] = print_image('images/camera.png', true, array('title' => __('Static Graph'))); break; case PERCENTILE_BAR: - $table->data[$i + 1]['icon'] = print_image('images/chart_bar.png', true); + $table->data[$i + 1]['icon'] = print_image('images/chart_bar.png', true, array('title' => __('Percentile Bar'))); break; case MODULE_GRAPH: - $table->data[$i + 1]['icon'] = print_image('images/chart_curve.png', true); + $table->data[$i + 1]['icon'] = print_image('images/chart_curve.png', true, array('title' => __('Module Graph'))); break; case SIMPLE_VALUE: - $table->data[$i + 1]['icon'] = print_image('images/binary.png', true); + $table->data[$i + 1]['icon'] = print_image('images/binary.png', true, array('title' => ___('Simple Value'))); + break; + case LABEL: + $table->data[$i + 1]['icon'] = print_image('images/tag_red.png', true, array('title' => ___('Label'))); + break; + case ICON: + $table->data[$i + 1]['icon'] = print_image('images/photo.png', true, array('title' => __('Icon'))); break; default: $table->data[$i + 1]['icon'] = ''; break; } - $table->data[$i + 1][0] = '' . - print_input_text ('label_' . $idLayoutData, $layoutData['label'], '', 10, 200, true) . - print_input_text_extended ('label_color_' . $idLayoutData, $layoutData['label_color'], 'text-'.'label_color_' . $idLayoutData, '', 7, 7, false, '', 'style="visibility: hidden; width: 0px;" class="label_color"', true) . - ''; - if ($layoutData['type'] == STATIC_GRAPH) { + //First row + + //Label and color label + if ($layoutData['type'] != ICON) { + $table->data[$i + 1][0] = '' . + print_input_text ('label_' . $idLayoutData, $layoutData['label'], '', 10, 200, true) . + print_input_text_extended ('label_color_' . $idLayoutData, $layoutData['label_color'], 'text-'.'label_color_' . $idLayoutData, '', 7, 7, false, '', 'style="visibility: hidden; width: 0px;" class="label_color"', true) . + ''; + } + else { + //Icon haven't the label. + $table->data[$i + 1][0] = ''; + } + + //Image + if (($layoutData['type'] == STATIC_GRAPH) || ($layoutData['type'] == ICON)) { $table->data[$i + 1][1] = print_select ($images_list, 'image_' . $idLayoutData, $layoutData['image'], '', 'None', '', true); } else { $table->data[$i + 1][1] = ''; } + + //Width and height $table->data[$i + 1][2] = print_input_text('width_' . $idLayoutData, $layoutData['width'], '', 3, 5, true) . 'x' . print_input_text('height_' . $idLayoutData, $layoutData['height'], '', 3, 5, true); + + //Position $table->data[$i + 1][3] = '(' . print_input_text('left_' . $idLayoutData, $layoutData['pos_x'], '', 3, 5, true) . ',' . print_input_text('top_' . $idLayoutData, $layoutData['pos_y'], '', 3, 5, true) . ')'; + + //Parent $table->data[$i + 1][4] = print_select_from_sql ('SELECT id, label FROM tlayout_data WHERE id_layout = '. $idVisualConsole . ' AND id !=' . $idLayoutData, 'parent_' . $idLayoutData, $layoutData['parent_item'], '', 'None', 0, true); + + //Delete row button $table->data[$i + 1][5] = '' . print_image('images/cross.png', true) . ''; + //Second row + $table->data[$i + 2]['icon'] = ''; - $table->data[$i + 2][0] = ' ' . __("Type at least two characters to search.") . '' . - print_input_text_extended ('agent_' . $idLayoutData, get_agent_name($layoutData['id_agent']), 'text-agent_' . $idLayoutData, '', 15, 100, false, '', - array('class' => 'text-agent', 'style' => 'background: #ffffff url(images/lightning.png) no-repeat right;'), true); - $sql = 'SELECT id_agente_modulo, nombre FROM tagente_modulo WHERE disabled = 0 AND id_agente = ' . $layoutData['id_agent']; - $table->data[$i + 2][1] = print_select_from_sql($sql, - 'module_' . $idLayoutData, $layoutData['id_agente_modulo'], '', '---', 0, true); - $table->data[$i + 2][2] = ''; + + //Agent + if (($layoutData['type'] != ICON) && ($layoutData['type'] != LABEL)) { + $table->data[$i + 2][0] = ' ' . __("Type at least two characters to search.") . '' . + print_input_text_extended ('agent_' . $idLayoutData, get_agent_name($layoutData['id_agent']), 'text-agent_' . $idLayoutData, '', 15, 100, false, '', + array('class' => 'text-agent', 'style' => 'background: #ffffff url(images/lightning.png) no-repeat right;'), true); + } + else { + $table->data[$i + 2][0] = ''; + } + + //Modules + if (($layoutData['type'] != ICON) && ($layoutData['type'] != LABEL)) { + $sql = 'SELECT id_agente_modulo, nombre FROM tagente_modulo WHERE disabled = 0 AND id_agente = ' . $layoutData['id_agent']; + $table->data[$i + 2][1] = print_select_from_sql($sql, + 'module_' . $idLayoutData, $layoutData['id_agente_modulo'], '', '---', 0, true); + } + else { + $table->data[$i + 2][1] = ''; + } + + //Empty + $table->data[$i + 2][2] = ''; + + //Period if ($layoutData['type'] == MODULE_GRAPH) { $table->data[$i + 2][3] = print_select ($intervals, 'period_' . $idLayoutData, $layoutData['period'], '', '--', 0, true); } else { $table->data[$i + 2][3] = ''; } + + //Map linked $table->data[$i + 2][4] = print_select_from_sql ('SELECT id, name FROM tlayout WHERE id != ' . $idVisualConsole, 'map_linked_' . $idLayoutData, $layoutData['id_layout_linked'], '', 'None', '', true); $table->data[$i + 2][5] = '';