From: <Ex...@us...> - 2012-02-26 15:28:25
|
Revision: 4976 http://web-erp.svn.sourceforge.net/web-erp/?rev=4976&view=rev Author: ExsonQu Date: 2012-02-26 15:28:19 +0000 (Sun, 26 Feb 2012) Log Message: ----------- 26/02/2012 PO_Items.php Add $_SESSION and $_POST variables to fixed extra lines added while page refreshing or push F5. Reported by CQZ and Ke from webERP Chinese forum QQ group. Fixed by Exson Modified Paths: -------------- trunk/PO_Items.php Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2012-02-26 14:59:18 UTC (rev 4975) +++ trunk/PO_Items.php 2012-02-26 15:28:19 UTC (rev 4976) @@ -507,8 +507,10 @@ } /*end if Enter line button was hit - adding non stock items */ +//Add variables $_SESSION['PO_ItemsResubmitForm' . $identifier] and $_POST['PO_ItemsResubmitFormValue'] to prevent from page refreshing effect -if (isset($_POST['NewItem'])){ +$_SESSION['PO_ItemsResubmitForm' . $identifier] = (empty($_SESSION['PO_ItemsResubmitForm' . $identifier]))? '1' : $_SESSION['PO_ItemsResubmitForm' . $identifier]; +if (isset($_POST['NewItem']) and !empty($_POST['PO_ItemsResubmitFormValue']) and $_SESSION['PO_ItemsResubmitForm' . $identifier] == $_POST['PO_ItemsResubmitFormValue']){ //only submit values can be processed /* NewItem is set from the part selection list as the part code selected * take the form entries and enter the data from the form into the PurchOrder class variable @@ -634,6 +636,7 @@ } /* end of if not already on the order */ } /* end if the $_POST has NewQty in the variable name */ } /* end loop around the $_POST array */ + $_SESSION['PO_ItemsResubmitForm' . $identifier]++; //change the $_SESSION VALUE } /* end of if its a new item */ /* This is where the order as selected should be displayed reflecting any deletions or insertions*/ @@ -1126,9 +1129,10 @@ } #end of while loop echo '</table>'; + echo '<input type="hidden" name="PO_ItemsResubmitFormValue" value="' . $_SESSION['PO_ItemsResubmitForm' . $identifier] . '" />'; echo '<a name="end"></a><br /><div class="centre"><input type="submit" name="NewItem" value="Order some" /></div>'; }#end if SearchResults to show echo '</form>'; include('includes/footer.inc'); -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |