New : can use translations into products webservice
Add lang parameter to force langage
This commit is contained in:
parent
9da84e4dd8
commit
75d2215733
@ -229,7 +229,7 @@ $styleuse='encoded'; // encoded/literal/literal wrapped
|
|||||||
$server->register(
|
$server->register(
|
||||||
'getProductOrService',
|
'getProductOrService',
|
||||||
// Entry values
|
// Entry values
|
||||||
array('authentication'=>'tns:authentication','id'=>'xsd:string','ref'=>'xsd:string','ref_ext'=>'xsd:string'),
|
array('authentication'=>'tns:authentication','id'=>'xsd:string','ref'=>'xsd:string','ref_ext'=>'xsd:string','lang'=>'xsd:string'),
|
||||||
// Exit values
|
// Exit values
|
||||||
array('result'=>'tns:result','product'=>'tns:product'),
|
array('result'=>'tns:result','product'=>'tns:product'),
|
||||||
$ns,
|
$ns,
|
||||||
@ -285,7 +285,7 @@ $server->register(
|
|||||||
$server->register(
|
$server->register(
|
||||||
'getProductsForCategory',
|
'getProductsForCategory',
|
||||||
// Entry values
|
// Entry values
|
||||||
array('authentication'=>'tns:authentication','id'=>'xsd:string'),
|
array('authentication'=>'tns:authentication','id'=>'xsd:string','lang'=>'xsd:string'),
|
||||||
// Exit values
|
// Exit values
|
||||||
array('result'=>'tns:result','products'=>'tns:ProductsArray2'),
|
array('result'=>'tns:result','products'=>'tns:ProductsArray2'),
|
||||||
$ns,
|
$ns,
|
||||||
@ -303,9 +303,10 @@ $server->register(
|
|||||||
* @param int $id Id of object
|
* @param int $id Id of object
|
||||||
* @param string $ref Ref of object
|
* @param string $ref Ref of object
|
||||||
* @param ref_ext $ref_ext Ref external of object
|
* @param ref_ext $ref_ext Ref external of object
|
||||||
|
* @param $lang $lang Force lang
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
function getProductOrService($authentication,$id='',$ref='',$ref_ext='')
|
function getProductOrService($authentication,$id='',$ref='',$ref_ext='',$lang='')
|
||||||
{
|
{
|
||||||
global $db,$conf,$langs;
|
global $db,$conf,$langs;
|
||||||
|
|
||||||
@ -327,6 +328,10 @@ function getProductOrService($authentication,$id='',$ref='',$ref_ext='')
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
$langcode=($lang?$lang:(empty($conf->global->MAIN_LANG_DEFAULT)?'auto':$conf->global->MAIN_LANG_DEFAULT));
|
||||||
|
$langs->setDefaultLang($langcode);
|
||||||
|
|
||||||
$fuser->getrights();
|
$fuser->getrights();
|
||||||
|
|
||||||
if ($fuser->rights->produit->lire || $fuser->rights->service->lire)
|
if ($fuser->rights->produit->lire || $fuser->rights->service->lire)
|
||||||
@ -702,7 +707,7 @@ function getListOfProductsOrServices($authentication,$filterproduct)
|
|||||||
|
|
||||||
|
|
||||||
// return category infos and children
|
// return category infos and children
|
||||||
function getProductsForCategory($authentication,$id)
|
function getProductsForCategory($authentication,$id,$lang='')
|
||||||
{
|
{
|
||||||
global $db,$conf,$langs;
|
global $db,$conf,$langs;
|
||||||
|
|
||||||
@ -726,6 +731,9 @@ function getProductsForCategory($authentication,$id)
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
|
$langcode=($lang?$lang:(empty($conf->global->MAIN_LANG_DEFAULT)?'auto':$conf->global->MAIN_LANG_DEFAULT));
|
||||||
|
$langs->setDefaultLang($langcode);
|
||||||
|
|
||||||
$fuser->getrights();
|
$fuser->getrights();
|
||||||
|
|
||||||
if ($fuser->rights->produit->lire)
|
if ($fuser->rights->produit->lire)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user