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

".$msg["print_options"]."

\n"; print ""; print "
"; print "
".$msg["print_size"].""; if(!isset($notice_id) || !$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["print_emailobj_label"]."
".$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"]["emailobj"]=$emailobj; $_SESSION["PRINT"]["emaildest"]=$emaildest; $_SESSION["PRINT"]["emaildest_id"]=$emaildest_id; $_SESSION["PRINT"]["emailcontent"]=$emailcontent; $_SESSION["PRINT"]["pager"]=$pager; $_SESSION["PRINT"]["selected_objects"]=(!empty($selected_objects) ? explode(',', $selected_objects) : array()); $_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"]["emailobj"]=$emailobj; $_SESSION["PRINT"]["emaildest"]=$emaildest; $_SESSION["PRINT"]["emaildest_id"]=$emaildest_id; $_SESSION["PRINT"]["emailcontent"]=$emailcontent; $_SESSION["PRINT"]["pager"]=$pager; $_SESSION["PRINT"]["selected_objects"]=(!empty($selected_objects) ? explode(',', $selected_objects) : array()); $_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"]) { if (is_array($environement["TEXT_LIST_QUERY"]) && count($environement["TEXT_LIST_QUERY"])) { foreach($environement["TEXT_LIST_QUERY"] as $query) { @pmb_mysql_query($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"; $requete .= " order by index_sew"; break; } } if (!empty($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 (!empty($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'].""; if($environement['output']=='email') { $environement['emailcontent'] = trim(stripslashes($environement['emailcontent'])); if ($environement['emailcontent']) { $pheader.= $msg['523'].$environement['emailcontent'].'
'; } } if($_SESSION["PRINT"]["notice_tpl"]) $noti_tpl=new notice_tpl_gen($_SESSION["PRINT"]["notice_tpl"]); else $noti_tpl=0; $pheader.= ''; if($noti_tpl) { $pheader.=$noti_tpl->get_print_css_style(); } $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.= '
'; while (($r=pmb_mysql_fetch_object($resultat))) { if ($environement["pager"] != 2 || in_array($r->notice_id, $environement['selected_objects'])) { 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.= "
"; } } } 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"; $mail_addresses = array(); foreach($environement['emaildest'] as $i => $email){ if(isset($environement['emaildest_id'][$i]) && $environement['emaildest_id'][$i]){ $environement['emaildest_id'][$i]+= 0; $query = "select empr_mail from empr where id_empr = ".$environement['emaildest_id'][$i]; $result = pmb_mysql_result(pmb_mysql_query($query), 0,0); $mail_addresses[] = $result; }else{ if($email){ $mail_addresses[] = $email; } } } $emailobj=$_SESSION['PRINT']['emailobj']; $f_objet_mail = trim(stripslashes($emailobj)); if (!$f_objet_mail) { $f_objet_mail=$msg['print_emailobj'].' '.$opac_biblio_name.' - '.$date_today; } $f_message_to_send = $output_final.'

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

".sprintf($msg["print_emailsucceed"],implode(', ',$mail_addresses))."


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

".sprintf($msg["print_emailfailed"],implode(', ',$mail_addresses))."


".$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; } ?>