From: <dai...@us...> - 2014-08-09 04:37:06
|
Revision: 6806 http://sourceforge.net/p/web-erp/reponame/6806 Author: daintree Date: 2014-08-09 04:37:02 +0000 (Sat, 09 Aug 2014) Log Message: ----------- review Modified Paths: -------------- trunk/AgedControlledInventory.php trunk/LocationUsers.php trunk/Locations.php trunk/includes/ConnectDB_mysqli.inc trunk/includes/LanguageSetup.php trunk/includes/MainMenuLinksArray.php trunk/includes/PDFStarter.php trunk/includes/UserLogin.php trunk/includes/session.inc Modified: trunk/AgedControlledInventory.php =================================================================== --- trunk/AgedControlledInventory.php 2014-08-08 16:12:36 UTC (rev 6805) +++ trunk/AgedControlledInventory.php 2014-08-09 04:37:02 UTC (rev 6806) @@ -5,7 +5,7 @@ include('includes/session.inc'); $PricesSecurity = 12;//don't show pricing info unless security token 12 available to user $Today = time(); -$Title = _('Aged Controlled Inventory') . ' as-of ' . Date(($_SESSION['DefaultDateFormat']), strtotime($UpcomingDate . ' + 0 days')); +$Title = _('Aged Controlled Inventory') . ' ' ._('as-of') .' ' . Date(($_SESSION['DefaultDateFormat']), strtotime($UpcomingDate . ' + 0 days')); include('includes/header.inc'); echo '<p class="page_title_text"> @@ -13,22 +13,21 @@ '" alt="" /><b>' . $Title. '</b> </p>'; -$sql = "SELECT stockserialitems.stockid, - stockmaster.description, - stockserialitems.serialno, +$sql = "SELECT stockserialitems.stockid, + stockmaster.description, + stockserialitems.serialno, stockserialitems.quantity, stockmoves.trandate, stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost AS cost, decimalplaces - FROM stockserialitems - LEFT JOIN stockserialmoves ON stockserialitems.serialno=stockserialmoves.serialno - LEFT JOIN stockmoves ON stockserialmoves.stockmoveno=stockmoves.stkmoveno - INNER JOIN stockmaster ON stockmaster.stockid = stockserialitems.stockid + FROM stockserialitems + LEFT JOIN stockserialmoves ON stockserialitems.serialno=stockserialmoves.serialno + LEFT JOIN stockmoves ON stockserialmoves.stockmoveno=stockmoves.stkmoveno + INNER JOIN stockmaster ON stockmaster.stockid = stockserialitems.stockid INNER JOIN locationusers ON locationusers.loccode=stockserialitems.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE quantity > 0 GROUP BY stockid, serialno - ORDER BY trandate - "; + ORDER BY trandate"; $ErrMsg = _('The stock held could not be retrieved because'); $LocStockResult = DB_query($sql, $db, $ErrMsg); Modified: trunk/LocationUsers.php =================================================================== --- trunk/LocationUsers.php 2014-08-08 16:12:36 UTC (rev 6805) +++ trunk/LocationUsers.php 2014-08-09 04:37:02 UTC (rev 6806) @@ -27,7 +27,7 @@ if (isset($_POST['Process'])) { if ($_POST['SelectedLocation'] == '') { - echo prnMsg(_('You have not selected any Location'), 'error'); + prnMsg(_('You have not selected any Location'), 'error'); echo '<br />'; unset($SelectedLocation); unset($_POST['SelectedLocation']); @@ -40,7 +40,7 @@ if ($_POST['SelectedUser'] == '') { $InputError = 1; - echo prnMsg(_('You have not selected an user to be authorised to use this Location'), 'error'); + prnMsg(_('You have not selected an user to be authorised to use this Location'), 'error'); echo '<br />'; unset($SelectedLocation); } @@ -59,7 +59,7 @@ if ($CheckRow[0] > 0) { $InputError = 1; - prnMsg(_('The user') . ' ' . $_POST['SelectedUser'] . ' ' . _('already authorised to use this Location'), 'error'); + prnMsg(_('The user') . ' ' . $_POST['SelectedUser'] . ' ' . _('is already authorised to use this location'), 'error'); } else { // Add new record on submit $SQL = "INSERT INTO locationusers (loccode, @@ -71,7 +71,7 @@ '1', '1')"; - $msg = _('User') . ': ' . $_POST['SelectedUser'] . ' ' . _('authorisation to use') . ' ' . $_POST['SelectedLocation'] . ' ' . _('Location has been changed'); + $msg = _('User') . ': ' . $_POST['SelectedUser'] . ' ' . _('authority to use the') . ' ' . $_POST['SelectedLocation'] . ' ' . _('location has been changed'); $Result = DB_query($SQL); prnMsg($msg, 'success'); unset($_POST['SelectedUser']); @@ -84,18 +84,18 @@ $ErrMsg = _('The Location user record could not be deleted because'); $Result = DB_query($SQL, $ErrMsg); - prnMsg(_('User') . ' ' . $SelectedUser . ' ' . _('has been un-authorised to use') . ' ' . $SelectedLocation . ' ' . _('Location'), 'success'); + prnMsg(_('User') . ' ' . $SelectedUser . ' ' . _('has had their authority to use the') . ' ' . $SelectedLocation . ' ' . _('location removed'), 'success'); unset($_GET['delete']); -} elseif (isset($_GET['toggleupd'])) { +} elseif (isset($_GET['ToggleUpdate'])) { $SQL = "UPDATE locationusers - SET canupd='" . $_GET['toggleupd'] . "' - WHERE loccode='" . $SelectedLocation . "' - AND userid='" . $SelectedUser . "'"; + SET canupd='" . $_GET['ToggleUpdate'] . "' + WHERE loccode='" . $SelectedLocation . "' + AND userid='" . $SelectedUser . "'"; $ErrMsg = _('The Location user record could not be deleted because'); $Result = DB_query($SQL, $ErrMsg); - prnMsg(_('User') . ' ' . $SelectedUser . ' ' . _('has been un-authorised to update') . ' ' . $SelectedLocation . ' ' . _('Location'), 'success'); - unset($_GET['toggleupd']); + prnMsg(_('User') . ' ' . $SelectedUser . ' ' . _('has had their authority to update') . ' ' . $SelectedLocation . ' ' . _('location removed'), 'success'); + unset($_GET['ToggleUpdate']); } if (!isset($SelectedLocation)) { @@ -109,11 +109,10 @@ <td>' . _('Select Location') . ':</td> <td><select name="SelectedLocation">'; - $SQL = "SELECT loccode, - locationname - FROM locations"; + $Result = DB_query("SELECT loccode, + locationname + FROM locations"); - $Result = DB_query($SQL); echo '<option value="">' . _('Not Yet Selected') . '</option>'; while ($MyRow = DB_fetch_array($Result)) { if (isset($SelectedLocation) and $MyRow['loccode'] == $SelectedLocation) { @@ -146,14 +145,13 @@ WHERE loccode='" . $SelectedLocation . "'"; $Result = DB_query($SQLName); $MyRow = DB_fetch_array($Result); - $SelectedBankName = $MyRow['locationname']; + $SelectedLocationName = $MyRow['locationname']; - echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">' . _('Authorised users for') . ' ' . $SelectedBankName . ' ' . _('Location') . '</a></div>'; - echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">' . _('Authorised users for') . ' ' . $SelectedLocationName . ' ' . _('Location') . '</a></div> + <form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '"> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> + <input type="hidden" name="SelectedLocation" value="' . $SelectedLocation . '" />'; - echo '<input type="hidden" name="SelectedLocation" value="' . $SelectedLocation . '" />'; - $SQL = "SELECT locationusers.userid, canview, canupd, @@ -167,7 +165,7 @@ echo '<table class="selection">'; echo '<tr> - <th colspan="6"><h3>' . _('Authorised users for Location') . ' ' . $SelectedBankName . '</h3></th> + <th colspan="6"><h3>' . _('Authorised users for Location') . ': ' . $SelectedLocationName . '</h3></th> </tr>'; echo '<tr> <th>' . _('User Code') . '</th> @@ -188,9 +186,9 @@ } if ($MyRow['canupd'] == 1) { - $ToggleText = '<td><a href="%s?SelectedUser=%s&toggleupd=0&SelectedLocation=' . $SelectedLocation . '" onclick="return confirm(\'' . _('Are you sure you wish to remove Update for this user?') . '\');">' . _('Remove Update') . '</a></td>'; + $ToggleText = '<td><a href="%s?SelectedUser=%s&ToggleUpdate=0&SelectedLocation=' . $SelectedLocation . '" onclick="return confirm(\'' . _('Are you sure you wish to remove Update for this user?') . '\');">' . _('Remove Update') . '</a></td>'; } else { - $ToggleText = '<td><a href="%s?SelectedUser=%s&toggleupd=1&SelectedLocation=' . $SelectedLocation . '" onclick="return confirm(\'' . _('Are you sure you wish to add Update for this user?') . '\');">' . _('Add Update') . '</a></td>'; + $ToggleText = '<td><a href="%s?SelectedUser=%s&ToggleUpdate=1&SelectedLocation=' . $SelectedLocation . '" onclick="return confirm(\'' . _('Are you sure you wish to add Update for this user?') . '\');">' . _('Add Update') . '</a></td>'; } printf('<td>%s</td> @@ -221,11 +219,10 @@ <td>' . _('Select User') . ':</td> <td><select name="SelectedUser">'; - $SQL = "SELECT userid, - realname - FROM www_users"; + $Result = DB_query("SELECT userid, + realname + FROM www_users"); - $Result = DB_query($SQL); if (!isset($_POST['SelectedUser'])) { echo '<option selected="selected" value="">' . _('Not Yet Selected') . '</option>'; } @@ -241,18 +238,16 @@ echo '</select> </td> - </tr>'; - - echo '</table>'; // close main table + </tr> + </table>'; // close main table DB_free_result($Result); echo '<div class="centre"> <input type="submit" name="submit" value="' . _('Accept') . '" /> <input type="submit" name="Cancel" value="' . _('Cancel') . '" /> - </div>'; + </div> + </form>'; - echo '</form>'; - } // end if user wish to delete } Modified: trunk/Locations.php =================================================================== --- trunk/Locations.php 2014-08-08 16:12:36 UTC (rev 6805) +++ trunk/Locations.php 2014-08-09 04:37:02 UTC (rev 6806) @@ -362,8 +362,8 @@ } $result= DB_query("DELETE FROM locstock WHERE loccode ='" . $SelectedLocation . "'",$db); + $result = DB_query("DELETE FROM locationusers WHERE loccode='" . $SelectedLocation . "'",$db); $result = DB_query("DELETE FROM locations WHERE loccode='" . $SelectedLocation . "'",$db); - $result = DB_query("DELETE FROM locationusers WHERE loccode='" . $SelectedLocation . "'",$db); prnMsg( _('Location') . ' ' . $SelectedLocation . ' ' . _('has been deleted') . '!', 'success'); unset ($SelectedLocation); Modified: trunk/includes/ConnectDB_mysqli.inc =================================================================== --- trunk/includes/ConnectDB_mysqli.inc 2014-08-08 16:12:36 UTC (rev 6805) +++ trunk/includes/ConnectDB_mysqli.inc 2014-08-09 04:37:02 UTC (rev 6806) @@ -54,8 +54,6 @@ } } -require_once ($PathPrefix .'includes/MiscFunctions.php'); - //DB wrapper functions to change only once for whole application function DB_query ($SQL, Modified: trunk/includes/LanguageSetup.php =================================================================== --- trunk/includes/LanguageSetup.php 2014-08-08 16:12:36 UTC (rev 6805) +++ trunk/includes/LanguageSetup.php 2014-08-09 04:37:02 UTC (rev 6806) @@ -102,4 +102,4 @@ $DecimalPoint = $LanguagesArray[$_SESSION['Language']]['DecimalPoint']; $ThousandsSeparator = $LanguagesArray[$_SESSION['Language']]['ThousandsSeparator']; -?> +?> \ No newline at end of file Modified: trunk/includes/MainMenuLinksArray.php =================================================================== --- trunk/includes/MainMenuLinksArray.php 2014-08-08 16:12:36 UTC (rev 6805) +++ trunk/includes/MainMenuLinksArray.php 2014-08-09 04:37:02 UTC (rev 6806) @@ -504,7 +504,7 @@ $MenuItems['system']['Maintenance']['Caption'] = array( _('Inventory Categories Maintenance'), _('Inventory Locations Maintenance'), - _('Inventory Location Authorized Users Maintenance'), + _('Inventory Location Authorised Users Maintenance'), _('Discount Category Maintenance'), _('Units of Measure'), _('MRP Available Production Days'), @@ -576,11 +576,11 @@ $MenuItems['Utilities']['Maintenance']['URL'] = array( '/Z_poAdmin.php', '/Z_MakeNewCompany.php', '/Z_DataExport.php', - '/Z_ImportDebtors.php', + '/Z_ImportDebtors.php', '/Z_ImportStocks.php', '/Z_ImportPriceList.php', '/Z_ImportFixedAssets.php', - '/Z_ImportGLTransactions.php', + '/Z_ImportGLTransactions.php', '/Z_CreateCompanyTemplateFile.php', '/Z_UpdateChartDetailsBFwd.php', '/Z_RePostGLFromPeriod.php', Modified: trunk/includes/PDFStarter.php =================================================================== --- trunk/includes/PDFStarter.php 2014-08-08 16:12:36 UTC (rev 6805) +++ trunk/includes/PDFStarter.php 2014-08-09 04:37:02 UTC (rev 6806) @@ -173,7 +173,15 @@ break; default: - $DocumentOrientation = 'L'; + $DocumentPaper = 'LETTER'; + $DocumentOrientation ='L'; + + $Page_Width = 792; // 72 * 11 inch + $Page_Height = 612; // 72 * 8.5 inch + $Top_Margin = 36; // Half inch = 72/2 + $Bottom_Margin = 36; // Half inch = 72/2 + $Left_Margin = 36; // Half inch = 72/2 + $Right_Margin = 36; // Half inch = 72/2 break; } Modified: trunk/includes/UserLogin.php =================================================================== --- trunk/includes/UserLogin.php 2014-08-08 16:12:36 UTC (rev 6805) +++ trunk/includes/UserLogin.php 2014-08-09 04:37:02 UTC (rev 6806) @@ -137,7 +137,7 @@ if($_SESSION['SmtpSetting']==0){ mail($SysAdminEmail,$EmailSubject,$EmailText); - }else{ + } else{ include('includes/htmlMimeMail.php'); $mail = new htmlMimeMail(); $mail->setSubject($EmailSubject); Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2014-08-08 16:12:36 UTC (rev 6805) +++ trunk/includes/session.inc 2014-08-09 04:37:02 UTC (rev 6806) @@ -81,7 +81,6 @@ include($PathPrefix . 'includes/LanguageSetup.php'); - if (!isset($AllowAnyone)){ /* only do security checks if AllowAnyone is not true */ include $PathPrefix . 'includes/UserLogin.php'; /* Login checking and setup */ @@ -100,7 +99,7 @@ $Theme = (isset($_SESSION['Theme'])) ? $_SESSION['Theme'] : 'gel'; switch ($rc) { case UL_OK; //user logged in successfully - include($PathPrefix . 'includes/LanguageSetup.php'); //set up the language + include($PathPrefix . 'includes/LanguageSetup.php'); //set up the language of the user break; case UL_SHOWLOGIN: @@ -265,15 +264,15 @@ $Title = _('Security Permissions Problem'); include($PathPrefix . 'includes/header.inc'); echo '<tr> - <td class="menu_group_items"> - <table width="100%" class="table_index"> - <tr><td class="menu_group_item">'; - echo '<b><font style="size:+1; text-align:center;">' . _('The security settings on your account do not permit you to access this function') . '</font></b>'; - - echo '</td> - </tr> - </table> - </td> + <td class="menu_group_items"> + <table width="100%" class="table_index"> + <tr> + <td class="menu_group_item"> + <b><font style="size:+1; text-align:center;">' . _('The security settings on your account do not permit you to access this function') . '</font></b> + </td> + </tr> + </table> + </td> </tr>'; include($PathPrefix . 'includes/footer.inc'); |