From: <tim...@us...> - 2010-01-16 12:09:36
|
Revision: 3302 http://web-erp.svn.sourceforge.net/web-erp/?rev=3302&view=rev Author: tim_schofield Date: 2010-01-16 12:08:57 +0000 (Sat, 16 Jan 2010) Log Message: ----------- Correctly deal with different paper sizes in form designer Modified Paths: -------------- trunk/FormDesigner.php trunk/PDFGrn.php trunk/companies/weberpdemo/FormDesigns/GoodsReceived.xml trunk/doc/Change.log.html Modified: trunk/FormDesigner.php =================================================================== --- trunk/FormDesigner.php 2010-01-16 09:52:39 UTC (rev 3301) +++ trunk/FormDesigner.php 2010-01-16 12:08:57 UTC (rev 3302) @@ -151,7 +151,7 @@ } echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Form Design') . '" alt="">' . ' ' . _('Form Design').'<br />'. $FormDesign['name'] . ''; echo '<div class="page_help_text">' . _('Enter the changes that you want in the form layout below.') .'<br /> '. _('All measurements are in millimetres') . '.</div><br>'; -$Papers=array('A4_Landscape', 'A4_Portrait', 'A3_Landscape', 'A3_Portrait'); // Possible paper sizes/orientations +$Papers=array('A4_Landscape', 'A4_Portrait', 'A3_Landscape', 'A3_Portrait', 'letter_Portrait', 'letter_Landscape', 'legal_Portrait', 'legal_Landscape'); // Possible paper sizes/orientations echo '<form method="post" id="Form" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '">'; echo '<input name=FormName type=hidden value="'.$_POST['FormName'].'">'; echo '<table width=85% border=1>'; //Start of outer table @@ -159,11 +159,16 @@ /* Select the paper size/orientation */ echo '<th width=33%>'._('Paper Size').'<select name="PaperSize">'; foreach ($Papers as $Paper) { - if ($Paper==$FormDesign->PaperSize) { - echo '<option selected value="'.$Paper.'">'.$Paper.'</option>'; + if (substr($Paper,-8)=='Portrait') { + $PaperValue=substr($Paper,0,strlen($Paper)-9); } else { - echo '<option value="'.$Paper.'">'.$Paper.'</option>'; + $PaperValue=$Paper; } + if ($PaperValue==$FormDesign->PaperSize) { + echo '<option selected value="'.$PaperValue.'">'.$Paper.'</option>'; + } else { + echo '<option value="'.$PaperValue.'">'.$Paper.'</option>'; + } } echo '</select></th>'; /* and the standard line height for the form */ Modified: trunk/PDFGrn.php =================================================================== --- trunk/PDFGrn.php 2010-01-16 09:52:39 UTC (rev 3301) +++ trunk/PDFGrn.php 2010-01-16 12:08:57 UTC (rev 3302) @@ -7,24 +7,27 @@ $PageSecurity = 2; include('includes/session.inc'); -$FormDesign = simplexml_load_file($PathPrefix.'companies/'.$_SESSION['DatabaseName'].'/FormDesigns/GoodsReceived.xml'); +if (isset($_POST['GRNNo'])) { + $GRNNo=$_POST['GRNNo']; +} else if (isset($_GET['GRNNo'])) { + $GRNNo=$_GET['GRNNo']; +} else { + $GRNNo=''; +} +if ($GRNNo=='Preview') { + $FormDesign = simplexml_load_file(sys_get_temp_dir().'/GoodsReceived.xml'); +} else { + $FormDesign = simplexml_load_file($PathPrefix.'companies/'.$_SESSION['DatabaseName'].'/FormDesigns/GoodsReceived.xml'); +} + // Set the paper size/orintation $PaperSize = $FormDesign->PaperSize; $PageNumber=1; $line_height=$FormDesign->LineHeight; - include('includes/PDFStarter.php'); $pdf->addInfo('Title', _('Goods Received Note') ); -if (isset($_POST['GRNNo'])) { - $GRNNo=$_POST['GRNNo']; -} else if (isset($_GET['GRNNo'])) { - $GRNNo=$_GET['GRNNo']; -} else { - $GRNNo=''; -} - include('includes/PDFGrnHeader.inc'); if ($GRNNo=='Preview') { Modified: trunk/companies/weberpdemo/FormDesigns/GoodsReceived.xml =================================================================== --- trunk/companies/weberpdemo/FormDesigns/GoodsReceived.xml 2010-01-16 09:52:39 UTC (rev 3301) +++ trunk/companies/weberpdemo/FormDesigns/GoodsReceived.xml 2010-01-16 12:08:57 UTC (rev 3302) @@ -105,4 +105,4 @@ <x>40</x> <y>760</y> </SignedFor> -</form> \ No newline at end of file +</form> Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-01-16 09:52:39 UTC (rev 3301) +++ trunk/doc/Change.log.html 2010-01-16 12:08:57 UTC (rev 3302) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>16/01/10 Tim: Correctly deal with different paper sizes in form designer</p> <p>16/01/10 Tim: Add the Goods Received Note to the Form Designer</p> <p>15/01/10 Tim: UserLogin.php: The userid session variable was not being correctly set.</p> <p>13/01/10 Tim: api_xml-rpc.php: Use output buffering to hide html error messages so that the api can handle errors in a graceful way</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |