explnum_id;
$resultat = mysql_query("SELECT explnum_id, explnum_notice, explnum_bulletin, explnum_nom, explnum_mimetype, explnum_url, explnum_data, length(explnum_data) as taille,explnum_path, concat(repertoire_path,explnum_path,explnum_nomfichier) as path, repertoire_id FROM explnum left join upload_repertoire on repertoire_id=explnum_repertoire WHERE explnum_id = '$explnum_id' ", $dbh);
$nb_res = mysql_num_rows($resultat) ;
$ligne = mysql_fetch_object($resultat);
$id_for_rigths = $ligne->explnum_notice;
if($ligne->explnum_bulletin != 0){
//si bulletin, les droits sont rattachés à la notice du bulletin, à défaut du pério...
$req = "select bulletin_notice,num_notice from bulletins where bulletin_id =".$ligne->explnum_bulletin;
$res = mysql_query($req);
if(mysql_num_rows($res)){
$row = mysql_fetch_object($result);
$id_for_rigths = $row->num_notice;
if(!$id_for_rigths){
$id_for_rigths = $row->bulletin_notice;
}
}$type = "" ;
}
//droits d'acces emprunteur/notice
if ($gestion_acces_active==1 && $gestion_acces_empr_notice==1) {
$ac= new acces();
$dom_2= $ac->setDomain(2);
$rights= $dom_2->getRights($_SESSION['id_empr_session'],$id_for_rigths);
}
//Accessibilité des documents numériques aux abonnés en opac
$req_restriction_abo = "SELECT explnum_visible_opac, explnum_visible_opac_abon ,notice_id FROM notice_statut, explnum, notices WHERE explnum_notice=notice_id AND statut=id_notice_statut AND explnum_id='$explnum_id' ";
$result=mysql_query($req_restriction_abo,$dbh);
if(! mysql_num_rows($result) ){// bulletin
$req_restriction_abo="SELECT explnum_visible_opac, explnum_visible_opac_abon,notice_id
FROM notice_statut, explnum, bulletins, notices
WHERE explnum_bulletin = bulletin_id
AND num_notice = notice_id
AND statut = id_notice_statut
AND explnum_id='$explnum_id' ";
$result=mysql_query($req_restriction_abo,$dbh);
}
$expl_num=mysql_fetch_array($result);
if( $rights & 16 || (is_null($dom_2) && $expl_num["explnum_visible_opac"] && (!$expl_num["explnum_visible_opac_abon"] || ($expl_num["explnum_visible_opac_abon"] && $_SESSION["user_code"])))){
if (($ligne->explnum_data)||($ligne->explnum_path)) {
$notice = new notice_affichage($expl_num["notice_id"], $liens_opac) ;
$notice->do_header_without_html();
$tpl.=" ".$notice->notice_header_without_html." : ".$ligne->explnum_nom."
";
$cpt_doc_num++;
}
}
}
}
if($cpt_doc_num){
$tpl="
".$msg["print_output_docnum_list"]."
". $tpl;
}else {
$tpl="".$msg["print_output_docnum_list_no_file"]."
";
}
return $tpl;
}