[Weberp-svn] SF.net SVN: weberp:[7840] trunk
Brought to you by:
sotandeka,
tim_schofield
From: <tim...@us...> - 2011-08-24 19:06:21
|
Revision: 7840 http://weberp.svn.sourceforge.net/weberp/?rev=7840&view=rev Author: tim_schofield Date: 2011-08-24 19:06:15 +0000 (Wed, 24 Aug 2011) Log Message: ----------- Add email addresses to test forms Modified Paths: -------------- trunk/Suppliers.php trunk/build/tests/includes/FillForm.php Modified: trunk/Suppliers.php =================================================================== --- trunk/Suppliers.php 2011-08-24 19:06:03 UTC (rev 7839) +++ trunk/Suppliers.php 2011-08-24 19:06:15 UTC (rev 7840) @@ -830,7 +830,7 @@ </tr>'; echo '<tr> <td>' . _('Email Address') . ':</td> - <td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="Email" value="' . $_POST['Email'] . '" size="42" maxlength="40" /></td> + <td><input class="email" '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="Email" value="' . $_POST['Email'] . '" size="42" maxlength="40" /></td> </tr>'; echo '<tr><td>' . _('Supplier Type') . ':</td><td><select name="SupplierType">'; $result=DB_query("SELECT typeid, typename FROM suppliertype", $db); Modified: trunk/build/tests/includes/FillForm.php =================================================================== --- trunk/build/tests/includes/FillForm.php 2011-08-24 19:06:03 UTC (rev 7839) +++ trunk/build/tests/includes/FillForm.php 2011-08-24 19:06:15 UTC (rev 7840) @@ -2,8 +2,16 @@ function RandomASCIIString($MaxLength) { $Answer = ''; + $Length = rand(0, $MaxLength-5); + for ($i=0; $i<$Length; $i++) { + $Answer .= chr(rand(32, 127)); + } + return $Answer; +} + +function RandomEmailString($MaxLength) { + $Answer = ''; $Length = rand(0, $MaxLength); - echo $Length.'xxxx'.$MaxLength; for ($i=0; $i<$Length; $i++) { $Answer .= chr(rand(32, 127)); } @@ -32,6 +40,8 @@ $PostData[$Field['name']]=RandomNumberString($Field['maxlength']); } else if (isset($Field['class']) and $Field['class']=='date') { $PostData[$Field['name']]=RandomDateString('2000-01-01', '2012-12-31'); + } else if (isset($Field['class']) and $Field['class']=='email') { + $PostData[$Field['name']]=RandomEmailString($Field['maxlength']); } else { $PostData[$Field['name']]=RandomASCIIString($Field['maxlength']); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |