correction sur la partie serveur OSC :

gestion des catégories OSC
diff -Naur --exclude=CVS --exclude='.#*' --exclude='*~' --exclude=documents /home/jean/projets/dolidev/sources/dolibarr_devref/dolibarr/htdocs/oscommerce_ws/ws_server/ws_articles.php /home/jean/projets/dolidev/sources/dolibarr/htdocs/oscommerce_ws/ws_server/ws_articles.php
--- /home/jean/projets/dolidev/sources/dolibarr_devref/dolibarr/htdocs/oscommerce_ws/ws_server/ws_articles.php	2007-10-03 22:44:11.000000000 +0200
+++ /home/jean/projets/dolidev/sources/dolibarr/htdocs/oscommerce_ws/ws_server/ws_articles.php	2007-10-06 08:14:25.000000000 +0200
@@ -16,7 +16,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
- * $Source: /sources/dolibarr/dolibarr/htdocs/oscommerce_ws/ws_server/ws_articles.php,v $
+ * $Source: /cvsroot/dolibarr/dolibarr/htdocs/oscommerce_ws/ws_server/ws_articles.php,v $
  *
  */
 
@@ -52,7 +52,7 @@
 $s->register('get_article');
 $s->register('get_listearticles');
 $s->register('create_article');
-
+$s->register('get_categorylist');
 
 
 function create_article($prod)
@@ -171,6 +171,37 @@
 	return $name.' enregistré';
 }
 
+// OSC categories list from $catid 
+
+function get_categorylist($catid)
+{
+//on se connecte
+	if (!($connexion = mysql_connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD)))   return new soap_fault("Server", "MySQL 1", "connexion impossible");
+	if (!($db = mysql_select_db(DB_DATABASE, $connexion)))  return new soap_fault("Server", "MySQL 2", mysql_error());
+
+	$sql = "select c.categories_id, cd.categories_name, c.parent_id ";
+	$sql .= " FROM categories c, categories_description cd ";
+	$sql .= " WHERE c.parent_id = '".$catid."' and c.categories_id = cd.categories_id and cd.language_id='" . OSC_LANGUAGE_ID ."' order by sort_order, cd.categories_name";
+
+	if (!($resquer = mysql_query($sql,$connexion)))  return new soap_fault("Server", "MySQL gey_categorylist ".$sql, mysql_error());
+
+		switch ($numrows = mysql_numrows($resquer)) {
+		case 0 : 
+			return new soap_fault("Server", "MySQL gey_categorylist", "pas de categories");
+			break;
+		default : 
+			$i = 0;
+			while ( $i < $numrows)  
+			{
+				$liste_cat[$i] =  mysql_fetch_array($resquer, MYSQL_ASSOC);
+				$i++;
+			}
+		}		
+	mysql_close($connexion);
+ /* Sends the results to the client */
+return $liste_cat;		
+}
+
 // Return the results.
 $s->service($HTTP_RAW_POST_DATA);
 
diff -Naur --exclude=CVS --exclude='.#*' --exclude='*~' --exclude=documents /home/jean/projets/dolidev/sources/dolibarr_devref/dolibarr/htdocs/oscommerce_ws/ws_server/ws_customers.php /home/jean/projets/dolidev/sources/dolibarr/htdocs/oscommerce_ws/ws_server/ws_customers.php
--- /home/jean/projets/dolidev/sources/dolibarr_devref/dolibarr/htdocs/oscommerce_ws/ws_server/ws_customers.php	2007-10-03 22:44:11.000000000 +0200
+++ /home/jean/projets/dolidev/sources/dolibarr/htdocs/oscommerce_ws/ws_server/ws_customers.php	2007-10-03 22:45:23.000000000 +0200
@@ -16,7 +16,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
- * $Source: /sources/dolibarr/dolibarr/htdocs/oscommerce_ws/ws_server/ws_customers.php,v $
+ * $Source: /cvsroot/dolibarr/dolibarr/htdocs/oscommerce_ws/ws_server/ws_customers.php,v $
  *
  */
 
diff -Naur --exclude=CVS --exclude='.#*' --exclude='*~' --exclude=documents /home/jean/projets/dolidev/sources/dolibarr_devref/dolibarr/htdocs/oscommerce_ws/ws_server/ws_orders.php /home/jean/projets/dolidev/sources/dolibarr/htdocs/oscommerce_ws/ws_server/ws_orders.php
--- /home/jean/projets/dolidev/sources/dolibarr_devref/dolibarr/htdocs/oscommerce_ws/ws_server/ws_orders.php	2007-10-03 22:44:11.000000000 +0200
+++ /home/jean/projets/dolidev/sources/dolibarr/htdocs/oscommerce_ws/ws_server/ws_orders.php	2007-10-03 22:45:23.000000000 +0200
@@ -16,7 +16,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
- * $Source: /sources/dolibarr/dolibarr/htdocs/oscommerce_ws/ws_server/ws_orders.php,v $
+ * $Source: /cvsroot/dolibarr/dolibarr/htdocs/oscommerce_ws/ws_server/ws_orders.php,v $
  *
  */
 set_magic_quotes_runtime(0);
_______________________________________________
Dolibarr-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/dolibarr-dev

Répondre à