id_location=0; if($pmb_lecteurs_localises){ $id_location+=0; if(!$id_location)$id_location=$deflt_docs_location; $this->id_location=$id_location; } $this->fetch_data(); } function fetch_data() { $this->info_expl=array(); $this->info_circ=array(); $this->classement['alert']=array(); $this->classement['to_be_circ']=array(); $this->classement['in_circ']=array(); $this->classement['retard']=array(); $this->classement['reproduction_ask']=array(); $this->classement['is_in_resa_ask']=array(); if($this->id_location) $restrict=" and expl_location=".$this->id_location; $req="select * from serialcirc_expl,exemplaires,bulletins where expl_id=num_serialcirc_expl_id and expl_bulletin=bulletin_id $restrict"; $resultat=mysql_query($req); if (mysql_num_rows($resultat)) { while($r=mysql_fetch_object($resultat)){ $this->info_expl[$r->expl_id]['expl_cb']= $r->expl_cb; $this->info_expl[$r->expl_id]['expl_id']= $r->expl_id; $this->info_expl[$r->expl_id]['expl_statut']= $r->expl_statut; $this->info_expl[$r->expl_id]['expl_location']= $r->expl_location; $this->info_expl[$r->expl_id]['bulletine_date']= $r->serialcirc_expl_bulletine_date; $this->info_expl[$r->expl_id]['num_diff']= $r->num_serialcirc_expl_serialcirc_diff; $this->info_expl[$r->expl_id]['expl_abt_num']= $r->expl_abt_num; $this->info_expl[$r->expl_id]['numero']= $r->bulletin_numero; $this->info_expl[$r->expl_id]['mention_date']= $r->mention_date; $this->info_expl[$r->expl_id]['bulletin_notice']= $r->bulletin_notice; $this->info_expl[$r->expl_id]['bulletin_id']= $r->bulletin_id; $this->info_expl[$r->expl_id]['num_notice']= $r->num_notice; $this->info_expl[$r->expl_id]['expl_link']="./catalog.php?categ=serials&sub=bulletinage&action=expl_form&bul_id=".$r->bulletin_id."&expl_id=".$r->expl_id; $this->info_expl[$r->expl_id]['bull_link']="./catalog.php?categ=serials&sub=bulletinage&action=view&bul_id=".$r->bulletin_id; $this->info_expl[$r->expl_id]['serial_link']="./catalog.php?categ=serials&sub=view&serial_id=".$r->bulletin_notice; $this->info_expl[$r->expl_id]['abt_link']="./catalog.php?categ=serialcirc_diff&sub=view&num_abt=".$r->expl_abt_num; $this->info_expl[$r->expl_id]['cirdiff_link']="./catalog.php?categ=serialcirc_diff&sub=view&num_abt=".$r->expl_abt_num; $this->info_expl[$r->expl_id]['view_link']='./circ.php?categ=visu_ex&form_cb_expl='.$r->expl_cb; $req_serial="select * from notices where notice_id=".$r->bulletin_notice.""; $res_serial=mysql_query($req_serial); if ($r_serial=mysql_fetch_object($res_serial)){ $this->info_expl[$r->expl_id]['serial_title']=$r_serial->tit1; } $this->info_expl[$r->expl_id]['num_serialcirc']= $r->num_serialcirc_expl_serialcirc; $this->info_expl[$r->expl_id]['serialcirc_diff'] = new serialcirc_diff($r->num_serialcirc_expl_serialcirc); $this->info_expl[$r->expl_id]['state_circ']= $r->serialcirc_expl_state_circ; // $this->info_expl[$r->expl_id]['diff']= $r->num_serialcirc_expl_serialcirc_diff; $this->info_expl[$r->expl_id]['current_empr']= $r->num_serialcirc_expl_current_empr; $this->info_expl[$r->expl_id]['start_date']= $r->serialcirc_expl_start_date; $this->fetch_info_circ($r->expl_id); if($this->is_in_alert($r->expl_id)) $this->classement['alert'][]=$r->expl_id; else if($this->is_in_to_be_circ($r->expl_id)) $this->classement['to_be_circ'][]=$r->expl_id; if($this->is_in_circ($r->expl_id)) $this->classement['in_circ'][]=$r->expl_id; if($this->is_in_late($r->expl_id)) $this->classement['retard'][]=$r->expl_id; if($this->is_in_reproduction_ask($r->expl_id)) $this->classement['reproduction_ask'][]=$r->expl_id; if($this->is_in_resa_ask($r->expl_id)) $this->classement['is_in_resa_ask'][]=$r->expl_id; $this->info_expl[$r->expl_id]['circ']=array(); $req_circ="select * from serialcirc_circ where num_serialcirc_circ_expl =".$r->expl_id; $resultat_circ=mysql_query($req_circ); if (mysql_num_rows($resultat_circ)) { while($r_circ=mysql_fetch_object($resultat_circ)){ $this->info_expl[$r->expl_id]['circ'][$r_circ->num_serialcirc_circ_empr ]['subscription']=$r_circ->serialcirc_circ_subscription; $this->info_expl[$r->expl_id]['circ'][$r_circ->num_serialcirc_circ_empr ]['ret_asked ']=$r_circ->serialcirc_circ_ret_asked ; $this->info_expl[$r->expl_id]['circ'][$r_circ->num_serialcirc_circ_empr ]['trans_asked ']=$r_circ->serialcirc_circ_trans_asked ; $this->info_expl[$r->expl_id]['circ'][$r_circ->num_serialcirc_circ_empr ]['trans_doc_asked']=$r_circ->serialcirc_circ_trans_doc_asked; $this->info_expl[$r->expl_id]['circ'][$r_circ->num_serialcirc_circ_empr ]['expected_date']=$r_circ->serialcirc_circ_expected_date; $this->info_expl[$r->expl_id]['circ'][$r_circ->num_serialcirc_circ_empr ]['pointed_date']=$r_circ->serialcirc_circ_pointed_date; if($this->info_expl[$r->expl_id]['serialcirc_diff']->virtual_circ && !$this->info_expl[$r->expl_id]['circ'][$r_circ->num_serialcirc_circ_empr ]['subscription']==0){ $this->info_expl[$r->expl_id]['circ'][$r_circ->num_serialcirc_circ_empr ]['no_subscription']=1; } else { $this->info_expl[$r->expl_id]['circ'][$r_circ->num_serialcirc_circ_empr ]['no_subscription']=0; } } } } } $this->fetch_data_copy() ; $this->fetch_data_resa() ; // printr($this->info_expl); // print"
";print_r($this->info_expl);print_r($this->classement);print""; } function fetch_data_copy(){ global $opac_url_base; $this->info_copy=array(); $req="select * from serialcirc_copy ,bulletins, notices where num_serialcirc_copy_bulletin=bulletin_id and bulletin_notice=notice_id order by serialcirc_copy_date "; $resultat=mysql_query($req); $i=0; if (mysql_num_rows($resultat)) { while($r=mysql_fetch_object($resultat)){ $this->info_copy[$i]['id']=$r->id_serialcirc_copy; $this->info_copy[$i]['id_empr']=$r->num_serialcirc_copy_empr; $this->info_copy[$i]['empr']=$this->empr_info($this->info_copy[$i]['id_empr']); $this->info_copy[$i]['id_bulletin']=$r->num_serialcirc_copy_bulletin; $this->info_copy[$i]['perio']=$r->tit1; $this->info_copy[$i]['numero']= $r->bulletin_numero; $this->info_copy[$i]['mention_date']= $r->mention_date; $this->info_copy[$i]['analysis']=$r->serialcirc_copy_analysis; $this->info_copy[$i]['date']=$r->serialcirc_copy_date; $this->info_copy[$i]['state']=$r->serialcirc_copy_state; $this->info_copy[$i]['comment']=$r->serialcirc_copy_comment; $this->info_copy[$i]['serial_link']="./catalog.php?categ=serials&sub=view&serial_id=".$r->notice_id; $this->info_copy[$i]['bull_link']="./catalog.php?categ=serials&sub=bulletinage&action=view&bul_id=".$r->bulletin_id; $this->info_copy[$i]['opac_link']=$opac_url_base."index.php?lvl=bulletin_display&id=".$r->bulletin_id; $this->index_info_copy[$r->id_serialcirc_copy]= $this->info_copy[$i]; $i++; } } } function fetch_data_resa(){ $this->info_resa=array(); $req="select * from serialcirc_circ, exemplaires, bulletins, notices where serialcirc_circ_hold_asked=1 and num_serialcirc_circ_expl=expl_id and expl_bulletin=bulletin_id and bulletin_notice=notice_id order by num_serialcirc_circ_expl,serialcirc_circ_order "; $resultat=mysql_query($req); $i=0; if (mysql_num_rows($resultat)) { while($r=mysql_fetch_object($resultat)){ $this->info_resa[$i]['id']=$r->id_serialcirc_circ; $this->info_resa[$i]['id_empr']=$r->num_serialcirc_circ_empr; $this->info_resa[$i]['id_expl']=$r->num_serialcirc_circ_expl; $this->info_resa[$i]['empr']=$this->empr_info($this->info_resa[$i]['id_empr']); $this->info_resa[$i]['id_bulletin']=$r->bulletin_id; $this->info_resa[$i]['perio']=$r->tit1; $this->info_resa[$i]['numero']= $r->bulletin_numero; $this->info_resa[$i]['mention_date']= $r->mention_date; $i++; } } } function fetch_info_circ($id_expl){ $this->info_circ[$id_expl]=array(); $req="select *,DATEDIFF(serialcirc_circ_expected_date,CURDATE())as late_diff from serialcirc_circ where num_serialcirc_circ_expl=$id_expl order by serialcirc_circ_order "; $resultat=mysql_query($req); if (mysql_num_rows($resultat)) { while($r=mysql_fetch_object($resultat)){ $this->info_circ[$id_expl][$r->num_serialcirc_circ_empr]['id']=$r->id_serialcirc_circ; $this->info_circ[$id_expl][$r->num_serialcirc_circ_empr]['num_diff']=$r->num_serialcirc_circ_diff; $this->info_circ[$id_expl][$r->num_serialcirc_circ_empr]['num_expl']=$r->num_serialcirc_circ_expl; $this->info_circ[$id_expl][$r->num_serialcirc_circ_empr]['num_empr']=$r->num_serialcirc_circ_empr; $this->info_circ[$id_expl][$r->num_serialcirc_circ_empr]['num_serialcirc']=$r->num_serialcirc_circ_serialcirc; $this->info_circ[$id_expl][$r->num_serialcirc_circ_empr]['order']=$r->serialcirc_circ_order; $this->info_circ[$id_expl][$r->num_serialcirc_circ_empr]['subscription']=$r->serialcirc_circ_subscription; $this->info_circ[$id_expl][$r->num_serialcirc_circ_empr]['hold_asked']=$r->serialcirc_circ_hold_asked; $this->info_circ[$id_expl][$r->num_serialcirc_circ_empr]['ret_asked']=$r->serialcirc_circ_ret_asked; $this->info_circ[$id_expl][$r->num_serialcirc_circ_empr]['trans_asked']=$r->serialcirc_circ_trans_asked; $this->info_circ[$id_expl][$r->num_serialcirc_circ_empr]['doc_asked']=$r->serialcirc_circ_trans_doc_asked; $this->info_circ[$id_expl][$r->num_serialcirc_circ_empr]['expected_date']=$r->serialcirc_circ_expected_date; $this->info_circ[$id_expl][$r->num_serialcirc_circ_empr]['pointed_date']=$r->serialcirc_circ_pointed_date; $this->info_circ[$id_expl][$r->num_serialcirc_circ_empr]['late_diff']=$r->late_diff; if($this->info_circ[$id_expl][$r->num_serialcirc_circ_empr]['late_diff'] <0 && !$this->info_circ[$id_expl][$r->num_serialcirc_circ_empr]['pointed_date']){ $this->info_expl[$id_expl]['is_late']=1; }else{ $this->info_expl[$id_expl]['is_late']=0; } } } // $this->get_next_diff_id($id_expl); return $this->info_circ[$id_expl]; } function empr_info($id){ global $dbh; $info=array(); $req="select empr_cb, empr_nom , empr_prenom, empr_mail from empr where id_empr=".$id; $res_empr=mysql_query($req); if ($empr=mysql_fetch_object($res_empr)) { $info['cb'] = $empr->empr_cb; $info['nom'] = $empr->empr_nom; $info['prenom'] = $empr->empr_prenom; $info['mail'] = $empr->empr_mail; $info['id_empr']=$id; $info['view_link']='./circ.php?categ=pret&form_cb='.$empr->empr_cb; $info['empr_libelle']=$info['nom']." ".$info['prenom']." ( ".$info['cb'] ." ) "; } return $info; } function expl_info($id){ global $dbh; $info=array(); $req="select * from exemplaires, bulletins, notices where expl_id=$id and expl_bulletin=bulletin_id and bulletin_notice=notice_id "; $resultat=mysql_query($req); if($r=mysql_fetch_object($resultat)){ $info['id']=$id; $info['cb']=$r->expl_cb; $info['id_bulletin']=$r->num_serialcirc_copy_bulletin; $info['perio']=$r->tit1; $info['numero']= $r->bulletin_numero; $info['mention_date']= $r->mention_date; $info['view_link']='./circ.php?categ=visu_ex&form_cb_expl='.$r->expl_cb; } return $info; } function is_in_alert($expl_id){ if($this->info_expl[$expl_id]['serialcirc_diff']->virtual_circ){ if( $this->info_expl[$expl_id]['start_date']=="0000-00-00")$start_date=$this->info_expl[$expl_id]['bulletine_date']; else $start_date=$this->info_expl[$expl_id]['start_date']; $req="select DATEDIFF(DATE_ADD('".$start_date."', INTERVAL ".$this->info_expl[$expl_id]['serialcirc_diff']->duration_before_send." DAY),CURDATE())"; $result=mysql_query($req); if($row = mysql_fetch_row($result)) { if($row[0]>0){ return true; } } } return false; } function is_alerted($expl_id){ //if($this->is_in_alert($expl_id)) return false; if($this->info_expl[$expl_id]['start_date']!="0000-00-00") return true; return false; } function is_in_to_be_circ($expl_id){ if($this->is_in_alert($expl_id) && $this->is_alerted($expl_id)) return false; if(!$this->info_expl[$expl_id]['state_circ'] && !$this->info_expl[$expl_id]['num_diff']){ return true; } return false; } function is_in_circ($expl_id){ if($this->info_expl[$expl_id]['num_diff']){ return true; } return false; } function empr_is_subscribe($empr_id, $expl_id){ if( !$this->info_expl[$expl_id]['circ'][$empr_group['num_empr'] ]){ return true; } elseif( !$this->info_expl[$expl_id]['circ'][$empr_group['num_empr'] ]['no_subscription']){ return true; } return false; } function is_in_late($expl_id){ if(!$this->info_expl[$expl_id]['serialcirc_diff']->checked) return false; if( $this->info_expl[$expl_id]['start_date']=="0000-00-00") return false; return $this->info_expl[$expl_id]['is_late']; } function is_in_reproduction_ask($expl_id){ if(!$this->info_expl[$expl_id]['state_circ'] && !$this->info_expl[$expl_id]['num_diff']){ return true; } } function is_in_resa_ask($expl_id){ } function delete_diffusion($expl_id){ $status=true; if (!$this->info_expl[$expl_id]) return false; // Traitement des résa $req="select num_serialcirc_circ_empr from serialcirc_circ where serialcirc_circ_hold_asked=2 and num_serialcirc_circ_expl=$expl_id order by serialcirc_circ_order"; $res=mysql_query($req); while ($r=mysql_fetch_object($res)) { $resa=new reservation($r->num_serialcirc_circ_empr,0,$this->info_expl[$expl_id]['bulletin_id']); if($resa->add()==true) $status=2; // mail de résa sera envoyé à l'affectation dans résa à traité } $req="delete from serialcirc_expl where num_serialcirc_expl_id =$expl_id"; mysql_query($req); $req="delete from serialcirc_circ where num_serialcirc_circ_expl =$expl_id"; mysql_query($req); // on change le statut si demandé if($this->info_expl[$expl_id]['serialcirc_diff']->expl_statut_circ_after){ $req="update exemplaires set expl_statut=".$this->info_expl[$expl_id]['serialcirc_diff']->expl_statut_circ_after." where expl_id=".$expl_id; mysql_query($req); } return $status; } function delete_expl($expl_id){ $req="delete from serialcirc_expl where num_serialcirc_expl_id =$expl_id"; mysql_query($req); $req="delete from serialcirc_circ where num_serialcirc_circ_expl =$expl_id"; mysql_query($req); } function copy_accept($copy_id){ global $serialcirc_copy_accepted_mail,$msg,$biblio_name, $biblio_email,$PMBuseremailbcc; if(!$this->index_info_copy[$copy_id]) return false; $copy=$this->index_info_copy[$copy_id]; $texte_mail=$serialcirc_copy_accepted_mail; $texte_mail=str_replace("!!issue!!", $copy['perio']."-".$copy['numero'], $texte_mail); mailpmb($copy['empr']["prenom"]." ".$copy['empr']["nom"], $copy['empr']["mail"], $msg["serialcirc_circ_title"], $texte_mail, $biblio_name, $biblio_email,"", "", $PMBuseremailbcc,1); $req="update serialcirc_copy set serialcirc_copy_state=1 where id_serialcirc_copy=$copy_id "; mysql_query($req); return true; } function copy_isdone($bul_id){ global $serialcirc_copy_isdone_mail,$msg,$biblio_name, $biblio_email,$PMBuseremailbcc; $req="select * from serialcirc_copy where num_serialcirc_copy_bulletin=$bul_id "; $resultat=mysql_query($req); if (mysql_num_rows($resultat)) { while($r=mysql_fetch_object($resultat)){ // envoit des mails if($copy=$this->index_info_copy[$r->id_serialcirc_copy]){ $texte_mail=$serialcirc_copy_isdone_mail; $texte_mail=str_replace("!!issue!!", $copy['perio']."-".$copy['numero'], $texte_mail); $texte_mail=str_replace("!!see!!", "".$copy['numero']."", $texte_mail); mailpmb($copy['empr']["prenom"]." ".$copy['empr']["nom"], $copy['empr']["mail"], $msg["serialcirc_circ_title"], $texte_mail, $biblio_name, $biblio_email,"", "", $PMBuseremailbcc,1); } } // on efface $req="delete from serialcirc_copy where num_serialcirc_copy_bulletin=$bul_id "; $resultat=mysql_query($req); } } function copy_none($copy_id){ global $serialcirc_copy_no_mail,$msg,$biblio_name, $biblio_email,$PMBuseremailbcc; if(!$this->index_info_copy[$copy_id]) return false; $req="delete from serialcirc_copy where id_serialcirc_copy=$copy_id"; mysql_query($req); $copy=$this->index_info_copy[$copy_id]; $texte_mail=$serialcirc_copy_no_mail; $texte_mail=str_replace("!!issue!!", $copy['perio']."-".$copy['numero'], $texte_mail); mailpmb($copy['empr']["prenom"]." ".$copy['empr']["nom"], $copy['empr']["mail"], $msg["serialcirc_circ_title"], $texte_mail, $biblio_name, $biblio_email,"", "", $PMBuseremailbcc,1); return true; } function ask_send_mail($expl_id,$empr_id,$objet,$texte_mail){ global $biblio_name,$biblio_email,$PMBuseremailbcc; $expl_info=$this->expl_info($expl_id); $empr_info=$this->empr_info($empr_id); $texte_mail=str_replace("!!issue!!", $expl_info['perio']."-".$expl_info['numero'], $texte_mail); mailpmb($empr_info["prenom"]." ".$empr_info["nom"], $empr_info["mail"], $objet, $texte_mail, $biblio_name, $biblio_email,"", "", $PMBuseremailbcc,1); return true; } function resa_accept($expl_id,$empr_id){ $req="select * from bulletins, exemplaires where bulletin_id=expl_bulletin and expl_id=$expl_id"; $res=mysql_query($req); if ($r=mysql_fetch_object($res)) { // $resa=new reservation($empr_id,0,$r->bulletin_id); // $resa->add(); $req="update serialcirc_circ set serialcirc_circ_hold_asked=2 where num_serialcirc_circ_expl=$expl_id and num_serialcirc_circ_empr=$empr_id"; $res=mysql_query($req); } // mail de résa sera envoyé à l'affectation dans résa à traité return true; } function resa_none($expl_id,$empr_id){ global $serialcirc_resa_no_mail,$msg; $req="update serialcirc_circ set serialcirc_circ_hold_asked=0 where num_serialcirc_circ_expl=$expl_id and num_serialcirc_circ_empr=$empr_id"; $res=mysql_query($req); // mail $this->ask_send_mail($expl_id,$empr_id,$msg["serialcirc_circ_title"],$serialcirc_resa_no_mail); return true; } function get_all_next_empr_id($expl_id){ } function get_next_diff_id($expl_id){ $found=0; foreach($this->info_expl[$expl_id]['serialcirc_diff']->diffusion as $id_diff => $diffusion){ // pas en circ on retourne le premier if(!$this->info_expl[$expl_id]['num_diff']) return $id_diff; if($id_diff==$this->info_expl[$expl_id]['num_diff'])$found=1; elseif( $found ){ return $id_diff; } } // le dernier l'a consulté; pas de suivant; return 0; } // l'exemplaire revient à la bib function return_expl($expl_id){ global $msg; if($this->info_expl[$expl_id]['serialcirc_diff']->circ_type == SERIALCIRC_TYPE_rotative){ // delete et changement de statut éventuel $status=$this->delete_diffusion($expl_id); }else{// SERIALCIRC_TYPE_star // envoi au empr suivant if($next_diff_id=$this->get_next_diff_id($expl_id)){ $req="UPDATE serialcirc_expl SET num_serialcirc_expl_serialcirc_diff=".$next_diff_id.", serialcirc_expl_state_circ=1, serialcirc_expl_ret_asked=0, serialcirc_expl_trans_asked=0, serialcirc_expl_trans_doc_asked=0, num_serialcirc_expl_current_empr=0 where num_serialcirc_expl_id= $expl_id"; mysql_query($req); $status=1; }else{ // C'est terminé! $status=$this->delete_diffusion($expl_id); } } switch($status){ case 1: $info=$msg["circ_retour_ranger_resa"]; break; default: $info=$msg["serialcirc_info_retour"]; break; } return $info; } function print_diffusion($expl_id,$start_diff_id){ $tpl=$this->build_print_diffusion($expl_id,$start_diff_id); global $class_path; require_once($class_path.'/html2pdf/html2pdf.class.php'); $html2pdf = new HTML2PDF('P','A4','fr'); $html2pdf->WriteHTML($tpl); $html2pdf->Output('diffusion.pdf'); } function print_sel_diffusion($list){ foreach($list as $circ){ $expl_id=$circ['expl_id']; $start_diff_id=$circ['start_diff_id']; $tpl.=$this->build_print_diffusion($expl_id,$start_diff_id); } global $class_path; require_once($class_path.'/html2pdf/html2pdf.class.php'); $html2pdf = new HTML2PDF('P','A4','fr'); $html2pdf->WriteHTML($tpl); $html2pdf->Output('diffusion.pdf'); } function build_print_diffusion($expl_id,$start_diff_id){ global $serialcirc_circ_pdf_diffusion,$charset,$serialcirc_circ_pdf_diffusion_destinataire; global $msg; if (!$this->info_expl[$expl_id]) return false; $req="UPDATE serialcirc_expl SET num_serialcirc_expl_serialcirc_diff=".$start_diff_id.", serialcirc_expl_state_circ=1, serialcirc_expl_start_date=CURDATE() where num_serialcirc_expl_id= $expl_id"; mysql_query($req); $req="select date_format(CURDATE(), '".$msg["format_date"]."') as print_date"; $result = mysql_query($req); $obj = mysql_fetch_object($result); $print_date=$obj->print_date; $tpl = $serialcirc_circ_pdf_diffusion; $tpl=str_replace("!!expl_cb!!", htmlentities($this->info_expl[$expl_id]['expl_cb'],ENT_QUOTES,$charset), $tpl); $tpl=str_replace("!!date!!", htmlentities($this->info_expl[$expl_id]['mention_date'],ENT_QUOTES,$charset), $tpl); $tpl=str_replace("!!periodique!!", htmlentities($this->info_expl[$expl_id]['serial_title'],ENT_QUOTES,$charset), $tpl); $tpl=str_replace("!!numero!!", htmlentities($this->info_expl[$expl_id]['numero'],ENT_QUOTES,$charset), $tpl); $tpl=str_replace("!!print_date!!", htmlentities($print_date,ENT_QUOTES,$charset), $tpl); // $tpl=str_replace("!!abonnement!!", htmlentities($this->info_expl[$expl_id]['serialcirc_diff']->abt_name,ENT_QUOTES,$charset), $tpl); if($start_diff_id) $found=0;else $found=1; foreach($this->info_expl[$expl_id]['serialcirc_diff']->diffusion as $diff_id => $diffusion){ if($start_diff_id && !$found){ if($start_diff_id==$diff_id)$found=1; } if($found){ $diff_list[]=$diff_id; if($diffusion["empr_type"]== SERIALCIRC_EMPR_TYPE_group ){ $name=$diffusion["empr_name"]; foreach($diffusion['group'] as $empr_group){ $empr_list[$empr_group["num_empr"]]=$diff_id; if($empr_group["duration"]) $empr_days[$empr_group["num_empr"]]=$empr_group["duration"]; else $empr_days[$empr_group["num_empr"]]=$this->info_expl[$expl_id]['serialcirc_diff']->duration; if($diffusion['type_diff']==1 && !$empr_group["responsable"]){ // groupe marguerite: on n'imprimera pas ce lecteur sauf le responsable //$empr_no_display[$empr_group["num_empr"]]=1; } } }else { $name=$this->info_expl[$expl_id]['serialcirc_diff']->empr_info[$diffusion["num_empr"]]["empr_libelle"]; $empr_list[$diffusion["num_empr"]]=$diff_id; if($diffusion["duration"]) $empr_days[$diffusion["num_empr"]]=$diffusion["duration"]; // durée de consultation particulière else $empr_days[$diffusion["num_empr"]]=$this->info_expl[$expl_id]['serialcirc_diff']->duration; } if($this->info_expl[$expl_id]['serialcirc_diff']->circ_type == SERIALCIRC_TYPE_star){ // on n'imprime que le suivant dans la liste break; } } } $this->gen_circ($empr_list,$empr_days, $expl_id); $gen_tpl= new serialcirc_print_fields($this->info_expl[$expl_id]['num_serialcirc']); $header_list=$gen_tpl->get_header_list(); $nb_col=count($header_list); $width_col=(int) (100/$nb_col); foreach($header_list as $titre){ $th.="