- { $acc = access_string($report->name);
- $st_reports .= "<tr><td><a href='javascript:showReport($rep_counter)'$acc[1]>$acc[0]</a></td></tr>";
-
- $action = $path_to_root.'/reporting/prn_redirect.php';
-
- $st_params .= "<div id='REP_" . $rep_counter++ . "' style='display:none'>";
- $st_params .= "<table border=0><tr><td>\n"
- . "<form method='POST' action='$action' target='_blank'>\n"
- . $report->getDisplay()
- . "\n</form>\n"
- . "</td></tr></table></div>";
-
+ {
+ $acc = access_string($report->name);
+ $st_reports .= "<tr><td><a class='printlink' href='"
+ .$_SERVER['PHP_SELF']."?Class=$class_counter&rep_id=$report->id'"
+ ." id='".default_focus()."'"
+ ."$acc[1]>$acc[0]</a><tr><td>\n";
+ if (isset($_REQUEST['rep_id']) && $_REQUEST['rep_id']==$report->id) {
+
+ $action = $path_to_root.'/reporting/prn_redirect.php';
+
+ $st_params = "<table border=0><tr><td>\n"
+ . "<form method='POST' action='$action' target='_blank'>\n";
+ $st_params .= hidden('REP_ID', $report->id, false);
+ $st_params .= submit('Rep'.$report->id,
+ _("Display: ") . access_string($report->name, true),
+ false, '', $pdf_debug ? false : 'default') . '<br><br>';
+ $st_params .= $report->getDisplay()
+ . "\n</form></td></tr></table>\n";
+ $Ajax->addUpdate(true, 'rep_form', $st_params);
+ }