phpBMS

Changeset 693 for trunk/phpbms/print.php

Show
Ignore:
Timestamp:
12/31/09 13:36:45 (2 years ago)
Author:
brieb
Message:
  • Introduced administratively changeable settings to indvidual reports
  • Modified all reports to work with new settings system
  • Altered invoice and line item total reports to accept parameters from reportsettings: You can now bypass the grouping/column dialog by providing the infrmation administratively
  • Altered all sales order PDF reports to accept parameters from reportsettings: You can now administratively change certain aspects of the print outs, including what parts of the top of the report to show, and what to title the report
  • Altered label reports to accept parameters from reportsettings: printed data as well

as label measurements and layout are now defined by administratively

  • Altered export and tableprint reports to accept parameters from reportsettings: You can specify individual columns and from table instead of just the defaults (all fields, main table only)
  • Added var_dump-esque 'debug' function for development purposes to common functions
  • Integrated FPDI functionality with sales order PDF reports: It is now possible to use a PDF saved in the files table as a background template for your invoices (e.g. watermarks)
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/phpbms/print.php

    r643 r693  
    100100 
    101101                        if(isset($_POST["choosereport"])){ 
     102 
    102103                                $tablePrinter->openwindows=""; 
     104 
    103105                                for($i=0;$i<count($_POST["choosereport"]);$i++){ 
     106 
    104107                                        if($_POST["choosereport"][$i]){ 
    105                                                 $querystatement="SELECT reportfile,type from reports where id=".$_POST["choosereport"][$i].";"; 
    106                                                 $queryresult=$db->query($querystatement); 
    107                                                 if(!$queryresult) $error = new appError(100,"Could not Retrieve Report Information"); 
    108                                                 $reportrecord=$db->fetchArray($queryresult); 
     108 
     109                                                $querystatement = " 
     110                                                    SELECT 
     111                                                        `uuid`, 
     112                                                        `reportfile`, 
     113                                                        `type` 
     114                                                    FROM 
     115                                                        `reports` 
     116                                                    WHERE 
     117                                                        id = ".$_POST["choosereport"][$i]; 
     118 
     119                                                $queryresult = $db->query($querystatement); 
     120 
     121                                                if(!$queryresult) 
     122                                                    $error = new appError(100,"Could not Retrieve Report Information"); 
     123 
     124                                                $reportrecord = $db->fetchArray($queryresult); 
     125 
    109126                                                $fakeExtForIE=""; 
    110                                                 if($reportrecord["type"]=="PDF Report") 
    111                                                         $fakeExtForIE="&amp;ext=.pdf"; 
    112                                                 $dateTimeStamp="&amp;ts=".mktime(); // make the url unique to avoid using browser cache 
     127 
     128                                                if($reportrecord["type"] == "PDF Report") 
     129                                                        $fakeExtForIE = "' + String.fromCharCode(38) + ' &amp;ext=.pdf"; 
     130 
     131                                                // make the url unique to avoid using browser cache 
     132                                                $dateTimeStamp = "' + String.fromCharCode(38) + 'ts=".mktime(); 
     133 
    113134                                                //javascript open each report in new window 
    114                                                 $tablePrinter->openwindows.="window.open('".APP_PATH.$reportrecord["reportfile"]."?tid=".urlencode($tablePrinter->tableid).$dateTimeStamp.$fakeExtForIE."','print".$i."');\n"; 
    115                                         } 
    116                                 } 
    117                         } 
     135                                                $tablePrinter->openwindows .= "window.open('".APP_PATH.$reportrecord["reportfile"]."?rid=".urlencode($reportrecord["uuid"])."' + String.fromCharCode(38) + 'tid=".urlencode($tablePrinter->tableid).$dateTimeStamp.$fakeExtForIE."','print".$i."');\n"; 
     136 
     137                                        }//endif 
     138 
     139                                }//endfor 
     140 
     141                        }//endif 
     142 
    118143                break; 
    119144        } 
phpBMS vulnerability assesment provided by Orvant Inc. Copyright © 2010 Kreotek, LLC. All Rights reserved.