Added custom graph selection in item list Tickets #3664

This commit is contained in:
fermin831 2016-05-17 13:56:23 +02:00
parent 0fa6369733
commit 8a4d627ca6
2 changed files with 20 additions and 9 deletions

View File

@ -74,11 +74,11 @@ $table->class = 'databox data';
$table->head = array();
$table->head['icon'] = '';
$table->head[0] = __('Label') . ' / ' . __('Agent') . ' / ' . __('Group');
$table->head[1] = __('Image') . ' / ' . __('Module');
$table->head[0] = __('Label') . '<br>' . __('Agent') . ' / ' . __('Group');
$table->head[1] = __('Image') . '<br>' . __('Module') . ' / ' . __('Custom graph');
$table->head[2] = __('Width x Height<br>Max value');
$table->head[3] = __('Period') . ' / ' . __('Position');
$table->head[4] = __('Parent') . ' / ' . __('Map linked');
$table->head[3] = __('Position') . '<br>' . __('Period');
$table->head[4] = __('Parent') . '<br>' . __('Map linked');
$table->head[5] = "";
$table->head[5] .= '&nbsp;&nbsp;&nbsp;' . html_print_checkbox('head_multiple_delete',
'', false, true, false, 'toggle_checkbox_multiple_delete();');
@ -373,7 +373,11 @@ foreach ($layoutDatas as $layoutData) {
$params['value'] = agents_get_name($layoutData['id_agent']);
}
$table->data[$i + 2][0] = ui_print_agent_autocomplete_input($params);
if ($layoutData['id_agent'] == 0 and $layoutData['id_custom_graph'] != 0) {
$table->data[$i + 2][0] = __("Custom graph");
} else {
$table->data[$i + 2][0] = ui_print_agent_autocomplete_input($params);
}
}
else {
$table->data[$i + 2][0] = $cell_content_enterprise;
@ -416,10 +420,16 @@ foreach ($layoutDatas as $layoutData) {
$modules = io_safe_output($modules);
$table->data[$i + 2][1] = html_print_select($modules,
'module_' . $idLayoutData,
$layoutData['id_agente_modulo'], '', '---', 0, true,
false, true, '', false, "width: 120px");
if ($layoutData['id_agent'] == 0 and $layoutData['id_custom_graph'] != 0) {
$table->data[$i + 2][1] = html_print_select_from_sql(
"SELECT id_graph, name FROM tgraph", 'custom_graph_' . $idLayoutData,
$layoutData['id_custom_graph'], '', __('None'), 0, true);
} else {
$table->data[$i + 2][1] = html_print_select($modules,
'module_' . $idLayoutData,
$layoutData['id_agente_modulo'], '', '---', 0, true,
false, true, '', false, "width: 120px");
}
}
else {
$table->data[$i + 2][1] = $cell_content_enterprise;

View File

@ -353,6 +353,7 @@ switch ($activeTab) {
$values['id_agent'] = agents_get_agent_id($agentName);
}
$values['id_agente_modulo'] = get_parameter('module_' . $id, 0);
$values['id_custom_graph'] = get_parameter('custom_graph_' . $id, 0);
$values['parent_item'] = get_parameter('parent_' . $id, 0);
$values['id_layout_linked'] = get_parameter('map_linked_' . $id, 0);