diff --git a/graph_templates_items.php b/graph_templates_items.php index af68f07999..9784099b31 100644 --- a/graph_templates_items.php +++ b/graph_templates_items.php @@ -167,7 +167,7 @@ function form_save() { if (!isset($orig_data_source_to_input{$save['task_item_id']})) { $ds_name = db_fetch_cell_prepared('SELECT data_source_name FROM data_template_rrd WHERE id = ?', array($_POST['task_item_id'])); - db_execute_prepared("REPLACE INTO graph_template_input (hash, graph_template_id, name, column_name) VALUES (?, ?, ?, 'task_item_id')", array(get_hash_graph_template(0, 'graph_template_input'), $save['graph_template_id'], 'Data Source [$ds_name]')); + db_execute_prepared("REPLACE INTO graph_template_input (hash, graph_template_id, name, column_name) VALUES (?, ?, ?, 'task_item_id')", array(get_hash_graph_template(0, 'graph_template_input'), $save['graph_template_id'], "Data Source [$ds_name]")); $graph_template_input_id = db_fetch_insert_id(); @@ -294,12 +294,12 @@ function item_edit() { input_validate_input_number(get_request_var_request('graph_template_id')); /* ==================================================== */ + print "
\n"; + $header_label = '[edit graph: ' . db_fetch_cell_prepared('SELECT name FROM graph_templates WHERE id = ?', array($_REQUEST['graph_template_id'])) . ']'; html_start_box('Graph Template Items ' . htmlspecialchars($header_label), '100%', '', '3', 'center', ''); - print "\n"; - if (!empty($_REQUEST['id'])) { $template_item = db_fetch_row_prepared('SELECT * FROM graph_templates_item WHERE id = ?', array($_REQUEST['id'])); } @@ -348,9 +348,9 @@ function item_edit() { GROUP BY graph_template_input.column_name', array($_REQUEST['graph_template_id'], $_REQUEST['id'])); if (sizeof($graph_item_input_fields) > 0) { - foreach ($graph_item_input_fields as $field) { - $form_array{$field['column_name']}['friendly_name'] .= " [Field Not Templated]"; - } + foreach ($graph_item_input_fields as $field) { + $form_array{$field['column_name']}['friendly_name'] .= " [Field Not Templated]"; + } } } @@ -390,6 +390,13 @@ function item_edit() { graph_type_ids - 1 - Comment 2 - HRule 3 - Vrule 4 - Line1 5 - Line2 6 - Line3 7 - Area 8 - Stack 9 - Gprint 10 - Legend */ + function changeColorId() { + $('#alpha').prop('disabled', true); + if ($('#color_id').val() != 0) { + $('#alpha').prop('disabled', false); + } + } + function setRowVisibility() { switch($('#graph_type_id').val()) { case "1": @@ -454,10 +461,7 @@ function setRowVisibility() { break; } - $('#alpha').prop('disabled', true); - if ($('#color_id').val() != 0) { - $('#alpha').prop('disabled', false); - } + changeColorId(); }