inner_directory);$i++) { $cle=$record->inner_directory[$i]['label']; switch($cle) { case "464": //C'est un périodique donc un dépouillement ou une notice objet $info_464=$record->get_subfield($cle,"t","v","p","d","z","e"); break; default: break; } /* end of switch */ } /* end of for */ $info_606_a=$record->get_subfield_array_array("606","a"); $info_900=$record->get_subfield_array_array("900","a"); $info_901=$record->get_subfield_array_array("901","a"); $info_902=$record->get_subfield_array_array("902","a"); $info_903=$record->get_subfield("903","a"); $info_904=$record->get_subfield("904","a"); $info_905=$record->get_subfield("905","a"); $info_906=$record->get_subfield_array_array("906","a"); } // fin recup_noticeunimarc_suite = fin récupération des variables propres à la bretagne function import_new_notice_suite() { global $dbh,$charset; global $notice_id; global $info_464; global $info_606_a; global $info_900,$info_901,$info_902,$info_903,$info_904,$info_905,$info_906; global $pmb_keyword_sep; global $bulletin_ex; // param : l'article hérite-t-il de l'URL de la vignette de la notice chapeau global $pmb_serial_thumbnail_url_article; // param : l'article hérite-t-il de l'URL de la vignette de la notice bulletin global $pmb_bulletin_thumbnail_url_article; //Cas des périodiques if (is_array($info_464)) { $requete="select * from notices where notice_id=$notice_id"; $resultat=pmb_mysql_query($requete); $r=pmb_mysql_fetch_object($resultat); //Notice chapeau existe-t-elle ? $requete="select notice_id from notices where tit1='".addslashes($info_464[0]['t'])."' and niveau_hierar='1' and niveau_biblio='s'"; $resultat=pmb_mysql_query($requete); if (@pmb_mysql_num_rows($resultat)) { //Si oui, récupération id $chapeau_id=pmb_mysql_result($resultat,0,0); //Bulletin existe-t-il ? $requete="select bulletin_id from bulletins where bulletin_numero='".addslashes($info_464[0]['v'])."' and mention_date='".addslashes($info_464[0]['d'])."' and bulletin_notice=$chapeau_id"; $resultat=pmb_mysql_query($requete); if (@pmb_mysql_num_rows($resultat)) { //Si oui, récupération id bulletin $bulletin_id=pmb_mysql_result($resultat,0,0); } else { //Si non, création bulletin $info=array(); $bulletin=new bulletinage("",$chapeau_id); $bul_titre_txt='Bulletin N°'; if ($charset=='utf-8') { $bul_titre_txt=utf8_encode($bul_titre_txt); } $info['bul_titre']=addslashes($bul_titre_txt.$info_464[0]['v']); $info['bul_no']=addslashes($info_464[0]['v']); $info['bul_date']=addslashes($info_464[0]['d']); if (!$info_464[0]['e']) { if ($info_904[0]) { $info['date_date']=$info_904[0]; } } else { $info['date_date']=$info_464[0]['e']; } $bulletin_id=$bulletin->update($info); } } else { //Si non, création notice chapeau et bulletin $chapeau=new serial(); $info=array(); $info['tit1']=addslashes($info_464[0]['t']); $info['niveau_biblio']='s'; $info['niveau_hierar']='1'; $info['typdoc']=$r->typdoc; $chapeau->update($info); $chapeau_id=$chapeau->serial_id; $bulletin=new bulletinage("",$chapeau_id); $info=array(); $bul_titre_txt='Bulletin N°'; if ($charset=='utf-8') { $bul_titre_txt=utf8_encode($bul_titre_txt); } $info['bul_titre']=addslashes($bul_titre_txt.$info_464[0]['v']); $info['bul_no']=addslashes($info_464[0]['v']); $info['bul_date']=addslashes($info_464[0]['d']); if (!$info_464[0]['e']) { if ($info_904[0]) { $info['date_date']=$info_904[0]; } } else { $info['date_date']=$info_464[0]['e']; } $bulletin_id=$bulletin->update($info); } //Notice objet ? if ($info_464[0]['z']=='objet') { //Supression de la notice $requete="delete from notices where notice_id=$notice_id"; pmb_mysql_query($requete); $bulletin_ex=$bulletin_id; } else { //Dédoublonnage : vérifie si un article avec ce titre n'existe pas déjà pour le bulletin $requete="SELECT old.notice_id,old.tit1 FROM notices new, notices old JOIN analysis ON analysis_notice=old.notice_id WHERE new.notice_id='".addslashes($notice_id)."' AND new.notice_id!=old.notice_id AND analysis_bulletin='".addslashes($bulletin_id)."' AND new.tit1=old.tit1"; $res_doubl=pmb_mysql_query($requete); if(pmb_mysql_num_rows($res_doubl)){ notice::del_notice($notice_id); pmb_mysql_query("insert into error_log (error_origin, error_text) values ('import_".addslashes(SESSid).".inc', '".addslashes("La notice existe déjà : ".pmb_mysql_result($res_doubl,0,1)." ")."') ") ; $notice_id=pmb_mysql_result($res_doubl,0,0); } else { //Passage de la notice en article $requete="update notices set niveau_biblio='a', niveau_hierar='2', code='', year='".addslashes($info_464[0]['d'])."', npages='".addslashes($info_464[0]['p'])."', date_parution='".$info['date_date']."' where notice_id=$notice_id"; pmb_mysql_query($requete); $requete="insert into analysis (analysis_bulletin,analysis_notice) values($bulletin_id,$notice_id)"; pmb_mysql_query($requete); //Copie de la vignette de la notice bulletin en article if ($pmb_bulletin_thumbnail_url_article) { $requete="UPDATE notices AS na, notices AS nb, analysis, bulletins SET na.thumbnail_url=nb.thumbnail_url WHERE LENGTH(nb.thumbnail_url)!=0 AND analysis_notice=$notice_id AND analysis_bulletin=bulletin_id AND num_notice=nb.notice_id AND na.notice_id=analysis_notice"; pmb_mysql_query($requete); } //Copie de la vignette de la notice chapeau en article if ($pmb_serial_thumbnail_url_article) { $requete="UPDATE notices AS na, notices AS nc, analysis, bulletins SET na.thumbnail_url=nc.thumbnail_url WHERE LENGTH(nc.thumbnail_url)!=0 AND LENGTH(na.thumbnail_url)=0 AND analysis_notice=$notice_id AND analysis_bulletin=bulletin_id AND bulletin_notice=nc.notice_id AND na.notice_id=analysis_notice"; pmb_mysql_query($requete); } $bulletin_ex=$bulletin_id; } } } else $bulletin_ex=0; //Traitement du thésaurus $unknown_desc=array(); $ordre_categ = 0; for ($i=0; $i"; echo "995\$b =".$info_995[$nb_expl]['b']."
"; echo "995\$c =".$info_995[$nb_expl]['c']."
"; echo "995\$d =".$info_995[$nb_expl]['d']."
"; echo "995\$f =".$info_995[$nb_expl]['f']."
"; echo "995\$k =".$info_995[$nb_expl]['k']."
"; echo "995\$m =".$info_995[$nb_expl]['m']."
"; echo "995\$n =".$info_995[$nb_expl]['n']."
"; echo "995\$o =".$info_995[$nb_expl]['o']."
"; echo "995\$q =".$info_995[$nb_expl]['q']."
"; echo "995\$r =".$info_995[$nb_expl]['r']."
"; echo "995\$u =".$info_995[$nb_expl]['u']."

"; */ } // fin for } // fin traite_exemplaires TRAITEMENT DES EXEMPLAIRES JUSQU'ICI // fonction spécifique d'export de la zone 995 function export_traite_exemplaires ($ex=array()) { global $msg, $dbh ; $subfields["a"] = $ex -> lender_libelle; $subfields["c"] = $ex -> lender_libelle; $subfields["f"] = $ex -> expl_cb; $subfields["k"] = $ex -> expl_cote; $subfields["u"] = $ex -> expl_note; if ($ex->statusdoc_codage_import) $subfields["o"] = $ex -> statusdoc_codage_import; if ($ex -> tdoc_codage_import) $subfields["r"] = $ex -> tdoc_codage_import; else $subfields["r"] = "uu"; if ($ex -> sdoc_codage_import) $subfields["q"] = $ex -> sdoc_codage_import; else $subfields["q"] = "u"; global $export996 ; $export996['f'] = $ex -> expl_cb ; $export996['k'] = $ex -> expl_cote ; $export996['u'] = $ex -> expl_note ; $export996['m'] = substr($ex -> expl_date_depot, 0, 4).substr($ex -> expl_date_depot, 5, 2).substr($ex -> expl_date_depot, 8, 2) ; $export996['n'] = substr($ex -> expl_date_retour, 0, 4).substr($ex -> expl_date_retour, 5, 2).substr($ex -> expl_date_retour, 8, 2) ; $export996['a'] = $ex -> lender_libelle; $export996['b'] = $ex -> expl_owner; $export996['v'] = $ex -> location_libelle; $export996['w'] = $ex -> ldoc_codage_import; $export996['x'] = $ex -> section_libelle; $export996['y'] = $ex -> sdoc_codage_import; $export996['e'] = $ex -> tdoc_libelle; $export996['r'] = $ex -> tdoc_codage_import; $export996['1'] = $ex -> statut_libelle; $export996['2'] = $ex -> statusdoc_codage_import; $export996['3'] = $ex -> pret_flag; global $export_traitement_exemplaires ; $export996['0'] = $export_traitement_exemplaires ; return $subfields ; }