From 22cff3c2b88e7de98a2f8bf33f2ab3d605d4481a Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Fri, 21 Nov 2014 10:42:14 +0100 Subject: [PATCH 01/16] Working in the new elements for the visualmap. Ticket #1478 --- .../pandoradb_migrate_5.1_to_6.0.mysql.sql | 6 +- .../pandoradb_migrate_5.1_to_6.0.oracle.sql | 5 +- ...andoradb_migrate_5.1_to_6.0.postgreSQL.sql | 5 +- .../visual_console_builder.editor.js | 94 ++++++++++++-- .../ajax/visual_console_builder.ajax.php | 16 +++ pandora_console/include/constants.php | 117 +++++++++--------- .../include/functions_visual_map.php | 35 ++++-- .../include/functions_visual_map_editor.php | 66 +++++++++- pandora_console/include/styles/pandora.css | 6 + 9 files changed, 266 insertions(+), 84 deletions(-) diff --git a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql index 61ec1bc8ff..b5a8ca7aa3 100755 --- a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.mysql.sql @@ -10,7 +10,7 @@ ALTER TABLE tlayout DROP COLUMN fullscreen; ALTER TABLE tlayout_data DROP COLUMN no_link_color; ALTER TABLE tlayout_data DROP COLUMN label_color; - - - +ALTER TABLE tlayout_data ADD COLUMN `border_width` INTEGER UNSIGNED NOT NULL default 0; +ALTER TABLE tlayout_data ADD COLUMN `border_color` varchar(200) DEFAULT ""; +ALTER TABLE tlayout_data ADD COLUMN `fill_color` varchar(200) DEFAULT ""; diff --git a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.oracle.sql b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.oracle.sql index 615dfb4db2..182394c445 100755 --- a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.oracle.sql +++ b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.oracle.sql @@ -9,4 +9,7 @@ ALTER TABLE tlayout DROP COLUMN fullscreen; -- --------------------------------------------------------------------- ALTER TABLE tlayout_data DROP COLUMN no_link_color; -ALTER TABLE tlayout_data DROP COLUMN label_color; \ No newline at end of file +ALTER TABLE tlayout_data DROP COLUMN label_color; +ALTER TABLE tlayout_data ADD COLUMN border_width INTEGER NOT NULL default 0; +ALTER TABLE tlayout_data ADD COLUMN border_color varchar(200) DEFAULT ""; +ALTER TABLE tlayout_data ADD COLUMN fill_color varchar(200) DEFAULT ""; \ No newline at end of file diff --git a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.postgreSQL.sql b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.postgreSQL.sql index 46d9a47fdd..81ae7e6c05 100755 --- a/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.postgreSQL.sql +++ b/pandora_console/extras/pandoradb_migrate_5.1_to_6.0.postgreSQL.sql @@ -9,4 +9,7 @@ ALTER TABLE "tlayout" DROP COLUMN "fullscreen"; -- --------------------------------------------------------------------- ALTER TABLE "tlayout_data" DROP COLUMN "no_link_color"; -ALTER TABLE "tlayout_data" DROP COLUMN "label_color"; \ No newline at end of file +ALTER TABLE "tlayout_data" DROP COLUMN "label_color"; +ALTER TABLE "tlayout_data" ADD COLUMN "border_width" INTEGER NOT NULL default 0; +ALTER TABLE "tlayout_data" ADD COLUMN "border_color" varchar(200) DEFAULT ""; +ALTER TABLE "tlayout_data" ADD COLUMN "fill_color" varchar(200) DEFAULT ""; \ No newline at end of file diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index 47f37587d8..6bccd80797 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -129,6 +129,8 @@ function update_button_palette_callback() { idElement = 0; break; + case 'box_item': + break; case 'group_item': case 'static_graph': $("#text_" + idItem).html(values['label']); @@ -245,6 +247,14 @@ function readFields() { values['id_group'] = $("select[name=group]").val(); values['id_custom_graph'] = parseInt( $("#custom_graph option:selected").val()); + values['width_box'] = parseInt( + $("input[name='width_box']").val()); + values['height_box'] = parseInt( + $("input[name='height_box']").val()); + values['border_color'] = $("input[name='border_color']").val(); + values['border_width'] = parseInt( + $("input[name='border_width']").val()); + values['fill_color'] = $("input[name='fill_color']").val(); if (metaconsole != 0) { values['metaconsole'] = 1; @@ -271,6 +281,8 @@ function create_button_palette_callback() { //VALIDATE DATA var validate = true; switch (creationItem) { + case 'box_item': + break; case 'group_item': case 'static_graph': if ((values['label'] == '') && (values['image'] == '')) { @@ -362,6 +374,7 @@ function toggle_item_palette() { activeToolboxButton('icon', true); activeToolboxButton('percentile_item', true); activeToolboxButton('group_item', true); + activeToolboxButton('box_item', true); if (typeof(enterprise_activeToolboxButton) == 'function') { enterprise_activeToolboxButton(true); @@ -386,6 +399,7 @@ function toggle_item_palette() { activeToolboxButton('icon', false); activeToolboxButton('percentile_item', false); activeToolboxButton('group_item', false); + activeToolboxButton('box_item', false); activeToolboxButton('copy_item', false); activeToolboxButton('edit_item', false); @@ -553,14 +567,22 @@ function loadFieldsFromDB(item) { $('#' + periodId + '_manual').show(); } } - if (key == 'width') $("input[name=width]").val(val); - if (key == 'height') $("input[name=height]").val(val); - if (key == 'parent_item') $("select[name=parent]").val(val); - if (key == 'id_layout_linked') $("select[name=map_linked]").val(val); - if (key == 'width_percentile') $("input[name=width_percentile]").val(val); - if (key == 'max_percentile') $("input[name=max_percentile]").val(val); - if (key == 'width_module_graph') $("input[name=width_module_graph]").val(val); - if (key == 'height_module_graph') $("input[name=height_module_graph]").val(val); + if (key == 'width') + $("input[name=width]").val(val); + if (key == 'height') + $("input[name=height]").val(val); + if (key == 'parent_item') + $("select[name=parent]").val(val); + if (key == 'id_layout_linked') + $("select[name=map_linked]").val(val); + if (key == 'width_percentile') + $("input[name=width_percentile]").val(val); + if (key == 'max_percentile') + $("input[name=max_percentile]").val(val); + if (key == 'width_module_graph') + $("input[name=width_module_graph]").val(val); + if (key == 'height_module_graph') + $("input[name=height_module_graph]").val(val); if (key == 'type_percentile') { if (val == 'percentile') { @@ -597,8 +619,19 @@ function loadFieldsFromDB(item) { $("#id_server_name").val(val); } } + + if (key == 'width_box') + $("input[name='width_box']").val(val); + if (key == 'height_box') + $("input[name='height_box']").val(val); + if (key == 'border_color') + $("input[name='border_color']").val(val); + if (key == 'border_width') + $("input[name='border_width']").val(val); + if (key == 'fill_color') + $("input[name='fill_color']").val(val); }); - + if (data.type == 1) { if (data.id_custom_graph > 0) { $("input[name='radio_choice'][value='custom_graph']") @@ -757,6 +790,18 @@ function hiddenFields(item) { $("#custom_graph_row").css('display', 'none'); $("#custom_graph_row." + item).css('display', ''); + $("#box_size_row").css('display', 'none'); + $("#box_size_row." + item).css('display', ''); + + $("#border_color_row").css('display', 'none'); + $("#border_color_row." + item).css('display', ''); + + $("#border_width_row").css('display', 'none'); + $("#border_width_row." + item).css('display', ''); + + $("#fill_color_row").css('display', 'none'); + $("#fill_color_row." + item).css('display', ''); + $("input[name='radio_choice']").trigger('change'); if (typeof(enterprise_hiddenFields) == 'function') { @@ -791,6 +836,13 @@ function cleanFields(item) { $("select[name=map_linked]").val(''); $("input[name=width_module_graph]").val(300); $("input[name=height_module_graph]").val(180); + $("input[name='width_box']").val(300); + $("input[name='height_box']").val(180); + $("input[name='border_color']").val('#000000'); + $("input[name='border_width']").val(3); + $("input[name='fill_color']").val('#ffffff'); + + $("#preview").empty(); @@ -1138,6 +1190,8 @@ function createItem(type, values, id_data) { } switch (type) { + case 'box_item': + break; case 'group_item': case 'static_graph': if ((values['width'] == 0) && (values['height'] == 0)) { @@ -1694,10 +1748,12 @@ function activeToolboxButton(id, active) { } if (active) { - $("input." + id + "[name=button_toolbox2]").removeAttr('disabled'); + $("input." + id + "[name=button_toolbox2]") + .removeAttr('disabled'); } else { - $("input." + id + "[name=button_toolbox2]").attr('disabled', true); + $("input." + id + "[name=button_toolbox2]") + .attr('disabled', true); } } @@ -1734,6 +1790,15 @@ function eventsItems(drag) { unselectAll(); $(divParent).css('border', '2px blue dotted'); + if ($(divParent).hasClass('box_item')) { + creationItem = null; + selectedItem = 'box_item'; + idItem = $(divParent).attr('id'); + activeToolboxButton('copy_item', true); + activeToolboxButton('edit_item', true); + activeToolboxButton('delete_item', true); + activeToolboxButton('show_grid', false); + } if ($(divParent).hasClass('static_graph')) { creationItem = null; selectedItem = 'static_graph'; @@ -1824,6 +1889,9 @@ function eventsItems(drag) { $(event.target).css('border', '2px blue dotted'); selectedItem = null; + if ($(event.target).hasClass('box_item')) { + selectedItem = 'box_item'; + } if ($(event.target).hasClass('static_graph')) { selectedItem = 'static_graph'; } @@ -1996,6 +2064,10 @@ function click_button_toolbox(id) { toolbuttonActive = creationItem = 'group_item'; toggle_item_palette(); break; + case 'box_item': + toolbuttonActive = creationItem = 'box_item'; + toggle_item_palette(); + break; diff --git a/pandora_console/include/ajax/visual_console_builder.ajax.php b/pandora_console/include/ajax/visual_console_builder.ajax.php index 651fb8b93d..50e8adfddd 100755 --- a/pandora_console/include/ajax/visual_console_builder.ajax.php +++ b/pandora_console/include/ajax/visual_console_builder.ajax.php @@ -71,6 +71,13 @@ $id_agent = get_parameter('id_agent', null); $id_metaconsole = get_parameter('id_metaconsole', null); $id_group = (int)get_parameter('id_group', 0); $id_custom_graph = get_parameter('id_custom_graph', null); +$height_module_graph = get_parameter('id_custom_graph', null); +$width_module_graph = get_parameter('id_custom_graph', null); +$border_width = get_parameter('border_width', 0); +$border_color = get_parameter('border_color', ''); +$fill_color = get_parameter('fill_color', ''); +$width_box = get_parameter('width_box', 0); +$height_box = get_parameter('height_box', 0); $get_element_status = get_parameter('get_element_status', 0); $get_image_path_status = get_parameter('get_image_path_status', 0); @@ -612,6 +619,15 @@ switch ($action) { $values['id_custom_graph'] = $id_custom_graph; switch ($type) { + case 'box_item': + $values['type'] = BOX_ITEM; + $values['border_width'] = $border_width; + $values['border_color'] = $border_color; + $values['fill_color'] = $fill_color; + $values['period'] = $period; + $values['width'] = $width_box; + $values['height'] = $height_box; + break; case 'module_graph': $values['type'] = MODULE_GRAPH; $values['height'] = $height_module_graph; diff --git a/pandora_console/include/constants.php b/pandora_console/include/constants.php index a59d22d874..16772c968e 100644 --- a/pandora_console/include/constants.php +++ b/pandora_console/include/constants.php @@ -61,38 +61,38 @@ define ('ERR_ACL', -110000); define ('ERR_AUTH', -120000); /* Event status code */ -define ('EVENT_STATUS_NEW',0); -define ('EVENT_STATUS_INPROCESS',2); -define ('EVENT_STATUS_VALIDATED',1); +define ('EVENT_STATUS_NEW', 0); +define ('EVENT_STATUS_INPROCESS', 2); +define ('EVENT_STATUS_VALIDATED', 1); /* Seconds in a time unit constants */ -define('SECONDS_1MINUTE', 60); -define('SECONDS_2MINUTES', 120); -define('SECONDS_5MINUTES', 300); -define('SECONDS_10MINUTES', 600); -define('SECONDS_15MINUTES', 900); -define('SECONDS_30MINUTES', 1800); -define('SECONDS_1HOUR', 3600); -define('SECONDS_2HOUR', 7200); -define('SECONDS_3HOUR', 10800); -define('SECONDS_5HOUR', 18000); -define('SECONDS_6HOURS', 21600); -define('SECONDS_12HOURS', 43200); -define('SECONDS_1DAY', 86400); -define('SECONDS_2DAY', 172800); -define('SECONDS_4DAY', 345600); -define('SECONDS_5DAY', 432000); -define('SECONDS_1WEEK', 604800); -define('SECONDS_10DAY', 864000); -define('SECONDS_2WEEK', 1209600); -define('SECONDS_15DAYS', 1296000); -define('SECONDS_1MONTH', 2592000); -define('SECONDS_2MONTHS', 5184000); -define('SECONDS_3MONTHS', 7776000); -define('SECONDS_6MONTHS', 15552000); -define('SECONDS_1YEAR', 31104000); -define('SECONDS_2YEARS', 62208000); -define('SECONDS_3YEARS', 93312000); +define('SECONDS_1MINUTE', 60); +define('SECONDS_2MINUTES', 120); +define('SECONDS_5MINUTES', 300); +define('SECONDS_10MINUTES', 600); +define('SECONDS_15MINUTES', 900); +define('SECONDS_30MINUTES', 1800); +define('SECONDS_1HOUR', 3600); +define('SECONDS_2HOUR', 7200); +define('SECONDS_3HOUR', 10800); +define('SECONDS_5HOUR', 18000); +define('SECONDS_6HOURS', 21600); +define('SECONDS_12HOURS', 43200); +define('SECONDS_1DAY', 86400); +define('SECONDS_2DAY', 172800); +define('SECONDS_4DAY', 345600); +define('SECONDS_5DAY', 432000); +define('SECONDS_1WEEK', 604800); +define('SECONDS_10DAY', 864000); +define('SECONDS_2WEEK', 1209600); +define('SECONDS_15DAYS', 1296000); +define('SECONDS_1MONTH', 2592000); +define('SECONDS_2MONTHS', 5184000); +define('SECONDS_3MONTHS', 7776000); +define('SECONDS_6MONTHS', 15552000); +define('SECONDS_1YEAR', 31104000); +define('SECONDS_2YEARS', 62208000); +define('SECONDS_3YEARS', 93312000); @@ -178,38 +178,39 @@ define('AGENT_STATUS_WARNING', 2); /* Visual maps contants */ //The items kind -define('STATIC_GRAPH', 0); -define('PERCENTILE_BAR', 3); -define('MODULE_GRAPH', 1); -define('SIMPLE_VALUE', 2); -define('LABEL', 4); -define('ICON', 5); -define('SIMPLE_VALUE_MAX', 6); -define('SIMPLE_VALUE_MIN', 7); -define('SIMPLE_VALUE_AVG', 8); -define('PERCENTILE_BUBBLE', 9); -define('SERVICE', 10); //Enterprise Item. -define('GROUP_ITEM', 11); +define('STATIC_GRAPH', 0); +define('PERCENTILE_BAR', 3); +define('MODULE_GRAPH', 1); +define('SIMPLE_VALUE', 2); +define('LABEL', 4); +define('ICON', 5); +define('SIMPLE_VALUE_MAX', 6); +define('SIMPLE_VALUE_MIN', 7); +define('SIMPLE_VALUE_AVG', 8); +define('PERCENTILE_BUBBLE', 9); +define('SERVICE', 10); //Enterprise Item. +define('GROUP_ITEM', 11); +define('BOX_ITEM', 12); //Some styles -define('MIN_WIDTH',300); -define('MIN_HEIGHT',120); -define('MIN_WIDTH_CAPTION',420); +define('MIN_WIDTH', 300); +define('MIN_HEIGHT', 120); +define('MIN_WIDTH_CAPTION', 420); //The process for simple value -define('PROCESS_VALUE_NONE', 0); -define('PROCESS_VALUE_MIN', 1); -define('PROCESS_VALUE_MAX', 2); -define('PROCESS_VALUE_AVG', 3); +define('PROCESS_VALUE_NONE', 0); +define('PROCESS_VALUE_MIN', 1); +define('PROCESS_VALUE_MAX', 2); +define('PROCESS_VALUE_AVG', 3); //Status -define('VISUAL_MAP_STATUS_CRITICAL_BAD', 1); -define('VISUAL_MAP_STATUS_CRITICAL_ALERT', 4); -define('VISUAL_MAP_STATUS_NORMAL', 0); -define('VISUAL_MAP_STATUS_WARNING', 2); -define('VISUAL_MAP_STATUS_UNKNOWN', 3); -define('VISUAL_MAP_STATUS_WARNING_ALERT', 10); +define('VISUAL_MAP_STATUS_CRITICAL_BAD', 1); +define('VISUAL_MAP_STATUS_CRITICAL_ALERT', 4); +define('VISUAL_MAP_STATUS_NORMAL', 0); +define('VISUAL_MAP_STATUS_WARNING', 2); +define('VISUAL_MAP_STATUS_UNKNOWN', 3); +define('VISUAL_MAP_STATUS_WARNING_ALERT', 10); //Wizard -define('VISUAL_MAP_WIZARD_PARENTS_NONE', 0); -define('VISUAL_MAP_WIZARD_PARENTS_ITEM_MAP', 1); -define('VISUAL_MAP_WIZARD_PARENTS_AGENT_RELANTIONSHIP', 2); +define('VISUAL_MAP_WIZARD_PARENTS_NONE', 0); +define('VISUAL_MAP_WIZARD_PARENTS_ITEM_MAP', 1); +define('VISUAL_MAP_WIZARD_PARENTS_AGENT_RELANTIONSHIP', 2); diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index f72a8cb578..26b5163074 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -65,6 +65,9 @@ function visual_map_print_item($mode = "read", $layoutData, $id_module = $layoutData['id_agente_modulo']; $type = $layoutData['type']; $period = $layoutData['period']; + $border_width = $layoutData['border_width']; + $border_color = $layoutData['border_color']; + $fill_color = $layoutData['fill_color']; $sizeStyle = ''; $borderStyle = ''; @@ -553,7 +556,9 @@ function visual_map_print_item($mode = "read", $layoutData, } } - $z_index = 1; + // + 1 for to avoid the box and lines items are on the top of + // others + $z_index = 1 + 1; switch ($type) { case STATIC_GRAPH: @@ -573,13 +578,13 @@ function visual_map_print_item($mode = "read", $layoutData, } if ($status == VISUAL_MAP_STATUS_CRITICAL_BAD) - $z_index = 3; + $z_index = 3 + 1; elseif ($status == VISUAL_MAP_STATUS_WARNING) - $z_index = 2; + $z_index = 2 + 1; elseif ($status == VISUAL_MAP_STATUS_CRITICAL_ALERT) - $z_index = 4; + $z_index = 4 + 1; else - $z_index = 1; + $z_index = 1 + 1; break; case ICON: if ($layoutData['image'] != null) { @@ -592,7 +597,7 @@ function visual_map_print_item($mode = "read", $layoutData, $imageSize = 'width="' . $width . '" height="' . $height . '"'; } - $z_index = 4; + $z_index = 4 + 1; break; case PERCENTILE_BAR: case PERCENTILE_BUBBLE: @@ -669,7 +674,10 @@ function visual_map_print_item($mode = "read", $layoutData, $img = str_replace('>', 'class="image" id="image_' . $id . '" />', $img); break; case LABEL: - $z_index = 4; + $z_index = 4 + 1; + break; + case BOX_ITEM: + $z_index = 1; break; } @@ -701,6 +709,9 @@ function visual_map_print_item($mode = "read", $layoutData, case ICON: $class .= "icon"; break; + case BOX_ITEM: + $class .= "box_item"; + break; default: if (!empty($element_enterprise)) { $class .= $element_enterprise['class']; @@ -723,6 +734,16 @@ function visual_map_print_item($mode = "read", $layoutData, } switch ($type) { + case BOX_ITEM: + $style = ""; + $style .= "width: " . $width . "px; "; + $style .= "height: " . $height . "px; "; + $style .= "border-style: solid; "; + $style .= "border-width: " . $border_width . "px; "; + $style .= "border-color: " . $border_color . "; "; + $style .= "background-color: " . $fill_color . "; "; + echo "
"; + break; case STATIC_GRAPH: case GROUP_ITEM: if ($layoutData['image'] != null) { diff --git a/pandora_console/include/functions_visual_map_editor.php b/pandora_console/include/functions_visual_map_editor.php index 22bcb0f682..93ea97646d 100755 --- a/pandora_console/include/functions_visual_map_editor.php +++ b/pandora_console/include/functions_visual_map_editor.php @@ -57,7 +57,8 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { 'simple_value' => __('Simple value'), 'label' => __('Label'), 'icon' => __('Icon'), - 'group_item' => __('Group')); + 'group_item' => __('Group'), + 'box_item' => __('Box')); if (enterprise_installed()) { enterprise_visual_map_editor_add_title_palette($titles); @@ -75,6 +76,52 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { ' . __('Size') . ' + ' . + html_print_input_text('width_box', 300, '', 3, 5, true) . + ' X ' . + html_print_input_text('height_box', 180, '', 3, 5, true) . + ''; + + $form_items['border_color_row'] = array(); + $form_items['border_color_row']['items'] = array('box_item'); + $form_items['border_color_row']['html'] = + '' . __('Border color') . '' . + '' . + html_print_input_text_extended ('border_color', + '#000000', 'text-border_color', '', 7, 7, false, '', + 'class="border_color"', true) . + ''; + + $form_items['border_width_row'] = array(); + $form_items['border_width_row']['items'] = array('box_item'); + $form_items['border_width_row']['html'] = '' . __('Border width') . ' + ' . + html_print_input_text('border_width', 3, '', 3, 5, true) . + ''; + + + $form_items['fill_color_row'] = array(); + $form_items['fill_color_row']['items'] = array('box_item'); + $form_items['fill_color_row']['html'] = + '' . __('Fill color') . '' . + '' . + html_print_input_text_extended ('fill_color', '#ffffff', + 'text-fill_color', '', 7, 7, false, '', + 'class="fill_color"', true) . + ''; + + $form_items['module_graph_size_row'] = array(); + $form_items['module_graph_size_row']['items'] = array('module_graph', 'datos'); + $form_items['module_graph_size_row']['html'] = '' . __('Size') . ' + ' . + html_print_input_text('width_module_graph', 300, '', 3, 5, true) . + ' X ' . + html_print_input_text('height_module_graph', 180, '', 3, 5, true) . + ''; + $form_items['label_row'] = array(); $form_items['label_row']['items'] = array('label', @@ -358,7 +405,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { $form_items_advance['position_row'] = array(); $form_items_advance['position_row']['items'] = array('static_graph', 'percentile_bar', 'percentile_item', 'module_graph', - 'simple_value', 'label', 'icon', 'datos'); + 'simple_value', 'label', 'icon', 'datos', 'box_item'); $form_items_advance['position_row']['html'] = ' ' . __('Position') . ' (' . html_print_input_text('left', '0', '', 3, 5, true) . @@ -420,6 +467,18 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { '; + + ui_require_css_file ('color-picker'); + + ui_require_jquery_file ('colorpicker'); + ?> + + '; echo ''; echo '
'; diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 3758b3eb40..742cc6732e 100755 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -758,6 +758,12 @@ input.icon_min { input.icon_min[disabled] { background: #fefefe url(../../images/photo.disabled.png) no-repeat center !important; } +input.box_item { + background: #fefefe url(../../images/photo.png) no-repeat center !important; +} +input.box_item[disabled] { + background: #fefefe url(../../images/photo.disabled.png) no-repeat center !important; +} input.copy_item { background: #fefefe url(../../images/copy_visualmap.png) no-repeat center !important; } From 9f7c8d4483426a2b2d747cacdad59011481610b4 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Fri, 21 Nov 2014 13:28:11 +0100 Subject: [PATCH 02/16] Working in the new elements for the visualmap. Ticket #1478 --- .../visual_console_builder.editor.js | 53 ++++++++++++++++-- pandora_console/images/box_item.disabled.png | Bin 0 -> 282 bytes pandora_console/images/box_item.png | Bin 0 -> 284 bytes .../ajax/visual_console_builder.ajax.php | 44 +++++++++++++-- .../include/functions_visual_map.php | 3 + pandora_console/include/styles/pandora.css | 4 +- pandora_console/pandoradb.postgreSQL.sql | 5 +- pandora_console/pandoradb.sql | 3 + pandora_console/pandoradb_data.sql | 2 +- 9 files changed, 99 insertions(+), 15 deletions(-) create mode 100755 pandora_console/images/box_item.disabled.png create mode 100755 pandora_console/images/box_item.png diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index 6bccd80797..e058d9120a 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -130,6 +130,11 @@ function update_button_palette_callback() { idElement = 0; break; case 'box_item': + $("#" + idItem + " div").css('background-color', values['fill_color']); + $("#" + idItem + " div").css('border-color', values['border_color']); + $("#" + idItem + " div").css('border-width', values['border_width'] + "px"); + $("#" + idItem + " div").css('height', values['height_box'] + "px"); + $("#" + idItem + " div").css('width', values['width_box'] + "px"); break; case 'group_item': case 'static_graph': @@ -624,12 +629,18 @@ function loadFieldsFromDB(item) { $("input[name='width_box']").val(val); if (key == 'height_box') $("input[name='height_box']").val(val); - if (key == 'border_color') + if (key == 'border_color') { $("input[name='border_color']").val(val); + $("#border_color_row .ColorPickerDivSample") + .css('background-color', val); + } if (key == 'border_width') $("input[name='border_width']").val(val); - if (key == 'fill_color') + if (key == 'fill_color') { $("input[name='fill_color']").val(val); + $("#fill_color_row .ColorPickerDivSample") + .css('background-color', val); + } }); if (data.type == 1) { @@ -1191,6 +1202,29 @@ function createItem(type, values, id_data) { switch (type) { case 'box_item': + item = $('
' + + '
' + + '
' + + '
' + + '' + ); break; case 'group_item': case 'static_graph': @@ -1359,7 +1393,8 @@ function createItem(type, values, id_data) { } $("#background").append(item); - $(".item").css('z-index', '1'); + $(".item").css('z-index', '2'); + $(".box_item").css('z-index', '1'); if (values['parent'] != 0) { var line = {"id": id_data, @@ -1434,9 +1469,15 @@ function updateDB_visual(type, idElement , values, event, top, left) { && (event != 'dragstop')) { var element_status= null; var parameter = Array(); - parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"}); - parameter.push ({name: "get_element_status", value: "1"}); - parameter.push ({name: "id_element", value: idElement}); + parameter.push ({ + name: "page", + value: "include/ajax/visual_console_builder.ajax"}); + parameter.push ({ + name: "get_element_status", + value: "1"}); + parameter.push ({ + name: "id_element", + value: idElement}); if (metaconsole != 0) { parameter.push ({name: "metaconsole", value: 1}); diff --git a/pandora_console/images/box_item.disabled.png b/pandora_console/images/box_item.disabled.png new file mode 100755 index 0000000000000000000000000000000000000000..4701027fe3cd973882c1dd5f9da7ccd038e7178b GIT binary patch literal 282 zcmeAS@N?(olHy`uVBq!ia0vp^k|4~%1|*NXY)uAIY)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPqwz1mmqClbLo-U3d9>?EK+sMhHDB!yPc-yrU z?_^E0B;lxr(hdp9863q2=bheoP;K?;!XM5PE6@CIUYwA2<{CHui+Y9IKOM4btyPkH zcIo-U3d9>?EKv*tTwAmDO;f{DnT z#@zvj0(Zn|x#&%BUgGRgvT%Vzg=U9xlXa3iN2OQvt>trN>r>K}Tx*j2Vn4wsV&XFX zlRk?l9ki1OKBTa)f0y#^nCr_no-Wm$!&hLPeAX`KEw^o7G((r~*QSiE$GTMStiNde zVM9=my|(jowiTC_p1!(!#msMEyr#9$nroyK-d_<}@bkRqJ_TcykJXos8!Ve*FJ#YN a$>h1m#JKX?nm<5CGkCiCxvX $id_visual_console), array('background', 'height', 'width')); + $backgroundFields = db_get_row_filter( + 'tlayout', + array('id' => $id_visual_console), + array('background', 'height', 'width')); echo json_encode($backgroundFields); break; + case 'box_item': case 'percentile_bar': case 'percentile_item': case 'static_graph': @@ -556,6 +578,13 @@ switch ($action) { $elementFields['width_module_graph'] = $elementFields['width']; $elementFields['height_module_graph'] = $elementFields['height']; break; + case 'box_item': + $elementFields['width_box'] = $elementFields['width']; + $elementFields['height_box'] = $elementFields['height']; + $elementFields['border_color'] = $elementFields['border_color']; + $elementFields['border_width'] = $elementFields['border_width']; + $elementFields['fill_color'] = $elementFields['fill_color']; + break; } //Support for max, min and svg process on simple value items @@ -726,10 +755,15 @@ switch ($action) { $return['id_data'] = $idData; $return['text'] = $text; $return['type'] = visual_map_type_in_js($values['type']); + + switch ($values['type']) { + case BOX_ITEM: + $return['values']['width_box'] = $values['width']; + $return['values']['height_box'] = $values['height']; + break; + } } - html_debug_print($return, true); - echo json_encode($return); break; diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index 26b5163074..ff680b952e 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -2030,6 +2030,9 @@ function visual_map_type_in_js($type) { case GROUP_ITEM: return 'group_item'; break; + case BOX_ITEM: + return 'box_item'; + break; } } diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 742cc6732e..b926b31e5d 100755 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -759,10 +759,10 @@ input.icon_min[disabled] { background: #fefefe url(../../images/photo.disabled.png) no-repeat center !important; } input.box_item { - background: #fefefe url(../../images/photo.png) no-repeat center !important; + background: #fefefe url(../../images/box_item.png) no-repeat center !important; } input.box_item[disabled] { - background: #fefefe url(../../images/photo.disabled.png) no-repeat center !important; + background: #fefefe url(../../images/box_item.disabled.png) no-repeat center !important; } input.copy_item { background: #fefefe url(../../images/copy_visualmap.png) no-repeat center !important; diff --git a/pandora_console/pandoradb.postgreSQL.sql b/pandora_console/pandoradb.postgreSQL.sql index 744c275c87..20fd07b0ae 100755 --- a/pandora_console/pandoradb.postgreSQL.sql +++ b/pandora_console/pandoradb.postgreSQL.sql @@ -1100,7 +1100,10 @@ CREATE TABLE "tlayout_data" ( "enable_link" SMALLINT NOT NULL default 1, "id_metaconsole" INTEGER NOT NULL default 0, "id_group" INTEGER NOT NULL default 0, - "id_custom_graph" INTEGER NOT NULL default 0 + "id_custom_graph" INTEGER NOT NULL default 0, + "border_width" INTEGER NOT NULL default 0, + "border_color" varchar(200) DEFAULT "", + "fill_color" varchar(200) DEFAULT "" ); -- --------------------------------------------------------------------- diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 54db5dcb75..376ae670aa 100755 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -1189,6 +1189,9 @@ CREATE TABLE IF NOT EXISTS `tlayout_data` ( `id_metaconsole` int(10) NOT NULL default 0, `id_group` INTEGER UNSIGNED NOT NULL default 0, `id_custom_graph` INTEGER UNSIGNED NOT NULL default 0, + `border_width` INTEGER UNSIGNED NOT NULL default 0, + `border_color` varchar(200) DEFAULT "", + `fill_color` varchar(200) DEFAULT "", PRIMARY KEY(`id`) ) ENGINE = InnoDB DEFAULT CHARSET=utf8; diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index c8dd19bf14..92dadb9d91 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -38,7 +38,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES ('graph_res','5'), ('step_compact','1'), ('db_scheme_version','6.0dev'), -('db_scheme_build','PD141120'), +('db_scheme_build','PD141119'), ('show_unknown','0'), ('show_lastalerts','1'), ('style','pandora'), From 93c1089cfff99eca19d48f7e15ee0bc45353b1e8 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Fri, 21 Nov 2014 13:37:07 +0100 Subject: [PATCH 03/16] Working in the new elements for the visualmap. Ticket #1478 --- .../visual_console_builder.elements.php | 72 +++++++++++++------ 1 file changed, 50 insertions(+), 22 deletions(-) diff --git a/pandora_console/godmode/reporting/visual_console_builder.elements.php b/pandora_console/godmode/reporting/visual_console_builder.elements.php index 6d67a8ab43..78ca646a47 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.elements.php +++ b/pandora_console/godmode/reporting/visual_console_builder.elements.php @@ -143,6 +143,10 @@ foreach ($layoutDatas as $layoutData) { $table->data[$i + 1]['icon'] = html_print_image('images/photo.png', true, array('title' => __('Icon'))); break; + case BOX_ITEM: + $table->data[$i + 1]['icon'] = + html_print_image('images/box_item.png', true, array('title' => __('Box'))); + break; default: if (enterprise_installed()) { $table->data[$i + 1]['icon'] = @@ -158,27 +162,35 @@ foreach ($layoutDatas as $layoutData) { //First row - //Label - if ($layoutData['type'] != ICON) { - $table->data[$i + 1][0] = '' . - html_print_input_hidden('label_' . $idLayoutData, $layoutData['label'], true) . - '' . __('Edit label') .'' . - ''; + //Label + switch ($layoutData['type']) { + case ICON: + case BOX_ITEM: + // hasn't the label. + $table->data[$i + 1][0] = ''; + break; + default: + $table->data[$i + 1][0] = '' . + html_print_input_hidden('label_' . $idLayoutData, $layoutData['label'], true) . + '' . __('Edit label') .'' . + ''; + break; } - 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] = html_print_select ($images_list, 'image_' . $idLayoutData, $layoutData['image'], '', 'None', '', true, false, true, '', false, "width: 120px"); - } - else { - $table->data[$i + 1][1] = ''; + switch ($layoutData['type']) { + case STATIC_GRAPH: + case ICON: + $table->data[$i + 1][1] = + html_print_select ($images_list, + 'image_' . $idLayoutData, $layoutData['image'], '', + 'None', '', true, false, true, '', false, + "width: 120px"); + break; + default: + $table->data[$i + 1][1] = ''; + break; } @@ -194,8 +206,14 @@ foreach ($layoutDatas as $layoutData) { ')'; //Parent - $table->data[$i + 1][4] = html_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, false, true, false, 'width: 120px;'); + switch ($layoutData['type']) { + case BOX_ITEM: + $table->data[$i + 1][4] = ""; + break; + default: + $table->data[$i + 1][4] = html_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, false, true, false, 'width: 120px;'); + } //Delete row button if (!defined('METACONSOLE')) { @@ -217,6 +235,7 @@ foreach ($layoutDatas as $layoutData) { //Agent switch ($layoutData['type']) { + case BOX_ITEM: case ICON: case LABEL: $table->data[$i + 2][0] = ''; @@ -268,6 +287,7 @@ foreach ($layoutDatas as $layoutData) { switch ($layoutData['type']) { case ICON: case LABEL: + case BOX_ITEM: $table->data[$i + 2][1] = ''; break; default: @@ -328,9 +348,17 @@ foreach ($layoutDatas as $layoutData) { } //Map linked - $table->data[$i + 2][4] = html_print_select_from_sql( - 'SELECT id, name FROM tlayout WHERE id != ' . $idVisualConsole, - 'map_linked_' . $idLayoutData, $layoutData['id_layout_linked'], '', 'None', '', true, false, true, '', false, "width: 120px"); + switch ($layoutData['type']) { + case BOX_ITEM: + $table->data[$i + 2][4] = ""; + break; + default: + $table->data[$i + 2][4] = html_print_select_from_sql( + 'SELECT id, name FROM tlayout WHERE id != ' . $idVisualConsole, + 'map_linked_' . $idLayoutData, $layoutData['id_layout_linked'], '', 'None', '', true, false, true, '', false, "width: 120px"); + break; + } + $table->data[$i + 2][5] = ''; if ($alternativeStyle) { From e63886e1e72ecf5e930ea57f8c2e3b64b47c4eb9 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Fri, 21 Nov 2014 13:41:20 +0100 Subject: [PATCH 04/16] Fixed the box for the dashboard. --- pandora_console/include/functions_visual_map.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index ff680b952e..a245d6d826 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -736,8 +736,8 @@ function visual_map_print_item($mode = "read", $layoutData, switch ($type) { case BOX_ITEM: $style = ""; - $style .= "width: " . $width . "px; "; - $style .= "height: " . $height . "px; "; + $style .= "width: " . ($width * $proportion) . "px; "; + $style .= "height: " . ($height * $proportion) . "px; "; $style .= "border-style: solid; "; $style .= "border-width: " . $border_width . "px; "; $style .= "border-color: " . $border_color . "; "; From 7edad2cb1d9249cc362b7a9c7c7b858f870e382d Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 24 Nov 2014 16:40:59 +0100 Subject: [PATCH 05/16] Working in the new elements for the visualmap. Ticket #1478 --- .../visual_console_builder.editor.js | 176 +++++++++++++++++- pandora_console/images/line_item.disabled.png | Bin 0 -> 343 bytes pandora_console/images/line_item.png | Bin 0 -> 331 bytes .../ajax/visual_console_builder.ajax.php | 15 ++ pandora_console/include/constants.php | 1 + .../include/functions_visual_map.php | 11 +- .../include/functions_visual_map_editor.php | 67 +++++-- pandora_console/include/styles/pandora.css | 6 + 8 files changed, 262 insertions(+), 14 deletions(-) create mode 100755 pandora_console/images/line_item.disabled.png create mode 100755 pandora_console/images/line_item.png diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index e058d9120a..7b93785caa 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -16,12 +16,16 @@ var is_opened_palette = false; var idItem = 0; var selectedItem = null; var lines = Array(); +var user_lines = Array(); var toolbuttonActive = null; var autosave = true; var list_actions_pending_save = []; var temp_id_item = 0; var parents = {}; +var obj_js_user_lines = null; + + var SIZE_GRID = 16; //Const the size (for width and height) of grid. function toggle_advance_options_palette(close) { @@ -53,6 +57,8 @@ function visual_map_main() { } ); + obj_js_user_lines = new jsGraphics("background"); + $("input[name='radio_choice']").on('change', function() { var radio_value = $("input[name='radio_choice']:checked").val(); @@ -260,6 +266,9 @@ function readFields() { values['border_width'] = parseInt( $("input[name='border_width']").val()); values['fill_color'] = $("input[name='fill_color']").val(); + values['line_width'] = parseInt( + $("input[name='line_width']").val()); + values['line_color'] = $("input[name='line_color']").val(); if (metaconsole != 0) { values['metaconsole'] = 1; @@ -361,11 +370,133 @@ function create_button_palette_callback() { } if (validate) { - insertDB(creationItem, values); + switch (creationItem) { + case 'line_item': + create_line('step_1', values); + break; + default: + insertDB(creationItem, values); + break; + } + + toggle_item_palette(); } } +function draw_user_lines(color, thickness, start_x, start_y , end_x, end_y) { + + obj_js_user_lines.clear(); + + // Draw the previous lines + for (iterator = 0; iterator < user_lines.length; iterator++) { + + obj_js_user_lines.setStroke(user_lines[iterator]['line_width']); + obj_js_user_lines.setColor(user_lines[iterator]['line_color']); + obj_js_user_lines.drawLine( + user_lines[iterator]['start_x'], + user_lines[iterator]['start_y'], + user_lines[iterator]['end_x'], + user_lines[iterator]['end_y']); + + } + + obj_js_user_lines.setStroke(thickness); + obj_js_user_lines.setColor(color); + obj_js_user_lines.drawLine(start_x, start_y, end_x, end_y); + + obj_js_user_lines.paint(); +} + +function create_line(step, values) { + + $('.item').unbind('click'); + $('.item').unbind('dblclick'); + $('.item').unbind('dragstop'); + $('.item').unbind('dragstart'); + + $('#background').unbind('click'); + $('#background').unbind('dblclick'); + + + switch (step) { + case 'step_1': + $("#background *").css("cursor", "crosshair"); + + + + $("#background *") + .on('mousemove', function(e) { + $('#div_step_1').css({ + left: e.pageX, + top: e.pageY + }); + $('#div_step_1').show(); + + // 2 for the black border of background + values['line_start_x'] = + e.pageX - $("#background").position().left - 2; + values['line_start_y'] = + e.pageY - $("#background").position().top - 2; + + }); + + + $("#background *") + .on('click', function(e) { + create_line('step_2', values); + }); + + break; + case 'step_2': + $('#div_step_1').hide(); + $("#background *").off('mousemove'); + $("#background *").off('click'); + + + $("#background *") + .on('mousemove', function(e) { + $('#div_step_2').css({ + left: e.pageX, + top: e.pageY + }); + $('#div_step_2').show(); + + // 2 for the black border of background + values['line_end_x'] = + e.pageX - $("#background").position().left - 2; + values['line_end_y'] = + e.pageY - $("#background").position().top - 2; + + draw_user_lines( + values['line_color'], + values['line_width'], + values['line_start_x'], + values['line_start_y'], + values['line_end_x'] - 3, + values['line_end_y'] - 3); + }); + + $("#background *") + .on('click', function(e) { + create_line('step_3', values); + }); + break; + case 'step_3': + $('#div_step_2').hide(); + $("#background *").off('mousemove'); + $("#background *").off('click'); + + $("#background *").css("cursor", ""); + + insertDB("line_item", values); + + eventsItems(); + eventsBackground(); + break; + } +} + function toggle_item_palette() { var item = null; @@ -641,6 +772,14 @@ function loadFieldsFromDB(item) { $("#fill_color_row .ColorPickerDivSample") .css('background-color', val); } + if (key == 'line_width') + $("input[name='line_width']").val(val); + if (key == 'line_color') { + $("input[name='line_color']").val(val); + $("#line_color_row .ColorPickerDivSample") + .css('background-color', val); + } + }); if (data.type == 1) { @@ -813,6 +952,16 @@ function hiddenFields(item) { $("#fill_color_row").css('display', 'none'); $("#fill_color_row." + item).css('display', ''); + $("#line_color_row").css('display', 'none'); + $("#line_color_row." + item).css('display', ''); + + $("#line_width_row").css('display', 'none'); + $("#line_width_row." + item).css('display', ''); + + + + + $("input[name='radio_choice']").trigger('change'); if (typeof(enterprise_hiddenFields) == 'function') { @@ -852,6 +1001,8 @@ function cleanFields(item) { $("input[name='border_color']").val('#000000'); $("input[name='border_width']").val(3); $("input[name='fill_color']").val('#ffffff'); + $("input[name='line_width']").val(3); + $("input[name='line_color']").val('#000000'); $("#preview").empty(); @@ -1447,6 +1598,21 @@ function insertDB(type, values) { addItemSelectParents(id, data['text']); //Reload all events for the item and new item. eventsItems(); + + switch (type) { + case 'line_item': + var line = { + "id": id, + "start_x": values['line_start_x'], + "start_y": values['line_start_y'], + "end_x": values['line_end_x'], + "end_y": values['line_end_y'], + "line_width": values['line_width'], + "line_color": values['line_color']}; + + user_lines.push(line); + break; + } } else { //TODO @@ -1822,6 +1988,7 @@ function eventsItems(drag) { //$(".item").resizable(); //Disable but run in ff and in the waste (aka micro$oft IE) show ungly borders $('.item').bind('click', function(event, ui) { + event.stopPropagation(); if (!is_opened_palette) { var divParent = $(event.target); @@ -1913,6 +2080,7 @@ function eventsItems(drag) { //Double click in the item $('.item').bind('dblclick', function(event, ui) { + event.stopPropagation(); if ((!is_opened_palette) && (autosave)) { toggle_item_palette(); @@ -1924,6 +2092,7 @@ function eventsItems(drag) { $(".item").draggable({containment: "#background", grid: drag}); $('.item').bind('dragstart', function(event, ui) { + event.stopPropagation(); if (!is_opened_palette) { unselectAll(); @@ -1973,6 +2142,7 @@ function eventsItems(drag) { }); $('.item').bind('dragstop', function(event, ui) { + event.stopPropagation(); var values = {}; @@ -2109,6 +2279,10 @@ function click_button_toolbox(id) { toolbuttonActive = creationItem = 'box_item'; toggle_item_palette(); break; + case 'line_item': + toolbuttonActive = creationItem = 'line_item'; + toggle_item_palette(); + break; diff --git a/pandora_console/images/line_item.disabled.png b/pandora_console/images/line_item.disabled.png new file mode 100755 index 0000000000000000000000000000000000000000..3dc5c57f5b6587c98eb8ac472f1b863581a2dd5b GIT binary patch literal 343 zcmeAS@N?(olHy`uVBq!ia0vp^k|4~%1|*NXY)uAIY)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPqwoin4)-gpW$V*`2<(u1doj9_^-d>6d-n{CD`hJFa#a#at&+qZKyDR?chPkkD_p+bo kp6HfcH20t5uJ?!A@zH`TrRdvRf&OLiboFyt=akR{04FSm1ONa4 literal 0 HcmV?d00001 diff --git a/pandora_console/images/line_item.png b/pandora_console/images/line_item.png new file mode 100755 index 0000000000000000000000000000000000000000..bedbc2ad077b4a6b479403c52d987b179d75d90f GIT binary patch literal 331 zcmeAS@N?(olHy`uVBq!ia0vp^k|4~%1|*NXY)uAIY)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPqwIrhw*!T4c)B=-cpQHl<|x#xz;nm<(`LEf z_vC)d|4(R@b9v42=!n%cXXDA-US_j-84qO|y1f_U(A&VH!gMvnbKA)yUfr?`zVhnV zr%dcA`POoq-SIl(s)n1#Lm4Mt%vMMVyOgxkg~i9dc;m|sx!FD;qDn^A+&8c0RNOmm zvHiGN$IQkjJYh*s8CN&0xjE-nY&4IJL-0z5hNXvpysBQuy1b)$p21Q5rk2D9n`Xx> zRT7*eCcIe5gQv0GRAKXiqH8r-`CR`UZ|(6fC@PQqW}vXy`}p4*KU{Z8>_4+h^5Om1 XxjJ`Q_n!F(^dp0(tDnm{r-UW|rIvwW literal 0 HcmV?d00001 diff --git a/pandora_console/include/ajax/visual_console_builder.ajax.php b/pandora_console/include/ajax/visual_console_builder.ajax.php index cdf07eb622..f6b6e905c9 100755 --- a/pandora_console/include/ajax/visual_console_builder.ajax.php +++ b/pandora_console/include/ajax/visual_console_builder.ajax.php @@ -78,6 +78,12 @@ $border_color = get_parameter('border_color', ''); $fill_color = get_parameter('fill_color', ''); $width_box = get_parameter('width_box', 0); $height_box = get_parameter('height_box', 0); +$line_start_x = (int)get_parameter('line_start_x', 0); +$line_start_y = (int)get_parameter('line_start_y', 0); +$line_end_x = (int)get_parameter('line_end_x', 0); +$line_end_y = (int)get_parameter('line_end_y', 0); +$line_width = (int)get_parameter('line_width', 0); +$line_color = get_parameter('line_color', ''); $get_element_status = get_parameter('get_element_status', 0); $get_image_path_status = get_parameter('get_image_path_status', 0); @@ -648,6 +654,15 @@ switch ($action) { $values['id_custom_graph'] = $id_custom_graph; switch ($type) { + case 'line_item': + $values['type'] = LINE_ITEM; + $values['border_width'] = $line_width; + $values['border_color'] = $line_color; + $values['pos_x'] = $line_start_x; + $values['pos_y'] = $line_start_y; + $values['width'] = $line_end_x; + $values['height'] = $line_end_y; + break; case 'box_item': $values['type'] = BOX_ITEM; $values['border_width'] = $border_width; diff --git a/pandora_console/include/constants.php b/pandora_console/include/constants.php index 16772c968e..3be630f662 100644 --- a/pandora_console/include/constants.php +++ b/pandora_console/include/constants.php @@ -191,6 +191,7 @@ define('PERCENTILE_BUBBLE', 9); define('SERVICE', 10); //Enterprise Item. define('GROUP_ITEM', 11); define('BOX_ITEM', 12); +define('LINE_ITEM', 13); //Some styles define('MIN_WIDTH', 300); define('MIN_HEIGHT', 120); diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index a245d6d826..afe423d3f6 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -1902,6 +1902,10 @@ function visual_map_create_internal_name_item($label = null, $type, $image, $age if (empty($label)) { switch ($type) { + case 'box_item': + case BOX_ITEM: + $text = __('Box'); + break; case 'module_graph': case MODULE_GRAPH: $text = __('Module graph'); @@ -2029,10 +2033,13 @@ function visual_map_type_in_js($type) { break; case GROUP_ITEM: return 'group_item'; - break; + break; case BOX_ITEM: return 'box_item'; - break; + break; + case LINE_ITEM: + return 'line_item'; + break; } } diff --git a/pandora_console/include/functions_visual_map_editor.php b/pandora_console/include/functions_visual_map_editor.php index 93ea97646d..48ddd63b2c 100755 --- a/pandora_console/include/functions_visual_map_editor.php +++ b/pandora_console/include/functions_visual_map_editor.php @@ -58,7 +58,8 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { 'label' => __('Label'), 'icon' => __('Icon'), 'group_item' => __('Group'), - 'box_item' => __('Box')); + 'box_item' => __('Box'), + 'line_item' => __('Line')); if (enterprise_installed()) { enterprise_visual_map_editor_add_title_palette($titles); @@ -76,35 +77,62 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { ' . __('Width') . ' + ' . + html_print_input_text('line_width', 3, '', 3, 5, true) . + ''; + + + $form_items['line_color_row'] = array(); + $form_items['line_color_row']['items'] = array('datos', 'line_item'); + $form_items['line_color_row']['html'] = + '' . + __('Border color') . + '' . + '' . + html_print_input_text_extended ('line_color', + '#000000', 'text-line_color', '', 7, 7, false, + '', 'class="line_color"', true) . + ''; + + $form_items['box_size_row'] = array(); - $form_items['box_size_row']['items'] = array('box_item'); - $form_items['box_size_row']['html'] = '' . __('Size') . ' + $form_items['box_size_row']['items'] = array('datos', 'box_item'); + $form_items['box_size_row']['html'] = + '' . __('Size') . ' ' . html_print_input_text('width_box', 300, '', 3, 5, true) . ' X ' . html_print_input_text('height_box', 180, '', 3, 5, true) . ''; + $form_items['border_color_row'] = array(); - $form_items['border_color_row']['items'] = array('box_item'); + $form_items['border_color_row']['items'] = array('datos', 'box_item'); $form_items['border_color_row']['html'] = - '' . __('Border color') . '' . + '' . + __('Border color') . + '' . '' . - html_print_input_text_extended ('border_color', - '#000000', 'text-border_color', '', 7, 7, false, '', - 'class="border_color"', true) . + html_print_input_text_extended ('border_color', + '#000000', 'text-border_color', '', 7, 7, false, + '', 'class="border_color"', true) . ''; + $form_items['border_width_row'] = array(); - $form_items['border_width_row']['items'] = array('box_item'); - $form_items['border_width_row']['html'] = '' . __('Border width') . ' + $form_items['border_width_row']['items'] = array('datos', 'box_item'); + $form_items['border_width_row']['html'] = + '' . __('Border width') . ' ' . html_print_input_text('border_width', 3, '', 3, 5, true) . ''; $form_items['fill_color_row'] = array(); - $form_items['fill_color_row']['items'] = array('box_item'); + $form_items['fill_color_row']['items'] = array('datos', 'box_item'); $form_items['fill_color_row']['html'] = '' . __('Fill color') . '' . '' . @@ -466,8 +494,23 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { '; + echo ''; + + echo ''; + ui_require_css_file ('color-picker'); ui_require_jquery_file ('colorpicker'); @@ -476,6 +519,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { $(document).ready (function () { $(".border_color").attachColorPicker(); $(".fill_color").attachColorPicker(); + $(".line_color").attachColorPicker(); }); Date: Mon, 24 Nov 2014 17:52:28 +0100 Subject: [PATCH 06/16] Working in the new elements for the visualmap. Ticket #1478 --- .../visual_console_builder.editor.js | 17 ++++++--- .../visual_console_builder.editor.php | 10 +++++- .../include/functions_visual_map.php | 36 +++++++++++++++++-- .../javascript/pandora_visual_console.js | 22 ++++++++++++ 4 files changed, 77 insertions(+), 8 deletions(-) mode change 100644 => 100755 pandora_console/godmode/reporting/visual_console_builder.editor.php diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index 7b93785caa..31adf44604 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -54,6 +54,8 @@ function visual_map_main() { //Fixed to wait the load of images. $(window).load(function() { draw_lines(lines, 'background', true); + + draw_user_lines("", 0, 0, 0 , 0, 0, true); } ); @@ -384,7 +386,7 @@ function create_button_palette_callback() { } } -function draw_user_lines(color, thickness, start_x, start_y , end_x, end_y) { +function draw_user_lines(color, thickness, start_x, start_y , end_x, end_y, only_defined_lines) { obj_js_user_lines.clear(); @@ -401,9 +403,16 @@ function draw_user_lines(color, thickness, start_x, start_y , end_x, end_y) { } - obj_js_user_lines.setStroke(thickness); - obj_js_user_lines.setColor(color); - obj_js_user_lines.drawLine(start_x, start_y, end_x, end_y); + + if (typeof(only_defined_lines) == "undefined") { + only_defined_lines = false; + } + + if (only_defined_lines) { + obj_js_user_lines.setStroke(thickness); + obj_js_user_lines.setColor(color); + obj_js_user_lines.drawLine(start_x, start_y, end_x, end_y); + } obj_js_user_lines.paint(); } diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.php b/pandora_console/godmode/reporting/visual_console_builder.editor.php old mode 100644 new mode 100755 index dea56b88d8..f3129d14d7 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.php +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.php @@ -85,8 +85,16 @@ foreach ($layoutDatas as $layoutData) { if ($delete_pending_module == 1 || $disabled_module == 1) continue; + switch ($layoutData['type']) { + case LINE_ITEM: + visual_map_print_user_lines("write", $layoutData); + break; + default: + visual_map_print_item("write", $layoutData); + break; + } + - visual_map_print_item("write", $layoutData); html_print_input_hidden('status_' . $layoutData['id'], $layoutData['status_calculated']); diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index afe423d3f6..4d8a103050 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -928,7 +928,8 @@ function visual_map_print_item($mode = "read", $layoutData, //Add the line between elements. if ($layoutData['parent_item'] != 0) { - $parent = db_get_row_filter('tlayout_data', array('id' => $layoutData['parent_item'])); + $parent = db_get_row_filter('tlayout_data', + array('id' => $layoutData['parent_item'])); echo ''; +} + /** * Prints visual map * @@ -1741,8 +1760,16 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, continue; } - visual_map_print_item("read", $layout_data, - $proportion, $show_links); + switch ($layout_data['type']) { + case LINE_ITEM: + visual_map_print_user_lines("read", $layout_data, + $proportion); + break; + default: + visual_map_print_item("read", $layout_data, + $proportion, $show_links); + break; + } } // End main div @@ -1759,9 +1786,12 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, var lines = Array(); + var user_lines = Array(); + //Fixed to wait the load of images. $(window).load(function() { draw_lines(lines, 'background'); + draw_user_lines_read(); } ); /* ]]> */ diff --git a/pandora_console/include/javascript/pandora_visual_console.js b/pandora_console/include/javascript/pandora_visual_console.js index 45d0b434ed..aa79c4c46f 100755 --- a/pandora_console/include/javascript/pandora_visual_console.js +++ b/pandora_console/include/javascript/pandora_visual_console.js @@ -123,3 +123,25 @@ function refresh_lines (lines, id_div, editor) { delete_lines (id_div); draw_lines (lines, id_div, editor); } + + +function draw_user_lines_read() { + var obj_js_user_lines = new jsGraphics("background"); + + obj_js_user_lines.clear(); + + // Draw the previous lines + for (iterator = 0; iterator < user_lines.length; iterator++) { + console.log(user_lines[iterator]); + obj_js_user_lines.setStroke(parseInt(user_lines[iterator]['line_width'])); + obj_js_user_lines.setColor(user_lines[iterator]['line_color']); + obj_js_user_lines.drawLine( + parseInt(user_lines[iterator]['start_x']), + parseInt(user_lines[iterator]['start_y']), + parseInt(user_lines[iterator]['end_x']), + parseInt(user_lines[iterator]['end_y'])); + + } + + obj_js_user_lines.paint(); +} \ No newline at end of file From 828d2aa8d839420baedf6be841a75f5612204df5 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 24 Nov 2014 18:14:39 +0100 Subject: [PATCH 07/16] Working in the new elements for the visualmap. Ticket #1478 --- .../godmode/reporting/visual_console_builder.editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index 31adf44604..d34f034a25 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -408,7 +408,7 @@ function draw_user_lines(color, thickness, start_x, start_y , end_x, end_y, only only_defined_lines = false; } - if (only_defined_lines) { + if (!only_defined_lines) { obj_js_user_lines.setStroke(thickness); obj_js_user_lines.setColor(color); obj_js_user_lines.drawLine(start_x, start_y, end_x, end_y); From 018c5136c5c1b730732fdf13de412feba899ebe1 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Tue, 25 Nov 2014 11:52:04 +0100 Subject: [PATCH 08/16] Working in the new elements for the visualmap. Ticket #1478 --- .../visual_console_builder.editor.js | 87 ++++++++++++------- .../visual_console_builder.editor.php | 1 + .../include/functions_visual_map.php | 39 +++++++++ .../include/functions_visual_map_editor.php | 6 +- 4 files changed, 99 insertions(+), 34 deletions(-) diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index d34f034a25..f441122ffa 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -520,6 +520,7 @@ function toggle_item_palette() { activeToolboxButton('percentile_item', true); activeToolboxButton('group_item', true); activeToolboxButton('box_item', true); + activeToolboxButton('line_item', true); if (typeof(enterprise_activeToolboxButton) == 'function') { enterprise_activeToolboxButton(true); @@ -545,6 +546,7 @@ function toggle_item_palette() { activeToolboxButton('percentile_item', false); activeToolboxButton('group_item', false); activeToolboxButton('box_item', false); + activeToolboxButton('line_item', false); activeToolboxButton('copy_item', false); activeToolboxButton('edit_item', false); @@ -863,6 +865,7 @@ function setAspectRatioBackground(side) { } function hiddenFields(item) { + //The method to hidden and show is //a row have a id and multiple class //then the steps is @@ -872,100 +875,100 @@ function hiddenFields(item) { // or ... $(".title_panel_span").css('display', 'none'); - $("#title_panel_span_" + item).css('display', 'inline'); + $("#title_panel_span_" + item).css('display', 'inline'); $("#label_row").css('display', 'none'); - $("#label_row." + item).css('display', ''); + $("#label_row." + item).css('display', ''); $("#image_row").css('display', 'none'); - $("#image_row." + item).css('display', ''); + $("#image_row." + item).css('display', ''); $("#enable_link_row").css('display', 'none'); - $("#enable_link_row." + item).css('display', ''); + $("#enable_link_row." + item).css('display', ''); $("#preview_row").css('display', 'none'); - $("#preview_row." + item).css('display', ''); + $("#preview_row." + item).css('display', ''); $("#position_row").css('display', 'none'); - $("#position_row." + item).css('display', ''); + $("#position_row." + item).css('display', ''); $("#agent_row").css('display', 'none'); - $("#agent_row." + item).css('display', ''); + $("#agent_row." + item).css('display', ''); $("#module_row").css('display', 'none'); - $("#module_row." + item).css('display', ''); + $("#module_row." + item).css('display', ''); $("#group_row").css('display', 'none'); - $("#group_row." + item).css('display', ''); + $("#group_row." + item).css('display', ''); $("#process_value_row").css('display', 'none'); - $("#process_value_row." + item).css('display', ''); + $("#process_value_row." + item).css('display', ''); $("#background_row_1").css('display', 'none'); - $("#background_row_1." + item).css('display', ''); + $("#background_row_1." + item).css('display', ''); $("#background_row_2").css('display', 'none'); - $("#background_row_2." + item).css('display', ''); + $("#background_row_2." + item).css('display', ''); $("#background_row_3").css('display', 'none'); - $("#background_row_3." + item).css('display', ''); + $("#background_row_3." + item).css('display', ''); $("#background_row_4").css('display', 'none'); - $("#background_row_4." + item).css('display', ''); + $("#background_row_4." + item).css('display', ''); $("#percentile_bar_row_1").css('display', 'none'); - $("#percentile_bar_row_1." + item).css('display', ''); + $("#percentile_bar_row_1." + item).css('display', ''); $("#percentile_bar_row_2").css('display', 'none'); - $("#percentile_bar_row_2." + item).css('display', ''); + $("#percentile_bar_row_2." + item).css('display', ''); $("#percentile_item_row_3").css('display', 'none'); - $("#percentile_item_row_3." + item).css('display', ''); + $("#percentile_item_row_3." + item).css('display', ''); $("#percentile_item_row_4").css('display', 'none'); - $("#percentile_item_row_4." + item).css('display', ''); + $("#percentile_item_row_4." + item).css('display', ''); $("#period_row").css('display', 'none'); - $("#period_row." + item).css('display', ''); + $("#period_row." + item).css('display', ''); $("#size_row").css('display', 'none'); - $("#size_row." + item).css('display', ''); + $("#size_row." + item).css('display', ''); $("#parent_row").css('display', 'none'); - $("#parent_row." + item).css('display', ''); + $("#parent_row." + item).css('display', ''); $("#map_linked_row").css('display', 'none'); - $("#map_linked_row." + item).css('display', ''); + $("#map_linked_row." + item).css('display', ''); $("#module_graph_size_row").css('display', 'none'); - $("#module_graph_size_row." + item).css('display', ''); + $("#module_graph_size_row." + item).css('display', ''); $("#background_color").css('display', 'none'); - $("#background_color." + item).css('display', ''); + $("#background_color." + item).css('display', ''); $("#radio_choice_graph").css('display', 'none'); - $("#radio_choice_graph." + item).css('display', ''); + $("#radio_choice_graph." + item).css('display', ''); $("#custom_graph_row").css('display', 'none'); - $("#custom_graph_row." + item).css('display', ''); + $("#custom_graph_row." + item).css('display', ''); $("#box_size_row").css('display', 'none'); - $("#box_size_row." + item).css('display', ''); + $("#box_size_row." + item).css('display', ''); $("#border_color_row").css('display', 'none'); - $("#border_color_row." + item).css('display', ''); + $("#border_color_row." + item).css('display', ''); $("#border_width_row").css('display', 'none'); - $("#border_width_row." + item).css('display', ''); + $("#border_width_row." + item).css('display', ''); $("#fill_color_row").css('display', 'none'); - $("#fill_color_row." + item).css('display', ''); + $("#fill_color_row." + item).css('display', ''); $("#line_color_row").css('display', 'none'); - $("#line_color_row." + item).css('display', ''); + $("#line_color_row." + item).css('display', ''); $("#line_width_row").css('display', 'none'); - $("#line_width_row." + item).css('display', ''); + $("#line_width_row." + item).css('display', ''); @@ -2079,6 +2082,20 @@ function eventsItems(drag) { activeToolboxButton('delete_item', true); activeToolboxButton('show_grid', false); } + if ($(divParent).hasClass('handle_start')) { + creationItem = null; + selectedItem = 'handle_start'; + activeToolboxButton('edit_item', true); + activeToolboxButton('delete_item', true); + activeToolboxButton('show_grid', false); + } + if ($(divParent).hasClass('handle_end')) { + creationItem = null; + selectedItem = 'handle_end'; + activeToolboxButton('edit_item', true); + activeToolboxButton('delete_item', true); + activeToolboxButton('show_grid', false); + } //Maybe receive a click event any Enterprise item. if (typeof(enterprise_click_item_callback) == 'function') { @@ -2132,6 +2149,12 @@ function eventsItems(drag) { if ($(event.target).hasClass('icon')) { selectedItem = 'icon'; } + if ($(event.target).hasClass('handle_start')) { + selectedItem = 'handle_start'; + } + if ($(event.target).hasClass('handle_end')) { + selectedItem = 'handle_end'; + } if (selectedItem == null) { //Maybe receive a click event any Enterprise item. diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.php b/pandora_console/godmode/reporting/visual_console_builder.editor.php index f3129d14d7..0311119deb 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.php +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.php @@ -87,6 +87,7 @@ foreach ($layoutDatas as $layoutData) { switch ($layoutData['type']) { case LINE_ITEM: + visual_map_print_user_line_handles($layoutData); visual_map_print_user_lines("write", $layoutData); break; default: diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index 4d8a103050..8b9d2330bd 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -47,6 +47,45 @@ function visual_map_print_item_toolbox($idDiv, $text, $float) { echo ''; } +function visual_map_print_user_line_handles($layoutData) { + $id = $layoutData['id']; + + $start_x = $layoutData['pos_x']; + $start_y = $layoutData['pos_y']; + $end_x = $layoutData['width']; + $end_y = $layoutData['height']; + $z_index = 2; + + $sizeStyle = ""; + + $radious_handle = 12 / 2; + + + //Handle of start + echo '
'; + + html_print_image("images/dot_red.png"); + + echo "
"; + + //Handle of end + echo '
'; + + html_print_image("images/dot_green.png"); + + echo "
"; +} + function visual_map_print_item($mode = "read", $layoutData, $proportion = 1, $show_links = true) { global $config; diff --git a/pandora_console/include/functions_visual_map_editor.php b/pandora_console/include/functions_visual_map_editor.php index 48ddd63b2c..686cf6b17b 100755 --- a/pandora_console/include/functions_visual_map_editor.php +++ b/pandora_console/include/functions_visual_map_editor.php @@ -78,7 +78,8 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { $form_items = array(); $form_items['line_width_row'] = array(); - $form_items['line_width_row']['items'] = array('datos', 'line_item'); + $form_items['line_width_row']['items'] = + array('datos', 'line_item', 'handle_start', 'handle_end'); $form_items['line_width_row']['html'] = '' . __('Width') . ' ' . html_print_input_text('line_width', 3, '', 3, 5, true) . @@ -86,7 +87,8 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { $form_items['line_color_row'] = array(); - $form_items['line_color_row']['items'] = array('datos', 'line_item'); + $form_items['line_color_row']['items'] = + array('datos', 'line_item', 'handle_start', 'handle_end'); $form_items['line_color_row']['html'] = '' . __('Border color') . From e48580c93a5a5270e030804d1912a75a1f3c3891 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Tue, 25 Nov 2014 13:15:51 +0100 Subject: [PATCH 09/16] Working in the new elements for the visualmap. Ticket #1478 --- .../visual_console_builder.editor.js | 96 +++++++++++++++---- .../ajax/visual_console_builder.ajax.php | 58 +++++++++-- .../include/functions_visual_map.php | 4 +- .../include/functions_visual_map_editor.php | 4 +- 4 files changed, 133 insertions(+), 29 deletions(-) diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index f441122ffa..58cf6e70d2 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -1828,15 +1828,49 @@ function updateDB(type, idElement , values, event) { parameter.push({name: key, value: val}); }); - if ((typeof(values['mov_left']) != 'undefined') && - (typeof(values['mov_top']) != 'undefined')) { - top = parseInt($("#" + idElement).css('top').replace('px', '')); - left = parseInt($("#" + idElement).css('left').replace('px', '')); - } - else if ((typeof(values['absolute_left']) != 'undefined') && - (typeof(values['absolute_top']) != 'undefined')) { - top = values['absolute_top']; - left = values['absolute_left']; + + switch (type) { + // -- line_item -- + case 'handler_start': + // --------------- + if ((typeof(values['mov_left']) != 'undefined') && + (typeof(values['mov_top']) != 'undefined')) { + top = parseInt($("#handler_start_" + idElement).css('top').replace('px', '')); + left = parseInt($("#handler_start_" + idElement).css('left').replace('px', '')); + } + else if ((typeof(values['absolute_left']) != 'undefined') && + (typeof(values['absolute_top']) != 'undefined')) { + top = values['absolute_top']; + left = values['absolute_left']; + } + break; + // -- line_item -- + case 'handler_end': + // --------------- + if ((typeof(values['mov_left']) != 'undefined') && + (typeof(values['mov_top']) != 'undefined')) { + top = parseInt($("#handler_end_" + idElement).css('top').replace('px', '')); + left = parseInt($("#handler_end_" + idElement).css('left').replace('px', '')); + } + else if ((typeof(values['absolute_left']) != 'undefined') && + (typeof(values['absolute_top']) != 'undefined')) { + top = values['absolute_top']; + left = values['absolute_left']; + } + break; + default: + + if ((typeof(values['mov_left']) != 'undefined') && + (typeof(values['mov_top']) != 'undefined')) { + top = parseInt($("#" + idElement).css('top').replace('px', '')); + left = parseInt($("#" + idElement).css('left').replace('px', '')); + } + else if ((typeof(values['absolute_left']) != 'undefined') && + (typeof(values['absolute_top']) != 'undefined')) { + top = values['absolute_top']; + left = values['absolute_left']; + } + break; } if ((typeof(top) != 'undefined') && (typeof(left) != 'undefined')) { @@ -1851,6 +1885,7 @@ function updateDB(type, idElement , values, event) { } } + success_update = false; if (!autosave) { list_actions_pending_save.push(parameter); @@ -2082,16 +2117,20 @@ function eventsItems(drag) { activeToolboxButton('delete_item', true); activeToolboxButton('show_grid', false); } - if ($(divParent).hasClass('handle_start')) { + if ($(divParent).hasClass('handler_start')) { + idItem = $(divParent).attr('id') + .replace("handler_start_", ""); creationItem = null; - selectedItem = 'handle_start'; + selectedItem = 'handler_start'; activeToolboxButton('edit_item', true); activeToolboxButton('delete_item', true); activeToolboxButton('show_grid', false); } - if ($(divParent).hasClass('handle_end')) { + if ($(divParent).hasClass('handler_end')) { + idItem = $(divParent).attr('id') + .replace("handler_end_", ""); creationItem = null; - selectedItem = 'handle_end'; + selectedItem = 'handler_end'; activeToolboxButton('edit_item', true); activeToolboxButton('delete_item', true); activeToolboxButton('show_grid', false); @@ -2149,11 +2188,11 @@ function eventsItems(drag) { if ($(event.target).hasClass('icon')) { selectedItem = 'icon'; } - if ($(event.target).hasClass('handle_start')) { - selectedItem = 'handle_start'; + if ($(event.target).hasClass('handler_start')) { + selectedItem = 'handler_start'; } - if ($(event.target).hasClass('handle_end')) { - selectedItem = 'handle_end'; + if ($(event.target).hasClass('handler_end')) { + selectedItem = 'handler_end'; } if (selectedItem == null) { @@ -2165,7 +2204,28 @@ function eventsItems(drag) { if (selectedItem != null) { creationItem = null; - idItem = $(event.target).attr('id'); + + switch (selectedItem) { + // -- line_item -- + case 'handler_start': + // --------------- + idItem = $(event.target).attr('id') + .replace("handler_end_", ""); + idItem = $(event.target).attr('id') + .replace("handler_start_", ""); + break; + // -- line_item -- + case 'handler_end': + // --------------- + idItem = $(event.target).attr('id') + .replace("handler_end_", ""); + idItem = $(event.target).attr('id') + .replace("handler_end_", ""); + break; + default: + idItem = $(event.target).attr('id'); + break; + } activeToolboxButton('copy_item', true); activeToolboxButton('edit_item', true); activeToolboxButton('delete_item', true); diff --git a/pandora_console/include/ajax/visual_console_builder.ajax.php b/pandora_console/include/ajax/visual_console_builder.ajax.php index f6b6e905c9..2029ca1bb7 100755 --- a/pandora_console/include/ajax/visual_console_builder.ajax.php +++ b/pandora_console/include/ajax/visual_console_builder.ajax.php @@ -360,13 +360,30 @@ switch ($action) { if ($label !== null) { $values['label'] = $label; } - if ($left !== null) { - $values['pos_x'] = $left; - } - if ($top !== null) { - $values['pos_y'] = $top; + + switch ($type) { + // -- line_item -- + case 'handler_end': + // --------------- + if ($left !== null) { + $values['width'] = $left; + } + if ($top !== null) { + $values['height'] = $top; + } + break; + default: + if ($left !== null) { + $values['pos_x'] = $left; + } + if ($top !== null) { + $values['pos_y'] = $top; + } + break; } + + if (defined('METACONSOLE') && $metaconsole) { if ($server_name !== null) { $values['id_metaconsole'] = db_get_value('id', @@ -394,7 +411,14 @@ switch ($action) { if ($map_linked !== null) { $values['id_layout_linked'] = $map_linked; } - switch($type) { + switch ($type) { + // -- line_item -- + case 'handler_start': + case 'handler_end': + // --------------- + $values['border_width'] = $line_width; + $values['border_color'] = $line_color; + break; case 'box_item': $values['border_width'] = $border_width; $values['border_color'] = $border_color; @@ -469,7 +493,7 @@ switch ($action) { unset($values['label']); // Don't change background color in graphs when move - switch($type) { + switch ($type) { case 'module_graph': unset($values['image']); break; @@ -480,6 +504,14 @@ switch ($action) { unset($values['period']); unset($values['width']); unset($values['height']); + break; + // -- line_item -- + case 'handler_start': + case 'handler_end': + // --------------- + unset($values['border_width']); + unset($values['border_color']); + break; } } @@ -501,6 +533,10 @@ switch ($action) { array('background', 'height', 'width')); echo json_encode($backgroundFields); break; + // -- line_item -- + case 'handler_start': + case 'handler_end': + // --------------- case 'box_item': case 'percentile_bar': case 'percentile_item': @@ -592,6 +628,14 @@ switch ($action) { $elementFields['fill_color'] = $elementFields['fill_color']; break; + // -- line_item -- + case 'handler_start': + case 'handler_end': + // --------------- + $elementFields['line_width'] = $elementFields['border_width']; + $elementFields['line_color'] = $elementFields['border_color']; + break; + } //Support for max, min and svg process on simple value items if ($type == 'simple_value') { diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index 8b9d2330bd..b56f2aa38d 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -62,7 +62,7 @@ function visual_map_print_user_line_handles($layoutData) { //Handle of start - echo '
"; //Handle of end - echo '
' . __('Width') . ' ' . html_print_input_text('line_width', 3, '', 3, 5, true) . @@ -88,7 +88,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { $form_items['line_color_row'] = array(); $form_items['line_color_row']['items'] = - array('datos', 'line_item', 'handle_start', 'handle_end'); + array('datos', 'line_item', 'handler_start', 'handler_end'); $form_items['line_color_row']['html'] = '' . __('Border color') . From 320d85b3b804b3d18ebc527a0a824a25a000c800 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Tue, 25 Nov 2014 15:37:58 +0100 Subject: [PATCH 10/16] Working in the new elements for the visualmap. Ticket #1478 --- .../visual_console_builder.editor.js | 71 ++++++++++++++++--- 1 file changed, 61 insertions(+), 10 deletions(-) diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index 58cf6e70d2..7998cc6797 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -111,8 +111,10 @@ function update_button_palette_callback() { switch (selectedItem) { case 'background': if(values['width'] == 0 && values['height'] == 0) { - values['width'] = $("#hidden-background_original_width").val(); - values['height'] = $("#hidden-background_original_height").val(); + values['width'] = + $("#hidden-background_original_width").val(); + values['height'] = + $("#hidden-background_original_height").val(); } $("#background").css('width', values['width']); $("#background").css('height', values['height']); @@ -386,7 +388,35 @@ function create_button_palette_callback() { } } -function draw_user_lines(color, thickness, start_x, start_y , end_x, end_y, only_defined_lines) { +function update_user_line(type, idElement, top, left) { + jQuery.each(user_lines, function(iterator, user_line) { + + if (user_line['id'] != idElement) + return; + + switch (type) { + // -- line_item -- + case 'handler_start': + // --------------- + + user_lines[iterator]['start_x'] = left; + user_lines[iterator]['start_y'] = top; + + break; + // -- line_item -- + case 'handler_end': + // --------------- + + user_lines[iterator]['end_x'] = left; + user_lines[iterator]['end_y'] = top; + + break; + } + }); +} + +function draw_user_lines(color, thickness, start_x, start_y , end_x, + end_y, only_defined_lines) { obj_js_user_lines.clear(); @@ -1701,7 +1731,8 @@ function updateDB_visual(type, idElement , values, event, top, left) { var params = []; params.push("get_image_path=1"); - params.push("img_src=images/console/icons/" + values['image'] + suffix); + params.push("img_src=" + + "images/console/icons/" + values['image'] + suffix); params.push("page=include/ajax/skins.ajax"); params.push("only_src=1"); jQuery.ajax ({ @@ -1787,6 +1818,8 @@ function updateDB_visual(type, idElement , values, event, top, left) { } break; } + + draw_user_lines("", 0, 0, 0 , 0, 0, true); } function updateDB(type, idElement , values, event) { @@ -1835,35 +1868,53 @@ function updateDB(type, idElement , values, event) { // --------------- if ((typeof(values['mov_left']) != 'undefined') && (typeof(values['mov_top']) != 'undefined')) { - top = parseInt($("#handler_start_" + idElement).css('top').replace('px', '')); - left = parseInt($("#handler_start_" + idElement).css('left').replace('px', '')); + top = parseInt($("#handler_start_" + idElement) + .css('top').replace('px', '')); + left = parseInt($("#handler_start_" + idElement) + .css('left').replace('px', '')); } else if ((typeof(values['absolute_left']) != 'undefined') && (typeof(values['absolute_top']) != 'undefined')) { top = values['absolute_top']; left = values['absolute_left']; } + + //Added the radious of image point of handler + top = top + 6; + left = left + 6; + + update_user_line(type, idElement, top, left); break; // -- line_item -- case 'handler_end': // --------------- if ((typeof(values['mov_left']) != 'undefined') && (typeof(values['mov_top']) != 'undefined')) { - top = parseInt($("#handler_end_" + idElement).css('top').replace('px', '')); - left = parseInt($("#handler_end_" + idElement).css('left').replace('px', '')); + top = parseInt($("#handler_end_" + idElement) + .css('top').replace('px', '')); + left = parseInt($("#handler_end_" + idElement) + .css('left').replace('px', '')); } else if ((typeof(values['absolute_left']) != 'undefined') && (typeof(values['absolute_top']) != 'undefined')) { top = values['absolute_top']; left = values['absolute_left']; } + + //Added the radious of image point of handler + top = top + 6; + left = left + 6; + + update_user_line(type, idElement, top, left); break; default: if ((typeof(values['mov_left']) != 'undefined') && (typeof(values['mov_top']) != 'undefined')) { - top = parseInt($("#" + idElement).css('top').replace('px', '')); - left = parseInt($("#" + idElement).css('left').replace('px', '')); + top = parseInt($("#" + idElement) + .css('top').replace('px', '')); + left = parseInt($("#" + idElement) + .css('left').replace('px', '')); } else if ((typeof(values['absolute_left']) != 'undefined') && (typeof(values['absolute_top']) != 'undefined')) { From 931aa455e0aa8dd46fe5a4353dacf9aa76727cf9 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Tue, 25 Nov 2014 16:30:40 +0100 Subject: [PATCH 11/16] Working in the new elements for the visualmap. Ticket #1478 --- .../visual_console_builder.editor.js | 64 ++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index 7998cc6797..e10625ab34 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -463,7 +463,6 @@ function create_line(step, values) { $("#background *").css("cursor", "crosshair"); - $("#background *") .on('mousemove', function(e) { $('#div_step_1').css({ @@ -1322,6 +1321,34 @@ function getPercentileBubble(id_data, values) { return img; } +function get_image_url(img_src) { + var img_url= null; + var parameter = Array(); + parameter.push ({name: "page", value: "include/ajax/skins.ajax"}); + parameter.push ({name: "get_image_path", value: "1"}); + parameter.push ({name: "img_src", value: img_src}); + parameter.push ({name: "only_src", value: "1"}); + + var url_ajax = "ajax.php"; + if (metaconsole != 0) { + url_ajax = "../../ajax.php"; + } + + + jQuery.ajax ({ + type: 'POST', + url: url_ajax, + data: parameter, + async: false, + timeout: 10000, + success: function (data) { + img_url = data; + } + }); + + return img_url; +} + function getImageElement(id_data) { metaconsole = $("input[name='metaconsole']").val(); @@ -1653,6 +1680,41 @@ function insertDB(type, values) { "line_color": values['line_color']}; user_lines.push(line); + + // Draw handlers + radious_handle = 6; + + // Draw handler start + var img_src= get_image_url("images/dot_red.png"); + + item = $('
' + + + '' + + + '
' + ); + $("#background").append(item); + + // Draw handler stop + var img_src= get_image_url("images/dot_green.png"); + + item = $('
' + + + '' + + + '
' + ); + $("#background").append(item); break; } } From 35739261fb472f4d6ea65d5b73b5c82024538475 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Tue, 25 Nov 2014 18:55:45 +0100 Subject: [PATCH 12/16] Working in the new elements for the visualmap. Ticket #1478 --- .../visual_console_builder.editor.js | 114 +++++++++++++++++- 1 file changed, 109 insertions(+), 5 deletions(-) diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index e10625ab34..0b38df80ae 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -1732,7 +1732,19 @@ function updateDB_visual(type, idElement , values, event, top, left) { url_ajax = "../../ajax.php"; } + radious_handle = 6; + switch (type) { + case 'handler_start': + $("#handler_start_" + idElement) + .css('top', top + 'px'); + $("#handler_start_" + idElement) + .css('left', left + 'px'); + break; + case 'handler_end': + $("#handler_end_" + idElement).css('top', (top - radious_handle) + 'px'); + $("#handler_end_" + idElement).css('left', (left - radious_handle) + 'px'); + break; case 'group_item': case 'static_graph': if ((event != 'resizestop') && (event != 'show_grid') @@ -1905,6 +1917,16 @@ function updateDB(type, idElement , values, event) { //Force to move action when resize a background, for to avoid //lost the label. case 'dragstop': + + switch (type) { + case 'handler_start': + idElement = idElement.replace("handler_start_", ""); + break; + case 'handler_end': + idElement = idElement.replace("handler_end_", ""); + break; + } + action = "move"; break; } @@ -2011,11 +2033,10 @@ function updateDB(type, idElement , values, event) { data: parameter, type: "POST", dataType: 'text', - success: function (data) - { - updateDB_visual(type, idElement , values, event, top, left); - } - }); + success: function (data) { + updateDB_visual(type, idElement , values, event, top, left); + } + }); } } @@ -2356,6 +2377,89 @@ function eventsItems(drag) { updateDB(selectedItem, idItem, values, 'dragstop'); }); + + $('.item').bind('drag', function(event, ui) { + if ($(event.target).hasClass('handler_start')) { + selectedItem = 'handler_start'; + } + if ($(event.target).hasClass('handler_end')) { + selectedItem = 'handler_end'; + } + + var values = {}; + values['mov_left'] = ui.position.left; + values['mov_top'] = ui.position.top; + + switch (selectedItem) { + // -- line_item -- + case 'handler_start': + // --------------- + idElement = $(event.target).attr('id') + .replace("handler_end_", ""); + idElement = $(event.target).attr('id') + .replace("handler_start_", ""); + break; + // -- line_item -- + case 'handler_end': + // --------------- + idElement = $(event.target).attr('id') + .replace("handler_end_", ""); + idElement = $(event.target).attr('id') + .replace("handler_end_", ""); + break; + } + + switch (selectedItem) { + // -- line_item -- + case 'handler_start': + // --------------- + if ((typeof(values['mov_left']) != 'undefined') && + (typeof(values['mov_top']) != 'undefined')) { + var top = parseInt($("#handler_start_" + idElement) + .css('top').replace('px', '')); + var left = parseInt($("#handler_start_" + idElement) + .css('left').replace('px', '')); + } + else if ((typeof(values['absolute_left']) != 'undefined') && + (typeof(values['absolute_top']) != 'undefined')) { + var top = values['absolute_top']; + var left = values['absolute_left']; + } + + //Added the radious of image point of handler + top = top + 6; + left = left + 6; + + update_user_line('handler_start', idElement, top, left); + + draw_user_lines("", 0, 0, 0 , 0, 0, true); + break; + // -- line_item -- + case 'handler_end': + // --------------- + if ((typeof(values['mov_left']) != 'undefined') && + (typeof(values['mov_top']) != 'undefined')) { + top = parseInt($("#handler_end_" + idElement) + .css('top').replace('px', '')); + left = parseInt($("#handler_end_" + idElement) + .css('left').replace('px', '')); + } + else if ((typeof(values['absolute_left']) != 'undefined') && + (typeof(values['absolute_top']) != 'undefined')) { + top = values['absolute_top']; + left = values['absolute_left']; + } + + //Added the radious of image point of handler + top = top + 6; + left = left + 6; + + update_user_line('handler_end', idElement, top, left); + + draw_user_lines("", 0, 0, 0 , 0, 0, true); + break; + } + }); } /** From 0bc0fb1d7b96ff817183c88c15b7b6a1034bc62d Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Tue, 25 Nov 2014 18:59:05 +0100 Subject: [PATCH 13/16] Working in the new elements for the visualmap. Ticket #1478 --- .../reporting/visual_console_builder.editor.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index 0b38df80ae..1b00dac721 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -604,7 +604,18 @@ function toggle_item_palette() { item = selectedItem; toolbuttonActive = item; - activeToolboxButton(toolbuttonActive, true); + + switch (item) { + case 'handler_start': + case 'handler_end': + activeToolboxButton('line_item', true); + break; + default: + activeToolboxButton(toolbuttonActive, true); + break; + } + + $("#button_create_row").css('display', 'none'); $("#button_update_row").css('display', ''); cleanFields(); From 61ecef9ef900fa014d5a8712f2a85a180891f841 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 26 Nov 2014 15:33:07 +0100 Subject: [PATCH 14/16] Working in the new elements for the visualmap. Ticket #1478 --- .../visual_console_builder.editor.js | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index 1b00dac721..619d91df33 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -388,6 +388,21 @@ function create_button_palette_callback() { } } +function delete_user_line(idElement) { + var found = null; + + jQuery.each(user_lines, function(iterator, user_line) { + if (user_line['id'] == idElement) { + found = iterator; + return; + } + }); + + if (found != null) { + user_lines.splice(found, 1); + } +} + function update_user_line(type, idElement, top, left) { jQuery.each(user_lines, function(iterator, user_line) { @@ -2127,9 +2142,22 @@ function deleteDB(idElement) { lines.splice(i, 1); } }); + + if ($("#handler_start_" + idElement).length || + $("#handler_end_" + idElement).length) { + + // Line item + + $("#handler_start_" + idElement).remove(); + $("#handler_end_" + idElement).remove(); + + delete_user_line(idElement); + } + + refresh_lines(lines, 'background', true); - + draw_user_lines("", 0, 0, 0 , 0, 0, true); $('#' + idElement).remove(); activeToolboxButton('delete_item', false); From 352c63087c12ef387111ffb6c9e83f5628b8130f Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 26 Nov 2014 16:03:40 +0100 Subject: [PATCH 15/16] The last work for the new elements into the visualmap. Ticket #1478 --- .../visual_console_builder.elements.php | 38 +++++++++++++++--- pandora_console/images/box_item.disabled.png | Bin 282 -> 1253 bytes pandora_console/images/box_item.png | Bin 284 -> 1255 bytes pandora_console/images/line_item.disabled.png | Bin 343 -> 1411 bytes pandora_console/images/line_item.png | Bin 331 -> 1479 bytes 5 files changed, 32 insertions(+), 6 deletions(-) mode change 100755 => 100644 pandora_console/images/box_item.disabled.png mode change 100755 => 100644 pandora_console/images/box_item.png mode change 100755 => 100644 pandora_console/images/line_item.disabled.png mode change 100755 => 100644 pandora_console/images/line_item.png diff --git a/pandora_console/godmode/reporting/visual_console_builder.elements.php b/pandora_console/godmode/reporting/visual_console_builder.elements.php index 78ca646a47..822432dbc9 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.elements.php +++ b/pandora_console/godmode/reporting/visual_console_builder.elements.php @@ -147,6 +147,11 @@ foreach ($layoutDatas as $layoutData) { $table->data[$i + 1]['icon'] = html_print_image('images/box_item.png', true, array('title' => __('Box'))); break; + case LINE_ITEM: + $table->data[$i + 1]['icon'] = + html_print_image('images/line_item.png', true, + array('title' => __('Line'))); + break; default: if (enterprise_installed()) { $table->data[$i + 1]['icon'] = @@ -166,6 +171,7 @@ foreach ($layoutDatas as $layoutData) { switch ($layoutData['type']) { case ICON: case BOX_ITEM: + case LINE_ITEM: // hasn't the label. $table->data[$i + 1][0] = ''; break; @@ -196,18 +202,35 @@ foreach ($layoutDatas as $layoutData) { //Width and height - $table->data[$i + 1][2] = html_print_input_text('width_' . $idLayoutData, $layoutData['width'], '', 2, 5, true) . - 'x' . - html_print_input_text('height_' . $idLayoutData, $layoutData['height'], '', 2, 5, true); + switch ($layoutData['type']) { + case LINE_ITEM: + // hasn't the width and height. + $table->data[$i + 1][2] = ''; + break; + default: + $table->data[$i + 1][2] = html_print_input_text('width_' . $idLayoutData, $layoutData['width'], '', 2, 5, true) . + 'x' . + html_print_input_text('height_' . $idLayoutData, $layoutData['height'], '', 2, 5, true); + break; + } //Position - $table->data[$i + 1][3] = '(' . html_print_input_text('left_' . $idLayoutData, $layoutData['pos_x'], '', 2, 5, true) . - ',' . html_print_input_text('top_' . $idLayoutData, $layoutData['pos_y'], '', 2, 5, true) . - ')'; + switch ($layoutData['type']) { + case LINE_ITEM: + // hasn't the width and height. + $table->data[$i + 1][3] = ''; + break; + default: + $table->data[$i + 1][3] = '(' . html_print_input_text('left_' . $idLayoutData, $layoutData['pos_x'], '', 2, 5, true) . + ',' . html_print_input_text('top_' . $idLayoutData, $layoutData['pos_y'], '', 2, 5, true) . + ')'; + break; + } //Parent switch ($layoutData['type']) { case BOX_ITEM: + case LINE_ITEM: $table->data[$i + 1][4] = ""; break; default: @@ -238,6 +261,7 @@ foreach ($layoutDatas as $layoutData) { case BOX_ITEM: case ICON: case LABEL: + case LINE_ITEM: $table->data[$i + 2][0] = ''; break; default: @@ -288,6 +312,7 @@ foreach ($layoutDatas as $layoutData) { case ICON: case LABEL: case BOX_ITEM: + case LINE_ITEM: $table->data[$i + 2][1] = ''; break; default: @@ -349,6 +374,7 @@ foreach ($layoutDatas as $layoutData) { //Map linked switch ($layoutData['type']) { + case LINE_ITEM: case BOX_ITEM: $table->data[$i + 2][4] = ""; break; diff --git a/pandora_console/images/box_item.disabled.png b/pandora_console/images/box_item.disabled.png old mode 100755 new mode 100644 index 4701027fe3cd973882c1dd5f9da7ccd038e7178b..85271da99ef88cfe7b1b7637dfb3dff1852b58fc GIT binary patch literal 1253 zcmaJ>ZD<>19KSTP_Qk9jLhMS}9*uL${b>H)_1r4HZ>xMMc-=zytm{3tX)366+z488lo6%>d< z3_ToV306(QvUq4xgF}zlu5hU1pP%D}y3{yEK zy%o!{VrbbgR0_u{l?qnzV~RF{laWXSCw#ci=d}=CeL^-k(<|#;H3bIhye6uKsK~%p zk#H!PNF~Fmcrug@F{v7tQTTBQ%0`VVJm7}wa_wc1 zR4XzAHSs7E(wZWH&7vu>elCH!dRttfelEefT--_qw@3T0QP*77{@BOu#kGv>)rYdR z@0zvPM}9lK*ScGWGfX^hep6cC*cfoO&>rN{nf4n<>vC@uDXkLDC+Vjf-E`5JeWTyy zi7(E*J+@=l;^N}TwPUA+*iyEAFQ}^2@$Wx7$M(`E4y2d=63lDO(ProEJC6Cw z4X1K+_QUe8jfHvQ`hLd~H)qd&HMjcb?NfKJJ${{jz4Q9gQs;#0xq2-<~jv*e$-%i`e$)YIWy8n3FwG{7UO|vB7sD{!G3CS58 z#Run|-gr=L_36SN&J!!o{BK^Ikap%8H~))zh5Fk+9kOe!Rg!yl>~V0Zad$Z~y=-dG zvm2pajy-}~!&(H|L`u&wGE51wcJb<*A{3Q<*!sl=-ws>lG`Dk-*KSo_e!5paYDaV_ z%l+H460b7;T;_N3$sIXC-mO`-6SzNpu>1LD%0hvSc0%^-mCPxzmG{rTtuO+*nZeW5 K&t;ucLK6TrIBB~8 diff --git a/pandora_console/images/box_item.png b/pandora_console/images/box_item.png old mode 100755 new mode 100644 index b3bdbefe9b49810e7c252e56b42311309014796c..50b9615f8adc23085d5c74d59c728cc586429dc6 GIT binary patch literal 1255 zcmeAS@N?(olHy`uVBq!ia0vp^k|4~%#=yY1`Q6s9AWn&EL`iUdT1k0gQ7VIDN`6wR zf@f}GdTLN=VoGJ<$y6H#24v4 zq}24xJX@vryZ0+8WTx0Eg`4^s_!c;)W@LI)6{QAO`Gq7`WhYyvDB0U7*i={n4aiL` zNmQuF&B-gas<2f8n`;GRgM{^!6u?SKvTcwn`Gtf;oFf&vzGto0N zF|ahT)KM@pFf`CNG}1RP*EKY-GBvj{FjRm7C7^9ZDQQ+gE^bh}fIM5JjFOT9D}DX) z@^Za$W4-*MbbUihOG|wNBYh(yU7!lx;>x^|#0uTKVr7^KE~&-IMVSR9nfZANAQKal z@=Hr>m4GgVcp+top^2{qPNz6-5^>ndS0-B+hnVDi`VPI)#U}R`uW@%|*Xy|HU>1Jl(XyE2( zX=Z3@;biOx)9aF-T$-DjR|3NYTMMS8k8hE&{2`t$$4Ju{bs7{kVy5*HY_cWE^+Bpoqe)^-SF6L1h<4zp?L zP`G#^%&h4oN2QyHo!wjp#+J*PIz8I*f7_)Q8NWHaX*hn+U^8duL0gWgM>jApU(LYO zabiO90U>9F)nPU{2UZKH@bgNDt(c%JV6Twyk5PhIjDLYckixZ61K+PKPU2|=wl^6W z1sqhela#Kq6|8U!=2KEUbcsRgfBg;_<*Y|X!w6f8)uEc9{$;5|xqD=X`0O#5S?n&S@W`?xxot zPrP?O-~ZrCR}QC81j7;TjUuAl6S~=TKD9dNFdX^lFsH$EhlHf$N;w~c%`+ulFhp!v zVt!?Vn&^UKvdVXBjP^Wcnb@NIL|);f_JYu~7oXT7CK;Tw@N5uU!)bBk`{N1kk1L*Y cn4ZMSaDnmCwWZN&nxLY`)78&qol`;+03v9gTmS$7 delta 265 zcmV+k0rvjq37i6u9De}B>4jqe000JJOGiWi{{a60|De66lK=n!32;bRa{vGf6951U z69E94oEQKA00(qQO+^RZ3l$4G9LWkSlmGw#sYygZR7l6|mOBo@Fc3uFkTewBfxA$` zQMg_zL@tm+q(ew_p`bu`DTpJ2J7Px&c}iQ_r=1;tWM-t+f`1wGKaet5k){vHOrw&) zJ{VKNAfb=CBfDJJrm@R)Eu0Q;J7dj0Z0!p@j#~hVP4$9kwZ@7i+^^9)@UT)+KPy9* z2B^}d%hkK6nf6u P0000eM}p57{0bE?LZieC?Ae-xw5fD=-u^`Ug+re+PPxWHjV{{y|xD}aJ_oHj=}<# zO<)Z(DJGgBphbxp84?FG0YBL?5^#&iOg5v55i*S$gU&#vn+aZlGXG#+a=G98=6#;` zc|YzKvsE9-OfO6a03g$1HrUy3LGl%*0RU%m<-@h4!5C{82UX9s;4}efy_A~(EhOGR z*a_U*`qDg62>`qjzq5v^u^z)b6e-4&G2#drWYGXnSrrN5o+g3;-9&>wpoV_`_;U#K zd)3f!xfQVn^@PuFZleiDTeZ{E*5pxnp{m1RWdvghNP@w^2-zG6VG%X7!Hcoyq#K67 zjS!|u4Q-05vD!dAMH8T0jFfv21qv!;VpN8xWU4Yyf}jYDN?=4;jv|;`i6JPs^+0Sk z+FOs=4W_MJtfhv03=_m)xTU2<+#(fIbOVg4R4N#ez!FJ08&Mu=4KR45JP;D47z{+n zL;Hh_p9+9UM%+z>88yTz-7J9&Zqo)rTWw++21oE9jEa$DNvS}q_5VXjayvT2*ojAa zcO(uuTZ05_Cqh)1_OOGi7bQ~#F+EM-3`ILBsyWp~n~!3skdF$2dWT$$f>zw)4l>0`0UWgvrWW&=U{PZ3@dO_AV6(U^Y+Ehd@KC}*dyFjN?K*0PE9?x1B0 z%hvH2EX<05lcW95s8cR>f0D=T#bu4{)h7b%zSHbtn~f04{#$DngVq`O*8R`=dKFLN z;^s7bIoP@|Hz&;L9Ia@7uzEUsAm?O;1{fA1oV7yW-pf-RiO<&azW})BIQ={aCs%N3 z*EDA?Pc!lJ*;p(F)(ruiSC$k{Jd9$6@!1RU^Q!1rCqMRS@kL;z_Jb^k!x6u~Pdm26#73*_qe*bB*)q!YBZp$jzO9-ZjbjwSza-*!Nn2d9h

g_m@SAugDGYzlPq_8XZ<#n6V_xF#ucGfn679DDAu?evJMqh&+Ky{!nnnJN z<0BV(mveoeJgs@Q&UU3eS~w1j+!oE=E4*=(1X6&#Ty57Zy>nk zIYFYkMAy#jcfN{`z(?)rho+)a#lA)EMWWj_+5s((71tJ;c8gs<@w-j~Pu}`E&6T$2 zdO@izZ}$vTG`(u-eTH+lLVu@6S)I7|C+BVH@av^z`3w5Vk9gvC!;f{oy(>qS7X;J$ i8~Z_f_^??bdY`>YE6z!VzC)wQYtdq?HjL|BXZ{7k2;v6- delta 324 zcmV-K0lWT#3)cdW9De}B>4jqe000JJOGiWi{{a60|De66lK=n!32;bRa{vGf6951U z69E94oEQKA00(qQO+^RZ3l$77JCmSi@Bjb+5AP`0W02i{6&V$*Q ziHEYM^H4BbXa)V9NfQa65 ztHOIiSK zk<;0>EkX!u7Cr6KT2r&C*eAaLo^uNSACR`v4 zq}24xJX@vryZ0+8WTx0Eg`4^s_!c;)W@LI)6{QAO`Gq7`WhYyvDB0U7*i={n4aiL` zNmQuF&B-gas<2f8n`;GRgM{^!6u?SKvTcwn`Gtf;oFf&vzGto0N zF|ahT)KM@pFf`CNG}1RP*EKY-GBvj{FjRm7C7^9ZDQQ+gE^bh}fIM5JjFOT9D}DX) z@^Za$W4-*MbbUihOG|wNBYh(yU7!lx;>x^|#0uTKVr7^KE~&-IMVSR9nfZANAQKal z@=Hr>m4GgVcp+top^2{qPNz6-5^>ndS0-B+hnVDkcVqtFV;^b;-=4@bYXy|I<8Iua(|ZvxVTlbLf2IMkUNs*a-B)QA%jU- z+^rna&t#AxwjipLC14Kwrplv-nckR91bVU~#n&f=)zpgNCvykyhE=YobQJvGx%)49 zAvIy{7lt``4L92@>|IW1Go5r%u=BT=^5(7M!@K;#JktfzBYr+o-F3?;LB+3O3PU@e zZ^JVVca1a+z7>fU3!evaJe6-)bx_tTVZQ^@BO5*c#Y`TBjGL}DEUH*gdx?R=;L|3( zosn}TPB$cOl<(m7Fcm+l{vb$x5({g?4<-XQI|tryhM?CIlhO{Z3SBMSdDiBJP9cNQ zcjs2S24PWyUk6*YLS!-+l{GD=aC%o+F&yc+P@}|fPWyn+?~Pq+8FvOYC30>kGGcgC zx4@Nq!8FOHBmLg5z6qDu2FQEZ|GSc!&(HOpA&0F&Yq^S|hi|j0^WtXS13Ypa)_w|l zLJVnd_+KnFxAAMLvU6w_l1qQ_>%(!*B_%%_uFsut>axHoYkpl9nSz(fTHl=}7uXBc p+uisoaGGV|(Oc~YCrf6sGI)fy%$|EdE*Vs`db;|#taD0e0suOX1wjA+ delta 312 zcmV-80muHw3(EqK9De}B>4jqe000JJOGiWi{{a60|De66lK=n!32;bRa{vGf6951U z69E94oEQKA00(qQO+^RZ3l$779@wO_w*UYD*hxe|R7l6|RzVVjAPn41^0OZM-X8lO z|6qk4MC%CR#5$HkGm{HSHk%Cr!f7!^?-mFyunZ&u)l^Bg$$!L3iyZ(>A1Bw8k&JZq zgxd!}*8!@4*~e7@kYg%erNj8@d#(kih+{Vc@cxT%{rrk`@!AB1jB@ zhczIxpmNrHYB6sL|3TWkPjGT~S@tj>vrEVQ*!V@c7{AQA8R6euoh;o2z0C0d0000< KMNUMnLSTXl&4IrF From e98a2fa535ec07da16aec7d05ae0c70da8da49ea Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 26 Nov 2014 16:12:22 +0100 Subject: [PATCH 16/16] Change the pandoradb_data.sql for to avoid the conflict in the merge with develop. --- pandora_console/pandoradb_data.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 92dadb9d91..8cd266a6e9 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -38,7 +38,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES ('graph_res','5'), ('step_compact','1'), ('db_scheme_version','6.0dev'), -('db_scheme_build','PD141119'), +('db_scheme_build','PD141126'), ('show_unknown','0'), ('show_lastalerts','1'), ('style','pandora'),