Jul 9th, 2011, 3:26 PM
Hi,
I find this application so interesting that I am preparing a site to manage audit results.
I had placed a question in the past about the possibility of form tools perform basic calculations, but I have already exceeded this question using JavaScript in the form.
I go back to contact with some doubts, questions and a bug (I think):
1 - question about the html export
my goal is to use this function to create the audit report (pdf printer). This report, in addition of presenting the results of each audit, also presents a chart that analyzes 3 results. I prepared the export template to create a graph (using the google graph api). So far so good.
My doubt is that I need the script that creates the chart, get in database values corresponding to 3 specific columns. For more than I read the Smarty template documentation I can’t write the code to perform this. (I hope it was explicit enough)
my example:
I want to replace the data.setvalue of "100" for the value of a particular column of the database. Is it possible to help me?
2 - A simpler question. The link at the top of page for updates is very useful, but I would that only appear with the administrator user. It is possible to hide this link for final customer accounts?
3 - What seems to be a bug. Whenever I want to add a new export type to export group (eg html - print) the link takes me the page to create new group and not to a new export type.
Thanks in advance
Rui
I find this application so interesting that I am preparing a site to manage audit results.
I had placed a question in the past about the possibility of form tools perform basic calculations, but I have already exceeded this question using JavaScript in the form.
I go back to contact with some doubts, questions and a bug (I think):
1 - question about the html export
my goal is to use this function to create the audit report (pdf printer). This report, in addition of presenting the results of each audit, also presents a chart that analyzes 3 results. I prepared the export template to create a graph (using the google graph api). So far so good.
My doubt is that I need the script that creates the chart, get in database values corresponding to 3 specific columns. For more than I read the Smarty template documentation I can’t write the code to perform this. (I hope it was explicit enough)
my example:
Code:
<html>
<head>
<title>{$export_group_name}</title>
{* escape the CSS so it doesn't confuse Smarty *}
{literal}
<style type="text/css">
body { margin: 0px; }
table, td, tr, div, span {
font-family: verdana; font-size: 8pt;
}
table { empty-cells: show }
#nav_row { background-color: #efefef; padding: 10px; }
#export_group_name { color: #336699; font-weight:bold }
.print_table { border: 1px solid #dddddd; }
.print_table th {
border: 1px solid #cccccc;
background-color: #efefef;
text-align: left;
}
.print_table td { border: 1px solid #cccccc; }
.one_item { margin-bottom: 15px; }
.page_break { page-break-after: always; }
</style>
<style type="text/css" media="print">
.no_print { display: none }
</style>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load('visualization', '1', {'packages':['corechart']});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Periodo');
data.addColumn('number', 'A1');
data.addColumn('number', 'A2');
data.addColumn('number', 'A3');
data.addRows(3);
data.setValue(0, 0, 'Grupo A');
data.setValue(0, 1, 100);
data.setValue(0, 2, 100);
data.setValue(0, 3, 100);
data.setValue(1, 0, 'Grupo B');
data.setValue(1, 1, 100);
data.setValue(1, 2, 100);
data.setValue(1, 3, 100);
data.setValue(2, 0, 'Grupo C');
data.setValue(2, 1, 100);
data.setValue(2, 2, 100);
data.setValue(2, 3, 100);
var chart = new google.visualization.ColumnChart(document.getElementById('chart_div'));
chart.draw(data, {width: 400, height: 240, vAxis: {maxValue: 10}});
}
</script>
{/literal}
</head>
<body>
<div id="nav_row" class="no_print">
<span style="float:right">
{* if there's more than one export type in this group, display the types in a dropdown *}
{if $export_types|@count > 1}
<select name="export_type_id" onchange="window.location='{$same_page}?export_group_id={$export_group_id}&export_group_{$export_group_id}_results={$export_group_results}&export_type_id=' + this.value">
{foreach from=$export_types item=export_type}
<option value="{$export_type.export_type_id}" {if $export_type.export_type_id == $export_type_id}selected{/if}>{eval var=$export_type.export_type_name}</option>
{/foreach}
</select>
{/if}
<input type="button" onclick="window.close()" value="{$LANG.word_close|upper}" />
<input type="button" onclick="window.print()" value="{$LANG.word_print|upper}" />
</span>
<span id="export_group_name">{eval var=$export_group_name}</span>
</div>
<div style="padding: 15px">
{$export_type_smarty_template}
</div>
</body>
</html>
I want to replace the data.setvalue of "100" for the value of a particular column of the database. Is it possible to help me?
2 - A simpler question. The link at the top of page for updates is very useful, but I would that only appear with the administrator user. It is possible to hide this link for final customer accounts?
3 - What seems to be a bug. Whenever I want to add a new export type to export group (eg html - print) the link takes me the page to create new group and not to a new export type.
Thanks in advance
Rui