analyser(); $print_options = $xml_print->table; if ($action_print=="print_prepare") { header ("Content-Type: text/html; charset=$charset"); print $std_header; print "

".$msg["print_options"]."

\n"; print " "; print "
".$msg["print_size"].""; if(!$notice_id) print"

"; $sort_info = $sort_id ? '' : ''; $onchange=" var div_sel=document.getElementById('sel_notice_tpl'); var div_sel2=document.getElementById('sel_notice_tpl2'); var notice_tpl=document.getElementById('notice_tpl'); var sel=notice_tpl.options[notice_tpl.selectedIndex].value; if(sel>0){ div_sel.style.display='none'; div_sel2.style.display='none'; }else { div_sel.style.display='block'; div_sel2.style.display='block'; } "; $sel_notice_tpl=notice_tpl_gen::gen_tpl_select("notice_tpl",0,$onchange); print" ".$msg["print_format_title"]."
$sel_notice_tpl





".$msg["print_ex_title"]."
"; if ($pmb_print_expl_default) { $checkprintexpl="checked"; $checknoprintexpl=""; } else { $checkprintexpl=""; $checknoprintexpl="checked"; } print "
".$msg["print_numeric_ex_title"]."

".$msg["print_output_title"]."



  ".$msg["print_emaildest"]."
   ".$msg["523"]." 
".$sort_info."
 
"; print ""; } if ($action_print=="print") { if ($_SESSION["session_history"][$current_print]) { $_SESSION["PRINT"]=$_SESSION["session_history"][$current_print]["NOTI"]; $_SESSION["PRINT"]["short"]=$short; $_SESSION["PRINT"]["ex"]=$ex; $_SESSION["PRINT"]["exnum"]=$exnum; $_SESSION["PRINT"]["output"]=$output; $_SESSION["PRINT"]["emaildest"]=$emaildest; $_SESSION["PRINT"]["emailcontent"]=$emailcontent; $_SESSION["PRINT"]["pager"]=$pager; $_SESSION["PRINT"]["notice_id"]=$notice_id; $_SESSION["PRINT"]["permalink"]=$permalink; $_SESSION["PRINT"]["vignette"]=$vignette; $_SESSION["PRINT"]["header"]=$header; $_SESSION["PRINT"]["notice_tpl"]=$notice_tpl; if ($sort_id) $_SESSION["PRINT"]["sort_id"]=$sort_id; else $_SESSION["PRINT"]["sort_id"]=$_SESSION['tri']; echo ""; } elseif ($notice_id) { $_SESSION["PRINT"]["short"]=$short; $_SESSION["PRINT"]["ex"]=$ex; $_SESSION["PRINT"]["exnum"]=$exnum; $_SESSION["PRINT"]["output"]=$output; $_SESSION["PRINT"]["emaildest"]=$emaildest; $_SESSION["PRINT"]["emailcontent"]=$emailcontent; $_SESSION["PRINT"]["pager"]=$pager; $_SESSION["PRINT"]["notice_id"]=$notice_id; $_SESSION["PRINT"]["permalink"]=$permalink; $_SESSION["PRINT"]["vignette"]=$vignette; $_SESSION["PRINT"]["header"]=$header; $_SESSION["PRINT"]["notice_tpl"]=$notice_tpl; echo ""; } else { echo ""; } } $use_opac_url_base=1; $prefix_url_image=$opac_url_base; $no_aff_doc_num_image=1; if (($action_print=="")&&($_SESSION["PRINT"])) { $environement=$_SESSION["PRINT"]; $limit=''; if($environement["notice_id"]){ $requete="select notice_id from notices where notice_id=".$environement["notice_id"]; } elseif ($environement["TEXT_QUERY"]) { $requete=preg_replace('/limit\s+[0-9]\s*,*\s*[0-9]*\s*$/','',$environement["TEXT_QUERY"],1); } else { switch ($environement["SEARCH_TYPE"]) { case "extended": $sh=new search(); $table=$sh->make_search(); $requete="select notice_id from $table"; break; case "cart": $requete="select object_id as notice_id from caddie_content join notices where caddie_id=".$idcaddie." and object_id=notice_id order by index_sew"; break; } } if ($environement["pager"]) { $start= $nb_per_page_search*($environement["PAGE"]-1); $nbLimit = $nb_per_page_search; $limit="limit ".$start.",$nb_per_page_search"; }else{ $start = 0; $nbLimit = -1; } if ($environement["sort_id"]) { $sort = new sort('notices','base'); $requete = $sort->appliquer_tri($environement["sort_id"] , $requete, "notice_id", $start, $nbLimit); }else{ $requete.=" $limit"; } $resultat=@pmb_mysql_query($requete); if (!$environement["vignette"]) { $pmb_book_pics_show = 0; } $pheader = ''.$msg['print_title'].''; $pheader.= ''; $output_final.= $pheader; $date_today = formatdate(today()) ; if (pmb_mysql_num_rows($resultat) != 1) { $output_final.= '

'.$date_today.' '.sprintf($msg["print_n_notices"],pmb_mysql_num_rows($resultat)).'

'; } //$output_final.= '
'; $output_final.= '
'; if($_SESSION["PRINT"]["notice_tpl"]) $noti_tpl=new notice_tpl_gen($_SESSION["PRINT"]["notice_tpl"]); while (($r=pmb_mysql_fetch_object($resultat))) { if($noti_tpl) { $output_final.=$noti_tpl->build_notice($r->notice_id,$deflt2docs_location); $output_final.="
"; } else{ $n=pmb_mysql_fetch_object(@pmb_mysql_query("select * from notices where notice_id=".$r->notice_id)); if($n->niveau_biblio != 's' && $n->niveau_biblio != 'a') { if($environement['output']=='email'||$environement['output']=='tt'){ $mono=new mono_display($n,$environement["short"],"",$environement["ex"],"","","",0,4,$environement["exnum"]); }else{ $mono=new mono_display($n,$environement["short"],"",$environement["ex"],"","","",0,1,$environement["exnum"]); } if ($environement["header"]) $output_final.= ''.$mono->header.'

'; $output_final.= $mono->isbd; } else { if($environement['output']=='email'||$environement['output']=='tt'){ $serial = new serial_display($n, $environement["short"], "", "", "", "", "", 0,4,$environement["exnum"] ); }else{ $serial = new serial_display($n, $environement["short"], "", "", "", "", "", 0,1,$environement["exnum"] ); } if ($environement["header"]) $output_final.= ''.$serial->header.'

'; $output_final.= $serial->isbd; } if($environement["permalink"]) $output_final .= "
".substr($pmb_opac_url."index.php?lvl=notice_display&id=".$r->notice_id,0,80)."
"; //$output_final.="
"; $output_final.= "
"; } } if ($charset!='utf-8') $output_final=cp1252Toiso88591($output_final); switch($environement['output']) { case 'email': $headers = "MIME-Version: 1.0\n"; $headers .= "Content-type: text/html; charset=".$charset."\n"; $f_objet_mail = $msg['print_emailobj']." - $biblio_name - $date_today "; $f_message_to_send = ""; if ($environement["emailcontent"]) $f_message_to_send .= $msg["523"].stripslashes($environement["emailcontent"])."
"; $f_message_to_send .= $output_final.'

'.mail_bloc_adresse()." "; $emaildest=$_SESSION["PRINT"]["emaildest"]; $res_envoi=mailpmb("", $emaildest, $f_objet_mail, $f_message_to_send, $PMBuserprenom." ".$PMBusernom, $PMBuseremail, $headers, "", $PMBuseremailbcc); if ($res_envoi) { print "$pheader\n

".sprintf($msg["print_emailsucceed"],$emaildest)."


".$msg["print_emailclose"]."
" ; } else { print "$pheader\n

".sprintf($msg["print_emailfailed"],$emaildest)."


".$msg["print_emailclose"]."
" ; } break; case 'printer': $output_final.= ''; $output_final.= ''; print pmb_bidi($output_final); break; case 'tt': $output_final.= ''; print pmb_bidi($output_final); break; } $_SESSION["PRINT"]=false; } ?>