Skip to content

Commit

Permalink
Show only graph template templates in dropdown
Browse files Browse the repository at this point in the history
Dropdown was showing data query based graph templates which is not valid
  • Loading branch information
cigamit committed Nov 7, 2015
1 parent cf7d472 commit b964174
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions host_templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,14 @@ function template_edit() {
</td>
<td>
<?php form_dropdown('graph_template_id',db_fetch_assoc_prepared('SELECT
graph_templates.id,
graph_templates.name
FROM graph_templates LEFT JOIN host_template_graph
ON (graph_templates.id = host_template_graph.graph_template_id AND host_template_graph.host_template_id = ?)
WHERE host_template_graph.host_template_id is null
ORDER BY graph_templates.name', array(get_request_var_request('id'))),'name','id','','','');?>
gt.id, gt.name
FROM graph_templates AS gt
LEFT JOIN host_template_graph AS htg
ON gt.id=htg.graph_template_id
AND htg.host_template_id = ?
WHERE htg.host_template_id IS NULL
AND gt.id NOT IN (SELECT graph_template_id FROM snmp_query_graph)
ORDER BY gt.name', array(get_request_var_request('id'))),'name','id','','','');?>
</td>
<td>
<input type='submit' value='Add' name='add_gt_x' title='Add Graph Template to Device Template'>
Expand Down

0 comments on commit b964174

Please sign in to comment.