correction bug source_groupes (data XML) sourceml.1.1.4
authordj3c1t <dj3c1t@free.fr>
Sat, 21 Dec 2013 22:14:18 +0000 (23:14 +0100)
committerdj3c1t <dj3c1t@free.fr>
Sat, 21 Dec 2013 22:14:18 +0000 (23:14 +0100)
app/config.xml
app/data/modules/xml/sml_data_source_groupes.php

index 426156c..d0fe939 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <config>
 
-  <version>1.1.3</version>
+  <version>1.1.4</version>
 
   <params>
     <parent>parent</parent>
index f85b617..cc21ed9 100644 (file)
         while(($sources !== false) && $v_rst = $sgbd->fetch_data($rst)){
           if(isset($v_rst) && isset($v_rst["id"])){
             if(isset($_sources[$v_rst["id"]])){
-              if(!isset($sources[$v_rst["id"]])){
-                $sources[$v_rst["id"]] = $v_rst;
-                $sources[$v_rst["id"]]["authors"] = array();
+              if(!isset($params["id_class"]) || (isset($v_rst["id_class"]) && ($v_rst["id_class"] == $params["id_class"]))){
+                if(!isset($sources[$v_rst["id"]])){
+                  $sources[$v_rst["id"]] = $v_rst;
+                  $sources[$v_rst["id"]]["authors"] = array();
+                }
+                $sources[$v_rst["id"]]["authors"][] = $_sources[$v_rst["id"]]["id_author"];
               }
-              $sources[$v_rst["id"]]["authors"][] = $_sources[$v_rst["id"]]["id_author"];
             }
           }
           else $sources = false;