Fixed pdf_debug mode.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Fri, 17 Oct 2008 11:02:13 +0000 (11:02 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Fri, 17 Oct 2008 11:02:13 +0000 (11:02 +0000)
reporting/includes/reporting.inc
reporting/includes/reports_classes.inc

index c79aee7e33e6f23a9edc1fed1b2f358408571139..f57739d6412f0934d8abf9dbd0ed831e53d29362 100644 (file)
@@ -69,7 +69,7 @@ function print_document_link($doc_no, $link_text, $link=true, $type_no)
 //
 function print_link($link_text, $rep, $pars = array(), $dir = '')
 {
-       global $path_to_root;
+       global $path_to_root, $pdf_debug;
 
        $url = $dir == '' ?  $path_to_root.'/reporting/prn_redirect.php?' : $dir;
 
@@ -78,8 +78,8 @@ function print_link($link_text, $rep, $pars = array(), $dir = '')
        }
        $pars[] = 'REP_ID='.urlencode($rep);
        $url .= implode ('&', $pars);
-       
-       return "<a class='printlink' target='_blank' href='$url'>$link_text</a>";
+       $class = $pdf_debug ? '' : "class='printlink'";
+       return "<a $class target='_blank' href='$url'>$link_text</a>";
 }
 
 function get_first_bank_account()
index 8f501fe023f50e359172533a1ade9c4a2c2124af..e244b8ff89c0cbaa9e1e230571668212167b6092 100644 (file)
@@ -43,7 +43,7 @@ class BoxReports
 
                                $st_params .= "<div id='REP_" . $rep_counter++ . "' style='display:none'>";
                                $st_params .= "<table border=0><tr><td>\n"
-                                                               . "<form method='POST' action='$action'>\n" 
+                                                               . "<form method='POST' action='$action' target='_blank'>\n" 
                                                                . $report->getDisplay() 
                                                                . "\n</form>\n"
                                                                . "</td></tr></table></div>";
@@ -103,12 +103,12 @@ class Report
        
        function getDisplay()
        {
-               global $path_to_root, $use_date_picker;
+               global $path_to_root, $use_date_picker, $pdf_debug;
 
                $st  = hidden('REP_ID', $this->id, false);
                $st .= submit('Rep'.$this->id,  
                        _("Display: ") . access_string($this->name,true),
-                       false, '', true) . '<br><br>';
+                       false, '', $pdf_debug==0) . '<br><br>';
                $dummy = "";
                if ($this->ar_params==null)
                        return "";