forked from science-ation/science-ation
- Rework the My Reports editor. with jquery it's 200 lines shorter now. :P
This commit is contained in:
parent
9b1ea927e6
commit
aadf84754a
@ -23,117 +23,212 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
require_once("../common.inc.php");
|
||||
require_once("../user.inc.php");
|
||||
require_once("reports.inc.php");
|
||||
require_once('../common.inc.php');
|
||||
require_once('../user.inc.php');
|
||||
require_once('reports.inc.php');
|
||||
|
||||
user_auth_required('committee');
|
||||
|
||||
|
||||
/* Load the user's volunteer position selections */
|
||||
$option_keys = array('type','stock');
|
||||
|
||||
$edit_mode = array_key_exists('edit', $_GET);
|
||||
|
||||
$action = $_GET['action'];
|
||||
if($action=='') $action = $_POST['action'];
|
||||
|
||||
if($action == 'unlink') {
|
||||
switch($_GET['action']) {
|
||||
case 'remove_report':
|
||||
$id = intval($_GET['id']);
|
||||
mysql_query("DELETE FROM reports_committee WHERE
|
||||
users_id='{$_SESSION['users_uid']}' AND id='$id'");
|
||||
$_SESSION['messages'][] = 'unlinked';
|
||||
header("Location: reports.php?edit=1");
|
||||
happy_('Report successfully removed');
|
||||
exit;
|
||||
}
|
||||
|
||||
$reports_id = 0;
|
||||
if($action == 'reload') {
|
||||
case 'reload':
|
||||
$edit_mode = true;
|
||||
$reports_id = intval($_POST['reports_id']);
|
||||
}
|
||||
exit;
|
||||
|
||||
if($action == 'add') {
|
||||
case 'load_report':
|
||||
$id = intval($_GET['id']);
|
||||
|
||||
/* Load report */
|
||||
if($id == -1) {
|
||||
$reports_id = intval($_GET['reports_id']);
|
||||
$report = report_load($reports_id);
|
||||
|
||||
$ret['id'] = -1;
|
||||
$ret['reports_id'] = $reports_id;
|
||||
$ret['type'] = $report['option']['type'];
|
||||
$ret['stock'] = $report['option']['stock'];
|
||||
$ret['comment'] = $report['desc'];
|
||||
$ret['category'] = '';
|
||||
} else {
|
||||
$q = mysql_query("SELECT * FROM reports_committee WHERE id='$id'");
|
||||
$ret = mysql_fetch_assoc($q);
|
||||
$ret['type'] = $ret['format'];
|
||||
}
|
||||
|
||||
/* Load available categories */
|
||||
$q = mysql_query("SELECT DISTINCT category FROM reports_committee
|
||||
WHERE users_id='{$_SESSION['users_uid']}'
|
||||
ORDER BY category");
|
||||
while($i = mysql_fetch_object($q))
|
||||
$ret['cat'][] = $i->category;
|
||||
echo json_encode($ret);
|
||||
exit;
|
||||
|
||||
case 'save':
|
||||
echo "POST: ";
|
||||
print_r($_POST);
|
||||
$id = intval($_POST['id']);
|
||||
$reports_id = intval($_POST['reports_id']);
|
||||
/* reports_id might be < 0, that's ok */
|
||||
if($id == -1) {
|
||||
/* New entry */
|
||||
mysql_query("INSERT INTO `reports_committee` (`users_id`,`reports_id`)
|
||||
VALUES('{$_SESSION['users_uid']}','$reports_id');");
|
||||
echo mysql_error();
|
||||
$id = mysql_insert_id();
|
||||
}
|
||||
|
||||
/* Update entry */
|
||||
$category = $_POST['category'];
|
||||
$category_exist = $_POST['category_exist'];
|
||||
$comment = mysql_escape_string(stripslashes($_POST['comment']));
|
||||
$comment = mysql_real_escape_string(stripslashes($_POST['comment']));
|
||||
|
||||
if($category_exist != '') $category = $category_exist;
|
||||
$category = mysql_escape_string(stripslashes(trim($category)));
|
||||
$category = mysql_real_escape_string(stripslashes(trim($category)));
|
||||
|
||||
if($category == '') $category = 'default';
|
||||
|
||||
if($category == '') {
|
||||
$_SESSION['messages'][] = 'nocategory';
|
||||
header("Location: reports.php?edit=1");
|
||||
exit;
|
||||
}
|
||||
|
||||
if($reports_id > 0) {
|
||||
/* SFIAB report */
|
||||
$type = $_POST['type'];
|
||||
$stock = $_POST['stock'];
|
||||
if(!array_key_exists($type, $report_options['type']['values'])) {
|
||||
echo "Invalid format: type=$type";
|
||||
error_("Invalid format: type=$type");
|
||||
exit;
|
||||
}
|
||||
if(!array_key_exists($stock, $report_stock)) {
|
||||
echo "Invalid stock: stock=$stock";
|
||||
error_("Invalid stock: stock=$stock");
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
/* Old custom */
|
||||
$type = '';
|
||||
$stock = '';
|
||||
}
|
||||
|
||||
mysql_query("INSERT INTO `reports_committee`
|
||||
(`id`, `users_id` , `reports_id` , `category` , `comment` , `format` , `stock`)
|
||||
VALUES (
|
||||
NULL , '{$_SESSION['users_uid']}',
|
||||
'$reports_id', '$category', '$comment',
|
||||
'$type', '$stock' );");
|
||||
$_SESSION['messages'][] = 'added';
|
||||
header("Location: reports.php?edit=1");
|
||||
mysql_query("UPDATE `reports_committee` SET
|
||||
`category`='$category',
|
||||
`comment`='$comment',
|
||||
`format`='$type',
|
||||
`stock`='$stock'
|
||||
WHERE id='$id'");
|
||||
happy_("Saved");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
//send the header
|
||||
if($edit_mode == false) {
|
||||
send_header("My Reports",
|
||||
array("Committee Main" => "committee_main.php"),
|
||||
"print/export_reports"
|
||||
);
|
||||
send_header("My Reports",
|
||||
array("Committee Main" => "committee_main.php"),
|
||||
"print/export_reports"
|
||||
);
|
||||
|
||||
/* Send a greeting */
|
||||
echo i18n('Welcome to the new report interface. You can select and save specific reports under specific categories so you can always find the report you need without having to go through the list each time. To begin customizing this list, click on the "Click Here to edit your Report List" link at the bottom of this page. ');
|
||||
echo i18n('The old report list is still available').' <a href="reports_old.php">'.i18n('here').'</a>, but will be deleted in the summer of 2008';
|
||||
echo '<br /><br />';
|
||||
/* Send a greeting */
|
||||
echo i18n('Welcome to the new report interface. You can select and save specific reports under specific categories so you can always find the report you need without having to go through the list each time. To begin customizing this list, click on the "Edit This List" button at the bottom of this page.');
|
||||
?>
|
||||
<br /><br />
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
} else {
|
||||
send_header("Edit My Reports",
|
||||
array("Committee Main" => "committee_main.php",
|
||||
"My Reports" => "admin/reports.php"),
|
||||
"print/export_reports"
|
||||
);
|
||||
}
|
||||
function remove_report(id)
|
||||
{
|
||||
$('#debug').load("<?$_SERVER['PHP_SELF']?>?action=remove_report&id="+id);
|
||||
$("#report_tr_"+id).remove();
|
||||
}
|
||||
|
||||
require_once("../ajax.inc.php");
|
||||
function edit_report(id,reports_id)
|
||||
{
|
||||
var r = (id == -1) ? '&reports_id='+reports_id : '';
|
||||
$.getJSON("<?=$_SERVER['PHP_SELF']?>?action=load_report&id="+id+r,
|
||||
function(json){
|
||||
$("#report_category_exist").html("<option value=\"\">-- <?=i18n('Use New Category')?> --</option>");
|
||||
for(var i in json.cat ) {
|
||||
var c = json.cat[i];
|
||||
$("#report_category_exist").append("<option value=\""+c+"\">"+c+"</option>");
|
||||
}
|
||||
$("#report_id").val( (id == -1) ? -1 : json.id);
|
||||
$("#report_reports_id").val(json.reports_id);
|
||||
$("#report_category").val(json.category);
|
||||
$("#report_stock").val(json.stock);
|
||||
$("#report_format").val(json.format);
|
||||
$("#report_comment").val(json.comment);
|
||||
/* Update the dialog title */
|
||||
$('#popup_editor').dialog('option', 'title', "<?=i18n('Report')?>: " + json.id);
|
||||
|
||||
|
||||
foreach($_SESSION['messages'] as $m) {
|
||||
switch($m) {
|
||||
case 'nocategory':
|
||||
echo error(i18n("You must select a category or type a new category name to add a report to your list"));
|
||||
break;
|
||||
case 'added':
|
||||
echo happy(i18n("Report successfully added"));
|
||||
break;
|
||||
case 'unlinked':
|
||||
echo happy(i18n("Report successfully removed"));
|
||||
break;
|
||||
popup_editor(id);
|
||||
});
|
||||
}
|
||||
|
||||
function save_report()
|
||||
{
|
||||
$('#debug').load("<?$_SERVER['PHP_SELF']?>?action=save", $('#report_form').serializeArray());
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
function add_report()
|
||||
{
|
||||
var reports_id = $('#report').val();
|
||||
edit_report(-1, reports_id);
|
||||
}
|
||||
|
||||
var edit=false;
|
||||
function edit_toggle()
|
||||
{
|
||||
if(edit == false) {
|
||||
$('#edit_toggle').val("<?=i18n("Done Editing")?>");
|
||||
$('#edit_info').show();
|
||||
$('.edit_buttons').show();
|
||||
edit = true;
|
||||
} else {
|
||||
$('#edit_toggle').val("<?=i18n("Edit This List")?>");
|
||||
$('#edit_info').hide();
|
||||
$('.edit_buttons').hide();
|
||||
edit = false;
|
||||
}
|
||||
}
|
||||
$_SESSION['messages'] = array();
|
||||
}
|
||||
|
||||
function popup_editor(id)
|
||||
{
|
||||
var w = (document.documentElement.clientWidth * 0.6);
|
||||
var h = (document.documentElement.clientHeight * 0.4);
|
||||
|
||||
report_id = id;
|
||||
|
||||
/* Show the dialog */
|
||||
$('#popup_editor').dialog('option', 'width', w);
|
||||
$('#popup_editor').dialog('option', 'height', h);
|
||||
$("#popup_editor").dialog('open');
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Setup the popup window */
|
||||
$(document).ready(function() {
|
||||
$("#popup_editor").dialog({
|
||||
bgiframe: true, autoOpen: false,
|
||||
modal: true, resizable: false,
|
||||
draggable: false,
|
||||
buttons: {
|
||||
"<?=i18n('Cancel')?>": function() {
|
||||
$(this).dialog("close");
|
||||
},
|
||||
"<?=i18n('Save')?>": function() {
|
||||
save_report();
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
<?
|
||||
|
||||
/* Load all the users reports */
|
||||
$q = mysql_query("SELECT reports_committee.*,reports.name
|
||||
@ -145,25 +240,15 @@
|
||||
if(mysql_num_rows($q) == 0) {
|
||||
echo i18n('You have no reports saved');
|
||||
} else {
|
||||
/* List each report with info */
|
||||
if($edit_mode == true) {
|
||||
echo i18n('Deleting all the reports from a category will also delete the category.');
|
||||
echo '<br />';
|
||||
echo '<br />';
|
||||
echo '<a href="reports.php">'.i18n('Click here when you are finished editing your report list').'</a>';
|
||||
echo '<br />';
|
||||
echo '<br />';
|
||||
}
|
||||
|
||||
$last_category = '';
|
||||
$x=0;
|
||||
echo "<table class=\"tableedit\">";
|
||||
echo "<table class=\"tableview\" style=\"border:0px;\">";
|
||||
while($i = mysql_fetch_object($q)) {
|
||||
$trclass = ($x % 2 == 0) ? "even" : "odd";
|
||||
$x++;
|
||||
if($last_category != $i->category) {
|
||||
/* New category */
|
||||
echo '<tr><td colspan=\"2\"><h3>';
|
||||
echo '<tr><td style="border:0px;" colspan="2" style="even"><h3>';
|
||||
if($edit_mode == true) echo i18n('Category').': ';
|
||||
echo "{$i->category}</h3></td></tr>";
|
||||
$last_category = $i->category;
|
||||
@ -176,17 +261,26 @@
|
||||
$name = $report_custom[-$i->reports_id]['name'];
|
||||
$url = $report_custom[-$i->reports_id]['custom_url'];
|
||||
}
|
||||
$name = "<a href=\"{$config['SFIABDIRECTORY']}/$url\">$name</a>";
|
||||
|
||||
if($edit_mode == false)
|
||||
$name = "<a href=\"{$config['SFIABDIRECTORY']}/$url\">$name</a>";
|
||||
|
||||
echo "<tr class=\"$trclass\"><td>";
|
||||
|
||||
if($edit_mode == true)
|
||||
echo "<a title=\"Remove Report\" href=\"reports.php?action=unlink&id={$i->id}\"><img src=\"".$config['SFIABDIRECTORY']."/images/16/button_cancel.".$config['icon_extension']."\" border=\"0\" alt=\"Remove Report\" /></a> ";
|
||||
echo $name.'</td>';
|
||||
|
||||
?>
|
||||
<tr id="report_tr_<?=$i->id?>">
|
||||
<td style="border:0px;"><?=$name?></td>
|
||||
<td style="border:0px; font-size:0.8em;"><?=$i->comment?></td>
|
||||
<td style="border:0px;">
|
||||
<div class="edit_buttons" style="display:none">
|
||||
<a title="Edit Report" onclick="edit_report(<?=$i->id?>,0);return false;" href="#">
|
||||
<img border="0" src="<?=$config['SFIABDIRECTORY']?>/images/16/edit.<?=$config['icon_extension']?>" />
|
||||
</a>
|
||||
<a title="Remove Report" onclick="remove_report(<?=$i->id?>);return false;" href="#">
|
||||
<img src="<?=$config['SFIABDIRECTORY']?>/images/16/button_cancel.<?=$config['icon_extension']?>" border="0" alt="Remove Report" />
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?
|
||||
/*
|
||||
|
||||
if($i->reports_id > 0) {
|
||||
echo '<tr><td width=\"20px\"></td><td>';
|
||||
echo '<span style=\"font-size: 0.75em;\">';
|
||||
@ -198,220 +292,81 @@
|
||||
}
|
||||
*/
|
||||
|
||||
echo "<td><span style=\"font-size: 0.85em;\">{$i->comment}</span></td></tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div id="edit_info" style="display:none;">
|
||||
<p>* <?=i18n('Deleting all the reports from a category will also delete the category.')?></p>
|
||||
<p>* <?=i18n('Deleting a report only unlinks it from your list, it doesn\'t delete it from the system.')?></p>
|
||||
</div>
|
||||
<br />
|
||||
<input id="edit_toggle" type="submit" onclick="edit_toggle();return false;" value="<?=i18n("Edit This List")?>">
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<?
|
||||
/* Load available reports */
|
||||
$reports = report_load_all();
|
||||
?>
|
||||
<hr />
|
||||
<h4><?=i18n("All Reports")?></h3>
|
||||
|
||||
if($edit_mode == false) {
|
||||
echo '<hr />';
|
||||
echo '<a href="reports.php?edit=1">'.i18n('Click here to edit your Report List').'</a>';
|
||||
|
||||
echo '<hr />';
|
||||
echo "<h3>".i18n("All Reports")."</h3>";
|
||||
|
||||
/* Print all the reports in a pulldown menu for generation */
|
||||
echo "<form method=\"get\" name=\"reportgen\" action=\"reports_gen.php\">";
|
||||
echo "<input type=\"hidden\" name=\"show_options\" value=\"1\" />";
|
||||
echo "<select name=\"id\" id=\"report\">";
|
||||
echo "<option value=\"0\">".i18n("Select a Report")."</option>\n";
|
||||
$x=0;
|
||||
foreach($reports as $r) {
|
||||
echo "<option value=\"{$r['id']}\">{$r['name']}</option>\n";
|
||||
}
|
||||
echo "</select>";
|
||||
echo "<input type=\"submit\" value=\"".i18n("Generate Report")."\"></form>";
|
||||
echo "<br />";
|
||||
|
||||
send_footer();
|
||||
exit;
|
||||
}
|
||||
|
||||
echo '<hr />';
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
function add_reload()
|
||||
{
|
||||
var url="report.ajax.php?reports_id="+document.addreport.reports_id.options[document.addreport.reports_id.selectedIndex].value;
|
||||
// alert(url);
|
||||
http.open("GET",url,true);
|
||||
http.onreadystatechange=handleResponse;
|
||||
http.send(null);
|
||||
return true;
|
||||
}
|
||||
|
||||
function handleResponse()
|
||||
{
|
||||
try {
|
||||
if(http.readyState==4)
|
||||
{
|
||||
//eval the JSON to get the object if the length is big enough (custom reports return json [])
|
||||
if(http.responseText.length>3) {
|
||||
document.addreport.type.disabled=false;
|
||||
document.addreport.stock.disabled=false;
|
||||
document.addreport.type.style.display='';
|
||||
document.addreport.stock.style.display='';
|
||||
document.getElementById('reporttypecustom').style.display='none';
|
||||
document.getElementById('reportstockcustom').style.display='none';
|
||||
|
||||
/* dont use JSON anymore since it adds an extra PHP-side requirement, we'll just get a 3 line response with one thing per line that we need
|
||||
var obj=eval('('+http.responseText+')');
|
||||
if(obj['option']['type']) {
|
||||
for(i=0;i<document.addreport.type.options.length;i++) {
|
||||
if(document.addreport.type.options[i].value==obj['option']['type'])
|
||||
document.addreport.type.selectedIndex=i;
|
||||
}
|
||||
}
|
||||
else
|
||||
document.addreport.type.selectedIndex=0;
|
||||
|
||||
if(obj['option']['stock']) {
|
||||
for(i=0;i<document.addreport.stock.options.length;i++) {
|
||||
if(document.addreport.stock.options[i].value==obj['option']['stock'])
|
||||
document.addreport.stock.selectedIndex=i;
|
||||
}
|
||||
}
|
||||
else
|
||||
document.addreport.stock.selectedIndex=0;
|
||||
|
||||
if(obj['desc'])
|
||||
document.addreport.comment.value=obj['desc'];
|
||||
*/
|
||||
var lines=http.responseText.split('\n');
|
||||
var reportType=lines[0];
|
||||
var reportStock=lines[1];
|
||||
var reportDesc=lines[2];
|
||||
|
||||
if(reportType) {
|
||||
for(i=0;i<document.addreport.type.options.length;i++) {
|
||||
if(document.addreport.type.options[i].value==reportType)
|
||||
document.addreport.type.selectedIndex=i;
|
||||
}
|
||||
}
|
||||
else
|
||||
document.addreport.type.selectedIndex=0;
|
||||
|
||||
if(reportStock) {
|
||||
for(i=0;i<document.addreport.stock.options.length;i++) {
|
||||
if(document.addreport.stock.options[i].value==reportStock)
|
||||
document.addreport.stock.selectedIndex=i;
|
||||
}
|
||||
}
|
||||
else
|
||||
document.addreport.stock.selectedIndex=0;
|
||||
|
||||
if(reportDesc);
|
||||
document.addreport.comment.value=reportDesc;
|
||||
}
|
||||
else
|
||||
{
|
||||
document.addreport.type.disabled=true;
|
||||
document.addreport.stock.disabled=true;
|
||||
document.addreport.type.style.display='none';
|
||||
document.addreport.stock.style.display='none';
|
||||
document.getElementById('reporttypecustom').style.display='';
|
||||
document.getElementById('reportstockcustom').style.display='';
|
||||
document.addreport.comment.value='';
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(e) {
|
||||
alert('caught error: '+e);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<?
|
||||
<form method="get" name="reportgen" action="reports_gen.php">
|
||||
<input type="hidden" name="show_options" value="1" />
|
||||
<select name="id" id="report">
|
||||
<option value="0"><?=i18n("Select a Report")?></option>
|
||||
<?
|
||||
foreach($reports as $r) {
|
||||
echo "<option value=\"{$r['id']}\">{$r['name']}</option>\n";
|
||||
}
|
||||
?>
|
||||
</select><br />
|
||||
<input type="submit" value="<?=i18n("Generate Report")?>">
|
||||
<input type="submit" onclick="add_report();return false;" value="<?=i18n("Add this Report to my list")?>">
|
||||
</form>
|
||||
<br />
|
||||
|
||||
<?
|
||||
/* Create an add report box */
|
||||
echo '<h3>'.i18n('Add a Report to your Report List').'</h3>';
|
||||
echo "<form method=\"post\" name=\"addreport\"action=\"reports.php\">";
|
||||
echo "<input type=\"hidden\" name=\"action\" value=\"add\">";
|
||||
echo "<table class=\"tableedit\">\n";
|
||||
echo '<tr><td colspan="2">';
|
||||
echo "<select name=\"reports_id\" onChange=\"add_reload()\">";
|
||||
echo "<option value=\"\">".i18n("Choose a report")."</option>\n";
|
||||
$x=0;
|
||||
foreach($reports as $r) {
|
||||
$x++;
|
||||
$sel = ($reports_id == $r['id']) ? 'selected="selected"' : '';
|
||||
echo "<option value=\"{$r['id']}\" $sel>$x. {$r['name']}</option>";
|
||||
?>
|
||||
<div id="popup_editor" title="Report" style="display: none">
|
||||
|
||||
}
|
||||
$rid = -1;
|
||||
foreach($report_custom as $r) {
|
||||
$x++;
|
||||
$sel = ($reports_id == $rid) ? 'selected="selected"' : '';
|
||||
echo "<option value=\"$rid\" $sel>$x. {$r['name']}</option>";
|
||||
$rid--;
|
||||
}
|
||||
|
||||
echo "</select></td></tr>";
|
||||
|
||||
echo "<tr><td>".i18n("Category").":</td><td>";
|
||||
$q = mysql_query("SELECT DISTINCT category FROM reports_committee
|
||||
WHERE users_id='{$_SESSION['users_uid']}'
|
||||
ORDER BY category");
|
||||
|
||||
echo i18n("Existing Category").": <select name=\"category_exist\">";
|
||||
echo "<option value=\"\">-- ".i18n('Use New Category')." --</option>";
|
||||
while($i = mysql_fetch_object($q)) {
|
||||
echo "<option value=\"{$i->category}\">{$i->category}</option>";
|
||||
}
|
||||
echo "</select><br />";
|
||||
echo i18n("OR New Category").": <input type=\"text\" name=\"category\">";
|
||||
echo "</td></tr>";
|
||||
|
||||
$option_keys = array('type','stock');
|
||||
<form id="report_form">
|
||||
<input type="hidden" id="report_id" name="id" value="" />
|
||||
<input type="hidden" id="report_reports_id" name="reports_id" value="" />
|
||||
<br />
|
||||
<table class="tableedit">
|
||||
<tr>
|
||||
<td><?=i18n("Category")?>:</td>
|
||||
<td><?=i18n("Existing Category")?>: <select name="category_exist" id="report_category_exist" onchange="$('#report_category').val('')" >
|
||||
</select><br />
|
||||
<?=i18n("OR New Category")?>: <input type="text" id="report_category" name="category" onkeypress="$('#report_category_exist').val('')" >
|
||||
</td>
|
||||
</tr>
|
||||
<?
|
||||
foreach($report_options as $ok=>$o) {
|
||||
if(!in_array($ok, $option_keys)) continue;
|
||||
echo "<tr><td>{$o['desc']}:</td>";
|
||||
echo "<td><select name=\"$ok\" id=\"$ok\">";
|
||||
echo "<td><select name=\"$ok\" id=\"report_$ok\">";
|
||||
foreach($o['values'] as $k=>$v) {
|
||||
echo "<option value=\"$k\">$v</option>\n";
|
||||
}
|
||||
echo "</select><span id=\"report{$ok}custom\" style=\"display: none;\">".i18n("Custom")."</span></td></tr>";
|
||||
}
|
||||
echo "<tr><td>".i18n("Comments").":</td><td>";
|
||||
echo "<textarea rows=\"3\" cols=\"60\" name=\"comment\"></textarea></td></tr>";
|
||||
echo "<tr><td colspan=\"2\"><input type=\"submit\" value=\"".i18n("Add Report to My Reports")."\" /></td></tr>";
|
||||
?>
|
||||
<tr>
|
||||
<td><?=i18n("Comments")?>:</td>
|
||||
<td><textarea rows="3" cols="40" name="comment" id="report_comment"></textarea></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
echo '</table></form>';
|
||||
|
||||
|
||||
|
||||
echo '<hr />';
|
||||
echo '<h3>Descriptions for All Reports</h3>';
|
||||
echo i18n('Click on the report number to try the report with the default report options before you add it to your Report List');
|
||||
echo '<br /><br />';
|
||||
echo "<table class=\"tableedit\">\n";
|
||||
$x=0;
|
||||
foreach(array_merge($reports, $report_custom) as $r) {
|
||||
$trclass = ($x % 2 == 0) ? "even" : "odd";
|
||||
$x++;
|
||||
echo "<tr class=\"$trclass\">";
|
||||
if($r['custom_url'] == '') {
|
||||
$url = "admin/reports_gen.php?id={$r['id']}";
|
||||
} else {
|
||||
$url = $r['custom_url'];
|
||||
}
|
||||
echo "<td><a href=\"{$config['SFIABDIRECTORY']}/$url\">$x.</a></td>";
|
||||
echo "<td><table cellspacing=0 cellpadding=0 width=\"100%\"><tr>";
|
||||
|
||||
echo "<td><b>{$r['name']}</b></td>";
|
||||
echo "<td align=\"right\">Created By: {$r['creator']}</td></tr>";
|
||||
echo "<tr><td colspan=\"2\">{$r['desc']}</td></tr>";
|
||||
echo "</table></tr>";
|
||||
}
|
||||
|
||||
echo "</table>";
|
||||
|
||||
echo "<br />";
|
||||
<?
|
||||
|
||||
send_footer();
|
||||
?>
|
||||
|
@ -87,7 +87,7 @@
|
||||
echo "<tr><td><b>".i18n('Comment')."</b>:</td>";
|
||||
echo "<td>{$i->comment}</td></tr>";
|
||||
} else {
|
||||
echo "<tr><td colspan=\"2\">".i18n('This report is NOT in your \'My Reports\' list.')."</td></tr>";
|
||||
echo "<tr><td></td><td>".i18n('This report is NOT in your \'My Reports\' list.')."</td></tr>";
|
||||
}
|
||||
echo '<tr><td colspan="2"><hr /></td></tr>';
|
||||
echo "<tr><td colspan=\"2\"><h3>".i18n('Report Options')."</h3></td></tr>";
|
||||
|
Loading…
Reference in New Issue
Block a user