forked from science-ation/science-ation
- Use the report generator dialog all the time
This commit is contained in:
parent
3bead26bf8
commit
ba808050d0
@ -175,8 +175,12 @@ function save_report()
|
|||||||
|
|
||||||
function add_report()
|
function add_report()
|
||||||
{
|
{
|
||||||
var reports_id = $('#report').val();
|
edit_report(-1, $('#report').val());
|
||||||
edit_report(-1, reports_id);
|
}
|
||||||
|
|
||||||
|
function gen_report()
|
||||||
|
{
|
||||||
|
report_gen($('#report').val());
|
||||||
}
|
}
|
||||||
|
|
||||||
var edit=false;
|
var edit=false;
|
||||||
@ -255,14 +259,12 @@ $(document).ready(function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($i->reports_id > 0) {
|
if($i->reports_id > 0) {
|
||||||
$name = $i->name;
|
// $url = "admin/reports_gen.php?id={$i->reports_id}&show_options=1";
|
||||||
$url = "admin/reports_gen.php?id={$i->reports_id}&show_options=1";
|
$name = "<a href=\"#\" onclick=\"report_gen({$i->reports_id}); return false\">{$i->name}</a>";
|
||||||
} else {
|
} else {
|
||||||
$name = $report_custom[-$i->reports_id]['name'];
|
$name = "<a href=\"{$config['SFIABDIRECTORY']}/{$report_custom[-$i->reports_id]['custom_url']}\">
|
||||||
$url = $report_custom[-$i->reports_id]['custom_url'];
|
{$report_custom[-$i->reports_id]['name']}</a>";
|
||||||
}
|
}
|
||||||
$name = "<a href=\"{$config['SFIABDIRECTORY']}/$url\">$name</a>";
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<tr id="report_tr_<?=$i->id?>">
|
<tr id="report_tr_<?=$i->id?>">
|
||||||
<td style="border:0px;"><?=$name?></td>
|
<td style="border:0px;"><?=$name?></td>
|
||||||
@ -315,8 +317,7 @@ $(document).ready(function() {
|
|||||||
<hr />
|
<hr />
|
||||||
<h4><?=i18n("All Reports")?></h3>
|
<h4><?=i18n("All Reports")?></h3>
|
||||||
|
|
||||||
<form method="get" name="reportgen" action="reports_gen.php">
|
<form name="reportgen" >
|
||||||
<input type="hidden" name="show_options" value="1" />
|
|
||||||
<select name="id" id="report">
|
<select name="id" id="report">
|
||||||
<option value="0"><?=i18n("Select a Report")?></option>
|
<option value="0"><?=i18n("Select a Report")?></option>
|
||||||
<?
|
<?
|
||||||
@ -325,7 +326,7 @@ foreach($reports as $r) {
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</select><br />
|
</select><br />
|
||||||
<input type="submit" value="<?=i18n("Generate Report")?>">
|
<input type="submit" onclick="gen_report();return false;" value="<?=i18n("Generate Report")?>">
|
||||||
<input type="submit" onclick="add_report();return false;" value="<?=i18n("Add this Report to my list")?>">
|
<input type="submit" onclick="add_report();return false;" value="<?=i18n("Add this Report to my list")?>">
|
||||||
</form>
|
</form>
|
||||||
<br />
|
<br />
|
||||||
|
@ -121,38 +121,31 @@ case 'dialog_gen':
|
|||||||
echo "</select></td></tr>";
|
echo "</select></td></tr>";
|
||||||
?>
|
?>
|
||||||
</table>
|
</table>
|
||||||
<br />
|
|
||||||
<hr />
|
|
||||||
<div align="right">
|
|
||||||
<input type="submit" id="report_dialog_gen_pdf_button" value="<?=i18n('Download PDF')?>" />
|
|
||||||
<input type="submit" id="report_dialog_gen_cancel_button" value="<?=i18n('Cancel')?>" />
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$("#report_dialog_gen_pdf_button").click(function () {
|
|
||||||
var dlargs = $('#report_dialog_form').serialize()+"<?=$filter_args?>";
|
|
||||||
var dlurl = "<?=$config['SFIABDIRECTORY']?>/admin/reports_gen.php?"+dlargs;
|
|
||||||
// alert(dlurl);
|
|
||||||
// $('#content').attr('src',dlurl);
|
|
||||||
window.location.href=dlurl;
|
|
||||||
$('#report_dialog_gen').dialog("close");
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
$("#report_dialog_gen_cancel_button").click(function () {
|
|
||||||
$('#report_dialog_gen').dialog("close");
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#report_dialog_gen").dialog({
|
$("#report_dialog_gen").dialog({
|
||||||
bgiframe: true, autoOpen: true,
|
bgiframe: true, autoOpen: true,
|
||||||
modal: true, resizable: false,
|
modal: true, resizable: false,
|
||||||
draggable: false,
|
draggable: false,
|
||||||
width: 800, //(document.documentElement.clientWidth * 0.8);
|
width: 800, //(document.documentElement.clientWidth * 0.8);
|
||||||
height: (document.documentElement.clientHeight * 0.5),
|
height: 600, //(document.documentElement.clientHeight * 0.7),
|
||||||
close: function() {
|
close: function() {
|
||||||
$(this).dialog('destroy');
|
$(this).dialog('destroy');
|
||||||
$('#report_dialog_gen').remove();
|
$('#report_dialog_gen').remove();
|
||||||
}
|
},
|
||||||
|
buttons: { "<?=i18n("Cancel")?>": function() {
|
||||||
|
$('#report_dialog_gen').dialog("close");
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
"<?=i18n("Download PDF")?>": function() {
|
||||||
|
var dlargs = $('#report_dialog_form').serialize()+"<?=$filter_args?>";
|
||||||
|
var dlurl = "<?=$config['SFIABDIRECTORY']?>/admin/reports_gen.php?"+dlargs;
|
||||||
|
// alert(dlurl);
|
||||||
|
// $('#content').attr('src',dlurl);
|
||||||
|
window.location.href=dlurl;
|
||||||
|
$('#report_dialog_gen').dialog("close");
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -62,6 +62,12 @@ function notice_(str)
|
|||||||
notice_create('notice',str,-1);
|
notice_create('notice',str,-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function report_gen(id)
|
||||||
|
{
|
||||||
|
var args="id="+id+"&action=dialog_gen";
|
||||||
|
$("#debug").load("reports_gen.php?"+args);
|
||||||
|
}
|
||||||
|
|
||||||
/* Stuff to do after the document loads */
|
/* Stuff to do after the document loads */
|
||||||
$(document).ready(function()
|
$(document).ready(function()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user