From: <dai...@us...> - 2010-10-09 02:49:41
|
Revision: 4095 http://web-erp.svn.sourceforge.net/web-erp/?rev=4095&view=rev Author: daintree Date: 2010-10-09 02:49:35 +0000 (Sat, 09 Oct 2010) Log Message: ----------- added GetStockCategoryList xmlrpc-api method Modified Paths: -------------- trunk/api/api_login.php trunk/api/api_stockcategories.php trunk/api/api_xml-rpc.php trunk/doc/Change.log.html Modified: trunk/api/api_login.php =================================================================== --- trunk/api/api_login.php 2010-10-04 15:54:54 UTC (rev 4094) +++ trunk/api/api_login.php 2010-10-09 02:49:35 UTC (rev 4095) @@ -52,12 +52,12 @@ // Is this user logged in? if (isset ($_SESSION['db']) ) { - // Cleanup is about all there is to do. - session_unset(); - session_destroy(); - $RetCode = 0; + // Cleanup is about all there is to do. + session_unset(); + session_destroy(); + $RetCode = 0; } else { - $RetCode = NoAuthorisation; + $RetCode = NoAuthorisation; } return $RetCode; Modified: trunk/api/api_stockcategories.php =================================================================== --- trunk/api/api_stockcategories.php 2010-10-04 15:54:54 UTC (rev 4094) +++ trunk/api/api_stockcategories.php 2010-10-09 02:49:35 UTC (rev 4095) @@ -208,4 +208,22 @@ return $Errors; } + /* This function returns a list of the stock categories setup on webERP */ + + function GetStockCategoryList($user, $password) { + $Errors = array(); + $db = db($user, $password); + if (gettype($db)=='integer') { + $Errors[0]=NoAuthorisation; + return $Errors; + } + $sql = 'SELECT categoryid FROM stockcategory'; + $result = DB_query($sql, $db); + $i=0; + while ($myrow=DB_fetch_array($result)) { + $StockCategoryList[$i]=$myrow[0]; + $i++; + } + return $StockCategoryList; + } ?> \ No newline at end of file Modified: trunk/api/api_xml-rpc.php =================================================================== --- trunk/api/api_xml-rpc.php 2010-10-04 15:54:54 UTC (rev 4094) +++ trunk/api/api_xml-rpc.php 2010-10-09 02:49:35 UTC (rev 4095) @@ -1313,9 +1313,8 @@ function xmlrpc_GetLocationList($xmlrpcmsg){ ob_start('ob_file_callback'); -/*x*/ if ($xmlrpcmsg->getNumParams() == 2) -/*x*/ { -/*x*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(GetLocationList($xmlrpcmsg->getParam( 0 )->scalarval( ), +/*x*/ if ($xmlrpcmsg->getNumParams() == 2){ +/*x*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(GetLocationList($xmlrpcmsg->getParam( 0 )->scalarval( ), /*x*/ $xmlrpcmsg->getParam( 1 )->scalarval( ))) ); /*x*/ } else { /*e*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(GetLocationList( '', ''))); @@ -1827,7 +1826,34 @@ ob_end_flush(); return $rtn; } + unset($Description); + unset($Parameter); + unset($ReturnValue); + $Description = _('This function returns a list of stock category abbreviations.'); + $Parameter[0]['name'] = _('User name'); + $Parameter[0]['description'] = _('A valid weberp username. This user should have security access to this data.'); + $Parameter[1]['name'] = _('User password'); + $Parameter[1]['description'] = _('The weberp password associated with this user name. '); + $ReturnValue[0] = _('If successful, this function returns an array of stock category ids. ') + ._('Otherwise an array of error codes is returned and no stock categories are returned. '); + +/*E*/ $GetStockCategoryList_sig = array(array($xmlrpcStruct), +/*x*/ array($xmlrpcStruct,$xmlrpcString,$xmlrpcString)); + $GetStockCategoryList_doc = apiBuildDocHTML( $Description,$Parameter,$ReturnValue ); + + function xmlrpc_GetStockCategoryList($xmlrpcmsg){ + ob_start('ob_file_callback'); +/*x*/if ($xmlrpcmsg->getNumParams() == 2){ +/*x*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(GetStockCategoryList($xmlrpcmsg->getParam( 0 )->scalarval( ), +/*x*/ $xmlrpcmsg->getParam( 1 )->scalarval( ))) ); +/*x*/ } else { +/*e*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(GetStockCategoryList( '', ''))); +/*x*/ } + ob_end_flush(); + return $rtn; + } + unset($Description); unset($Parameter); unset($ReturnValue); @@ -2897,6 +2923,10 @@ "function" => "xmlrpc_StockCatPropertyList", "signature" => $StockCatPropertyList_sig, "docstring" => $StockCatPropertyList_doc), + "weberp.xmlrpc_GetStockCategoryList" => array( + "function" => "xmlrpc_GetStockCategoryList", + "signature" => $GetStockCategoryList_sig, + "docstring" => $GetStockCategoryList_doc), "weberp.xmlrpc_GetGLAccountList" => array( "function" => "xmlrpc_GetGLAccountList", "signature" => $GetGLAccountList_sig, Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-10-04 15:54:54 UTC (rev 4094) +++ trunk/doc/Change.log.html 2010-10-09 02:49:35 UTC (rev 4095) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>09/10/10 Phil: Added xmlrpc_GetStockCategoryList api method <p>04/10/10 Matt Taylor: upgrade3.11.1-3.12.sql - Update tables to utf8</p> <p>03/10/10 Gabriel Olowo: ManualPurchaseOrdering.php - Manual for purchase ordering system</p> <p>02/10/10 Tim: AuditTrail.php - Bug fixes and layout changes</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |