Fix: Checkstyle
This commit is contained in:
parent
d8d1db143f
commit
72608e7a72
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2012 JF FERRY <jfefe@aternatik.fr>
|
* Copyright (C) 2012 JF FERRY <jfefe@aternatik.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
@ -67,7 +67,7 @@ $server->wsdl->addComplexType(
|
|||||||
'entity' => array('name'=>'entity','type'=>'xsd:string'),
|
'entity' => array('name'=>'entity','type'=>'xsd:string'),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Une catégorie
|
* Une catégorie
|
||||||
*/
|
*/
|
||||||
@ -90,7 +90,7 @@ $server->wsdl->addComplexType(
|
|||||||
'filles' => array('name'=>'filles','type'=>'tns:FillesArray')
|
'filles' => array('name'=>'filles','type'=>'tns:FillesArray')
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Les catégories filles, sous tableau dez la catégorie
|
* Les catégories filles, sous tableau dez la catégorie
|
||||||
*/
|
*/
|
||||||
@ -123,12 +123,12 @@ $server->wsdl->addComplexType(
|
|||||||
'tns:categories'
|
'tns:categories'
|
||||||
);
|
);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Les photos de la catégorie (un tableau indéxé qui contient les images avec leur vignette)
|
* Les photos de la catégorie (un tableau indéxé qui contient les images avec leur vignette)
|
||||||
*/
|
*/
|
||||||
$server->wsdl->addComplexType(
|
$server->wsdl->addComplexType(
|
||||||
'PhotosArray',
|
'PhotosArray',
|
||||||
'complexType',
|
'complexType',
|
||||||
'array',
|
'array',
|
||||||
'',
|
'',
|
||||||
@ -137,7 +137,7 @@ $server->wsdl->addComplexType(
|
|||||||
array(
|
array(
|
||||||
array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:image[]')
|
array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:image[]')
|
||||||
),
|
),
|
||||||
''
|
''
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -235,7 +235,7 @@ function getCategory($authentication,$id)
|
|||||||
$dir = (!empty($conf->categorie->dir_output)?$conf->categorie->dir_output:$conf->service->dir_output);
|
$dir = (!empty($conf->categorie->dir_output)?$conf->categorie->dir_output:$conf->service->dir_output);
|
||||||
$pdir = get_exdir($categorie->id,2) . $categorie->id ."/photos/";
|
$pdir = get_exdir($categorie->id,2) . $categorie->id ."/photos/";
|
||||||
$dir = $dir . '/'. $pdir;
|
$dir = $dir . '/'. $pdir;
|
||||||
|
|
||||||
$cat = array(
|
$cat = array(
|
||||||
'id' => $categorie->id,
|
'id' => $categorie->id,
|
||||||
'id_mere' => $categorie->id_mere,
|
'id_mere' => $categorie->id_mere,
|
||||||
@ -247,11 +247,10 @@ function getCategory($authentication,$id)
|
|||||||
'dir' => $pdir,
|
'dir' => $pdir,
|
||||||
'photos' => $categorie->liste_photos($dir,$nbmax=10)
|
'photos' => $categorie->liste_photos($dir,$nbmax=10)
|
||||||
);
|
);
|
||||||
|
|
||||||
$cats = $categorie->get_filles();
|
$cats = $categorie->get_filles();
|
||||||
if (sizeof ($cats) > 0)
|
if (count($cats) > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
foreach($cats as $fille)
|
foreach($cats as $fille)
|
||||||
{
|
{
|
||||||
$dir = (!empty($conf->categorie->dir_output)?$conf->categorie->dir_output:$conf->service->dir_output);
|
$dir = (!empty($conf->categorie->dir_output)?$conf->categorie->dir_output:$conf->service->dir_output);
|
||||||
@ -268,11 +267,11 @@ function getCategory($authentication,$id)
|
|||||||
'dir' => $pdir,
|
'dir' => $pdir,
|
||||||
'photos' => $fille->liste_photos($dir,$nbmax=10)
|
'photos' => $fille->liste_photos($dir,$nbmax=10)
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create
|
// Create
|
||||||
$objectresp = array(
|
$objectresp = array(
|
||||||
'result'=>array('result_code'=>'OK', 'result_label'=>''),
|
'result'=>array('result_code'=>'OK', 'result_label'=>''),
|
||||||
|
|||||||
@ -116,7 +116,7 @@ $server->wsdl->addComplexType(
|
|||||||
'price_ttc' => array('name'=>'price_ttc','type'=>'xsd:string'),
|
'price_ttc' => array('name'=>'price_ttc','type'=>'xsd:string'),
|
||||||
'price_min' => array('name'=>'price_min','type'=>'xsd:string'),
|
'price_min' => array('name'=>'price_min','type'=>'xsd:string'),
|
||||||
'price_min_ttc' => array('name'=>'price_min_ttc','type'=>'xsd:string'),
|
'price_min_ttc' => array('name'=>'price_min_ttc','type'=>'xsd:string'),
|
||||||
|
|
||||||
'price_base_type' => array('name'=>'price_base_type','type'=>'xsd:string'),
|
'price_base_type' => array('name'=>'price_base_type','type'=>'xsd:string'),
|
||||||
|
|
||||||
'vat_rate' => array('name'=>'vat_rate','type'=>'xsd:string'),
|
'vat_rate' => array('name'=>'vat_rate','type'=>'xsd:string'),
|
||||||
@ -622,68 +622,64 @@ function getProductsForCategory($authentication,$id)
|
|||||||
$res = $db->query($sql);
|
$res = $db->query($sql);
|
||||||
if ($res)
|
if ($res)
|
||||||
{
|
{
|
||||||
|
while ($rec = $db->fetch_array($res))
|
||||||
while ($rec = $db->fetch_array ($res))
|
|
||||||
{
|
{
|
||||||
$obj = new Product ($db);
|
$obj = new Product($db);
|
||||||
$obj->fetch ($rec['fk_'.$field]);
|
$obj->fetch($rec['fk_'.$field]);
|
||||||
if($obj->status > 0 ) {
|
if($obj->status > 0 )
|
||||||
|
{
|
||||||
$dir = (!empty($conf->product->dir_output)?$conf->product->dir_output:$conf->service->dir_output);
|
$dir = (!empty($conf->product->dir_output)?$conf->product->dir_output:$conf->service->dir_output);
|
||||||
$pdir = get_exdir($obj->id,2) . $obj->id ."/photos/";
|
$pdir = get_exdir($obj->id,2) . $obj->id ."/photos/";
|
||||||
$dir = $dir . '/'. $pdir;
|
$dir = $dir . '/'. $pdir;
|
||||||
|
|
||||||
$products[] = array(
|
$products[] = array(
|
||||||
|
'id' => $obj->id,
|
||||||
'id' => $obj->id,
|
'ref' => $obj->ref,
|
||||||
'ref' => $obj->ref,
|
'ref_ext' => $obj->ref_ext,
|
||||||
'ref_ext' => $obj->ref_ext,
|
'label' => $obj->label,
|
||||||
'label' => $obj->label,
|
'description' => $obj->description,
|
||||||
'description' => $obj->description,
|
'date_creation' => dol_print_date($obj->date_creation,'dayhourrfc'),
|
||||||
'date_creation' => dol_print_date($obj->date_creation,'dayhourrfc'),
|
'date_modification' => dol_print_date($obj->date_modification,'dayhourrfc'),
|
||||||
'date_modification' => dol_print_date($obj->date_modification,'dayhourrfc'),
|
'note' => $obj->note,
|
||||||
'note' => $obj->note,
|
'status_tosell' => $obj->status,
|
||||||
'status_tosell' => $obj->status,
|
'status_tobuy' => $obj->status_buy,
|
||||||
'status_tobuy' => $obj->status_buy,
|
'type' => $obj->type,
|
||||||
'type' => $obj->type,
|
'barcode' => $obj->barcode,
|
||||||
'barcode' => $obj->barcode,
|
'barcode_type' => $obj->barcode_type,
|
||||||
'barcode_type' => $obj->barcode_type,
|
'country_id' => $obj->country_id>0?$obj->country_id:'',
|
||||||
'country_id' => $obj->country_id>0?$obj->country_id:'',
|
'country_code' => $obj->country_code,
|
||||||
'country_code' => $obj->country_code,
|
'custom_code' => $obj->customcode,
|
||||||
'custom_code' => $obj->customcode,
|
|
||||||
|
|
||||||
'price_net' => $obj->price,
|
'price_net' => $obj->price,
|
||||||
'price' => ($obj->price_ttc-$obj->price),
|
'price' => ($obj->price_ttc-$obj->price),
|
||||||
'vat_rate' => $obj->tva_tx,
|
'vat_rate' => $obj->tva_tx,
|
||||||
'price_ttc' => $obj->price_ttc,
|
'price_ttc' => $obj->price_ttc,
|
||||||
'price_base_type' => $obj->price_base_type,
|
'price_base_type' => $obj->price_base_type,
|
||||||
|
|
||||||
'stock_real' => $obj->stock_reel,
|
'stock_real' => $obj->stock_reel,
|
||||||
'stock_alert' => $obj->seuil_stock_alerte,
|
'stock_alert' => $obj->seuil_stock_alerte,
|
||||||
'pmp' => $obj->pmp,
|
'pmp' => $obj->pmp,
|
||||||
'import_key' => $obj->import_key,
|
'import_key' => $obj->import_key,
|
||||||
'dir' => $pdir,
|
'dir' => $pdir,
|
||||||
'photos' => $obj->liste_photos($dir,$nbmax=10)
|
'photos' => $obj->liste_photos($dir,$nbmax=10)
|
||||||
|
|
||||||
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Retour
|
// Retour
|
||||||
$objectresp = array(
|
$objectresp = array(
|
||||||
'result'=>array('result_code'=>'OK', 'result_label'=>''),
|
'result'=>array('result_code'=>'OK', 'result_label'=>''),
|
||||||
'products'=> $products
|
'products'=> $products
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$errorcode='NORECORDS_FOR_ASSOCIATION'; $errorlabel='No products associated'.$sql;
|
$errorcode='NORECORDS_FOR_ASSOCIATION'; $errorlabel='No products associated'.$sql;
|
||||||
$objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel));
|
$objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel));
|
||||||
dol_syslog("getProductsForCategory:: ".$c->error, LOG_DEBUG);
|
dol_syslog("getProductsForCategory:: ".$c->error, LOG_DEBUG);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user