From: <tim...@us...> - 2010-07-04 22:02:52
|
Revision: 3563 http://web-erp.svn.sourceforge.net/web-erp/?rev=3563&view=rev Author: tim_schofield Date: 2010-07-04 22:02:46 +0000 (Sun, 04 Jul 2010) Log Message: ----------- Corrections to sql statements and layout changes Modified Paths: -------------- trunk/CustEDISetup.php trunk/doc/Change.log.html Modified: trunk/CustEDISetup.php =================================================================== --- trunk/CustEDISetup.php 2010-07-04 22:02:28 UTC (rev 3562) +++ trunk/CustEDISetup.php 2010-07-04 22:02:46 UTC (rev 3563) @@ -14,50 +14,51 @@ unset($Errors); } -$Errors = array(); +$Errors = array(); $i=0; +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Search') . '" alt="">' . ' ' . $title.'<br>'; if (isset($_POST['submit'])) { - //initialise no input errors assumed initially before we test - $InputError = 0; + //initialise no input errors assumed initially before we test + $InputError = 0; - /* actions to take once the user has clicked the submit button - ie the page has called itself with some user input */ + /* actions to take once the user has clicked the submit button + ie the page has called itself with some user input */ - //first off validate inputs sensible + //first off validate inputs sensible - if (strstr($_POST['EDIReference'],"'") - OR strstr($_POST['EDIReference'],'+') + if (strstr($_POST['EDIReference'],"'") + OR strstr($_POST['EDIReference'],'+') OR strstr($_POST['EDIReference'],"\"") OR strstr($_POST['EDIReference'],'&') OR strstr($_POST['EDIReference'],' ')) { - $InputError = 1; - prnMsg(_('The customers EDI reference code cannot contain any of the following characters') .' - \' & + \" ' . _('or a space'),'warn'); - } - if (strlen($_POST['EDIReference'])<4 AND ($_POST['EDIInvoices']==1 OR $_POST['EDIOrders']==1)){ - $InputError = 1; - prnMsg(_('The customers EDI reference code must be set when EDI Invoices or EDI orders are activated'),'warn'); + $InputError = 1; + prnMsg(_('The customers EDI reference code cannot contain any of the following characters') .' - \' & + \" ' . _('or a space'),'warn'); + } + if (strlen($_POST['EDIReference'])<4 AND ($_POST['EDIInvoices']==1 OR $_POST['EDIOrders']==1)){ + $InputError = 1; + prnMsg(_('The customers EDI reference code must be set when EDI Invoices or EDI orders are activated'),'warn'); $Errors[$i] = 'EDIReference'; - $i++; - } - if (strlen($_POST['EDIAddress'])<4 AND $_POST['EDIInvoices']==1){ - $InputError = 1; - prnMsg(_('The customers EDI email address or FTP server address must be entered if EDI Invoices are to be sent'),'warn'); + $i++; + } + if (strlen($_POST['EDIAddress'])<4 AND $_POST['EDIInvoices']==1){ + $InputError = 1; + prnMsg(_('The customers EDI email address or FTP server address must be entered if EDI Invoices are to be sent'),'warn'); $Errors[$i] = 'EDIAddress'; - $i++; - } + $i++; + } - If ($InputError==0){ //ie no input errors + If ($InputError==0){ //ie no input errors - if (!isset($_POST['EDIServerUser'])){ - $_POST['EDIServerUser']=''; - } - if (!isset($_POST['EDIServerPwd'])){ - $_POST['EDIServerPwd']=''; - } - $sql = 'UPDATE debtorsmaster SET ediinvoices =' . $_POST['EDIInvoices'] . ', - ediorders =' . $_POST['EDIOrders'] . ", + if (!isset($_POST['EDIServerUser'])){ + $_POST['EDIServerUser']=''; + } + if (!isset($_POST['EDIServerPwd'])){ + $_POST['EDIServerPwd']=''; + } + $sql = "UPDATE debtorsmaster SET ediinvoices ='" . $_POST['EDIInvoices'] . "', + ediorders ='" . $_POST['EDIOrders'] . "', edireference='" . $_POST['EDIReference'] . "', editransport='" . $_POST['EDITransport'] . "', ediaddress='" . $_POST['EDIAddress'] . "', @@ -65,17 +66,17 @@ ediserverpwd='" . $_POST['EDIServerPwd'] . "' WHERE debtorno = '" . $_SESSION['CustomerID'] . "'"; - $ErrMsg = _('The customer EDI setup data could not be updated because'); + $ErrMsg = _('The customer EDI setup data could not be updated because'); $result = DB_query($sql,$db,$ErrMsg); - prnMsg(_('Customer EDI configuration updated'),'success'); + prnMsg(_('Customer EDI configuration updated'),'success'); - } else { - prnMsg(_('Customer EDI configuration failed'),'error'); - } + } else { + prnMsg(_('Customer EDI configuration failed'),'error'); + } } echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . SID ."'>"; -echo '<table>'; +echo '<br><table class=selection>'; $sql = "SELECT debtorno, name, @@ -99,63 +100,63 @@ echo '<tr><td>'._('Customer Name').':</td> <td>' . $myrow['name'] . '</td></tr>'; echo '<tr><td>'._('Enable Sending of EDI Invoices').':</td> - <td><select TABINDEX=1 name="EDIInvoices">'; + <td><select tabindex=1 name="EDIInvoices">'; if ($myrow['ediinvoices']==0){ - echo '<option selected VALUE=0>'._('Disabled'); - echo '<option VALUE=1>'._('Enabled'); + echo '<option selected VALUE=0>'._('Disabled'); + echo '<option VALUE=1>'._('Enabled'); } else { - echo '<option VALUE=0>'._('Disabled'); - echo '<option selected VALUE=1>'._('Enabled'); + echo '<option VALUE=0>'._('Disabled'); + echo '<option selected VALUE=1>'._('Enabled'); } echo "</select><a href='$rootpath/EDIMessageFormat.php?" . SID . "&MessageType=INVOIC&PartnerCode=" . $_SESSION['CustomerID'] . "'>"._('Create') . '/' . _('Edit Invoice Message Format').'</a></td></tr>'; echo '<tr><td>'._('Enable Receiving of EDI Orders').":</td> - <td><select TABINDEX=2 name='EDIOrders'>"; + <td><select tabindex=2 name='EDIOrders'>"; if ($myrow['ediorders']==0){ - echo '<option selected VALUE=0>'._('Disabled'); - echo '<option VALUE=1>'._('Enabled'); + echo '<option selected VALUE=0>'._('Disabled'); + echo '<option VALUE=1>'._('Enabled'); } else { - echo '<option VALUE=0>'._('Disabled'); - echo '<option selected VALUE=1>'._('Enabled'); + echo '<option VALUE=0>'._('Disabled'); + echo '<option selected VALUE=1>'._('Enabled'); } echo '</select></td></tr>'; echo '<tr><td>'._('Customer EDI Reference').":</td> <td><input " . (in_array('EDIReference',$Errors) ? 'class="inputerror"' : '' ) . - " TABINDEX=3 type='Text' name='EDIReference' size=20 maxlength=20 value='" . $myrow['edireference'] . "'></td></tr>"; + " tabindex=3 type='Text' name='EDIReference' size=20 maxlength=20 value='" . $myrow['edireference'] . "'></td></tr>"; echo '<tr><td>'._('EDI Communication Method').":</td> - <td><select TABINDEX=4 name='EDITransport'>"; + <td><select tabindex=4 name='EDITransport'>"; if ($myrow['editransport']=='email'){ - echo "<option selected VALUE='email'>"._('Email Attachments'); - echo "<option VALUE='ftp'>"._('File Transfer Protocol (FTP)'); + echo "<option selected value='email'>"._('Email Attachments'); + echo "<option value='ftp'>"._('File Transfer Protocol (FTP)'); } else { - echo "<option VALUE='email'>"._('Email Attachments'); - echo "<option selected VALUE='ftp'>"._('File Transfer Protocol (FTP)'); + echo "<option value='email'>"._('Email Attachments'); + echo "<option selected value='ftp'>"._('File Transfer Protocol (FTP)'); } echo '</select></td></tr>'; echo '<tr><td>'._('FTP Server or Email Address').":</td> <td><input " . (in_array('EDIAddress',$Errors) ? 'class="inputerror"' : '' ) . - " TABINDEX=5 type='Text' name='EDIAddress' size=42 maxlength=40 value='" . $myrow['ediaddress'] . "'></td></tr>"; + " tabindex=5 type='Text' name='EDIAddress' size=42 maxlength=40 value='" . $myrow['ediaddress'] . "'></td></tr>"; if ($myrow['editransport']=='ftp'){ - echo '<tr><td>'._('FTP Server User Name').":</td> - <td><input TABINDEX=6 type='Text' name='EDIServerUser' size=20 maxlength=20 value=" . $myrow['ediserveruser'] . "></td></tr>"; - echo '<tr><td>'._('FTP Server Password').":</td> - <td><input TABINDEX=7 type='Text' name='EDIServerPwd' size=20 maxlength=20 value='" . $myrow['ediserverpwd'] . "'></td></tr>"; + echo '<tr><td>'._('FTP Server User Name').":</td> + <td><input tabindex=6 type='Text' name='EDIServerUser' size=20 maxlength=20 value=" . $myrow['ediserveruser'] . "></td></tr>"; + echo '<tr><td>'._('FTP Server Password').":</td> + <td><input tabindex=7 type='Text' name='EDIServerPwd' size=20 maxlength=20 value='" . $myrow['ediserverpwd'] . "'></td></tr>"; } -echo "</table><div class='centre'><input TABINDEX=8 type='Submit' name='submit' value='"._('Update EDI Configuration')."'></div></form>"; +echo "</table><br><div class='centre'><input tabindex=8 type='Submit' name='submit' value='"._('Update EDI Configuration')."'></div></form>"; include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-07-04 22:02:28 UTC (rev 3562) +++ trunk/doc/Change.log.html 2010-07-04 22:02:46 UTC (rev 3563) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>04/07/10 Tim: CustEDISetup.php - Corrections to sql statements</p> <p>04/07/10 Tim: Currencies.php - Corrections to sql statements and layout changes</p> <p>04/07/10 Tim: CreditStatus.php - Corrections to sql statements and layout changes</p> <p>04/07/10 Tim: Credit_Invoice.php - Minor bug fixes layout changes and corrections to sql statements</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |