From: <dai...@us...> - 2013-10-02 07:31:36
|
Revision: 6341 http://sourceforge.net/p/web-erp/reponame/6341 Author: daintree Date: 2013-10-02 07:31:32 +0000 (Wed, 02 Oct 2013) Log Message: ----------- David Lynn: added url to suppliers Modified Paths: -------------- trunk/SelectSupplier.php trunk/Suppliers.php trunk/doc/Change.log trunk/doc/Manual/ManualContributors.html trunk/sql/mysql/upgrade4.11-4.12.sql Modified: trunk/SelectSupplier.php =================================================================== --- trunk/SelectSupplier.php 2013-09-28 10:36:40 UTC (rev 6340) +++ trunk/SelectSupplier.php 2013-10-02 07:31:32 UTC (rev 6341) @@ -94,7 +94,8 @@ address3, address4, telephone, - email + email, + url FROM suppliers ORDER BY suppname"; } else { @@ -110,7 +111,8 @@ address3, address4, telephone, - email + email, + url FROM suppliers WHERE suppname " . LIKE . " '" . $SearchString . "' ORDER BY suppname"; @@ -124,7 +126,8 @@ address3, address4, telephone, - email + email, + url FROM suppliers WHERE supplierid " . LIKE . " '%" . $_POST['SupplierCode'] . "%' ORDER BY supplierid"; @@ -283,6 +286,7 @@ <th class="ascending">' . _('Address 4') . '</th> <th class="ascending">' . _('Telephone') . '</th> <th class="ascending">' . _('Email') . '</th> + <th class="ascending">' . _('URL') . '</th> </tr>'; $k = 0; //row counter to determine background colour $RowIndex = 0; @@ -306,6 +310,7 @@ <td>' . $myrow['address4'] . '</td> <td>' . $myrow['telephone'] . '</td> <td><a href="mailto://'.$myrow['email'].'">' . $myrow['email']. '</a></td> + <td><a href="'.$myrow['url'].'"target="_blank">' . $myrow['url']. '</a></td> </tr>'; $RowIndex = $RowIndex + 1; //end of page full new headings if Modified: trunk/Suppliers.php =================================================================== --- trunk/Suppliers.php 2013-09-28 10:36:40 UTC (rev 6340) +++ trunk/Suppliers.php 2013-10-02 07:31:32 UTC (rev 6341) @@ -376,6 +376,12 @@ $Errors[$i] = 'Email'; $i++; } + if (mb_strlen($_POST['URL']) >50) { + $InputError = 1; + prnMsg(_('The URL address must be 50 characters or less long'),'error'); + $Errors[$i] = 'URL'; + $i++; + } if (mb_strlen($_POST['BankRef']) > 12) { $InputError = 1; prnMsg(_('The bank reference text must be less than 12 characters long'),'error'); @@ -473,6 +479,7 @@ telephone='". $_POST['Phone'] ."', fax = '". $_POST['Fax']."', email = '" . $_POST['Email'] . "', + url = '" . $_POST['URL'] . "', supptype = '".$_POST['SupplierType']."', currcode='" . $_POST['CurrCode'] . "', suppliersince='".$SQL_SupplierSince . "', @@ -501,6 +508,7 @@ telephone='" . $_POST['Phone']."', fax = '" . $_POST['Fax'] . "', email = '" . $_POST['Email'] . "', + url = '" . $_POST['URL'] . "', supptype = '".$_POST['SupplierType']."', suppliersince='" . $SQL_SupplierSince . "', paymentterms='" . $_POST['PaymentTerms'] . "', @@ -536,6 +544,7 @@ telephone, fax, email, + url, supptype, currcode, suppliersince, @@ -560,6 +569,7 @@ '" . $_POST['Phone'] . "', '" . $_POST['Fax'] . "', '" . $_POST['Email'] . "', + '" . $_POST['URL'] . "', '".$_POST['SupplierType']."', '" . $_POST['CurrCode'] . "', '" . $SQL_SupplierSince . "', @@ -592,6 +602,7 @@ unset($_POST['Phone']); unset($_POST['Fax']); unset($_POST['Email']); + unset($_POST['URL']); unset($_POST['SupplierType']); unset($_POST['CurrCode']); unset($SQL_SupplierSince); @@ -673,26 +684,31 @@ echo '<tr><td>' . _('Supplier Code') . ':</td> <td><input type="text" data-type="no-illegal-chars" title="'._('The supplier id should not be within 10 legal characters and cannot be blank').'" required="required" name="SupplierID" placeholder="'._('within 10 characters').'" size="11" maxlength="10" /></td> </tr>'; - echo '<tr><td>' . _('Supplier Name') . ':</td> + echo '<tr> + <td>' . _('Supplier Name') . ':</td> <td><input type="text" pattern="(?!^\s+$)[^<>+-]{1,40}" required="required" title="'._('The supplier name should not be blank and should be less than 40 legal characters').'" name="SuppName" size="42" placeholder="'._('Within 40 legal characters').'" maxlength="40" /></td> - </tr>'; - echo '<tr><td>' . _('Address Line 1 (Street)') . ':</td> + </tr> + <tr> + <td>' . _('Address Line 1 (Street)') . ':</td> <td><input type="text" pattern=".{1,40}" title="'._('The input should be less than 40 characters').'" placeholder="'._('Less than 40 characters').'" name="Address1" size="42" maxlength="40" /></td> - </tr>'; - echo '<tr><td>' . _('Address Line 2 (Street)') . ':</td> + </tr> + <tr> + <td>' . _('Address Line 2 (Street)') . ':</td> <td><input type="text" name="Address2" pattern=".{1,40}" title="'._('The input should be less than 40 characters').'" placeholder="'._('Less than 40 characters').'" size="42" maxlength="40" /></td> - </tr>'; - echo '<tr><td>' . _('Address Line 3 (Suburb/City)') . ':</td> + </tr> + <tr> + <td>' . _('Address Line 3 (Suburb/City)') . ':</td> <td><input type="text" title="'._('The input should be less than 40 characters').'" placeholder="'._('Less than 40 characters').'" name="Address3" size="42" maxlength="40" /></td> - </tr>'; - echo '<tr><td>' . _('Address Line 4 (State/Province)') . ':</td> + </tr> + <tr> + <td>' . _('Address Line 4 (State/Province)') . ':</td> <td><input type="text" name="Address4" placeholder="'._('Less than 50 characters').'" size="42" maxlength="50" /></td> - </tr>'; - echo '<tr><td>' . _('Address Line 5 (Postal Code)') . ':</td> + </tr> + <tr> + <td>' . _('Address Line 5 (Postal Code)') . ':</td> <td><input type="text" name="Address5" size="42" placeholder="'._('Less than 40 characters').'" maxlength="40" /></td> - </tr>'; - - echo '<tr> + </tr> + <tr> <td>' . _('Country') . ':</td> <td><select name="Address6">'; foreach ($CountriesArray as $CountryEntry => $CountryName){ @@ -705,41 +721,54 @@ } } echo '</select></td> - </tr>'; - - echo '<tr><td>' . _('Telephone') . ':</td> + </tr> + <tr> + <td>' . _('Telephone') . ':</td> <td><input type="tel" pattern="[\s\d+)(-]{1,40}" title="'._('The input should be phone number').'" placeholder="'._('only number + - ( and ) allowed').'" name="Phone" size="30" maxlength="40" /></td> - </tr>'; - echo '<tr><td>' . _('Facsimile') . ':</td> + </tr> + <tr> + <td>' . _('Facsimile') . ':</td> <td><input type="tel" pattern="[\s\d+)(-]{1,40}" title="'._('The input should be fax number').'" placeholder="'._('only number + - ( and ) allowed').'" name="Fax" size="30" maxlength="40" /></td> - </tr>'; - echo '<tr><td>' . _('Email Address') . ':</td> - <td><input type="email" name="Email" title="'._('Only email address are allowed').'" placeholder="'._('email format such as xx...@ma...').'" size="30" maxlength="40" pattern="[a-z0-9!#$%&\'*+/=?^_`{|}~.-]+@[a-z0-9-]+(\.[a-z0-9-]+)*" /></td> - </tr>'; - echo '<tr><td>' . _('Supplier Type') . ':</td> + </tr> + <tr> + <td>' . _('Email Address') . ':</td> + <td><input type="email" name="Email" title="'._('Only email address are allowed').'" placeholder="'._('email format such as xx...@ma...').'" size="30" maxlength="50" pattern="[a-z0-9!#$%&\'*+/=?^_`{|}~.-]+@[a-z0-9-]+(\.[a-z0-9-]+)*" /></td> + </tr> + <tr> + <td>' . _('URL') . ':</td> + <td><input type="url" name="url" title="'._('Only URL address are allowed').'" placeholder="'._('URL format such as www.example.com').'" size="30" maxlength="50" /></td> + </tr> + <tr> + <td>' . _('Supplier Type') . ':</td> <td><select name="SupplierType">'; $result=DB_query("SELECT typeid, typename FROM suppliertype", $db); while ($myrow = DB_fetch_array($result)) { echo '<option value="' . $myrow['typeid'] . '">' . $myrow['typename'] . '</option>'; } //end while loop - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; $DateString = Date($_SESSION['DefaultDateFormat']); - echo '<tr><td>' . _('Supplier Since') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td> + echo '<tr> + <td>' . _('Supplier Since') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td> <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" name="SupplierSince" value="' . $DateString . '" size="12" maxlength="10" /></td> - </tr>'; - echo '<tr><td>' . _('Bank Particulars') . ':</td> + </tr> + <tr> + <td>' . _('Bank Particulars') . ':</td> <td><input type="text" name="BankPartics" size="13" maxlength="12" /></td> - </tr>'; - echo '<tr><td>' . _('Bank reference') . ':</td> + </tr> + <tr> + <td>' . _('Bank reference') . ':</td> <td><input type="text" name="BankRef" value="0" size="13" maxlength="12" /></td> - </tr>'; - echo '<tr><td>' . _('Bank Account No') . ':</td> + </tr> + <tr> + <td>' . _('Bank Account No') . ':</td> <td><input type="text" placeholder="'._('Less than 30 characters').'" name="BankAct" size="31" maxlength="30" /></td></tr>'; $result=DB_query("SELECT terms, termsindicator FROM paymentterms", $db); - echo '<tr><td>' . _('Payment Terms') . ':</td> + echo '<tr> + <td>' . _('Payment Terms') . ':</td> <td><select name="PaymentTerms">'; while ($myrow = DB_fetch_array($result)) { @@ -750,7 +779,8 @@ $result=DB_query("SELECT id, coyname FROM factorcompanies", $db); - echo '<tr><td>' . _('Factor Company') . ':</td> + echo '<tr> + <td>' . _('Factor Company') . ':</td> <td><select name="FactorID">'; echo '<option value="0">' . _('None') . '</option>'; while ($myrow = DB_fetch_array($result)) { @@ -761,8 +791,10 @@ } } //end while loop DB_data_seek($result, 0); - echo '</select></td></tr>'; - echo '<tr><td>' . _('Tax Reference') . ':</td> + echo '</select></td> + </tr> + <tr> + <td>' . _('Tax Reference') . ':</td> <td><input type="text" name="TaxRef" placehoder="'._('Within 20 characters').'" size="21" maxlength="20" /></td></tr>'; $result=DB_query("SELECT currency, currabrev FROM currencies", $db); @@ -772,7 +804,8 @@ $_POST['CurrCode'] = $myrow[0]; } - echo '<tr><td>' . _('Supplier Currency') . ':</td> + echo '<tr> + <td>' . _('Supplier Currency') . ':</td> <td><select name="CurrCode">'; while ($myrow = DB_fetch_array($result)) { if ($_POST['CurrCode'] == $myrow['currabrev']){ @@ -783,15 +816,17 @@ } //end while loop DB_data_seek($result, 0); - echo '</select></td></tr> - <tr><td>' . _('Remittance Advice') . ':</td> - <td><select name="Remittance">'; - echo '<option value="0">' . _('Not Required') . '</option>'; - echo '<option value="1">' . _('Required') . '</option>'; - - echo '</select></td></tr>'; - - echo '<tr><td>' . _('Tax Group') . ':</td> + echo '</select></td> + </tr> + <tr> + <td>' . _('Remittance Advice') . ':</td> + <td><select name="Remittance"> + <option value="0">' . _('Not Required') . '</option> + <option value="1">' . _('Required') . '</option> + </select></td> + </tr> + <tr> + <td>' . _('Tax Group') . ':</td> <td><select name="TaxGroup">'; DB_data_seek($result, 0); @@ -807,7 +842,8 @@ } } //end while loop - echo '</select></td></tr> + echo '</select></td> + </tr> </table> <br /> <div class="centre"><input type="submit" name="submit" value="' . _('Insert New Supplier') . '" /></div>'; @@ -835,6 +871,7 @@ telephone, fax, email, + url, supptype, currcode, suppliersince, @@ -863,6 +900,7 @@ $_POST['Phone'] = $myrow['telephone']; $_POST['Fax'] = $myrow['fax']; $_POST['Email'] = $myrow['email']; + $_POST['URL'] = $myrow['url']; $_POST['SupplierType'] = $myrow['supptype']; $_POST['SupplierSince'] = ConvertSQLDate($myrow['suppliersince']); $_POST['PaymentTerms'] = $myrow['paymentterms']; @@ -917,6 +955,8 @@ <td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="tel" pattern="[\s\d+()-]{1,40}" placeholder="'._('Only digit blank ( ) and - allowed').'" name="Fax" value="' . $_POST['Fax'] . '" size="42" maxlength="40" /></td></tr>'; echo '<tr><td>' . _('Email Address') . ':</td> <td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="email" title="'._('The input must be in email format').'" name="Email" value="' . $_POST['Email'] . '" size="42" maxlength="40" placeholder="'._('email format such as xx...@ma...').'" pattern="[a-z0-9!#$%&\'*+/=?^_`{|}~.-]+@[a-z0-9-]+(\.[a-z0-9-]+)*" /></td></tr>'; + echo '<tr><td>' . _('URL') . ':</td> + <td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="url" title="'._('The input must be in url format').'" name="URL" value="' . $_POST['URL'] . '" size="42" maxlength="40" placeholder="'._('url format such as www.example.com').'" /></td></tr>'; echo '<tr><td>' . _('Supplier Type') . ':</td> <td><select name="SupplierType">'; $result=DB_query("SELECT typeid, typename FROM suppliertype", $db); Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2013-09-28 10:36:40 UTC (rev 6340) +++ trunk/doc/Change.log 2013-10-02 07:31:32 UTC (rev 6341) @@ -1,5 +1,6 @@ webERP Change Log +2/10/13 David Lynn: Added new field url to suppliers modified SelectSupplier.php and Suppliers.php 28/9/13 wh_hsn: help with regular expression to trap quotes and backslashes for data-type="no-illegal-chars" 28/9/13 Phil: Followed Exson's example to set pattern to prevent dodgy characters in other scripts that were using a pattern that only allowed [a-zA-Z0-9] thus making it impossible to enter non latin characters. 11/9/13 icedlava: SelectCompletedOrder.php Fix SQL typo. Modified: trunk/doc/Manual/ManualContributors.html =================================================================== --- trunk/doc/Manual/ManualContributors.html 2013-09-28 10:36:40 UTC (rev 6340) +++ trunk/doc/Manual/ManualContributors.html 2013-10-02 07:31:32 UTC (rev 6341) @@ -80,6 +80,8 @@ <br /> David Luo<br /> <br /> + David Lynn<br /> + <br /> Martha Madjack<br /> <br /> Wayne McDougall<br /> Modified: trunk/sql/mysql/upgrade4.11-4.12.sql =================================================================== --- trunk/sql/mysql/upgrade4.11-4.12.sql 2013-09-28 10:36:40 UTC (rev 6340) +++ trunk/sql/mysql/upgrade4.11-4.12.sql 2013-10-02 07:31:32 UTC (rev 6341) @@ -1,4 +1,5 @@ INSERT INTO scripts VALUES ('Z_UpdateSalesAnalysisWithLatestCustomerData.php','15','Update sales analysis with latest customer and branch salesperson sales area and salestype irrespective of what these settings were when the sale was made'); INSERT INTO scripts VALUES ('PurchaseByPrefSupplier.php','2','Purchase ordering by preferred supplier'); +ALTER TABLE `suppliers` ADD COLUMN `url` varchar(50) NOT NULL DEFAULT ''; #--UPDATE config SET confvalue='4.11.0' WHERE confname='VersionNumber'; |