* * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ */ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/product.class.php"); require_once("../includes/configure.php"); llxHeader(); if ($action == '' && !$cancel) { if ($_GET['id']) { $osc_prod = new Osc_product($db, $_GET['id']); $result = $osc_prod->fetch($_GET['id']); if ( !$result) { print '
| Descrption | '.$osc_prod->osc_desc.' | '; print '
| ref | '.$osc_prod->osc_ref.' | '; print '
| Id | '.$osc_prod->osc_id.' | '; print '
| Prix | '.$osc_prod->osc_price.' | '; print '
| Four_id | '.$osc_prod->osc_four.' | '; print "
ERROR 1
\n"; dol_print_error('',"erreur webservice ".$osc_prod->error); } } else { print "ERROR 1
\n"; print "Error"; } } /* action Import cr�ation de l'objet product de dolibarr * */ if (($_GET["action"] == 'import' ) && ( $_GET["id"] != '' ) && ($user->rights->produit->creer || $user->rights->service->creer)) { $osc_prod = new Osc_product($db, $_GET['id']); $result = $osc_prod->fetch($_GET['id']); if ( !$result ) { $product = new Product($db); if ($_error == 1) { print 'erreur $osc_prod->fetch
"; } /* utilisation de la table de transco*/ if ($osc_prod->get_productid($osc_prod->osc_id)>0) { print 'Ce produit existe d�j�
'; } else { $id = $product->create($user); if ($id > 0) { print "\ncr�ation r�ussie produit '.$id.' r�f�rence : '.$product->ref; $res = $osc_prod->transcode($osc_prod->osc_id,$product->id); print ' Id osc : '.$osc_prod->osc_id.'
'; print ''.$langs->trans("Retour").''; print "\nOn a une erreur".$id."
"; if ($id == -3) { $_error = 1; $_GET["action"] = "create"; $_GET["type"] = $_POST["type"]; } if ($id == -2) { /* la r�f�rence existe on fait un update */ $product_control = new Product($db); if ($_error == 1) { print 'erreur'.$product->error().'
'; } print ''; } } } llxFooter('$Date$ - $Revision$'); ?>