X-Git-Url: http://git.dj3c1t.com/?a=blobdiff_plain;f=app%2Fdata%2Fmodules%2Fxml%2Fsml_data_sources.php;h=fb8dc2bb46cae13fad336c33f8e5a41f502b5e6b;hb=refs%2Ftags%2Fsourceml.1.1.2;hp=b4a4d1bbd478e392d279e4d881d2e33b7dd61b9d;hpb=7d287d32ecd625ad3c21e9aa2aa122c86f9ec671;p=mw_sourceml diff --git a/app/data/modules/xml/sml_data_sources.php b/app/data/modules/xml/sml_data_sources.php index b4a4d1b..fb8dc2b 100644 --- a/app/data/modules/xml/sml_data_sources.php +++ b/app/data/modules/xml/sml_data_sources.php @@ -56,6 +56,7 @@ $id_composition = isset($params["id_composition"]) ? $params["id_composition"] : null; $id_source_derivation = isset($params["id_source_derivation"]) ? $params["id_source_derivation"] : null; $id_licence = isset($params["id_licence"]) ? $params["id_licence"] : null; + $is_reference = isset($params["is_reference"]) ? $params["is_reference"] : null; $order_by = isset($params["order_by"]) ? $params["order_by"] : "ordre"; $order = isset($params["order"]) ? $params["order"] : "ASC"; @@ -112,7 +113,10 @@ $res = array(); if($rst = $sgbd->open_data("sml_sources")) { while($v_rst = $sgbd->fetch_data($rst)) - { if(isset($v_rst)) $res[$v_rst["id"]] = $v_rst; + { if(isset($v_rst)){ + $res[$v_rst["id"]] = $v_rst; + if(!isset($res[$v_rst["id"]]["ordre"])) $res[$v_rst["id"]]["ordre"] = 0; + } else { $res = false; break; @@ -197,6 +201,18 @@ } } + // -------------------------------- filtre sur is_reference + if($MATCH){ + if(isset($is_reference)){ + if($is_reference){ + $MATCH = isset($v_rst["reference"]) && $v_rst["reference"]; + } + else{ + $MATCH = !isset($v_rst["reference"]) || !$v_rst["reference"]; + } + } + } + // -------------------------------- filtre sur quantite de resultats if($MATCH) { $sources["total"]++;