get_empr_query());
if($res){
$empr_carac = pmb_mysql_fetch_array($res);
$log->add_log('empr',$empr_carac);
}
}
$log->add_log('num_session',session_id());
$log->add_log('expl',$infos_expl);
$log->add_log('docs',$infos_notice);
$log->save();
}
if (file_exists($include_path.'/print/print_options_subst.xml')){
$xml_print = new XMLlist($include_path.'/print/print_options_subst.xml');
} else {
$xml_print = new XMLlist($include_path.'/print/print_options.xml');
}
$xml_print->analyser();
$print_options = $xml_print->table;
if (($action=="print_$lvl")&&($output=="tt")) {
header("Content-Type: application/word");
header('Content-Disposition: attachement; filename="liste.doc"');
}
$header_print = '';
$footer_print = '';
if($opac_print_cart_header_footer) {
$req = "select * from print_cart_tpl where id_print_cart_tpl='".$opac_print_cart_header_footer."'";
$resultat = pmb_mysql_query($req);
if (pmb_mysql_num_rows($resultat)) {
$r = pmb_mysql_fetch_object($resultat);
$header_print = $r->print_cart_tpl_header;
$footer_print = $r->print_cart_tpl_footer;
}
}
$output_final = '
'.$msg['print_title'].'';
if ( $action != "print_$lvl" ) {
$output_final.= HtmlHelper::getInstance()->getStyle($css);
}
$output_final.= '';
if($action) {
$output_final.= $header_print;
}
if ($output!='email') {
$output_final.= "
";
} else {
$emailexp = trim(stripslashes($emailexp));
if($emailexp) {
$output_final.= $msg['print_emailexp'].' '.$emailexp.'
';
}
$emailcontent = trim(stripslashes($emailcontent));
if($emailcontent) {
$output_final.= $msg['print_emailcontent'].' '.$emailcontent.'
';
}
}
if ($action!="print_$lvl") {
$output_final.="";
$output_final.="";
if($lvl) $output_final.="".$msg["print_title_".$lvl]."
";
else $output_final .="".$msg["print_title"]."
";
$output_final.= "".$msg["print_options"]."
";
$output_final.= "
";
} elseif($output=="docnum"){
$docnum=new docnum_merge(0,$doc_num_list);
$docnum->merge();
exit;
} else {
$opac_visionneuse_allow=0;
if(isset($notice_tpl) && $notice_tpl)$noti_tpl=new notice_tpl_gen($notice_tpl);
else $noti_tpl = '';
if(is_readable("./styles/".$css."/print/print.css") ) {
$output_final.= "";
}
$output_final .= "";
if($noti_tpl) {
$output_final.=$noti_tpl->get_print_css_style();
}
$notices = array();
switch ($action) {
case 'print_cart':
if($number && $select_noti){
$notices = explode(",",$select_noti);
} else $notices =$_SESSION["cart"];
break;
case 'print_list':
if($number && $select_noti){
$notices = explode(",",$select_noti);
} else {
$liste = new liste_lecture($id_liste);
$nom_liste = $liste->nom_liste;
$description = $liste->description;
$notices = $liste->sort_notices($liste->notices);
}
break;
case 'print_search':
if($select_noti){
$notices = explode(",",$select_noti);
} else {
$notices = explode(",",$_SESSION["tab_result_current_page"]);
}
//on ajoute 'es' dans le cas des notices externes
if (!empty($mode) && $mode == TYPE_EXTERNAL){
foreach ($notices as $key=>$noti){
$notices[$key] = 'es'.$noti;
}
}
break;
case 'print_etagere':
$etagere_caddies = new etagere_caddies($id_etagere);
$notices = $etagere_caddies->get_notices(0, $opac_nb_aut_rec_per_page);
break;
}
$show_what = array(
'short' => $short,
'header' => $header,
'vignette' => $vignette,
'expl' => $ex,
);
$notices_aff="";
if (count($notices)) {
$date_today = formatdate(today()) ;
if ($output=="email") {
//on rajoute une mention spécifiant l'origine du mail...
$rqt = "select empr_nom, empr_prenom from empr where id_empr ='".$_SESSION['id_empr_session']."'";
$res = pmb_mysql_query($rqt);
if(pmb_mysql_num_rows($res)){
$info = pmb_mysql_fetch_object($res);
$output_final .= "".$msg['biblio_send_by']." ".$info->empr_nom." ".$info->empr_prenom."
" ;
}
}
$output_final .= "".$date_today." ".sprintf($msg["show_cart_n_notices"],count($notices))."
";
for ($i=0; $ibuild_notice(substr($notices[$i],0,2)!="es"?$notices[$i]:substr($notices[$i],2));
$output_final .= $notice_aff."
";
} else{
if (substr($notices[$i],0,2)!="es" && $type=='PUBLIC' && $opac_notices_format==AFF_ETA_NOTICES_TEMPLATE_DJANGO) {
if($short) {
switch ($output) {
case 'pdf' :
$notice_aff = record_display::get_display_for_pdf_short($notices[$i], '', $show_what);
break;
case 'printer' :
default:
$notice_aff = record_display::get_display_for_printer_short($notices[$i], '', $show_what);
}
}else {
switch ($output) {
case 'pdf' :
$notice_aff = record_display::get_display_for_pdf_extended($notices[$i], '', $show_what);
break;
case 'printer' :
default:
$notice_aff = record_display::get_display_for_printer_extended($notices[$i], '', $show_what);
}
}
$output_final.= $notice_aff."
";
//TRAITEMENT DE LAFFICHAGE DES NOTICES ES (EXTERNAL SEARCH)
} else if (substr($notices[$i],0,2)=="es" && $opac_notices_format==AFF_ETA_NOTICES_TEMPLATE_DJANGO){
if($short) {
switch ($output) {
case 'pdf' :
$notice = substr($notices[$i],2);
$notice_aff = record_display::get_display_for_pdf_short_unimarc($notice, $opac_notices_format_django_directory,$show_what);
break;
case 'printer' :
default:
$notice = substr($notices[$i],2);
$notice_aff = record_display::get_display_for_printer_short_unimarc($notice, $opac_notices_format_django_directory, $show_what);
break;
}
}else {
switch ($output) {
case 'pdf' :
$notice = substr($notices[$i],2);
$notice_aff = record_display::get_display_for_pdf_extended_unimarc($notice, $opac_notices_format_django_directory, $show_what);
break;
case 'printer' :
default:
$notice = substr($notices[$i],2);
$notice_aff = record_display::get_display_for_printer_extended_unimarc($notice, $opac_notices_format_django_directory, $show_what);
break;
}
}
$output_final.= $notice_aff."
";
} else {
if (substr($notices[$i],0,2)!="es") {
if (!$opac_notice_affichage_class) $opac_notice_affichage_class="notice_affichage";
} else {
$opac_notice_affichage_class="notice_affichage_unimarc";
}
$current = new $opac_notice_affichage_class((substr($notices[$i],0,2)!="es"?$notices[$i]:substr($notices[$i],2)),array(),0,1);
$notice_aff .= $current->get_print_css_style();
$current->do_header();
if ($type=='PUBLIC') {
$current->do_public($short,$ex);
if ($vignette) $current->do_image($current->notice_public,false);
} else {
$current->do_isbd($short,$ex);
if ($vignette) {
if ($output == 'pdf') $opac_notice_is_pdf = true;
$current->do_image($current->notice_isbd,false);
}
}
//Icone type de Document
if (!isset($icon_doc)) {
$icon_doc = marc_list_collection::get_instance('icondoc');
$icon_doc = $icon_doc->table;
}
$icon = $icon_doc[$current->notice->niveau_biblio.$current->notice->typdoc];
$iconDoc = "";
if ($icon) {
if(!isset($biblio_doc)) {
$biblio_doc = marc_list_collection::get_instance('nivbiblio');
$biblio_doc = $biblio_doc->table;
}
$info_bulle_icon=$biblio_doc[$current->notice->niveau_biblio]." : ".$tdoc->table[$current->notice->typdoc];
$iconDoc="";
}
if ($header) {
$notice_aff .= " ".$iconDoc.$current->notice_header."
";
}
if ($current->notice->niveau_biblio =='s') {
if (!isset($bulletins)) $bulletins = '';
$perio="[".$msg['isbd_type_perio'].$bulletins."] ";
} elseif ($current->notice->niveau_biblio =='a') {
$perio="[".$msg['isbd_type_art']."] ";
} else $perio="";
if ($type=='PUBLIC') {
$notice_aff .= $perio.$current->notice_public;
} else {
$notice_aff .= $perio.$current->notice_isbd;
}
if ($ex) $notice_aff .= $current->affichage_expl ;
$output_final .= $notice_aff."
";
}
}
if ($opac_notice_is_pdf) {
$notices_aff.= "" . $notice_aff . "";
} else {
$notices_aff.= $notice_aff;
}
if($noti_tpl) {
$notices_aff .= "
";
} else {
$notices_aff .= "
";
}
}
$notices_aff = $header_print.$notices_aff.$footer_print;
$output_final .= $footer_print;
if ($charset!='utf-8') $output_final=cp1252Toiso88591($output_final);
}
if ($output=="printer") $output_final .= "";
}
if($opac_parse_html){
$output_final=parseHTML($output_final);
}
if ($output=="pdf"){
if($charset != 'utf-8'){
if(function_exists("mb_convert_encoding")){
$notices_aff = mb_convert_encoding($notices_aff,"UTF-8","Windows-1252");
}else{
$notices_aff = utf8_encode($notices_aff);
}
}
$html2pdf = new Html2Pdf();
$css = "";
$html2pdf->writeHTML("".$css.$notices_aff."");
$html2pdf->output('diffusion.pdf','I');
exit;
}
if ($output!='email') {
print pmb_bidi($output_final.'') ;
} else {
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=".$charset."\n";
$emailobj = trim(stripslashes($emailobj));
if (!$emailobj) {
$emailobj=$msg['print_emailobjet'].' '.$opac_biblio_name.' - '.$date_today;
}
$mail_addresses = array();
foreach($emaildest as $i => $email){
if(isset($emaildest_id[$i]) && $emaildest_id[$i]){
$emaildest_id[$i]+= 0;
$query = "select empr_mail from empr where id_empr = ".$emaildest_id[$i];
$result = pmb_mysql_result(pmb_mysql_query($query), 0,0);
$mail_addresses[] = $result;
}else{
if($email){
$mail_addresses[] = $email;
}
}
}
$res_envoi=mailpmb('', implode(';',$mail_addresses), $emailobj, $output_final.'
'.mail_bloc_adresse().'