//Récupération de l'ensemble des types de documents
if(!$_REQUEST['entities_chosen']){
$stmt=$db->query("select entity_id, short_label from ".ENT_ENTITIES." where enabled = 'Y' order by short_label");
}elseif($_REQUEST['sub_entities']=='true'){
$stmt=$db->query("select entity_id, short_label from ".ENT_ENTITIES." where enabled = 'Y' and entity_id IN (".$entities_chosen.") or entity_id IN (".$sub_entities1.") order by short_label");
}else{
$stmt=$db->query("select entity_id, short_label from ".ENT_ENTITIES." where enabled = 'Y' and entity_id IN (".$entities_chosen.") order by short_label",array());
}
...
...
@@ -215,7 +231,7 @@ $totalCourrier=array();
$totalEntities=count($entities);
for($i=0;$i<$totalEntities;$i++){
$stmt=$db->query("select count(*) as total from ".$view." inner join mlb_coll_ext on ".$view.".res_id = mlb_coll_ext.res_id where destination = ? and ".$view.".status not in ('DEL','BAD') ".$where_date." ".$where_status." ".$where_priority.$where_clause." ",array($entities[$i]['ID']));
$stmt=$db->query("select count(*) as total from ".$view." where destination = ? and ".$view.".status not in ('DEL','BAD') ".$where_date." ".$where_status." ".$where_priority.$where_clause." ",array($entities[$i]['ID']));