From: <dai...@us...> - 2011-04-11 10:33:41
|
Revision: 4546 http://web-erp.svn.sourceforge.net/web-erp/?rev=4546&view=rev Author: daintree Date: 2011-04-11 10:33:34 +0000 (Mon, 11 Apr 2011) Log Message: ----------- to launchpad 4587-86 Modified Paths: -------------- trunk/AddCustomerContacts.php trunk/AuditTrail.php trunk/GLBudgets.php trunk/PcAuthorizeExpenses.php trunk/PcExpensesTypeTab.php trunk/PcTypeTabs.php trunk/SelectSalesOrder.php trunk/StockLocTransfer.php trunk/TopItems.php trunk/UserSettings.php trunk/WWW_Users.php trunk/api/api_workorders.php trunk/doc/Change.log.html Modified: trunk/AddCustomerContacts.php =================================================================== --- trunk/AddCustomerContacts.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/AddCustomerContacts.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -1,5 +1,5 @@ <?php -/* $Revision: 1.6 $ */ + /* $Id$*/ include('includes/session.inc'); @@ -17,8 +17,8 @@ } elseif (isset($_GET['DebtorNo'])){ $DebtorNo = $_GET['DebtorNo']; } -echo "<a href='" . $rootpath . '/Customers.php?' . SID .'&DebtorNo='.$DebtorNo."'>" . _('Back to Customers') . '</a><br>'; -$SQLname="SELECT * from debtorsmaster where debtorno='" .$DebtorNo."'"; +echo "<a href='" . $rootpath . '/Customers.php?' . SID .'&DebtorNo='.$DebtorNo."'>" . _('Back to Customers') . '</a><br />'; +$SQLname="SELECT name FROM debtorsmaster where debtorno='" .$DebtorNo."'"; $Result = DB_query($SQLname,$db); $row = DB_fetch_array($Result); if (!isset($_GET['Id'])) { @@ -38,13 +38,13 @@ //first off validate inputs sensible if (isset($_POST['Con_ID']) and !is_long((integer)$_POST['Con_ID'])) { $InputError = 1; - prnMsg( _('The Contact must be an integer.'), 'error'); + prnMsg( _('The Contact ID must be an integer.'), 'error'); } elseif (strlen($_POST['conName']) >40) { $InputError = 1; - prnMsg( _("The contact's name must be forty characters or less long"), 'error'); + prnMsg( _('The contact name must be forty characters or less long'), 'error'); } elseif( trim($_POST['conName']) == '' ) { $InputError = 1; - prnMsg( _("The contact's name may not be empty"), 'error'); + prnMsg( _('The contact name may not be empty'), 'error'); } if (isset($Id) and ($Id and $InputError !=1)) { @@ -72,11 +72,11 @@ if ($InputError !=1) { $result = DB_query($sql,$db); - //echo '<br>'.$sql; + //echo '<br />'.$sql; - echo '<br>'; + echo '<br />'; prnMsg($msg, 'success'); - echo '<br>'; + echo '<br />'; unset($Id); unset($_POST['conName']); unset($_POST['conRole']); @@ -92,9 +92,9 @@ $sql="DELETE FROM custcontacts WHERE contid=".$Id." and debtorno='".$DebtorNo."'"; $result = DB_query($sql,$db); - //echo '<br>'.$sql; + //echo '<br />'.$sql; - echo '<br>'; + echo '<br />'; prnMsg( _('The contact record has been deleted'), 'success'); unset($Id); unset($_GET['delete']); @@ -105,7 +105,7 @@ $sql = "SELECT * FROM custcontacts where debtorno='".$DebtorNo."' ORDER BY contid"; $result = DB_query($sql,$db); - //echo '<br>'.$sql; + //echo '<br />'.$sql; echo '<table class=selection>'; echo '<tr> @@ -153,7 +153,7 @@ <?php if (!isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '&DebtorNo='.$DebtorNo.'">'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?DebtorNo='.$DebtorNo.'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($Id)) { @@ -163,7 +163,7 @@ and debtorno='".$DebtorNo."'"; $result = DB_query($sql, $db); - //echo '<br>'.$sql; + //echo '<br />'.$sql; $myrow = DB_fetch_array($result); Modified: trunk/AuditTrail.php =================================================================== --- trunk/AuditTrail.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/AuditTrail.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -2,8 +2,6 @@ /* $Id$ */ -//$PageSecurity=15; - include('includes/session.inc'); $title = _('Audit Trail'); @@ -25,12 +23,12 @@ } // Get list of tables -$tableresult = DB_show_tables($db); +$TableResult = DB_show_tables($db); // Get list of users -$userresult = DB_query('SELECT userid FROM www_users',$db); +$UserResult = DB_query("SELECT userid FROM www_users",$db); -echo '<form action=' . $_SERVER['PHP_SELF'] . '?' . SID . ' method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection>'; @@ -43,29 +41,29 @@ echo '<tr><td>'. _('User ID'). '</td> <td><select tabindex="3" name="SelectedUser">'; echo '<option value=ALL>ALL'; -while ($users = DB_fetch_row($userresult)) { +while ($users = DB_fetch_row($UserResult)) { if (isset($_POST['SelectedUser']) and $users[0]==$_POST['SelectedUser']) { - echo '<option selected value=' . $users[0] . '>' . $users[0]; + echo '<option selected value=' . $users[0] . '>' . $users[0] . '</option>'; } else { - echo '<option value=' . $users[0] . '>' . $users[0]; + echo '<option value=' . $users[0] . '>' . $users[0] . '</option>'; } } echo '</select></td></tr>'; // Show table selections echo '<tr><td>'. _('Table '). '</td><td><select tabindex="4" name="SelectedTable">'; -echo '<option value=ALL>ALL'; -while ($tables = DB_fetch_row($tableresult)) { +echo '<option value="ALL">' . _('ALL') . '</option>'; +while ($tables = DB_fetch_row($TableResult)) { if (isset($_POST['SelectedTable']) and $tables[0]==$_POST['SelectedTable']) { - echo '<option selected value=' . $tables[0] . '>' . $tables[0]; + echo '<option selected value=' . $tables[0] . '>' . $tables[0] . '</option>'; } else { - echo '<option value=' . $tables[0] . '>' . $tables[0]; + echo '<option value=' . $tables[0] . '>' . $tables[0] . '</option>'; } } echo '</select></td></tr>'; echo '</table><br />'; -echo "<div class=centre><input tabindex='5' type=submit name=View value='" . _('View') . "'></div>"; +echo '<div class="centre"><input tabindex="5" type="submit" name="View" value="' . _('View') . '"></div>'; echo '</form>'; // View the audit trail @@ -112,12 +110,12 @@ } function DeleteQueryInfo($SQLString) { - $SQLArray = explode('WHERE', $SQLString); + $SQLArray = explode("WHERE", $SQLString); $_SESSION['SQLString']['table'] = $SQLArray[0]; $SQLString = trim(str_replace($SQLArray[0], '', $SQLString)); - $SQLString = trim(str_replace('DELETE', '', $SQLString)); - $SQLString = trim(str_replace('FROM', '', $SQLString)); - $SQLString = trim(str_replace('WHERE', '', $SQLString)); + $SQLString = trim(str_replace("DELETE", '', $SQLString)); + $SQLString = trim(str_replace("FROM", '', $SQLString)); + $SQLString = trim(str_replace("WHERE", '', $SQLString)); $Assigment = explode('=', $SQLString); $_SESSION['SQLString']['fields'][0] = $Assigment[0]; $_SESSION['SQLString']['values'][0] = $Assigment[1]; @@ -148,16 +146,16 @@ <th>' . _('Field Name') . '</th> <th>' . _('Value') . '</th></tr>'; while ($myrow = DB_fetch_row($result)) { - if (Query_Type($myrow[2]) == 'INSERT') { + if (Query_Type($myrow[2]) == "INSERT") { InsertQueryInfo(str_replace("INSERT INTO",'',$myrow[2])); $RowColour = '#a8ff90'; } - if (Query_Type($myrow[2]) == 'UPDATE') { - UpdateQueryInfo(str_replace('UPDATE','',$myrow[2])); + if (Query_Type($myrow[2]) == "UPDATE") { + UpdateQueryInfo(str_replace("UPDATE",'',$myrow[2])); $RowColour = '#feff90'; } - if (Query_Type($myrow[2]) == 'DELETE') { - DeleteQueryInfo(str_replace('DELETE FROM','',$myrow[2])); + if (Query_Type($myrow[2]) == "DELETE") { + DeleteQueryInfo(str_replace("DELETE FROM",'',$myrow[2])); $RowColour = '#fe90bf'; } Modified: trunk/GLBudgets.php =================================================================== --- trunk/GLBudgets.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/GLBudgets.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -33,10 +33,10 @@ echo '</br><tr><td>'. _('Select GL Account'). ":</td><td><select name='SelectedAccount' onChange='ReloadForm(selectaccount.Select)'>"; -$SQL = 'SELECT accountcode, +$SQL = "SELECT accountcode, accountname FROM chartmaster - ORDER BY accountcode'; + ORDER BY accountcode"; $result=DB_query($SQL,$db); if (DB_num_rows($result)==0){ @@ -215,12 +215,12 @@ echo '<script>defaultControl(document.form.1next);</script>'; echo '</br><div class="centre"><input type="submit" name=update value="' . _('Update') . '"></div></form>'; - $SQL='SELECT MIN(periodno) FROM periods'; + $SQL="SELECT MIN(periodno) FROM periods"; $result=DB_query($SQL,$db); $MyRow=DB_fetch_array($result); $FirstPeriod=$MyRow[0]; - $SQL='SELECT MAX(periodno) FROM periods'; + $SQL="SELECT MAX(periodno) FROM periods"; $result=DB_query($SQL,$db); $MyRow=DB_fetch_array($result); $LastPeriod=$MyRow[0]; Modified: trunk/PcAuthorizeExpenses.php =================================================================== --- trunk/PcAuthorizeExpenses.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/PcAuthorizeExpenses.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -1,7 +1,6 @@ <?php -/* $Revision: 1.0 $ */ -//$PageSecurity = 6; +/* $Id$ */ include('includes/session.inc'); $title = _('Authorization of Petty Cash Expenses'); @@ -41,16 +40,16 @@ } if (isset($_POST['submit']) or isset($_POST['update']) OR isset($SelectedTabs) OR isset ($_POST['GO'])) { - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if(!isset ($Days)){ $Days=30; } - echo "<input type=hidden name='SelectedTabs' VALUE=" . $SelectedTabs . ">"; + echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '">'; echo '<br><table class=selection>'; - echo "<tr><th colspan=7>" . _('Detail Of Movement For Last ') .': '; - echo "<input type=text class=number name='Days' VALUE=" . $Days . " MAXLENGTH =3 size=4> Days "; + echo '<tr><th colspan="7">' . _('Detail Of Movement For Last ') .': '; + echo '<input type="text" class="number" name="Days" value="' . $Days . '" maxlength ="3" size="4"> ' ._('Days'); echo '<input type=submit name="Go" value="' . _('Go') . '"></tr></th>'; echo '</form>'; @@ -77,15 +76,15 @@ $result = DB_query($sql,$db); - echo "<tr> - <th>" . _('Date') . "</th> - <th>" . _('Expense Code') . "</th> - <th>" . _('Amount') . "</th> - <th>" . _('Posted') . "</th> - <th>" . _('Notes') . "</th> - <th>" . _('Receipt') . "</th> - <th>" . _('Authorized') . "</th> - </tr>"; + echo '<tr> + <th>' . _('Date') . '</th> + <th>' . _('Expense Code') . '</th> + <th>' . _('Amount') . '</th> + <th>' . _('Posted') . '</th> + <th>' . _('Notes') . '</th> + <th>' . _('Receipt') . '</th> + <th>' . _('Authorized') . '</th> + </tr>'; $k=0; //row colour counter echo'<form action="PcAuthorizeExpenses.php" method="POST" name="'._('update').'">'; @@ -94,7 +93,7 @@ while ($myrow=DB_fetch_array($result)) { //update database if update pressed - if ((isset($_POST['submit']) and $_POST['submit']==_('Update')) AND isset($_POST[$myrow['counterindex']])){ + if ((isset($_POST['submit']) AND $_POST['submit']==_('Update')) AND isset($_POST[$myrow['counterindex']])){ $PeriodNo = GetPeriod(ConvertSQLDate($myrow['date']), $db); @@ -124,7 +123,7 @@ $typeno = GetNextTransNo($type,$db); //build narrative - $narrative= "PettyCash - ".$myrow['tabcode']." - ".$myrow['codeexpense']." - ".$myrow['notes']." - ".$myrow['receipt'].""; + $narrative= _('PettyCash') . ' - ' . $myrow['tabcode'] . ' - ' . $myrow['codeexpense'] . ' - ' . DB_escape_string($myrow['notes']) . ' - '.$myrow['receipt']; //insert to gltrans DB_Txn_Begin($db); Modified: trunk/PcExpensesTypeTab.php =================================================================== --- trunk/PcExpensesTypeTab.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/PcExpensesTypeTab.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -1,7 +1,6 @@ <?php -/* $Revision: 1.0 $ */ -//$PageSecurity = 15; +/* $Id$ */ include('includes/session.inc'); $title = _('Maintenance Of Petty Cash Expenses For a Type Tab'); @@ -14,6 +13,8 @@ $SelectedType = strtoupper($_POST['SelectedType']); } elseif (isset($_GET['SelectedType'])){ $SelectedType = strtoupper($_GET['SelectedType']); +} else { + $SelectedType=''; } if (ContainsIllegalCharacters($SelectedType) OR strpos($SelectedType,' ')>0){ $InputError = 1; @@ -58,7 +59,7 @@ VALUES ('" . $_POST['SelectedTabs'] . "', '" . $_POST['SelectedExpense'] . "')"; - $msg = _('Expense code:') . ' ' . $_POST["SelectedExpense"].' '._('for Type of Tab:') .' '. $_POST["SelectedTabs"] . ' ' . _('has been created'); + $msg = _('Expense code:') . ' ' . $_POST['SelectedExpense'].' '._('for Type of Tab:') .' '. $_POST['SelectedTabs'] . ' ' . _('has been created'); $checkSql = "SELECT count(typetabcode) FROM pctypetabs"; $result = DB_query($checkSql, $db); @@ -96,25 +97,26 @@ then none of the above are true and the list of sales types will be displayed with links to delete or edit each. These will call the same page again and allow update/input or deletion of the records*/ -echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; -echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<table class=selection>'; //Main table + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<table class=selection>'; //Main table + + echo '<tr><td>' . _('Select Type of Tab') . ':</td><td><select name="SelectedTabs">'; -echo '<tr><td>' . _('Select Type of Tab') . ":</td><td><select name='SelectedTabs'>"; - DB_free_result($result); - $SQL = "SELECT typetabcode,typetabdescription - FROM pctypetabs"; + $SQL = "SELECT typetabcode, + typetabdescription + FROM pctypetabs"; $result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['SelectedTabs']) and $myrow['typetabcode']==$_POST['SelectedTabs']) { - echo "<option selected VALUE='"; + echo '<option selected value="'; } else { - echo "<option VALUE='"; + echo '<option VALUE="'; } - echo $myrow['typetabcode'] . "'>" . $myrow['typetabcode'] . ' - ' . $myrow['typetabdescription']; + echo $myrow['typetabcode'] . '">' . $myrow['typetabcode'] . ' - ' . $myrow['typetabdescription'] . '</option>'; } //end while loop @@ -142,11 +144,11 @@ $result = DB_query($sql,$db); - echo '<table class=selection>'; - echo "<tr> - <th>" . _('Expense Code') . "</th> - <th>" . _('Description') . "</th> - </tr>"; + echo '<table class="selection">'; + echo '<tr> + <th>' . _('Expense Code') . '</th> + <th>' . _('Description') . '</th> + </tr>'; $k=0; //row colour counter @@ -176,47 +178,44 @@ if (! isset($_GET['delete'])) { - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '>'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<br /><table class=selection>'; //Main table - - - - echo '<tr><td>' . _('Select Expense Code') . ":</td><td><select name='SelectedExpense'>"; - - DB_free_result($result); - $SQL = "SELECT codeexpense,description - FROM pcexpenses"; - - $result = DB_query($SQL,$db); - - while ($myrow = DB_fetch_array($result)) { - if (isset($_POST['SelectedExpense']) and $myrow['codeexpense']==$_POST['SelectedExpense']) { - echo "<option selected VALUE='"; - } else { - echo "<option VALUE='"; - } - echo $myrow['codeexpense'] . "'>" . $myrow['codeexpense'] . ' - ' . $myrow['description']; - - } //end while loop - - echo '</select></td></tr>'; - - - echo "<input type=hidden name='SelectedTabs' VALUE=" . $SelectedTabs . ">"; - - echo '</td></tr></table>'; // close main table - - echo '<p><div class="centre"><input type=submit name=submit VALUE="' . _('Accept') . '"><input type=submit name=Cancel VALUE="' . _('Cancel') . '"></div>'; - - echo '</form>'; - -} // end if user wish to delete - - + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<br /><table class="selection">'; //Main table + + + + echo '<tr><td>' . _('Select Expense Code') . ':</td><td><select name="SelectedExpense">'; + + DB_free_result($result); + $SQL = "SELECT codeexpense, + description + FROM pcexpenses"; + + $result = DB_query($SQL,$db); + + while ($myrow = DB_fetch_array($result)) { + if (isset($_POST['SelectedExpense']) and $myrow['codeexpense']==$_POST['SelectedExpense']) { + echo '<option selected value="'; + } else { + echo '<option value="'; + } + echo $myrow['codeexpense'] . '">' . $myrow['codeexpense'] . ' - ' . $myrow['description'] . '</option>'; + + } //end while loop + + echo '</select></td></tr>'; + + + echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '">'; + + echo '</td></tr></table>'; // close main table + + echo '<p><div class="centre"><input type=submit name=submit VALUE="' . _('Accept') . '"><input type=submit name=Cancel VALUE="' . _('Cancel') . '"></div>'; + + echo '</form>'; + + } // end if user wish to delete } - - include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/PcTypeTabs.php =================================================================== --- trunk/PcTypeTabs.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/PcTypeTabs.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -1,8 +1,6 @@ <?php /* $Id$ */ -//$PageSecurity = 15; - include('includes/session.inc'); $title = _('Maintenance Of Petty Cash Type of Tabs'); include('includes/header.inc'); @@ -125,7 +123,7 @@ echo '<br>'; echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<p><div class="centre"><input type=submit name=return VALUE="' . _('Return to list of tab types') . '"></div>'; + echo '<p><div class="centre"><input type=submit name=return value="' . _('Return to list of tab types') . '"></div>'; echo '</form>'; include('includes/footer.inc'); exit; @@ -190,7 +188,7 @@ } if (! isset($_GET['delete'])) { - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p><table class=selection>'; //Main table @@ -220,19 +218,19 @@ // This is a new type so the user may volunteer a type code - echo "<table class=selection><tr><td>" . _('Code Of Type Of Tab') . ":</td><td><input type='Text' - " . (in_array('TypeTabCode',$Errors) ? 'class="inputerror"' : '' ) ." name='TypeTabCode'></td></tr>"; + echo '<table class="selection"><tr><td>' . _('Code Of Type Of Tab') . ':</td><td><input type="text" + ' . (in_array('TypeTabCode',$Errors) ? 'class="inputerror"' : '' ) .' name="TypeTabCode"></td></tr>'; } if (!isset($_POST['TypeTabDescription'])) { $_POST['TypeTabDescription']=''; } - echo "<tr><td>" . _('Description Of Type of Tab') . ":</td><td><input type='Text' name='TypeTabDescription' size=50 maxlength=49 value='" . $_POST['TypeTabDescription'] . "'></td></tr>"; + echo '<tr><td>' . _('Description Of Type of Tab') . ':</td><td><input type="text" name="TypeTabDescription" size="50" maxlength="49" value="' . $_POST['TypeTabDescription'] . '"></td></tr>'; echo '</td></tr></table>'; // close main table - echo '<p><div class="centre"><input type=submit name=submit VALUE="' . _('Accept') . '"><input type=submit name=Cancel VALUE="' . _('Cancel') . '"></div>'; + echo '<p><div class="centre"><input type=submit name=submit value="' . _('Accept') . '"><input type=submit name="Cancel" VALUE="' . _('Cancel') . '"></div>'; echo '</form>'; Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/SelectSalesOrder.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -417,10 +417,11 @@ if (!isset($_REQUEST['OrderNumber']) or $_REQUEST['OrderNumber']==''){ echo '<table class=selection>'; - echo '<tr><td>' . _('Order number') . ": </td><td><input type=text name='OrderNumber' maxlength=8 size=9></td><td>" . - _('From Stock Location') . ":</td><td><select name='StockLocation'> "; + echo '<tr><td>' . _('Order number') . ': </td> + <td><input type="text" name="OrderNumber" maxlength="8" size="9"></td> + <td>' . _('From Stock Location') . ':</td><td><select name="StockLocation"> '; - $sql = 'SELECT loccode, locationname FROM locations'; + $sql = "SELECT loccode, locationname FROM locations"; $resultStkLocs = DB_query($sql,$db); @@ -459,10 +460,10 @@ _('Add Sales Order') . '</a></td></tr></table>'; } - $SQL='SELECT categoryid, + $SQL="SELECT categoryid, categorydescription FROM stockcategory - ORDER BY categorydescription'; + ORDER BY categorydescription"; $result1 = DB_query($SQL,$db); Modified: trunk/StockLocTransfer.php =================================================================== --- trunk/StockLocTransfer.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/StockLocTransfer.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -1,8 +1,6 @@ <?php /* $Id$*/ -/* contributed by Chris Bice */ -//$PageSecurity = 11; include('includes/session.inc'); $title = _('Inventory Location Transfer Shipment'); include('includes/header.inc'); @@ -17,7 +15,7 @@ $result = DB_query("SELECT * FROM loctransfers WHERE reference='" . $_POST['Trf_ID'] . "'",$db); if (DB_num_rows($result)!=0){ $InputError = true; - $ErrorMessage = _('This transaction has already been entered') . '. ' . _('Please start over now').'<br>'; + $ErrorMessage = _('This transaction has already been entered') . '. ' . _('Please start over now').'<br />'; unset($_POST['submit']); unset($_POST['EnterMoreItems']); for ($i=$_POST['LinesCounter']-10;$i<$_POST['LinesCounter'];$i++){ @@ -33,19 +31,19 @@ $myrow = DB_fetch_row($result); if ($myrow[0]==0){ $InputError = True; - $ErrorMessage .= _('The part code entered of'). ' ' . $_POST['StockID' . $i] . ' '. _('is not set up in the database') . '. ' . _('Only valid parts can be entered for transfers'). '<br>'; + $ErrorMessage .= _('The part code entered of'). ' ' . $_POST['StockID' . $i] . ' '. _('is not set up in the database') . '. ' . _('Only valid parts can be entered for transfers'). '<br />'; $_POST['LinesCounter'] -= 10; } DB_free_result( $result ); if (!is_numeric($_POST['StockQTY' . $i])){ $InputError = True; - $ErrorMessage .= _('The quantity entered of'). ' ' . $_POST['StockQTY' . $i] . ' '. _('for part code'). ' ' . $_POST['StockID' . $i] . ' '. _('is not numeric') . '. ' . _('The quantity entered for transfers is expected to be numeric').'<br>'; + $ErrorMessage .= _('The quantity entered of'). ' ' . $_POST['StockQTY' . $i] . ' '. _('for part code'). ' ' . $_POST['StockID' . $i] . ' '. _('is not numeric') . '. ' . _('The quantity entered for transfers is expected to be numeric').'<br />'; $_POST['LinesCounter'] -= 10; } if ($_POST['StockQTY' . $i] <= 0){ $InputError = True; - $ErrorMessage .= _('The quantity entered for').' '. $_POST['StockID' . $i] . ' ' . _('is less than or equal to 0') . '. ' . _('Please correct this or remove the item').'<br>'; - + $ErrorMessage .= _('The quantity entered for').' '. $_POST['StockID' . $i] . ' ' . _('is less than or equal to 0') . '. ' . _('Please correct this or remove the item').'<br />'; + $_POST['LinesCounter'] -= 10; } // Only if stock exists at this location $result = DB_query("SELECT quantity FROM locstock WHERE stockid='" . $_POST['StockID' . $i] . "' and loccode='".$_POST['FromStockLocation']."'",$db); @@ -61,7 +59,7 @@ }//for all LinesCounter if ($TotalItems == 0){ $InputError = True; - $ErrorMessage .= _('You must enter at least 1 Stock Item to transfer').'<br>'; + $ErrorMessage .= _('You must enter at least 1 Stock Item to transfer').'<br />'; } /*Ship location and Receive location are different */ @@ -122,10 +120,10 @@ } if (isset($InputError) and $InputError==true){ - echo '<br>'; + echo '<br />'; prnMsg($ErrorMessage, 'error'); - echo '<br>'; + echo '<br />'; } @@ -215,8 +213,8 @@ $i++; } - echo '</table><br><div class="centre"> - <input type=hidden name="LinesCounter" value='. $i .'><input type=submit name="EnterMoreItems" value="'. _('Add More Items'). '"><input type=submit name="Submit" value="'. _('Create Transfer Shipment'). '"><br>'; + echo '</table><br /><div class="centre"> + <input type=hidden name="LinesCounter" value='. $i .'><input type=submit name="EnterMoreItems" value="'. _('Add More Items'). '"><input type=submit name="Submit" value="'. _('Create Transfer Shipment'). '"><br />'; echo '<script type="text/javascript">defaultControl(document.forms[0].StockID0);</script>'; echo '</form></div>'; include('includes/footer.inc'); Modified: trunk/TopItems.php =================================================================== --- trunk/TopItems.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/TopItems.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -11,9 +11,9 @@ if (!(isset($_POST['Search']))) { echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Top Sales Order Search') . '" alt="" />' . ' ' . _('Top Sales Order Search') . '</p>'; - echo "<form action=" . $_SERVER['PHP_SELF'] . '?' . SID . ' name="SelectCustomer" method=POST>'; + echo '<form action="' . $_SERVER['PHP_SELF'] . '?name="SelectCustomer" method="POST">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table cellpadding=3 colspan=4 class=selection>'; + echo '<table cellpadding="3" colspan="4" class="selection">'; //to view store location echo '<tr><td width="150">' . _('Select Location') . ' </td><td>:</td><td><select name=Location>'; $sql = "SELECT loccode, @@ -83,7 +83,7 @@ AND salesorderdetails.stkcode = stockmaster.stockid AND salesorders.debtorno = debtorsmaster.debtorno AND debtorsmaster.currcode = currencies.currabrev - AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' + AND salesorderdetails.actualdispatchdate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode ORDER BY '" . $_POST['Sequence'] . "' DESC LIMIT " . $_POST['NumberOfTopItems'] . ""; @@ -104,7 +104,7 @@ AND salesorders.debtorno = debtorsmaster.debtorno AND debtorsmaster.currcode = currencies.currabrev AND debtorsmaster.typeid = '" . $_POST['Customers'] . "' - AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' + AND salesorderdetails.actualdispatchdate >= '" . $FromDate . "' GROUP BY salesorderdetails.stkcode ORDER BY '" . $_POST['Sequence'] . "' DESC LIMIT " . $_POST[NumberOfTopItems] . ""; @@ -112,44 +112,44 @@ //the situation if the customer type selected "All" if ($_POST['Customers'] == 'All') { $SQL = "SELECT salesorderdetails.stkcode, - SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, - SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, - stockmaster.description, - stockmaster.units, - currencies.rate, - debtorsmaster.currcode, - stockmaster.decimalplaces - FROM salesorderdetails, salesorders, debtorsmaster,stockmaster, currencies - WHERE salesorderdetails.orderno = salesorders.orderno - AND salesorderdetails.stkcode = stockmaster.stockid - AND salesorders.debtorno = debtorsmaster.debtorno - AND debtorsmaster.currcode = currencies.currabrev - AND salesorders.fromstkloc = '" . $_POST['Location'] . "' - AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' - GROUP BY salesorderdetails.stkcode - ORDER BY " . $_POST['Sequence'] . " DESC - LIMIT " . $_POST['NumberOfTopItems'] . ""; + SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, + SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, + stockmaster.description, + stockmaster.units, + currencies.rate, + debtorsmaster.currcode, + stockmaster.decimalplaces + FROM salesorderdetails, salesorders, debtorsmaster,stockmaster, currencies + WHERE salesorderdetails.orderno = salesorders.orderno + AND salesorderdetails.stkcode = stockmaster.stockid + AND salesorders.debtorno = debtorsmaster.debtorno + AND debtorsmaster.currcode = currencies.currabrev + AND salesorders.fromstkloc = '" . $_POST['Location'] . "' + AND salesorderdetails.actualdispatchdate >= '" . $FromDate . "' + GROUP BY salesorderdetails.stkcode + ORDER BY " . $_POST['Sequence'] . " DESC + LIMIT " . $_POST['NumberOfTopItems'] . ""; } else { //the situation if the location and customer type not selected "All" $SQL = "SELECT salesorderdetails.stkcode, - SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, - SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, - stockmaster.description, - stockmaster.units, - currencies.rate, - debtorsmaster.currcode, - stockmaster.decimalplaces - FROM salesorderdetails, salesorders, debtorsmaster,stockmaster, currencies - WHERE salesorderdetails.orderno = salesorders.orderno - AND salesorderdetails.stkcode = stockmaster.stockid - AND salesorders.debtorno = debtorsmaster.debtorno - AND debtorsmaster.currcode = currencies.currabrev - AND salesorders.fromstkloc = '" . $_POST['Location'] . "' - AND debtorsmaster.typeid = '" . $_POST['Customers'] . "' - AND salesorderdetails.ActualDispatchDate >= '" . $FromDate . "' - GROUP BY salesorderdetails.stkcode - ORDER BY '" . $_POST['Sequence'] . "' DESC - LIMIT " . $_POST['NumberOfTopItems'] . ""; + SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, + SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, + stockmaster.description, + stockmaster.units, + currencies.rate, + debtorsmaster.currcode, + stockmaster.decimalplaces + FROM salesorderdetails, salesorders, debtorsmaster,stockmaster, currencies + WHERE salesorderdetails.orderno = salesorders.orderno + AND salesorderdetails.stkcode = stockmaster.stockid + AND salesorders.debtorno = debtorsmaster.debtorno + AND debtorsmaster.currcode = currencies.currabrev + AND salesorders.fromstkloc = '" . $_POST['Location'] . "' + AND debtorsmaster.typeid = '" . $_POST['Customers'] . "' + AND salesorderdetails.actualdispatchdate >= '" . $FromDate . "' + GROUP BY salesorderdetails.stkcode + ORDER BY '" . $_POST['Sequence'] . "' DESC + LIMIT " . $_POST['NumberOfTopItems'] . ""; } } } Modified: trunk/UserSettings.php =================================================================== --- trunk/UserSettings.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/UserSettings.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -97,7 +97,7 @@ } } -echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; +echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; If (!isset($_POST['DisplayRecordsMax']) OR $_POST['DisplayRecordsMax']=='') { @@ -114,20 +114,19 @@ <input type="hidden" name="RealName" VALUE="'.$_SESSION['UsersRealName'].'"<td></tr>'; echo '<tr> - <td>' . _('Maximum Number of Records to Display') . ":</td> - <td><input type='Text' class='number' name='DisplayRecordsMax' size=3 maxlength=3 VALUE=" . $_POST['DisplayRecordsMax'] . " ></td> - </tr>"; + <td>' . _('Maximum Number of Records to Display') . ':</td> + <td><input type="text" class="number" name="DisplayRecordsMax" size="3" maxlength="3" value="' . $_POST['DisplayRecordsMax'] . '" ></td> + </tr>'; echo '<tr> - <td>' . _('Language') . ":</td> - <td><select name='Language'>"; + <td>' . _('Language') . ':</td> + <td><select name="Language">'; - $LangDirHandle = dir('locale/'); + $Languages = scandir('locale/', 0); - - while (false != ($LanguageEntry = $LangDirHandle->read())){ - + foreach ($Languages as $LanguageEntry){ + if (is_dir('locale/' . $LanguageEntry) AND $LanguageEntry != '..' AND $LanguageEntry != '.svn' Modified: trunk/WWW_Users.php =================================================================== --- trunk/WWW_Users.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/WWW_Users.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -574,13 +574,15 @@ <td>' . _('Language') . ':</td> <td><select name="UserLanguage">'; - $LangDirHandle = dir('locale/'); +$Languages = scandir('locale/', 0); +foreach ($Languages as $LanguageEntry){ + + if (is_dir('locale/' . $LanguageEntry) + AND $LanguageEntry != '..' + AND $LanguageEntry != '.svn' + AND $LanguageEntry!='.'){ -while (false != ($LanguageEntry = $LangDirHandle->read())){ - - if (is_dir('locale/' . $LanguageEntry) AND $LanguageEntry != '..' AND $LanguageEntry != 'CVS' AND $LanguageEntry!='.'){ - if (isset($_POST['UserLanguage']) and $_POST['UserLanguage'] == $LanguageEntry){ echo '<option selected value="' . $LanguageEntry . '">' . $LanguageEntry .'</option>'; } elseif (!isset($_POST['UserLanguage']) and $LanguageEntry == $DefaultLanguage) { @@ -591,6 +593,8 @@ } } + + echo '</select></td></tr>'; Modified: trunk/api/api_workorders.php =================================================================== --- trunk/api/api_workorders.php 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/api/api_workorders.php 2011-04-11 10:33:34 UTC (rev 4546) @@ -44,7 +44,7 @@ } function VerifyRequiredByDate($RequiredByDate, $i, $Errors, $db) { - $sql="select confvalue from config where confname='DefaultDateFormat'"; + $sql="SELECT confvalue FROM config WHERE confname='DefaultDateFormat'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; @@ -77,7 +77,7 @@ } function VerifyStartDate($StartDate, $i, $Errors, $db) { - $sql="select confvalue from config where confname='DefaultDateFormat'"; + $sql="SELECT confvalue FROM config WHERE confname='DefaultDateFormat'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; @@ -310,37 +310,37 @@ '".$newqoh."', '".$cost."', '".$cost."')"; - $locstocksql='UPDATE locstock SET quantity = quantity + '.$Quantity." - WHERE loccode='". $Location."' - AND stockid='".$StockID."'"; + $locstocksql="UPDATE locstock SET quantity = quantity + " . $Quantity ." + WHERE loccode='". $Location."' + AND stockid='".$StockID."'"; $glupdatesql1="INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - amount, - narrative) - VALUES (28, - '".$TransactionNo. "', - '".$TranDate."', - '".GetPeriodFromTransactionDate($TranDate, sizeof($Errors), $Errors, $db)."', - '".$wipglact."', - '".$cost*-$Quantity."', - '".$StockID.' x '.$Quantity.' @ '.$cost."')"; + typeno, + trandate, + periodno, + account, + amount, + narrative) + VALUES (28, + '".$TransactionNo. "', + '".$TranDate."', + '".GetPeriodFromTransactionDate($TranDate, sizeof($Errors), $Errors, $db)."', + '".$wipglact."', + '".$cost*-$Quantity."', + '".$StockID.' x '.$Quantity.' @ '.$cost."')"; $glupdatesql2="INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - amount, - narrative) - VALUES (28, - '".$TransactionNo."', - '".$TranDate."', - '".GetPeriodFromTransactionDate($TranDate, sizeof($Errors), $Errors, $db)."', - '".$stockact."', - '".$cost*$Quantity."', - '".$StockID.' x '.$Quantity.' @ '.$cost."')"; + typeno, + trandate, + periodno, + account, + amount, + narrative) + VALUES (28, + '".$TransactionNo."', + '".$TranDate."', + '".GetPeriodFromTransactionDate($TranDate, sizeof($Errors), $Errors, $db)."', + '".$stockact."', + '".$cost*$Quantity."', + '".$StockID.' x '.$Quantity.' @ '.$cost."')"; $systypessql = "UPDATE systypes set typeno='".$TransactionNo."' where typeid=28"; $batchsql="UPDATE stockserialitems SET quantity=quantity-" . $Quantity. " WHERE stockid='".$StockID."' @@ -474,7 +474,7 @@ } $sql="SELECT wo FROM woitems - WHERE ".$Field." LIKE '%".$Criteria."%'"; + WHERE " . $Field ." " . LIKE . " '%".$Criteria."%'"; $result = DB_Query($sql, $db); $i=0; $WOList = array(); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-04-10 10:41:20 UTC (rev 4545) +++ trunk/doc/Change.log.html 2011-04-11 10:33:34 UTC (rev 4546) @@ -1,6 +1,9 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p /> -<p>10/4/11 Tim: +<p>11/4/11 Tim: pcAuthorizeExpenses.php DB_escape_string(notes)</p> +<p>11/4/11 Tim: StockLocTransfer.php added $_POST['LinesCounter'] -= 10;</p> +<p>11/4/11 Tim/Phil: Use PHP 5 specific scandir to sort languages into alphabetic order for UserSettings and WWW_Users language selection</p> +<p>10/4/11 Tim: AddCustomerContacts.php use single field rather than * in SQL></p> <p>10/4/11 Tim: GLAccountInquiry.php show None if no tag selected</p> <p>10/4/11 Tim : PDFPrintLabel.php javascript fix</p> <p>10/4/11 Tim: Add perishable to StockTransfer.php and PDFStockTransfer</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |