Fix: Respect W3C
This commit is contained in:
parent
356577081f
commit
a7f5ee10c2
@ -391,10 +391,16 @@ class ActionComm
|
|||||||
$lien = '<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$this->id.'">';
|
$lien = '<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$this->id.'">';
|
||||||
$lienfin='</a>';
|
$lienfin='</a>';
|
||||||
|
|
||||||
$transcode=$langs->trans("Action".$this->code);
|
if ($langs->trans("Action".$this->code) != "Action".$this->code)
|
||||||
$libelle=($transcode!="Action".$this->code ? $transcode : $this->libelle);
|
{
|
||||||
$libelleshort=$libelle;
|
$libelle=$langs->trans("Action".$this->code);
|
||||||
if ($option) $libelleshort=dolibarr_trunc($libelle,$option);
|
$libelleshort=$langs->trans("Action".$this->code,'','','','',$option);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$libelle=$this->libelle;
|
||||||
|
$libelleshort=dolibarr_trunc($this->libelle,$option);
|
||||||
|
}
|
||||||
|
|
||||||
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowTask").': '.$libelle,'task').$lienfin.' ');
|
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowTask").': '.$libelle,'task').$lienfin.' ');
|
||||||
$result.=$lien.$libelleshort.$lienfin;
|
$result.=$lien.$libelleshort.$lienfin;
|
||||||
|
|||||||
@ -16,4 +16,5 @@ LDAPUsers=Users in LDAP database
|
|||||||
LDAPGroups=Groups in LDAP database
|
LDAPGroups=Groups in LDAP database
|
||||||
SynchronizeDolibarr2Ldap=Synchronize user (Dolibarr -> LDAP)
|
SynchronizeDolibarr2Ldap=Synchronize user (Dolibarr -> LDAP)
|
||||||
UserSynchronized=User synchronized
|
UserSynchronized=User synchronized
|
||||||
ForceSynchronize=Force synchronizing Dolibarr -> LDAP
|
ForceSynchronize=Force synchronizing Dolibarr -> LDAP
|
||||||
|
ErrorFailedToReadLDAP=Failed to read LDAP database.Check LDAP module setup and database accessibility.
|
||||||
@ -17,3 +17,4 @@ LDAPGroups=Groupes en base LDAP
|
|||||||
SynchronizeDolibarr2Ldap=Synchroniser utilisateur (Dolibarr -> LDAP)
|
SynchronizeDolibarr2Ldap=Synchroniser utilisateur (Dolibarr -> LDAP)
|
||||||
UserSynchronized=Utilisateur synchronisé
|
UserSynchronized=Utilisateur synchronisé
|
||||||
ForceSynchronize=Forcer synchro Dolibarr -> LDAP
|
ForceSynchronize=Forcer synchro Dolibarr -> LDAP
|
||||||
|
ErrorFailedToReadLDAP=Echec de la lecture de l'annuaire LDAP. Vérifier la configuration du module LDAP et l'accessibilité de l'annuaire.
|
||||||
|
|||||||
@ -54,20 +54,27 @@ if ($action == '' && !$cancel) {
|
|||||||
if ( $user->rights->societe->creer) {
|
if ( $user->rights->societe->creer) {
|
||||||
print '<a class="tabAction" href="fiche.php?action=import&custid='.$osc_cust->osc_custid.'">'.$langs->trans("Import").'</a>';
|
print '<a class="tabAction" href="fiche.php?action=import&custid='.$osc_cust->osc_custid.'">'.$langs->trans("Import").'</a>';
|
||||||
}
|
}
|
||||||
|
print '<a class="tabAction" href="index.php">'.$langs->trans("Retour").'</a>';
|
||||||
print "\n</div><br>\n";
|
print "\n</div><br>\n";
|
||||||
// seule action importer
|
// seule action importer
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "<p>ERROR 1c</p>\n";
|
print "\n<div class=\"tabsAction\">\n";
|
||||||
dolibarr_print_error('',"erreur webservice ".$osc_cust->error);
|
print "<p>ERROR 1c</p>\n";
|
||||||
|
dolibarr_print_error('',"erreur webservice ".$osc_cust->error);
|
||||||
|
print '<a class="tabAction" href="index.php">'.$langs->trans("Retour").'</a>';
|
||||||
|
print "\n</div><br>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "<p>ERROR 1b</p>\n";
|
print "\n<div class=\"tabsAction\">\n";
|
||||||
print "Error";
|
print "<p>ERROR 1b</p>\n";
|
||||||
|
print "Error";
|
||||||
|
print '<a class="tabAction" href="index.php">'.$langs->trans("Retour").'</a>';
|
||||||
|
print "\n</div><br>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* action Import création de l'objet product de dolibarr
|
/* action Import création de l'objet product de dolibarr
|
||||||
@ -83,8 +90,11 @@ if ($action == '' && !$cancel) {
|
|||||||
$societe = new Societe($db);
|
$societe = new Societe($db);
|
||||||
if ($_error == 1)
|
if ($_error == 1)
|
||||||
{
|
{
|
||||||
print '<br>erreur 1</br>';
|
|
||||||
exit;
|
print "\n<div class=\"tabsAction\">\n";
|
||||||
|
print '<br>erreur 1</br>';
|
||||||
|
print '<a class="tabAction" href="index.php">'.$langs->trans("Retour").'</a>';
|
||||||
|
print "\n</div><br>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
/* initialisation */
|
/* initialisation */
|
||||||
@ -105,14 +115,22 @@ if ($action == '' && !$cancel) {
|
|||||||
$societe->client = 1; // mettre 0 si prospect
|
$societe->client = 1; // mettre 0 si prospect
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* utilisation de la table de transco*/
|
||||||
|
if ($osc_cust->get_clientid($osc_cust->osc_custid)>0)
|
||||||
|
{
|
||||||
|
print '<p>Ce client existe déjà</p>';
|
||||||
|
}
|
||||||
|
else {
|
||||||
$id = $societe->create($user);
|
$id = $societe->create($user);
|
||||||
|
|
||||||
if ($id == 0)
|
if ($id == 0)
|
||||||
{
|
{
|
||||||
print '<br>création réussie nouveau client/prospect '.$societe->id.' nom : '.$societe->nom.'</br>';
|
print "\n<div class=\"tabsAction\">\n";
|
||||||
$res = $osc_cust->transcode($osc_cust->osc_custid,$societe->id);
|
print '<p>création réussie nouveau client/prospect '.$societe->id.' nom : '.$societe->nom.'</p>';
|
||||||
print '<br>transcode '.$res.' | '.$societe->id.' osc : '.$osc_cust->osc_custid.'</br>';
|
$res = $osc_cust->transcode($osc_cust->osc_custid,$societe->id);
|
||||||
|
print '<p>transcode '.$res.' | '.$societe->id.' osc : '.$osc_cust->osc_custid.'</p>';
|
||||||
|
print '<a class="tabAction" href="index.php">'.$langs->trans("Retour").'</a>';
|
||||||
|
print "\n</div><br>\n";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -128,8 +146,10 @@ print '<br>transcode '.$res.' | '.$societe->id.' osc : '.$osc_cust->osc_custid.'
|
|||||||
$societe_control = new Societe($db);
|
$societe_control = new Societe($db);
|
||||||
if ($_error == 1)
|
if ($_error == 1)
|
||||||
{
|
{
|
||||||
|
print "\n<div class=\"tabsAction\">\n";
|
||||||
print '<br>erreur 1</br>';
|
print '<br>erreur 1</br>';
|
||||||
exit;
|
print '<a class="tabAction" href="index.php">'.$langs->trans("Retour").'</a>';
|
||||||
|
print "\n</div><br>\n";
|
||||||
}
|
}
|
||||||
$idp = $societe_control->fetch($socid = $osc_cust->osc_ref);
|
$idp = $societe_control->fetch($socid = $osc_cust->osc_ref);
|
||||||
|
|
||||||
@ -143,6 +163,7 @@ print '<br>transcode '.$res.' | '.$societe->id.' osc : '.$osc_cust->osc_custid.'
|
|||||||
else print '<br>update impossible $id : '.$idp.' </br>';
|
else print '<br>update impossible $id : '.$idp.' </br>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -66,6 +66,7 @@ elseif (!($err = $client->getError()) )
|
|||||||
print "<td>Ville</td>";
|
print "<td>Ville</td>";
|
||||||
print "<td>Pays</td>";
|
print "<td>Pays</td>";
|
||||||
print '<td align="center">Téléphone</td>';
|
print '<td align="center">Téléphone</td>';
|
||||||
|
print '<TD align="center">Importer</TD>';
|
||||||
print "</TR>\n";
|
print "</TR>\n";
|
||||||
|
|
||||||
while ($i < $num) {
|
while ($i < $num) {
|
||||||
@ -78,6 +79,7 @@ elseif (!($err = $client->getError()) )
|
|||||||
print "<TD>".$result[$i][entry_city]."</TD>\n";
|
print "<TD>".$result[$i][entry_city]."</TD>\n";
|
||||||
print '<TD align="center">'.$result[$i][countries_name]."</TD>\n";
|
print '<TD align="center">'.$result[$i][countries_name]."</TD>\n";
|
||||||
print '<TD align="center">'.$result[$i][customers_telephone]."</TD>\n";
|
print '<TD align="center">'.$result[$i][customers_telephone]."</TD>\n";
|
||||||
|
print '<TD align="center"><a href="fiche.php?action=import&custid='.$result[$i][customers_id].'"'."><b>importer</b></a></TD>\n";
|
||||||
print "</TR>\n";
|
print "</TR>\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -55,20 +55,26 @@ if ($action == '' && !$cancel) {
|
|||||||
if ( $user->rights->commande->creer) {
|
if ( $user->rights->commande->creer) {
|
||||||
print '<a class="tabAction" href="fiche.php?action=import&orderid='.$osc_order->osc_orderid.'">'.$langs->trans("Import").'</a>';
|
print '<a class="tabAction" href="fiche.php?action=import&orderid='.$osc_order->osc_orderid.'">'.$langs->trans("Import").'</a>';
|
||||||
}
|
}
|
||||||
|
print '<a class="tabAction" href="index.php">'.$langs->trans("Retour").'</a>';
|
||||||
print "\n</div><br>\n";
|
print "\n</div><br>\n";
|
||||||
// seule action importer
|
// seule action importer
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "<p>ERROR 1c</p>\n";
|
print "\n<div class=\"tabsAction\">\n";
|
||||||
dolibarr_print_error('',"erreur webservice ".$osc_order->error);
|
print "<p>ERROR 1c</p>\n";
|
||||||
|
dolibarr_print_error('',"erreur webservice ".$osc_order->error);
|
||||||
|
print '<a class="tabAction" href="index.php">'.$langs->trans("Retour").'</a>';
|
||||||
|
print "\n</div><br>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "<p>ERROR 1b</p>\n";
|
print "\n<div class=\"tabsAction\">\n";
|
||||||
print "Error";
|
print "<p>ERROR 1b</p>\n";
|
||||||
|
print '<a class="tabAction" href="index.php">'.$langs->trans("Retour").'</a>';
|
||||||
|
print "\n</div><br>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* action Import création de l'objet commande de dolibarr
|
/* action Import création de l'objet commande de dolibarr
|
||||||
@ -81,13 +87,25 @@ if ($action == '' && !$cancel) {
|
|||||||
if ( !$result )
|
if ( !$result )
|
||||||
{
|
{
|
||||||
$commande = $osc_order->osc2dolibarr($_GET["orderid"]);
|
$commande = $osc_order->osc2dolibarr($_GET["orderid"]);
|
||||||
print_r($commande);
|
// print_r($commande);
|
||||||
}
|
}
|
||||||
|
/* utilisation de la table de transco*/
|
||||||
|
if ($osc_order->get_orderid($osc_order->osc_orderid)>0)
|
||||||
|
{
|
||||||
|
print '<p>Cette commande existe déjà</p>';
|
||||||
|
}
|
||||||
|
else {
|
||||||
$id = $commande->create($user);
|
$id = $commande->create($user);
|
||||||
|
|
||||||
if ($id > 0)
|
if ($id > 0)
|
||||||
{
|
{
|
||||||
print '<br>création réussie nouvelle commande '.$id;
|
print "\n<div class=\"tabsAction\">\n";
|
||||||
|
print '<br>création réussie nouvelle commande '.$id;
|
||||||
|
$res = $osc_order->transcode($osc_order->osc_orderid,$id);
|
||||||
|
print '<p>transcode '.$res.' | '.$id.' osc : '.$osc_order->osc_orderid.'</p>';
|
||||||
|
print '<a class="tabAction" href="index.php">'.$langs->trans("Retour").'</a>';
|
||||||
|
print "\n</div><br>\n";
|
||||||
|
|
||||||
if ($id > 0) exit;
|
if ($id > 0) exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -117,6 +135,7 @@ if ($action == '' && !$cancel) {
|
|||||||
else print '<br>update impossible $id : '.$id.' </br>';
|
else print '<br>update impossible $id : '.$id.' </br>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -66,6 +66,7 @@ elseif (!($err = $client->getError()) )
|
|||||||
print "<td>Date</td>";
|
print "<td>Date</td>";
|
||||||
print "<td>Montant</td>";
|
print "<td>Montant</td>";
|
||||||
print '<td align="center">Paiement</td>';
|
print '<td align="center">Paiement</td>';
|
||||||
|
print '<TD align="center">Importer</TD>';
|
||||||
print "</TR>\n";
|
print "</TR>\n";
|
||||||
|
|
||||||
while ($i < $num) {
|
while ($i < $num) {
|
||||||
@ -73,11 +74,13 @@ elseif (!($err = $client->getError()) )
|
|||||||
|
|
||||||
print "<TR $bc[$var]>";
|
print "<TR $bc[$var]>";
|
||||||
print '<TD><a href="fiche.php?orderid='.$result[$i][orders_id].'">'.$result[$i][orders_id]."</TD>\n";
|
print '<TD><a href="fiche.php?orderid='.$result[$i][orders_id].'">'.$result[$i][orders_id]."</TD>\n";
|
||||||
|
print "<TD> </TD>\n";
|
||||||
print "<TD>".$result[$i][customers_name]."</TD>\n";
|
print "<TD>".$result[$i][customers_name]."</TD>\n";
|
||||||
print "<TD>".$result[$i][date_purchased]."</TD>\n";
|
print "<TD>".$result[$i][date_purchased]."</TD>\n";
|
||||||
print "<TD>".$result[$i][value]."</TD>\n";
|
print "<TD>".$result[$i][value]."</TD>\n";
|
||||||
print '<TD align="center">'.$result[$i][payment_method]."</TD>\n";
|
print '<TD align="center">'.' '.$result[$i][payment_method]."</TD>\n";
|
||||||
// print '<TD align="center">'/*.$result[$i][customers_telephone]*/."</TD>\n";
|
// print '<TD align="center">'/*.$result[$i][customers_telephone]*/."</TD>\n";
|
||||||
|
print '<TD align="center"><a href="fiche.php?action=import&orderid='.$result[$i][orders_id].'">'."<b>importer</b></a></TD>\n";
|
||||||
print "</TR>\n";
|
print "</TR>\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -169,7 +169,60 @@ class Osc_order
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* \brief Mise à jour de la table de transition
|
||||||
|
* \param oscid Id du produit dans OsC
|
||||||
|
* \param prodid champ référence
|
||||||
|
* \return int <0 si ko, >0 si ok
|
||||||
|
*/
|
||||||
|
function transcode($osc_orderid, $doli_orderid)
|
||||||
|
{
|
||||||
|
|
||||||
|
print "entree transcode <br>";
|
||||||
|
|
||||||
|
/* suppression et insertion */
|
||||||
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."osc_orders WHERE osc_prodid = ".$osc_orderid.";";
|
||||||
|
$result=$this->db->query($sql);
|
||||||
|
if ($result)
|
||||||
|
{
|
||||||
|
print "suppression ok ".$sql." * ".$result;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print "suppression rate ".$sql." * ".$result;
|
||||||
|
dolibarr_syslog("osc_order::transcode echec suppression");
|
||||||
|
// $this->db->rollback();
|
||||||
|
// return -1;
|
||||||
|
}
|
||||||
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."osc_order VALUES (".$osc_orderid." , now() , ".$doli_orderid.") ;";
|
||||||
|
|
||||||
|
$result=$this->db->query($sql);
|
||||||
|
if ($result)
|
||||||
|
{
|
||||||
|
print "insertion ok ". $sql." ". $result;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print "insertion rate ".$sql." , ".$result;
|
||||||
|
dolibarr_syslog("osc_product::transcode echec insert");
|
||||||
|
// $this->db->rollback();
|
||||||
|
// return -1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
// converti le client osc en client dolibarr
|
||||||
|
|
||||||
|
function get_orderid($osc_orderid)
|
||||||
|
{
|
||||||
|
$sql = "SELECT doli_orderidp";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."osc_order";
|
||||||
|
$sql.= " WHERE osc_orderid = ".$osc_orderid;
|
||||||
|
$result=$this->db->query($sql);
|
||||||
|
$row = $this->db->fetch_row($resql);
|
||||||
|
// test d'erreurs
|
||||||
|
return $row[0];
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -7,8 +7,8 @@
|
|||||||
----------------------------------------------*/
|
----------------------------------------------*/
|
||||||
|
|
||||||
//base url des webservices
|
//base url des webservices
|
||||||
//define(OSCWS_DIR,'http://osc-tiaris/ws_OSC/');
|
define(OSCWS_DIR,'http://osc-tiaris/ws_OSC/');
|
||||||
define(OSCWS_DIR,'http://osc.tiaris.info/ws_OSC/');
|
//define(OSCWS_DIR,'http://osc.tiaris.info/ws_OSC/');
|
||||||
//affichages dans la page d'accueil
|
//affichages dans la page d'accueil
|
||||||
define(OSC_MAXNBCOM, 5);
|
define(OSC_MAXNBCOM, 5);
|
||||||
define(OSC_ORDWAIT,'4'); // code du statut de commande en attente
|
define(OSC_ORDWAIT,'4'); // code du statut de commande en attente
|
||||||
|
|||||||
@ -29,7 +29,7 @@ if ($action == '' && !$cancel) {
|
|||||||
|
|
||||||
if ($_GET['id'])
|
if ($_GET['id'])
|
||||||
{
|
{
|
||||||
$osc_prod = new Osc_product();
|
$osc_prod = new Osc_product($db, $_GET['id']);
|
||||||
$result = $osc_prod->fetch($_GET['id']);
|
$result = $osc_prod->fetch($_GET['id']);
|
||||||
|
|
||||||
if ( !$result)
|
if ( !$result)
|
||||||
@ -54,6 +54,8 @@ if ($action == '' && !$cancel) {
|
|||||||
if ( $user->rights->produit->creer) {
|
if ( $user->rights->produit->creer) {
|
||||||
print '<a class="tabAction" href="fiche.php?action=import&id='.$osc_prod->osc_id.'">'.$langs->trans("Import").'</a>';
|
print '<a class="tabAction" href="fiche.php?action=import&id='.$osc_prod->osc_id.'">'.$langs->trans("Import").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print '<a class="tabAction" href="index.php">'.$langs->trans("Retour").'</a>';
|
||||||
print "\n</div><br>\n";
|
print "\n</div><br>\n";
|
||||||
// seule action importer
|
// seule action importer
|
||||||
|
|
||||||
@ -75,7 +77,7 @@ if ($action == '' && !$cancel) {
|
|||||||
*/
|
*/
|
||||||
if (($_GET["action"] == 'import' ) && ( $_GET["id"] != '' ) && $user->rights->produit->creer)
|
if (($_GET["action"] == 'import' ) && ( $_GET["id"] != '' ) && $user->rights->produit->creer)
|
||||||
{
|
{
|
||||||
$osc_prod = new Osc_product();
|
$osc_prod = new Osc_product($db, $_GET['id']);
|
||||||
$result = $osc_prod->fetch($_GET['id']);
|
$result = $osc_prod->fetch($_GET['id']);
|
||||||
|
|
||||||
if ( !$result )
|
if ( !$result )
|
||||||
@ -99,11 +101,22 @@ if ($action == '' && !$cancel) {
|
|||||||
$product->status = 1; /* en vente */
|
$product->status = 1; /* en vente */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* utilisation de la table de transco*/
|
||||||
|
if ($osc_prod->get_productid($osc_prod->osc_id)>0)
|
||||||
|
{
|
||||||
|
print '<p>Ce produit existe déjà</p>';
|
||||||
|
}
|
||||||
|
else {
|
||||||
$id = $product->create($user);
|
$id = $product->create($user);
|
||||||
|
|
||||||
if ($id > 0)
|
if ($id > 0)
|
||||||
{
|
{
|
||||||
print '<br>création réussie produit '.$id.' référence : '.$product->ref.'</br>';
|
print "\n<div class=\"tabsAction\">\n";
|
||||||
|
print '<p>création réussie produit '.$id.' référence : '.$product->ref.'</p>';
|
||||||
|
$res = $osc_prod->transcode($osc_prod->osc_id,$product->id);
|
||||||
|
print '<p>transcode '.$res.' | '.$product->id.' osc : '.$osc_prod->osc_id.'</p>';
|
||||||
|
print '<a class="tabAction" href="index.php">'.$langs->trans("Retour").'</a>';
|
||||||
|
print "\n</div><br>\n";
|
||||||
$id_entrepot = OSC_ENTREPOT;
|
$id_entrepot = OSC_ENTREPOT;
|
||||||
$id = $product->create_stock($id_entrepot,$osc_prod->osc_stock);
|
$id = $product->create_stock($id_entrepot,$osc_prod->osc_stock);
|
||||||
if ($id > 0) exit;
|
if ($id > 0) exit;
|
||||||
@ -139,6 +152,7 @@ if ($action == '' && !$cancel) {
|
|||||||
else print '<br>update impossible $id : '.$id.' </br>';
|
else print '<br>update impossible $id : '.$id.' </br>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -66,6 +66,7 @@ elseif (!($err = $client->getError()) )
|
|||||||
print "<td>Groupe</td>";
|
print "<td>Groupe</td>";
|
||||||
print '<td align="center">Stock</td>';
|
print '<td align="center">Stock</td>';
|
||||||
print '<TD align="center">Status</TD>';
|
print '<TD align="center">Status</TD>';
|
||||||
|
print '<TD align="center">Importer</TD>';
|
||||||
print "</TR>\n";
|
print "</TR>\n";
|
||||||
|
|
||||||
while ($i < $num) {
|
while ($i < $num) {
|
||||||
@ -78,6 +79,7 @@ elseif (!($err = $client->getError()) )
|
|||||||
print "<TD>".$result[$i][manufacturer]."</TD>\n";
|
print "<TD>".$result[$i][manufacturer]."</TD>\n";
|
||||||
print '<TD align="center">'.$result[$i][quantity]."</TD>\n";
|
print '<TD align="center">'.$result[$i][quantity]."</TD>\n";
|
||||||
print '<TD align="center">'.$result[$i][status]."</TD>\n";
|
print '<TD align="center">'.$result[$i][status]."</TD>\n";
|
||||||
|
print '<TD align="center"><a href="fiche.php?action=import&id='.$result[$i][OSC_id].'"'."><b>importer</b></a></TD>\n";
|
||||||
print "</TR>\n";
|
print "</TR>\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,6 +34,8 @@
|
|||||||
|
|
||||||
class Osc_product
|
class Osc_product
|
||||||
{
|
{
|
||||||
|
var $db;
|
||||||
|
|
||||||
var $osc_id;
|
var $osc_id;
|
||||||
var $osc_ref;
|
var $osc_ref;
|
||||||
var $osc_name;
|
var $osc_name;
|
||||||
@ -50,13 +52,14 @@ class Osc_product
|
|||||||
* \brief Constructeur de la classe
|
* \brief Constructeur de la classe
|
||||||
* \param id Id produit (0 par defaut)
|
* \param id Id produit (0 par defaut)
|
||||||
*/
|
*/
|
||||||
function Osc_product($id=0) {
|
function Osc_product($DB, $id=0) {
|
||||||
|
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
$this->osc_id = $id ;
|
$this->osc_id = $id ;
|
||||||
|
|
||||||
/* les initialisations nécessaires */
|
/* les initialisations nécessaires */
|
||||||
|
$this->db = $DB;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -113,6 +116,60 @@ class Osc_product
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Mise à jour de la table de transition
|
||||||
|
* \param oscid Id du produit dans OsC
|
||||||
|
* \param prodid champ référence
|
||||||
|
* \return int <0 si ko, >0 si ok
|
||||||
|
*/
|
||||||
|
function transcode($oscid, $prodid)
|
||||||
|
{
|
||||||
|
|
||||||
|
print "entree transcode <br>";
|
||||||
|
|
||||||
|
/* suppression et insertion */
|
||||||
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."osc_product WHERE osc_prodid = ".$oscid.";";
|
||||||
|
$result=$this->db->query($sql);
|
||||||
|
if ($result)
|
||||||
|
{
|
||||||
|
print "suppression ok ".$sql." * ".$result;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print "suppression rate ".$sql." * ".$result;
|
||||||
|
dolibarr_syslog("osc_product::transcode echec suppression");
|
||||||
|
// $this->db->rollback();
|
||||||
|
// return -1;
|
||||||
|
}
|
||||||
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."osc_product VALUES (".$oscid." , now() , ".$prodid.") ;";
|
||||||
|
|
||||||
|
$result=$this->db->query($sql);
|
||||||
|
if ($result)
|
||||||
|
{
|
||||||
|
print "insertion ok ". $sql." ". $result;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print "insertion rate ".$sql." , ".$result;
|
||||||
|
dolibarr_syslog("osc_product::transcode echec insert");
|
||||||
|
// $this->db->rollback();
|
||||||
|
// return -1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
// converti le client osc en client dolibarr
|
||||||
|
|
||||||
|
function get_productid($osc_product)
|
||||||
|
{
|
||||||
|
$sql = "SELECT doli_prodidp";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."osc_product";
|
||||||
|
$sql.= " WHERE osc_prodid = ".$osc_product;
|
||||||
|
$result=$this->db->query($sql);
|
||||||
|
$row = $this->db->fetch_row($resql);
|
||||||
|
// test d'erreurs
|
||||||
|
return $row[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -210,19 +210,27 @@ class Translate {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Retourne la version traduite du texte passé en paramètre
|
* \brief Retourne la version traduite du texte passé en paramètre
|
||||||
* Si il n'y a pas de correspondance pour ce texte, on cherche dans fichier alternatif
|
* Si il n'y a pas de correspondance pour ce texte, on cherche dans fichier alternatif
|
||||||
* et si toujours pas trouvé, il est retourné tel quel
|
* et si toujours pas trouvé, il est retourné tel quel
|
||||||
* Les paramètres de cette méthode peuvent contenir de balises HTML.
|
* Les paramètres de cette méthode peuvent contenir de balises HTML.
|
||||||
* \param str chaine a traduire
|
* \param key clé de chaine a traduire
|
||||||
* \param param1 chaine de param1
|
* \param param1 chaine de param1
|
||||||
* \param param2 chaine de param1
|
* \param param2 chaine de param1
|
||||||
* \param param3 chaine de param1
|
* \param param3 chaine de param1
|
||||||
* \return string chaine traduite
|
* \param maxsize taille max
|
||||||
|
* \return string chaine traduite
|
||||||
*/
|
*/
|
||||||
function trans($str, $param1='', $param2='', $param3='', $param4='')
|
function trans($key, $param1='', $param2='', $param3='', $param4='', $maxsize=0)
|
||||||
{
|
{
|
||||||
return $this->transnoentities($str,htmlentities($param1),htmlentities($param2),htmlentities($param3),htmlentities($param4));
|
if ($this->getTransFromTab($key))
|
||||||
|
{
|
||||||
|
// Si la traduction est disponible
|
||||||
|
$str=sprintf($this->tab_translate[$key],$param1,$param2,$param3,$param4);
|
||||||
|
if ($maxsize) $str=dolibarr_trunc($str,$maxsize);
|
||||||
|
return htmlentities($str);
|
||||||
|
}
|
||||||
|
return $key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user