[Weberp-svn] SF.net SVN: weberp:[8892] trunk
Brought to you by:
sotandeka,
tim_schofield
From: <tim...@us...> - 2012-05-12 19:56:34
|
Revision: 8892 http://weberp.svn.sourceforge.net/weberp/?rev=8892&view=rev Author: tim_schofield Date: 2012-05-12 19:56:27 +0000 (Sat, 12 May 2012) Log Message: ----------- Fixes to show links to batches and serial numbers Modified Paths: -------------- trunk/SelectProduct.php trunk/StockSerialItems.php trunk/includes/MiscFunctions.php Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2012-05-12 16:17:45 UTC (rev 8891) +++ trunk/SelectProduct.php 2012-05-12 19:56:27 UTC (rev 8892) @@ -139,7 +139,7 @@ if ($myrow['serialised'] == 1) { echo _('serialised'); } elseif ($myrow['controlled'] == 1) { - echo _('Batchs/Lots'); + echo '<a href="StockSerialItems.php?Location=All&StockID='.$StockID.'">' . _('Batchs/Lots') . '</a>'; } else { echo _('N/A'); } @@ -236,7 +236,7 @@ // Item Category Property mod: display the item properties echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table align="left" class="selection">'; + echo '<table align="left" style="background: transparent;border: gray solid 1px;border-radius: 5px">'; $CatValResult = DB_query("SELECT categoryid FROM stockmaster WHERE stockid='" . $StockID . "'", $db); @@ -264,7 +264,7 @@ echo '<input type="hidden" name="PropCat' . $PropertyRow['stkcatpropid'] . '" value="' . $PropertyRow['stkcatpropid'] . '" />'; switch ($PropertyRow['controltype']) { case 0; //textbox - echo '<td class="select number" width="60"><input type="text" name="PropValue' . $PropertyRow['stkcatpropid'] . '" value="' . $PropertyValue . '" />'; + echo '<td class="select number" style="border: 0px" width="60"><input type="text" name="PropValue' . $PropertyRow['stkcatpropid'] . '" value="' . $PropertyValue . '" />'; break; case 1; //select box $OptionValues = explode(',', $PropertyRow['defaultvalue']); @@ -290,7 +290,7 @@ $PropertyCounter++; } //end loop round properties for the item category echo '<tr> - <th colspan="2"><button type="submit" name="UpdateProperties">' . _('Update Properties') . '</button></th> + <th colspan="2" style="border: 0px"><button type="submit" name="UpdateProperties">' . _('Update Properties') . '</button></th> </tr>'; echo '</table></form>'; //end of Item Category Property mod echo '<td style="width: 15%; vertical-align: top"> @@ -463,8 +463,8 @@ echo '</td><td valign="top" class="select">'; /* Stock Transactions */ if ($Its_A_Kitset_Assembly_Or_Dummy == false) { - echo '<a href="' . $rootpath . '/StockAdjustments.php?StockID=' . $StockID . '">' . _('Quantity Adjustments') . '</a><br />'; - echo '<a href="' . $rootpath . '/StockTransfers.php?StockID=' . $StockID . '&NewTransfer=Yes">' . _('Location Transfers') . '</a><br />'; + echo InternalLink($rootpath, '/StockAdjustments.php?StockID=' . $StockID, _('Quantity Adjustments')) . '<br />'; + echo InternalLink($rootpath, '/StockTransfers.php?StockID=' . $StockID . '&NewTransfer=Yes', _('Location Transfers')) . '<br />'; if (function_exists('imagecreatefrompng')){ $StockImgLink = 'GetStockImage.php?automake=1&textcolor=FFFFFF&bgcolor=CCCCCC'. '&StockID='.urlencode($StockID). @@ -502,8 +502,8 @@ } /* end of ($Its_A_Kitset_Assembly_Or_Dummy == False) */ echo '</td><td valign="top" class="select">'; /* Stock Maintenance Options */ - echo '<a href="' . $rootpath . '/Stocks.php?">' . _('Add Inventory Items') . '</a><br />'; - echo '<a href="' . $rootpath . '/Stocks.php?StockID=' . $StockID . '">' . _('Modify Item Details') . '</a><br />'; + echo InternalLink($rootpath, '/Stocks.php?', _('Add Inventory Items'), '') . '<br />'; + echo InternalLink($rootpath, '/Stocks.php?StockID=' . $StockID . '', _('Modify Item Details'), '') . '<br />'; if ($Its_A_Kitset_Assembly_Or_Dummy == False) { echo '<a href="' . $rootpath . '/StockReorderLevel.php?StockID=' . $StockID . '">' . _('Maintain Reorder Levels') . '</a><br />'; echo '<a href="' . $rootpath . '/StockCostUpdate.php?StockID=' . $StockID . '">' . _('Maintain Standard Cost') . '</a><br />'; Modified: trunk/StockSerialItems.php =================================================================== --- trunk/StockSerialItems.php 2012-05-12 16:17:45 UTC (rev 8891) +++ trunk/StockSerialItems.php 2012-05-12 19:56:27 UTC (rev 8892) @@ -44,35 +44,48 @@ exit; } -$result = DB_query("SELECT locationname - FROM locations - WHERE loccode='" . $_GET['Location'] . "'", - $db, - _('Could not retrieve the stock location of the item because'), - _('The SQL used to lookup the location was')); +if ($_GET['Location']!='All') { + $result = DB_query("SELECT locationname + FROM locations + WHERE loccode='" . $_GET['Location'] . "'", + $db, + _('Could not retrieve the stock location of the item because'), + _('The SQL used to lookup the location was')); -$myrow = DB_fetch_array($result); + $myrow = DB_fetch_array($result); + $LocationName=$myrow['locationname']; -$sql = "SELECT serialno, - quantity, - expirationdate - FROM stockserialitems - WHERE loccode='" . $_GET['Location'] . "' - AND stockid = '" . $StockID . "' - AND quantity <>0"; + $sql = "SELECT serialno, + quantity, + expirationdate + FROM stockserialitems + WHERE loccode='" . $_GET['Location'] . "' + AND stockid = '" . $StockID . "' + AND quantity <>0"; + $ErrMsg = _('The serial numbers/batches held cannot be retrieved because'); + $LocStockResult = DB_query($sql, $db, $ErrMsg); +} else { + $LocationName=_('All Locations'); -$ErrMsg = _('The serial numbers/batches held cannot be retrieved because'); -$LocStockResult = DB_query($sql, $db, $ErrMsg); + $sql = "SELECT serialno, + quantity, + expirationdate + FROM stockserialitems + WHERE stockid = '" . $StockID . "' + AND quantity <>0"; + $ErrMsg = _('The serial numbers/batches held cannot be retrieved because'); + $LocStockResult = DB_query($sql, $db, $ErrMsg); +} + echo '<table cellpadding="2" class="selection">'; if ($Serialised==1){ - echo '<tr><th colspan="5" class="header">' . _('Serialised items in') . ' '; + echo '<tr><th colspan="5" class="header">' . _('Serialised items in') . ' ' . $LocationName . '</th></tr>'; } else { - echo '<tr><th colspan="11" class="header">' . _('Controlled items in') . ' '; + echo '<tr><th colspan="11" class="header">' . _('Controlled items in') . ' ' . $LocationName . '</th></tr>'; } -echo $myrow['locationname']. '</th></tr>'; echo '<tr><th colspan="11" class="header">'.$StockID .'-'. $Description .'</b> (' . _('In units of') . ' ' . $UOM . ')</th></tr>'; @@ -156,8 +169,8 @@ } //end of while loop +echo '<tr><th colspan="9"><b>' . _('Total quantity') . ': ' . locale_number_format($TotalQuantity, $DecimalPlaces) . '</b></th></tr>'; echo '</table><br />'; -echo '<div class="centre"><br /><b>' . _('Total quantity') . ': ' . locale_number_format($TotalQuantity, $DecimalPlaces) . '<br /></div>'; echo '</form>'; include('includes/footer.inc'); Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2012-05-12 16:17:45 UTC (rev 8891) +++ trunk/includes/MiscFunctions.php 2012-05-12 19:56:27 UTC (rev 8892) @@ -6,12 +6,6 @@ /** STANDARD MESSAGE HANDLING & FORMATTING **/ /********************************************/ -function prnMsg($Msg,$Type='info', $Prefix=''){ - - echo getMsg($Msg, $Type, $Prefix); - -}//prnMsg - function reverse_escape($str) { $search=array("\\\\","\\0","\\n","\\r","\Z","\'",'\"'); $replace=array("\\","\0","\n","\r","\x1a","'",'"'); @@ -38,6 +32,12 @@ return str_replace($LocaleInfo['mon_decimal_point'], '.', str_replace($LocaleInfo['mon_thousands_sep'], '', $Amount)); } +function prnMsg($Msg,$Type='info', $Prefix=''){ + + echo getMsg($Msg, $Type, $Prefix); + +}//prnMsg + function getMsg($Msg,$Type='info',$Prefix=''){ $Colour=''; if (isset($_SESSION['LogSeverity']) and $_SESSION['LogSeverity']>0) { @@ -322,4 +322,12 @@ return false; } -?> +function InternalLink($rootpath, $Script, $Caption, $Format='') { + $ScriptNameArray = explode('?', substr($Script,1)); + $PageSecurity = $_SESSION['PageSecurityArray'][$ScriptNameArray[0]]; + if ((in_array($PageSecurity, $_SESSION['AllowedPageSecurityTokens']) OR !isset($PageSecurity))) { + return '<a href="' . $rootpath . $Script .'">' . $Caption . '</a>'; + } +} + +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |