X-Git-Url: http://git.dj3c1t.com/?a=blobdiff_plain;f=app%2Fdata%2Fmodules%2Fsql%2Fsml_data_sources.php;fp=app%2Fdata%2Fmodules%2Fsql%2Fsml_data_sources.php;h=4c85c2b4ddbeb7f948791b0c50c0d7eb17f37c99;hb=37049b502efdf68a562ce63d8f37a820c66bc887;hp=c7eb45caab3422ecd2f147c3092a586482c609ad;hpb=aa56057fe2634113eb8d1a50ed54b6a8988645a8;p=mw_sourceml diff --git a/app/data/modules/sql/sml_data_sources.php b/app/data/modules/sql/sml_data_sources.php index c7eb45c..4c85c2b 100644 --- a/app/data/modules/sql/sml_data_sources.php +++ b/app/data/modules/sql/sml_data_sources.php @@ -44,6 +44,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"; $sgbd = $this->sgbd(); @@ -117,6 +118,19 @@ if(isset($id_licence)) $WHERE .= ($WHERE ? " AND " : " WHERE ") ." #--sml_sources.licence=".$this->eq($id_licence); + if(isset($is_reference)){ + $WHERE .= ($WHERE ? " AND " : " WHERE "); + if($is_reference){ + $WHERE .= + " #--sml_sources.reference IS NOT NULL" + ." AND LENGTH(#--sml_sources.reference) > 0"; + } + else{ + $WHERE .= + " (#--sml_sources.reference IS NULL" + ." OR (LENGTH(#--sml_sources.reference) = 0))"; + } + } $ORDER_BY = " ORDER BY ".$order_by." ".$order; $LIMIT = (isset($start) && $env->config("max_list") ? " LIMIT ".$env->config("max_list")." OFFSET ".$start : ""); try{