";
}
$form_notice = str_replace('!!index_concept_form!!', $index_concepts_form, $form_notice);
}else{
$form_notice = str_replace('!!index_concept_form!!', "", $form_notice);
}
//Mise à jour de l'onglet 9
$p_perso=new parametres_perso("notices");
if(function_exists("param_perso_form")) {
param_perso_form($p_perso);
}
//pour Pubmed et DOI, on regarde si on peut remplir un champ résolveur...
if(!empty($this->others_ids)){
foreach($p_perso->t_fields as $key => $t_field){
if($t_field['TYPE'] =="resolve"){
$field_options = $t_field['OPTIONS'][0];
foreach($field_options['RESOLVE'] as $resolve){
//pubmed = 1 | DOI = 2
foreach($this->others_ids as $other_id){
if($other_id['b'] == "PMID" && $resolve['ID']=="1"){
//on a le champ perso résolveur PubMed
$p_perso->values[$key][]=$other_id['a']."|1";
}else if($other_id['b'] == "DOI" && $resolve['ID']=="2"){
//on a le champ perso résolveur DOI
$p_perso->values[$key][]=$other_id['a']."|2";
}
}
}
}
}
}
if (!$p_perso->no_special_fields) {
$perso_=$p_perso->show_editable_fields($id_notice,true);
$perso="";
for ($i=0; $i
".$p["COMMENT_DISPLAY"]."
".$p["AFF"]."
";
}
$perso.=$perso_["CHECK_SCRIPTS"];
$ptab[9]=str_replace("!!champs_perso!!",$perso,$ptab[9]);
} else
$ptab[9]="\n\n";
$form_notice = str_replace('!!tab9!!', $ptab[9], $form_notice);
//----------------------- INICIO LLIUREX ----------------------------------
$p_perso1=new parametres_perso("notices");
if (!$p_perso1->no_special_fields) {
// si on duplique, construire le formulaire avec les donnees de la notice d'origine
if ($this->duplicate_from_id) $perso1_=$p_perso1->show_editable_fields($this->duplicate_from_id);
else $perso1_=$p_perso1->show_editable_fields($this->id);
$perso1="";
for ($i=0; $i
".$p["COMMENT_DISPLAY"]."
".$p["AFF"]."
";
}else{
if (strncmp($p["NAME"], $c2,6)== 0) {
$perso1.="
".$p["COMMENT_DISPLAY"]."
".$p["AFF"]."
";
}else{
if (strncmp($p["NAME"], $c3,6)== 0) {
$perso1.="
".$p["COMMENT_DISPLAY"]."
".$p["AFF"]."
";
}else{
if (strncmp($p["NAME"], $c4,6)== 0) {
$perso1.="
".$p["COMMENT_DISPLAY"]."
".$p["AFF"]."
";
}else{
if (strncmp($p["NAME"], $c5,6)== 0) {
$perso1.="
".$p["COMMENT_DISPLAY"]."
".$p["AFF"]."
";
}else{
if (strncmp($p["NAME"], $c6,6)== 0) {
$perso1.="
".$p["COMMENT_DISPLAY"]."
".$p["AFF"]."
";
}
}
}
}
}
}
}
$perso1.=$perso1_["CHECK_SCRIPTS"];
$ptab[999]=str_replace("!!champs_perso!!",$perso1,$ptab[999]);
} else
$ptab[999]="\n\n";
$form_notice = str_replace('!!tab999!!', $ptab[999], $form_notice);
//----------------------- FIN LLIUREX ----------------------------------
// champs de gestion
$ptab[10] = str_replace('!!message_folder!!',thumbnail::get_message_folder(), $ptab[10]);
// langue de la notice
global $lang,$xmlta_indexation_lang;
$user_lang = (!empty($this->indexation_lang) ? $this->indexation_lang : $xmlta_indexation_lang);
$langues = new XMLlist("$include_path/messages/languages.xml");
$langues->analyser();
$clang = $langues->table;
$combo = "";
$ptab[10] = str_replace('!!indexation_lang!!',$combo, $ptab[10]);
$form_notice = str_replace('!!indexation_lang_sel!!', $user_lang, $form_notice);
global $deflt_integration_notice_statut;
if ($id_notice) {
$rqt_statut="select statut from notices where notice_id='$id_notice' ";
$res_statut=pmb_mysql_query($rqt_statut);
$stat = pmb_mysql_fetch_object($res_statut) ;
$select_statut = gen_liste_multiple ("select id_notice_statut, gestion_libelle from notice_statut order by 2", "id_notice_statut", "gestion_libelle", "id_notice_statut", "form_notice_statut", "", $stat->statut, "", "","","",0) ;
} else {
$select_statut = gen_liste_multiple ("select id_notice_statut, gestion_libelle from notice_statut order by 2", "id_notice_statut", "gestion_libelle", "id_notice_statut", "form_notice_statut", "", $deflt_integration_notice_statut, "", "","","",0) ;
}
$ptab[10] = str_replace('!!notice_statut!!', $select_statut, $ptab[10]);
$ptab[10] = str_replace('!!commentaire_gestion!!', (!empty($this->commentaire_gestion) ? htmlentities($this->commentaire_gestion, ENT_QUOTES, $charset) : ''), $ptab[10]);
$ptab[10] = str_replace('!!thumbnail_url!!',htmlentities($this->thumbnail_url,ENT_QUOTES, $charset), $ptab[10]);
global $deflt_notice_is_new;
if ($deflt_notice_is_new) {
$notice_is_new_checked_no = '';
$notice_is_new_checked_yes = 'checked = "checked"';
} else {
$notice_is_new_checked_no = 'checked = "checked"';
$notice_is_new_checked_yes = '';
}
$ptab[10] = str_replace('!!notice_is_new_checked_no!!', $notice_is_new_checked_no, $ptab[10]);
$ptab[10] = str_replace('!!notice_is_new_checked_yes!!', $notice_is_new_checked_yes, $ptab[10]);
$form_notice = str_replace('!!tab10!!', $ptab[10], $form_notice);
// Documents Numériques
$docnum_infos = "";
$count = 0;
$upload_doc_num="";
if($this->source_id){
$requete="select * from connectors_sources where source_id=".$this->source_id."";
$resultat=pmb_mysql_query($requete);
if (pmb_mysql_num_rows($resultat)) {
$r=pmb_mysql_fetch_object($resultat);
if(!$r->upload_doc_num) $upload_doc_num = "checked";
}
}
if (count($this->doc_nums)) {
global $deflt_explnum_statut;
$statutlist = gen_liste_multiple ("select id_explnum_statut, gestion_libelle from explnum_statut order by 2", "id_explnum_statut", "gestion_libelle", "id_explnum_statut", "doc_num_statut!!docnumid!!", "", $deflt_explnum_statut, "", "","","",0);
foreach ($this->doc_nums as $doc_num) {
$docnum_info = $ptab[1111];
// $alink = ''.htmlspecialchars($doc_num["a"]).'';
$docnum_info = str_replace('!!docnum_url!!', htmlspecialchars($doc_num["a"],ENT_QUOTES, $charset), $docnum_info);
$docnum_info = str_replace('!!docnum_caption!!', htmlspecialchars($doc_num["b"],ENT_QUOTES, $charset), $docnum_info);
$docnum_info = str_replace('!!docnum_filename!!', htmlspecialchars($doc_num["f"],ENT_QUOTES, $charset), $docnum_info);
$docnum_info = str_replace('!!docnum_statutlist!!', $statutlist, $docnum_info);
$docnum_info = str_replace('!!docnumid!!', $count, $docnum_info);
$docnum_info = str_replace('!!upload_doc_num!!', $upload_doc_num, $docnum_info);
$docnum_infos .= $docnum_info;
$count++;
}
}
if (!$docnum_infos)
$docnum_infos = $msg["noticeintegre_nodocnum"];
$ptab[1110] = str_replace('!!docnum_count!!', $count, $ptab[1110]);
$ptab[1110] = str_replace('!!docnums!!', $docnum_infos, $ptab[1110]);
$form_notice = str_replace('!!tab11!!', $ptab[1110], $form_notice);
$aac=explode('&',$action);
$retact = (!empty($aac[2]) ? '&'.$aac[2] : '').(!empty($aac[5]) ? '&'.$aac[5] : '').(!empty($aac[6]) ? '&'.$aac[6] : '');
global $force;
$retares='';
switch ($retour) {
case 'button' :
if($this->message_retour) {
$retares="";
} else {
if($force == 1 ){
$retares="".$msg['z3950_retour_a_resultats']."";
}else{
$retares="".$msg['z3950_retour_a_resultats']."";
}
}
break;
case 'link' :
$retares="".$msg['z3950_retour_a_resultats']."";
break;
default :
break;
}
$form_notice = str_replace('!!retour_a_resultats!!', $retares, $form_notice);
if (!$this->bt_integr_value) {
if (!$id_notice) {
$form_notice = str_replace('!!bouton_integration!!', $msg['z3950_integr_not_seule'], $form_notice);
} else {
$form_notice = str_replace('!!bouton_integration!!', $msg['notice_z3950_remplace_catal'], $form_notice);
}
} else {
$form_notice = str_replace('!!bouton_integration!!', $this->bt_integr_value, $form_notice);
}
if ($this->bt_undo_value && $this->bt_undo_action) {
$bt_undo = str_replace('!!value!!', $this->bt_undo_value, $bt_undo);
$bt_undo = str_replace('!!action!!', $this->bt_undo_action, $bt_undo);
$form_notice = str_replace('', $bt_undo, $form_notice);
}
$form_notice = str_replace('!!id_notice!!', $id_notice, $form_notice);
$form_notice = str_replace('!!notice!!',$znotices_id,$form_notice);
$form_notice = str_replace('!!notice_type!!',$this->notice_type,$form_notice);
return $form_notice;
}
// Traitement retour du formulaire
public function from_form () {
global $typdoc, $b_level, $h_level, $f_title_0, $f_title_1, $f_title_2, $f_title_3, $f_serie, $f_serie_id, $f_nbr_in_serie ;
global $f_editor_name_0, $f_editor_ville_0, $f_editor_name_1, $f_editor_ville_1, $f_collection_name, $f_collection_issn, $f_subcollection_name, $f_subcollection_issn,
$f_nbr_in_collection, $f_year, $f_mention_edition, $f_cb, $f_page_nbr, $f_illustration, $f_size, $f_prix, $f_accompagnement,
$f_general_note, $f_content_note, $f_abstract_note,
$f_indexint, $f_indexint_id, $f_free_index,
$f_language_code, $f_original_language_code,
$f_link_url, $f_link_format,
$f_orinot_nom, $f_orinot_pays,
$form_notice_statut, $f_commentaire_gestion, $f_thumbnail_url,
$f_notice_is_new ;
global $categ_pas_trouvee, $pmb_keyword_sep, $categorisation_type,$indexation_lang;
global $opac_url_base,$item;
global $pmb_use_uniform_title;
if ($pmb_use_uniform_title) {
global $max_titre_uniforme;
if ($max_titre_uniforme) {
global $memo_value_tu;
$value_tu=unserialize(rawurldecode($memo_value_tu));
// Titres uniformes
for ($i=0; $i<$max_titre_uniforme ; $i++) {
$var_tu_id = "f_titre_uniforme_code$i" ;
$var_tu_titre = "f_titre_uniforme$i" ;
$var_ntu_titre = "ntu_titre$i" ;
$var_ntu_date = "ntu_date$i" ;
$var_ntu_sous_vedette = "ntu_sous_vedette$i" ;
$var_ntu_langue = "ntu_langue$i" ;
$var_ntu_version = "ntu_version$i" ;
$var_ntu_mention = "ntu_mention$i" ;
global ${$var_tu_id},${$var_tu_titre},${$var_ntu_titre},${$var_ntu_date},${$var_ntu_sous_vedette},${$var_ntu_langue},${$var_ntu_version},${$var_ntu_mention};
if(${$var_tu_titre}) {
// on crée un nouveau titre uniforme si un id et un titre différent, ou si pas d'id
if(${$var_tu_id} && (${$var_tu_titre} != $value_tu[$i]["name"] ) || (!${$var_tu_id})) {
$value_tu[$i]["name"]=${$var_tu_titre};
$tu_id=titre_uniforme::import($value_tu[$i],1);
} else {
$tu_id=${$var_tu_id};
}
// il est soit existant, soit créé
if($tu_id) {
$this->titres_uniformes[] = array (
'tu_titre' => ${$var_tu_titre},
'num_tu' => $tu_id,
'ntu_titre' => ${$var_ntu_titre},
'ntu_date' => ${$var_ntu_date},
'ntu_sous_vedette' => ${$var_ntu_sous_vedette},
'ntu_langue' => ${$var_ntu_langue},
'ntu_version' => ${$var_ntu_version},
'ntu_mention' => ${$var_ntu_mention} )
;
}
}
}
}
}
$this->document_type = clean_string ($typdoc);
$this->bibliographic_level = clean_string ($b_level);
$this->hierarchic_level = clean_string ($h_level);
$this->titles[0] = clean_string ($f_title_0);
$this->titles[1] = clean_string ($f_title_1);
$this->titles[2] = clean_string ($f_title_2);
$this->titles[3] = clean_string ($f_title_3);
global $serie_type;
if ($serie_type == "use_existing") {
$this->serie = clean_string (stripslashes($f_serie));
$this->serie_id = $f_serie_id;
} else {
global $f_serie_new;
$this->serie = clean_string (stripslashes($f_serie_new));
}
$this->nbr_in_serie = clean_string ($f_nbr_in_serie);
$this->aut_array = array () ;
global $max_aut1, $max_aut2 ;
// auteur principal
global $author0_type;
if ($author0_type == "use_existing") {
global $f_existing_f0_code, $f_aut0_existing_id, $f_auth_number_to_compare_0;
if ($f_aut0_existing_id)
$this->aut_array[] = array(
'fonction' => $f_existing_f0_code,
'id' => $f_aut0_existing_id,
'responsabilite' => 0,
// si auteur existe, on récupère quand même le numéro d'autorité de l'auteur en cours d'import
// il sera intégré si la source de l'autorité n'existe pas encore en base
'authority_number' => $f_auth_number_to_compare_0 );
} else {
global $f_author_name_0, $f_author_rejete_0, $f_author_date_0, $f_author_type_0, $f_author_function_0, $f_author_lieu_0, $f_author_pays_0, $f_author_comment_0, $f_author_ville_0, $f_author_subdivision_0, $f_author_numero_0, $f_author_web_0, $f_authority_number_0 ;
$this->aut_array[] = array(
'entree' => stripslashes($f_author_name_0),
'rejete' => stripslashes($f_author_rejete_0),
'date' => stripslashes($f_author_date_0),
'type_auteur' => $f_author_type_0,
'fonction' => $f_author_function_0,
'id' => 0,
'responsabilite' => 0,
'lieu' => stripslashes($f_author_lieu_0),
'pays' => stripslashes($f_author_pays_0),
'author_comment' => stripslashes($f_author_comment_0),
'ville' => stripslashes($f_author_ville_0),
'subdivision' => stripslashes($f_author_subdivision_0),
'numero' => $f_author_numero_0,
'web' => $f_author_web_0,
'authority_number' => $f_authority_number_0 );
}
// autres auteurs
for ($i=0; $i< $max_aut1 ; $i++) {
$var_aut_name = "f_author_name_1$i" ;
$var_aut_rejete = "f_author_rejete_1$i" ;
$var_aut_date = "f_author_date_1$i" ;
$var_aut_type_auteur = "f_author_type_1$i" ;
$var_aut_function = "f_author_function_1$i" ;
$var_auth_type_use = "author1_type_$i";
$var_aut_pays = "f_author_lieu_1$i" ;
$var_aut_lieu = "f_author_pays_1$i" ;
$var_aut_comment = "f_author_comment_1$i" ;
$var_aut_ville = "f_author_ville_1$i" ;
$var_aut_subdivision = "f_author_subdivision_1$i" ;
$var_aut_numero = "f_author_numero_1$i" ;
$var_aut_web = "f_author_web_1$i" ;
$var_aut_number = "f_authority_number_1$i" ;
global ${$var_aut_name}, ${$var_aut_rejete}, ${$var_aut_date}, ${$var_aut_type_auteur}, ${$var_aut_function}, ${$var_auth_type_use}, ${$var_aut_lieu}, ${$var_aut_pays}, ${$var_aut_comment}, ${$var_aut_ville}, ${$var_aut_subdivision}, ${$var_aut_numero}, ${$var_aut_web}, ${$var_aut_number};
if (${$var_auth_type_use} == "use_existing") {
$a_id = "f_aut1_id$i";
$a_code = "f_f1_code$i";
// si auteur existe, on récupère quand même le numéro d'autorité de l'auteur en cours d'import
// il sera intégré si la source de l'autorité n'existe pas encore en base
$a_aut_to_compare = "f_auth_number_to_compare_1$i";
global ${$a_code}, ${$a_id}, ${$a_aut_to_compare};
if (${$a_id})
$this->aut_array[] = array(
'fonction' => ${$a_code},
'id' => ${$a_id},
'responsabilite' => 1,
'authority_number' => ${$a_aut_to_compare} );
} else if (${$var_aut_name})
$this->aut_array[] = array(
'entree' => stripslashes(${$var_aut_name}),
'rejete' => stripslashes(${$var_aut_rejete}),
'date' => stripslashes(${$var_aut_date}),
'type_auteur' => ${$var_aut_type_auteur},
'fonction' => ${$var_aut_function},
'id' => 0,
'responsabilite' => 1,
'lieu' => stripslashes(${$var_aut_lieu}),
'pays' => stripslashes(${$var_aut_pays}),
'author_comment' => stripslashes(${$var_aut_comment}),
'ville' => stripslashes(${$var_aut_ville}),
'subdivision' => stripslashes(${$var_aut_subdivision}),
'numero' => ${$var_aut_numero},
'web' => ${$var_aut_web},
'authority_number' => ${$var_aut_number} );
}
// auteurs secondaires
for ($i=0; $i< $max_aut2 ; $i++) {
$var_aut_name = "f_author_name_2$i" ;
$var_aut_rejete = "f_author_rejete_2$i" ;
$var_aut_date = "f_author_date_2$i" ;
$var_aut_type_auteur = "f_author_type_2$i" ;
$var_aut_function = "f_author_function_2$i" ;
$var_auth_type_use = "author2_type_$i";
$var_aut_pays = "f_author_lieu_2$i" ;
$var_aut_lieu = "f_author_pays_2$i" ;
$var_aut_comment = "f_author_comment_2$i" ;
$var_aut_ville = "f_author_ville_2$i" ;
$var_aut_subdivision = "f_author_subdivision_2$i" ;
$var_aut_numero = "f_author_numero_2$i" ;
$var_aut_web = "f_author_web_2$i" ;
$var_aut_number = "f_authority_number_2$i" ;
global ${$var_aut_name}, ${$var_aut_rejete}, ${$var_aut_date}, ${$var_aut_type_auteur}, ${$var_aut_function}, ${$var_auth_type_use}, ${$var_aut_lieu}, ${$var_aut_pays}, ${$var_aut_comment}, ${$var_aut_ville}, ${$var_aut_subdivision}, ${$var_aut_numero}, ${$var_aut_web}, ${$var_aut_number};
if (${$var_auth_type_use} == "use_existing") {
$a_id = "f_aut2_id$i";
$a_code = "f_f2_code$i";
// si auteur existe, on récupère quand même le numéro d'autorité de l'auteur en cours d'import
// il sera intégré si la source de l'autorité n'existe pas encore en base
$a_aut_to_compare = "f_auth_number_to_compare_2$i";
global ${$a_code}, ${$a_id}, ${$a_aut_to_compare};
if (${$a_id})
$this->aut_array[] = array(
'fonction' => ${$a_code},
'id' => ${$a_id},
'responsabilite' => 2,
'authority_number' => ${$a_aut_to_compare} );
}
else if (${$var_aut_name})
$this->aut_array[] = array(
'entree' => stripslashes(${$var_aut_name}),
'rejete' => stripslashes(${$var_aut_rejete}),
'date' => stripslashes(${$var_aut_date}),
'type_auteur' => ${$var_aut_type_auteur},
'fonction' => ${$var_aut_function},
'id' => 0,
'responsabilite' => 2,
'lieu' => stripslashes(${$var_aut_lieu}),
'pays' => stripslashes(${$var_aut_pays}),
'author_comment' => stripslashes(${$var_aut_comment}),
'ville' => stripslashes(${$var_aut_ville}),
'subdivision' => stripslashes(${$var_aut_subdivision}),
'numero' => ${$var_aut_numero},
'web' => ${$var_aut_web},
'authority_number' => ${$var_aut_number} );
}
global $editor_type, $f_ed1_id;
global $collection_type,$f_coll_existing_id;
global $subcollection_type,$f_subcoll_existing_id;
if ($editor_type == "use_existing") {
if ($f_ed1_id) {
$this->editors[0]['id'] = $f_ed1_id;
if ($collection_type == "use_existing") {
if($f_coll_existing_id){
$this->collection['id'] = $f_coll_existing_id;
if ($subcollection_type == "use_existing") {
if($f_subcoll_existing_id){
$this->subcollection['id'] = $f_subcoll_existing_id;
}
}else{
$this->subcollection['name'] = clean_string (stripslashes($f_subcollection_name));
$this->subcollection['issn'] = clean_string (stripslashes($f_subcollection_issn));
$this->subcollection['id'] = 0;
}
}//Si on dit utiliser une collection existante mais qu'il n'y en a pas on ne reprend pas de sous collection
}else{
$this->collection['name'] = clean_string (stripslashes($f_collection_name));
$this->collection['issn'] = clean_string (stripslashes($f_collection_issn));
$this->collection['id'] = 0;
//Si on insert une nouvelle collection on insert aussi une nouvelle sous-collection
$this->subcollection['name'] = clean_string (stripslashes($f_subcollection_name));
$this->subcollection['issn'] = clean_string (stripslashes($f_subcollection_issn));
$this->subcollection['id'] = 0;
}
}//Si on dit utiliser un editeur existant mais qu'il n'y en a pas on ne reprend pas de collection ni sous collection
}else{
$this->editors[0]['name'] = clean_string (stripslashes($f_editor_name_0));
$this->editors[0]['ville'] = clean_string (stripslashes($f_editor_ville_0));
$this->editors[0]['id'] = 0;
//Si on insert un nouvel editeur on insert aussi une nouvelle sous-collection
$this->collection['name'] = clean_string (stripslashes($f_collection_name));
$this->collection['issn'] = clean_string (stripslashes($f_collection_issn));
$this->collection['id'] = 0;
//Et une sous collection
$this->subcollection['name'] = clean_string (stripslashes($f_subcollection_name));
$this->subcollection['issn'] = clean_string (stripslashes($f_subcollection_issn));
$this->subcollection['id'] = 0;
}
global $editor1_type, $f_ed11_id;
if ($editor1_type == "use_existing") {
if ($f_ed11_id) {
$this->editors[1]['id'] = $f_ed11_id;
}
}
else {
$this->editors[1]['name'] = clean_string (stripslashes($f_editor_name_1));
$this->editors[1]['ville'] = clean_string (stripslashes($f_editor_ville_1));
$this->editors[1]['id'] = 0;
}
$this->nbr_in_collection = clean_string ($f_nbr_in_collection);
$this->year = clean_string ($f_year);
$this->mention_edition = clean_string ($f_mention_edition);
$this->isbn = clean_string ($f_cb);
$this->page_nbr = clean_string ($f_page_nbr);
$this->illustration = clean_string ($f_illustration);
$this->size = clean_string ($f_size);
$this->prix = clean_string ($f_prix);
$this->accompagnement = clean_string ($f_accompagnement);
$this->general_note = $f_general_note;
$this->content_note = $f_content_note;
$this->abstract_note = $f_abstract_note;
// catégories
if ($categorisation_type == "categorisation_auto") {
$this->categories = traite_categories_from_form();
$this->categorisation_type = "categorisation_auto";
}
else {
global $max_categ;
$categories = array();
for($i=0, $count=$max_categ; $i<$count; $i++) {
$a_categ_id_name = "f_categ_id".$i;
global ${$a_categ_id_name};
if (!${$a_categ_id_name})
continue;
$acategory = array("categ_id" => ${$a_categ_id_name});
$categories[] = $acategory;
}
$this->categories = $categories;
$this->categorisation_type = "categorisation_manual";
}
global $indexint_type;
if ($indexint_type == "use_existing") {
$this->dewey[0] = clean_string (stripslashes($f_indexint));
$this->internal_index = $f_indexint_id ;
}
else {
global $f_indexint_new, $f_indexint_new_comment, $f_indexint_new_pclass;
$this->dewey[0] = clean_string (stripslashes($f_indexint_new));
$this->dewey["new_comment"] = clean_string (stripslashes($f_indexint_new_comment));
$this->dewey["new_pclass"] = clean_string (stripslashes($f_indexint_new_pclass));
$this->internal_index = 0;
}
// $categ_pas_trouvee ; est un tableau de catégories pas trouvées,
// mots clés pas présents dans $this->categories mais à conserver en zone libre
if (!isset($categ_pas_trouvee)) $categ_pas_trouvee=array();
$categ_pas_trouvee_pasvide = array();
for ($i=0;$ifree_index = clean_string ($f_free_index);
// traitement des langues
global $max_lang, $max_langorg;
$f_lang_form = array();
$f_langorg_form = array() ;
// langues de la publication
$j=0;
$this->language_code = array();
for ($i=0; $i< $max_lang ; $i++) {
$var_langcode = "f_lang_code$i" ;
global ${$var_langcode} ;
if (${$var_langcode}) {
$this->language_code[$j] = ${$var_langcode};
$j++;
}
}
// langues originales
$j=0;
$this->original_language_code = array();
for ($i=0; $i< $max_langorg ; $i++) {
$var_langorgcode = "f_langorg_code$i" ;
global ${$var_langorgcode};
if (${$var_langorgcode}) {
$this->original_language_code[$j] = ${$var_langorgcode};
$j++;
}
}
$this->link_url = clean_string ($f_link_url);
$this->link_format = clean_string ($f_link_format);
$this->origine_notice['nom'] = clean_string ($f_orinot_nom);
$this->origine_notice['pays'] = clean_string ($f_orinot_pays);
$this->statut = $form_notice_statut ;
$this->commentaire_gestion = $f_commentaire_gestion ;
$this->indexation_lang = $indexation_lang ;
$this->thumbnail_url = $f_thumbnail_url;
// vignette de la notice uploadé dans un répertoire
$uploaded_thumbnail_url = thumbnail::create("es_".$item);
if($uploaded_thumbnail_url) {
$this->thumbnail_url = $uploaded_thumbnail_url;
$this->flag_upload_vignette = "img_es_".$item;
}
//Document Numérique
global $doc_num_count;
for ($i=0; $i<$doc_num_count; $i++) {
$include_cb_name = "include_doc_num".$i;
global ${$include_cb_name};
if (${$include_cb_name}) {
$docnum_filename_name = "doc_num_filename".$i;
global ${$docnum_filename_name};
$docnum_caption_name = "doc_num_caption".$i;
global ${$docnum_caption_name};
$docnum_url_name = "doc_num_url".$i;
global ${$docnum_url_name};
$docnum_statut_name = "doc_num_statut".$i;
global ${$docnum_statut_name};
$docnum_nodownload_name = "doc_num_nodownload".$i;
global ${$docnum_nodownload_name};
if (${$docnum_nodownload_name})
$nodownload = 1;
else
$nodownload = 0;
$this->doc_nums[] = array("a" => ${$docnum_url_name}, "b" => ${$docnum_caption_name}, "f" => ${$docnum_filename_name}, "__nodownload__" => $nodownload, "s" => ${$docnum_statut_name});
}
}
global $perio_type,$bull_type;
//Périos
if($perio_type == 'use_existing'){
global $f_perio_existing_id;
$this->perio_id = $f_perio_existing_id;
} else {
global $f_perio_new, $f_perio_new_issn;
$this->perio_titre = clean_string ($f_perio_new);
$this->perio_issn = clean_string ($f_perio_new_issn);
}
//Bulletins
if($bull_type == 'use_existing'){
global $f_bull_existing_id;
$this->bull_id = $f_bull_existing_id;
} else {
global $f_bull_new_num, $f_bull_new_titre, $f_bull_new_mention,$date_date_lib;
$this->bull_num = clean_string ($f_bull_new_num);
$this->bull_titre = clean_string ($f_bull_new_titre);
$this->bull_date = extraitdate(clean_string($date_date_lib));
$this->bull_mention = clean_string ($f_bull_new_mention);
}
$this->notice_is_new = $f_notice_is_new;
}
public function process_isbn ($code) {
/* We've got everything, let's have a look if ISBN already exists in notices table */
$code_nettoye = preg_replace("/([^0-9|X])/i", '', $code);
$isbn_10 = '';
$isbn_13 = '';
$code_length = strlen($code_nettoye);
switch ($code_length) {
case 13 :
if(isEAN($code_nettoye)) {
$isbn_13 = formatISBN($code_nettoye, 13);
$isbn_10 = formatISBN($code_nettoye, 10);
}
break;
case 10 :
if(isISBN($code_nettoye)) {
$isbn_10 = formatISBN($code_nettoye, 10);
}
break;
default :
break;
}
if ($isbn_13) {
return $isbn_13;
}
if($isbn_10) {
return $isbn_10;
}
$ret_code = clean_string($code);
return $ret_code;
}
public function process_author ($name, $rejete, $type, $date) {
if (!$rejete) {
$field = explode (',', $name, 2);
$name = $field[0];
$rejete = $field[1];
}
$name = $this->clean_field ($name);
$rejete = $this->clean_field ($rejete);
$author['name'] = $name;
$author['rejete'] = $rejete;
$author['type'] = $type;
$author['date'] = $date;
return $author;
}
public function clean_field ($field) {
return preg_replace('/-$| $|\($|\)$|\[$|\]$|\:$|\;$|\/$\|\$|([^ ].)\.$|,$/', '$1', trim ($field));
}
// fonction d'intégration de l'origine de l'autorité (pratiquement identique à keep_authority_infos dans pmb/admin/import/import.finc.php)
public function insert_authority_infos($authority_number,$type,$id_origin_authority,$authority_infos=array()){
global $opac_enrichment_bnf_sparql;
//on a un numéro d'autorité, on regarde si on l'a déjà rencontré
$num_authority=$authority_infos['id'];
$query = "select id_authority_source,num_authority from authorities_sources where authority_number = '".$authority_number."' and num_origin_authority='".$id_origin_authority."' and authority_type = '".$type."'";
$result = pmb_mysql_query($query) or die("can't select authorities_sources :".$query);
if(pmb_mysql_num_rows($result)){
$row = pmb_mysql_fetch_object($result);
$num_authority = $row->num_authority;
$num_authority_source= $row->id_authority_source;
// on cherche la préférence... dès fois que...
$query = "select id_authority_source, num_authority from authorities_sources where authority_number = '".$authority_number."' and authority_type = '".$type."' and authority_favorite = 1";
$result = pmb_mysql_query($query) or die("can't select authorities_sources :".$query);
if(pmb_mysql_num_rows($result)){
$row = pmb_mysql_fetch_object($result);
$num_authority = $row->num_authority;
$num_authority_source= $row->id_authority_source;
}
}else{
// on importe l'autorité dans la base si elle n'a pas d'id
if($num_authority==0){
switch($type){
case "author" :
$num_authority = auteur::import($authority_infos);
break;
case "uniform_title" :
$num_authority = titre_uniforme::import($authority_infos);
break;
case "category" :
$num_authority = category::import($authority_infos);
break;
case "collection" :
$num_authority = collection::import($authority_infos);
break;
case "subcollection" :
$num_authority = subcollection::import($authority_infos);
break;
case "serie" :
break;
}
}
// on intègre la source de l'autorité
$query = "insert into authorities_sources set
num_authority = '$num_authority',
authority_number = '".$authority_number."',
authority_type = '$type',
num_origin_authority = ".$id_origin_authority.",
import_date = now()";
pmb_mysql_query($query) or die("can't insert authorities_sources :".$query);
$num_authority_source = pmb_mysql_insert_id();
if(($opac_enrichment_bnf_sparql) && ($type=='author')){
auteur::author_enrichment($num_authority);
}
}
return $num_authority;
}
public function from_usmarc ($record) {
$this->document_type = $record->inner_guide['dt'];
$this->bibliographic_level = $record->inner_guide['bl'];
$this->hierarchic_level = $record->inner_guide['hl'];
if ($this->hierarchic_level=="") {
if ($this->bibliographic_level=="s") $this->hierarchic_level="1";
if ($this->bibliographic_level=="m") $this->hierarchic_level="0";
}
for ($i=0;$iinner_directory);$i++) {
$cle=$record->inner_directory[$i]['label'];
switch($cle) {
case "020": /* isbn */
$isbn = $record->get_subfield($cle,'a');
break;
case "041": /* language */
$this->language_code = $record->get_subfield_array($cle,"a");
break;
case "245": /* titles */
$tit = $record->get_subfield($cle, "a", "b", "n", "p");
break;
case "246": /* titles */
$tit_sup=$record->get_subfield($cle, "a");
break;
case "247": /* former title */
$tit_for=$record->get_subfield($cle, "a");
break;
case "250": /* mention_edition */
$subfield = $record->get_subfield($cle,"a");
$this->mention_edition = $subfield[0];
break;
case "260": /* publisher */
$editor = $record->get_subfield($cle,"a","b","c");
break;
case "300": /* description */
$subfield = $record->get_subfield($cle,"a");
$this->page_nbr = $this->clean_field ($subfield[0]);
$subfield = $record->get_subfield($cle,"b");
$this->illustration = $this->clean_field ($subfield[0]);
$subfield = $record->get_subfield($cle,"c");
$this->size = $this->clean_field ($subfield[0]);
$subfield = $record->get_subfield($cle,"e");
$this->accompagnement = $this->clean_field ($subfield[0]);
break;
case "022": /* collection */
$collection_022=$record->get_subfield($cle,"a");
break;
case "222": /* collection */
$collection_222=$record->get_subfield($cle,"a","v","x");
break;
case "440": /* collection */
$collection_440=$record->get_subfield($cle,"a","v","x");
break;
case "500": /* inside */
$general_note = $record->get_subfield($cle,"a");
break;
case "502": /* abstract */
$content_note = $record->get_subfield($cle,"a");
break;
case "520": /* abstract */
$abstract_note = $record->get_subfield($cle,"a");
break;
case "082": /* Dewey */
$this->dewey=$record->get_subfield($cle,"a");
break;
case "100":
$aut_100=$record->get_subfield($cle,"a","d","e","4","3");
break;
case "110":
$aut_110=$record->get_subfield($cle,"a","d","e","4","3");
break;
case "111":
$aut_111=$record->get_subfield($cle,"a","d","e","4","3");
break;
case "700":
$aut_700=$record->get_subfield($cle,"a","d","e","4","3");
break;
case "710":
$aut_710=$record->get_subfield($cle,"a","d","e","4","3");
break;
case "711":
$aut_711=$record->get_subfield($cle,"a","d","e","4","3");
break;
case "856":
$subfield = $record->get_subfield($cle,"u","q");
$this->ressource = $subfield[0];
break;
case "650":
$this->info_606_a=$record->get_subfield_array_array($cle,"a");
$this->info_606_3=$record->get_subfield_array_array($cle,"3");
$this->info_606_j=$record->get_subfield_array_array($cle,"j");
$this->info_606_x=$record->get_subfield_array_array($cle,"x");
$this->info_606_y=$record->get_subfield_array_array($cle,"y");
$this->info_606_z=$record->get_subfield_array_array($cle,"z");
break;
case "653":
$index_sujets=$record->get_subfield($cle,"a");
break;
default:
break;
} /* end of switch */
} /* end of for */
$this->isbn = $this->process_isbn ($isbn[0]);
/* INSERT de la notice OK, on va traiter les auteurs
10# : personnal : type auteur 70 71# : collectivités : type auteur 71
1 seul en 700 idem pour les déclinaisons
n en 701 n en 702
les 7#0 tombent en auteur principal : responsability_type = 0
les 7#1 tombent en autre auteur : responsability_type = 1
les 7#2 tombent en auteur secondaire : responsability_type = 2
*/
$this->aut_array = array();
/* on compte tout de suite le nbre d'enreg dans les répétables */
$nb_repet_700 = count($aut_700);
$nb_repet_710 = count($aut_710);
$nb_repet_711 = count($aut_711);
/* renseignement de aut0 */
if ($aut_100[0]['a']!="") { /* auteur principal en 100 ? */
$author=$this->process_author($aut_100[0]['a'],$aut_100[0]['b'],'','');
$this->aut_array[] = array(
"entree" => $author['name'], //$aut_100[0]['a'],
"rejete" => $author['rejete'], //$aut_100[0]['b'],
"type_auteur" => "70",
"fonction" => convert_usmarc_unimarc_functions($aut_100[0][4]),
"id" => 0,
"responsabilite" => 0,
"authority_number" => $aut_100[0][3] ) ;
} elseif ($aut_110[0]['a']!="") { /* auteur principal en 110 ? */
$author=$this->process_author($aut_110[0]['a'],$aut_110[0]['b'],'','');
$this->aut_array[] = array(
"entree" => $author['name'], //$aut_110[0]['a'],
"rejete" => $author['rejete'], //$aut_110[0]['b'],
"type_auteur" => "71",
"fonction" => convert_usmarc_unimarc_functions($aut_110[0][4]),
"id" => 0,
"responsabilite" => 0 ,
"authority_number" => $aut_110[0][3] ) ;
} elseif ($aut_111[0]['a']!="") { /* auteur principal en 111 ? */
$author=$this->process_author($aut_111[0]['a'],$aut_111[0]['b'],'','');
$this->aut_array[] = array(
"entree" => $author['name'], //$aut_111[0]['a'],
"rejete" => $author['rejete'], //$aut_111[0]['b'],
"type_auteur" => "71",
"fonction" => convert_usmarc_unimarc_functions($aut_111[0][4]),
"id" => 0,
"responsabilite" => 0,
"authority_number" => $aut_111[0][3] ) ;
}
/* renseignement de aut1 */
for ($i=0 ; $i < $nb_repet_700 ; $i++) {
$author=$this->process_author($aut_700[$i]['a'],$aut_700[$i]['b'],'','');
$this->aut_array[] = array(
"entree" => $author['name'], //$aut_700[$i]['a'],
"rejete" => $author['rejete'], //$aut_700[$i]['b'],
"type_auteur" => "70",
"fonction" => convert_usmarc_unimarc_functions($aut_700[$i][4]),
"id" => 0,
"responsabilite" => 1 ,
"authority_number" => $aut_700[$i][3] ) ;
}
for ($i=0 ; $i < $nb_repet_710 ; $i++) {
$author=$this->process_author($aut_710[$i]['a'],$aut_710[$i]['b'],'','');
$this->aut_array[] = array(
"entree" => $author['name'], //$aut_710[$i]['a'],
"rejete" => $author['rejete'], //$aut_710[$i]['b'],
"type_auteur" => "71",
"fonction" => convert_usmarc_unimarc_functions($aut_710[$i][4]),
"id" => 0,
"responsabilite" => 1,
"authority_number" => $aut_710[$i][3] ) ;
}
/* renseignement de aut2 */
for ($i=0 ; $i < $nb_repet_711 ; $i++) {
$author=$this->process_author($aut_711[$i]['a'],$aut_711[$i]['b'],'','');
$this->aut_array[] = array(
"entree" => $author['name'], //$aut_711[$i]['a'],
"rejete" => $author['rejete'], //$aut_711[$i]['b'],
"type_auteur" => "71",
"fonction" => convert_usmarc_unimarc_functions($aut_711[$i][4]),
"id" => 0,
"responsabilite" => 2 ,
"authority_number" => $aut_711[$i][3]) ;
}
/* Editors */
$this->year = preg_replace ("/[^0-9\[\]()]/", "", $editor[0]['c']);
$this->editors[0]['name'] = $this->clean_field ($editor[0]['b']);
$this->editors[0]['ville'] = $this->clean_field ($editor[0]['a']);
$this->editors[1]['name'] = $this->clean_field ($editor[1]['b']);
$this->editors[1]['ville'] = $this->clean_field ($editor[1]['a']);
/* ici traitement des collections */
$coll_name = "";
$subcoll_name = "";
$coll_issn = "";
$subcoll_issn = "";
$nocoll = "";
/* traitement de 222$a, si rien alors 440$a pour la collection */
if ($collection_222[0]['a']!="") {
$coll_name = $this->clean_field($collection_222[0]['a']);
$coll_issn = $collection_022[0]['a'];
} elseif ($collection_440[0]['a']!="") {
$coll_name = $this->clean_field($collection_440[0]['a']);
$coll_issn = $collection_440[0]['x'];
}
/* traitement de 222 1, si rien alors 440 1 pour la sous-collection */
if ($collection_222[1]['a']!="") {
$subcoll_name = $this->clean_field($collection_222[1]['a']);
$subcoll_issn = $collection_022[1]['a'];
} elseif ($collection_440[1]['a']!="") {
$subcoll_name = $this->clean_field($collection_440[1]['a']);
$subsubcoll_issn = $collection_440[1]['x'];
}
/* gaffe au nocoll, en principe en 440$v */
if ($collection_440[0]['v']!="") {
$this->nbr_in_collection = $collection_440[0]['v'];
} else
$this->nbr_in_collection = "";
$this->collection['name']=clean_string($coll_name);
$this->collection['issn']=clean_string($coll_issn);
$this->subcollection['name']=clean_string($subcoll_name);
$this->subcollection['issn']=clean_string($subcoll_issn);
/* Series */
$this->serie = clean_string ($tit[0]['p']);
$this->nbr_in_serie = clean_string ($tit[0]['n']);
/* traitement ressources */
$this->link_url = $ressource[0]["u"];
$this->link_format = $ressource[0]["2"];
/* traitement des titres */
$this->titles[0] = preg_replace('/-$| $|\||\($|\)$|\[$|\]$|\:$|\;$|\/$|\\$|\.+$/', '', trim($tit[0]['a']));
$this->titles[1] = preg_replace('/-$| $|\||\($|\)$|\[$|\]$|\:$|\;$|\/$\|\$|\.+$/', '', trim($tit_sup[0]['a']));
$this->titles[2] = preg_replace('/-$| $|\||\($|\)$|\[$|\]$|\:$|\;$|\/$\|\$|\.+$/', '', trim($tit_for[0]['a']));
$this->titles[3] = preg_replace('/-$| $|\||\($|\)$|\[$|\]$|\:$|\;$|\/$\|\$|\.+$/', '', trim($tit[0]['b']));
$this->general_note = "";
$this->content_note = "";
$this->abstract_note = "";
/* prepare index_titre field for searching */
for ($i = 0; $i < count ($abstract_note); $i++) {
$this->abstract_note .= $abstract_note[$i]." ";
}
for ($i = 0; $i < count($general_note); $i++) {
$this->general_note .= $general_note[$i]." ";
}
for ($i = 0; $i < count ($content_note); $i++) {
$this->content_note .= $content_note[$i]." ";
}
if (trim ($this->abstract_note) == "")
$this->abstract_note = $this->general_note." ".$this->content_note;
global $pmb_keyword_sep ;
if (!$pmb_keyword_sep) $pmb_keyword_sep=" ";
if (is_array($index_sujets)) $this->free_index = implode ($pmb_keyword_sep,$index_sujets);
else $this->free_index = $index_sujets;
}
public function from_unimarc ($record) {
$this->document_type = $record->inner_guide['dt'];
$this->bibliographic_level = $record->inner_guide['bl'];
$this->hierarchic_level = $record->inner_guide['hl'];
if ($this->hierarchic_level=="") {
if ($this->bibliographic_level=="s") $this->hierarchic_level="1";
if ($this->bibliographic_level=="m") $this->hierarchic_level="0";
}
if(function_exists("param_perso_prepare")) param_perso_prepare($record);
$indicateur = array();
$isbn = array();
$cb = '';
$tit = array();
$editeur_lieu = array();
$editeur_nom = '';
$editeur_date = array();
$editeur_date_machine = array();
$collection_225 = array();
$general_note = '';
$content_note = '';
$abstract_note = '';
$EAN = '';
$collection_411 = array();
$bulletin_463 = '';
$perio530a = '';
$index_sujets = '';
$aut_700 = array();
$aut_701 = array();
$aut_702 = array();
$aut_710 = array();
$aut_711 = array();
$aut_712 = array();
$origine_notice = array();
$ressource = array();
$info_995 = '';
for ($i=0;$iinner_directory);$i++) {
$cle=$record->inner_directory[$i]['label'];
$indicateur[$cle][]=substr($record->inner_data[$i]['content'],0,2);
switch($cle) {
case "010": /* isbn */
$isbn = $record->get_subfield($cle,'a');
$subfield = $record->get_subfield($cle,"d");
$this->prix = (!empty($subfield) ? $subfield[0] : '');
case "011": /* isbn */
$isbn = $record->get_subfield($cle,'a');
break;
case "014": /* isbn */
$this->others_ids = $record->get_subfield($cle,'a','b');
break;
case "071": /* barcode */
$cb = $record->get_subfield($cle,"a");
break;
case "101": /* language */
//martizva NOTE: some server send language in UPCASE!!!
// $subfield = $record->get_subfield($cle,"a");
// $this->language_code = strtolower($subfield[0]);
// $subfield = $record->get_subfield($cle,"c");
// $this->original_language_code = strtolower($subfield[0]);
$this->language_code = $record->get_subfield_array($cle,"a");
$this->original_language_code = $record->get_subfield_array($cle,"c");
break;
case "200": /* titles */
$tit = $record->get_subfield($cle, 'a', 'c', 'd', 'e', 'v');
$tit_200a=$record->get_subfield_array($cle, 'a');
$tit_200c=$record->get_subfield_array($cle, 'c');
$tit_200d=$record->get_subfield_array($cle, 'd');
$tit_200e=$record->get_subfield_array($cle, 'e');
$tit_200v=$record->get_subfield_array($cle, 'v');
$this->serie_200=$record->get_subfield($cle, 'h', 'i');
break;
case "205": /* mention_edition */
$subfield = $record->get_subfield($cle,"a");
$this->mention_edition = $subfield[0];
break;
case "210": /* publisher */
case "214":
case "219":
$editeur_lieu=$record->get_subfield_array_array($cle, "a");
$editeur_nom=$record->get_subfield_array_array($cle, "c");
$editeur_date=$record->get_subfield_array($cle, "d");
$editeur_date_machine=$record->get_subfield_array($cle, "h");
break;
case "215": /* description */
$subfield = $record->get_subfield($cle,"a");
$this->page_nbr = (!empty($subfield) ? $subfield[0] : '');
$subfield = $record->get_subfield($cle,"c");
$this->illustration = (!empty($subfield) ? $subfield[0] : '');
$subfield = $record->get_subfield($cle,"d");
$this->size = (!empty($subfield) ? $subfield[0] : '');
$subfield = $record->get_subfield($cle,"e");
$this->accompagnement = (!empty($subfield) ? $subfield[0] : '');
break;
case "225": /* collection */
$collection_225 = $record->get_subfield($cle,"a","i","v","x");
break;
case "300": /* inside */
$general_note = $record->get_subfield_array($cle,"a");
break;
case "327": /* inside */
$content_note=$record->get_subfield_array($cle,"a");
break;
case "330": /* abstract */
$abstract_note = $record->get_subfield_array($cle,"a");
break;
case "345": /* EAN */
$EAN=$record->get_subfield($cle,"b");
break;
case "410": /* collection */
$collection_410 = $record->get_subfield($cle,"t","v","x");
break;
case "411": /* sub-collection */
$collection_411 = $record->get_subfield($cle,"t","v","x");
break;
case "461": /* series ou perios*/
if(($this->bibliographic_level == 'a' || $this->bibliographic_level == 'b' || $this->bibliographic_level == 's') && $this->hierarchic_level == '2'){
$perio = $record->get_subfield($cle,"t","x","v","d","e");
$this->perio_titre = $record->get_subfield_array($cle,"t");
$this->perio_issn = $record->get_subfield_array($cle,"x");
if($record->get_subfield_array($cle,"v")) $this->bull_num = $record->get_subfield_array($cle,"v");
if($record->get_subfield_array($cle,"d")) $this->bull_date = $record->get_subfield_array($cle,"d");
if($record->get_subfield_array($cle,"e")) $this->bull_mention = $record->get_subfield_array($cle,"e");
} else {
$serie = $record->get_subfield($cle,"t","v");
}
break;
case "463":/* Bulletins */
$bulletin_463 = $record->get_subfield($cle,"t","v","d","e");
$this->bull_num = $record->get_subfield_array($cle,"v");
$this->bull_date = $record->get_subfield_array($cle,"d");
$this->bull_mention = $record->get_subfield_array($cle,"e");
$this->bull_titre = $record->get_subfield_array($cle,"t");
break;
case "500": /* Titres uniformes */
$this->tu_500 = $record->get_subfield($cle,"a","k","m","q","u","v","w");
$this->tu_500_i = $record->get_subfield_array_array($cle,"i");
$this->tu_500_j = $record->get_subfield_array_array($cle,"j");
$this->tu_500_l = $record->get_subfield_array_array($cle,"l");
$this->tu_500_n = $record->get_subfield_array_array($cle,"n");
$this->tu_500_r = $record->get_subfield_array_array($cle,"r");
$this->tu_500_s = $record->get_subfield_array_array($cle,"s");
break;
case "503": /* Titres de forme */
$this->info_503 = $record->get_subfield($cle,"a","e","f","h","m","n");
$this->info_503_d = $record->get_subfield_array_array($cle,"d");
$this->info_503_j = $record->get_subfield_array_array($cle,"j");
break;
case "530":
$perio530a=$record->get_subfield_array($cle, 'a');
break;
//TODO AR
//recup 530 (voir import_unimarc_lien)
case "600": // 600 PERSONAL NAME USED AS SUBJECT
$this->info_600_3=$record->get_subfield_array_array($cle,"3");
$this->info_600_a=$record->get_subfield_array_array($cle,"a");
$this->info_600_b=$record->get_subfield_array_array($cle,"b");
$this->info_600_c=$record->get_subfield_array_array($cle,"c");
$this->info_600_d=$record->get_subfield_array_array($cle,"d");
$this->info_600_f=$record->get_subfield_array_array($cle,"f");
$this->info_600_g=$record->get_subfield_array_array($cle,"g");
$this->info_600_j=$record->get_subfield_array_array($cle,"j");
$this->info_600_p=$record->get_subfield_array_array($cle,"p");
$this->info_600_t=$record->get_subfield_array_array($cle,"t");
$this->info_600_x=$record->get_subfield_array_array($cle,"x");
$this->info_600_y=$record->get_subfield_array_array($cle,"y");
$this->info_600_z=$record->get_subfield_array_array($cle,"z");
break;
case "601": // 601 CORPORATE BODY NAME USED AS SUBJECT
$this->info_601_3=$record->get_subfield_array_array($cle,"3");
$this->info_601_a=$record->get_subfield_array_array($cle,"a");
$this->info_601_b=$record->get_subfield_array_array($cle,"b");
$this->info_601_c=$record->get_subfield_array_array($cle,"c");
$this->info_601_d=$record->get_subfield_array_array($cle,"d");
$this->info_601_e=$record->get_subfield_array_array($cle,"e");
$this->info_601_f=$record->get_subfield_array_array($cle,"f");
$this->info_601_g=$record->get_subfield_array_array($cle,"g");
$this->info_601_h=$record->get_subfield_array_array($cle,"h");
$this->info_601_t=$record->get_subfield_array_array($cle,"t");
$this->info_601_j=$record->get_subfield_array_array($cle,"j");
$this->info_601_x=$record->get_subfield_array_array($cle,"x");
$this->info_601_y=$record->get_subfield_array_array($cle,"y");
$this->info_601_z=$record->get_subfield_array_array($cle,"z");
break;
case "602": // 602 FAMILY NAME USED AS SUBJECT
$this->info_602_3=$record->get_subfield_array_array($cle,"3");
$this->info_602_a=$record->get_subfield_array_array($cle,"a");
$this->info_602_f=$record->get_subfield_array_array($cle,"f");
$this->info_602_t=$record->get_subfield_array_array($cle,"t");
$this->info_602_j=$record->get_subfield_array_array($cle,"j");
$this->info_602_x=$record->get_subfield_array_array($cle,"x");
$this->info_602_y=$record->get_subfield_array_array($cle,"y");
$this->info_602_z=$record->get_subfield_array_array($cle,"z");
break;
case "604": // 604 AUTEUR-TITRE USED AS SUBJECT
$this->info_604_a=$record->get_subfield_array_array($cle,"a");
$this->info_604_h=$record->get_subfield_array_array($cle,"h");
$this->info_604_i=$record->get_subfield_array_array($cle,"i");
$this->info_604_j=$record->get_subfield_array_array($cle,"j");
$this->info_604_k=$record->get_subfield_array_array($cle,"k");
$this->info_604_l=$record->get_subfield_array_array($cle,"l");
$this->info_604_x=$record->get_subfield_array_array($cle,"x");
$this->info_604_y=$record->get_subfield_array_array($cle,"y");
$this->info_604_z=$record->get_subfield_array_array($cle,"z");
break;
case "605": // 605 TITLE USED AS SUBJECT
$this->info_605_3=$record->get_subfield_array_array($cle,"3");
$this->info_605_a=$record->get_subfield_array_array($cle,"a");
$this->info_605_h=$record->get_subfield_array_array($cle,"h");
$this->info_605_i=$record->get_subfield_array_array($cle,"i");
$this->info_605_j=$record->get_subfield_array_array($cle,"j");
$this->info_605_k=$record->get_subfield_array_array($cle,"k");
$this->info_605_l=$record->get_subfield_array_array($cle,"l");
$this->info_605_m=$record->get_subfield_array_array($cle,"m");
$this->info_605_n=$record->get_subfield_array_array($cle,"n");
$this->info_605_q=$record->get_subfield_array_array($cle,"q");
$this->info_605_r=$record->get_subfield_array_array($cle,"r");
$this->info_605_s=$record->get_subfield_array_array($cle,"s");
$this->info_605_u=$record->get_subfield_array_array($cle,"u");
$this->info_605_w=$record->get_subfield_array_array($cle,"w");
$this->info_605_j=$record->get_subfield_array_array($cle,"j");
$this->info_605_x=$record->get_subfield_array_array($cle,"x");
$this->info_605_y=$record->get_subfield_array_array($cle,"y");
$this->info_605_z=$record->get_subfield_array_array($cle,"z");
break;
case "606": // RAMEAU / TOPICAL NAME USED AS SUBJECT
$this->info_606_3=$record->get_subfield_array_array($cle,"3");
$this->info_606_a=$record->get_subfield_array_array($cle,"a");
$this->info_606_j=$record->get_subfield_array_array($cle,"j");
$this->info_606_x=$record->get_subfield_array_array($cle,"x");
$this->info_606_y=$record->get_subfield_array_array($cle,"y");
$this->info_606_z=$record->get_subfield_array_array($cle,"z");
break;
case "607": // 607 GEOGRAPHICAL NAME USED AS SUBJECT
$this->info_607_3=$record->get_subfield_array_array($cle,"3");
$this->info_607_a=$record->get_subfield_array_array($cle,"a");
$this->info_607_j=$record->get_subfield_array_array($cle,"j");
$this->info_607_x=$record->get_subfield_array_array($cle,"x");
$this->info_607_y=$record->get_subfield_array_array($cle,"y");
$this->info_607_z=$record->get_subfield_array_array($cle,"z");
break;
case "608": // 608 Vedette matière de forme, de genre ou des caractéristiques physiques
$this->info_608_3=$record->get_subfield_array_array($cle,"3");
$this->info_608_a=$record->get_subfield_array_array($cle,"a");
$this->info_608_j=$record->get_subfield_array_array($cle,"j");
$this->info_608_x=$record->get_subfield_array_array($cle,"x");
$this->info_608_y=$record->get_subfield_array_array($cle,"y");
$this->info_608_z=$record->get_subfield_array_array($cle,"z");
break;
case "610": /* mots clé */
$index_sujets=$record->get_subfield($cle,"a");
break;
case "676": /* Dewey */
$this->dewey=$record->get_subfield($cle,"a");
break;
case "686": /* PCDM */
if (!$this->dewey)
$this->dewey=$record->get_subfield($cle,"a");
break;
case "700":
$aut_700=$record->get_subfield($cle,"a","b","c","d","4","f","N","3");
break;
case "701":
$aut_701=$record->get_subfield($cle,"a","b","c","d","4","f","N","3");
break;
case "702":
$aut_702=$record->get_subfield($cle,"a","b","c","d","4","f","N","3");
break;
case "710":
$aut_710=$record->get_subfield($cle,"a","b","c","g","d","4","f","e","k","l","m","n","3");
break;
case "711":
$aut_711=$record->get_subfield($cle,"a","b","c","g","d","4","f","e","k","l","m","n","3");
break;
case "712":
$aut_712=$record->get_subfield($cle,"a","b","c","g","d","4","f","e","k","l","m","n","3");
break;
case "801": /* origine du catalogage */
$origine_notice=$record->get_subfield($cle,"a","b");
break;
case "856":
$ressource = $record->get_subfield($cle,"u","q");
break;
case "995": /* infos de la BDP */
$info_995 = $record->get_subfield($cle,"a","b","c","d","f","k","m","n","o","r","u");
$this->exemplaires = $info_995;
break;
case "896": /* Thumbnail */
$thumbnail_url = $record->get_subfield($cle,"a");
$this->thumbnail_url = $thumbnail_url[0];
break;
//Documents numériques
case "897":
$this->doc_nums = $record->get_subfield($cle,"a", "b","f","p");
break;
case "900":
$this->info_900 = $record->get_subfield($cle,"a");
default:
break;
} /* end of switch */
} /* end of for */
//Traitement import perso
if (function_exists('param_perso_prepare_fin')) {
param_perso_prepare_fin($this->notice,$this->exemplaires);
}
//Récupération des catégories en lien avec le fichier xml
category_auto::get_info_categ($record);
$this->isbn = (!empty($isbn[0]) ? $this->process_isbn ($isbn[0]) : '');
if (function_exists("traite_categories_from_unimarc")) {
$this->categories = traite_categories_from_unimarc($this);
}
/* INSERT de la notice OK, on va traiter les auteurs
70# : personnal : type auteur 70 71# : collectivités : type auteur 71
1 seul en 700 idem pour les déclinaisons
n en 701 n en 702
les 7#0 tombent en auteur principal : responsability_type = 0
les 7#1 tombent en autre auteur : responsability_type = 1
les 7#2 tombent en auteur secondaire : responsability_type = 2
*/
$this->aut_array = array();
/* on compte tout de suite le nbre d'enreg dans les répétables */
$nb_repet_701 = count($aut_701);
$nb_repet_711 = count($aut_711);
$nb_repet_702 = count($aut_702);
$nb_repet_712 = count($aut_712);
/* renseignement de aut0 */
if (isset($aut_700[0]['a']) && $aut_700[0]['a']!="") { /* auteur principal en 700 ? */
$this->aut_array[] = array(
"entree" => $aut_700[0]['a'],
"rejete" => $aut_700[0]['b'],
"author_comment" => $aut_700[0]['c']." ".$aut_700[0]['d'],
"date" => $aut_700[0]['f'],
"type_auteur" => "70",
"fonction" => $aut_700[0][4],
"id" => 0,
"responsabilite" => 0 ,
"ordre" => 0 ,
"authority_number" => $aut_700[0][3]) ;
} elseif (isset($aut_710[0]['a']) && $aut_710[0]['a']!="") { /* auteur principal en 710 ? */
if(substr($indicateur["710"][0],0,1)=="1") $type_auteur="72";
else $type_auteur="71";
$lieu=$aut_710[0]['e'];
if(!$lieu)$lieu=$aut_710[0]['k'];
$this->aut_array[] = array(
"entree" => $aut_710[0]['a'],
"rejete" => $aut_710[0]['g'],
"subdivision" => $aut_710[0]['b'],
"author_comment" => $aut_710[0]['c'],
"numero" => $aut_710[0]['d'],
"ville" => $aut_710[0]['l'],
"web" => $aut_710[0]['n'],
"date" => $aut_710[0]['f'],
"type_auteur" => $type_auteur*1,
"fonction" => $aut_710[0][4],
"id" => 0,
"responsabilite" => 0,
"ordre" => 0 ,
"lieu" => $lieu,
"pays" => $aut_710[0]['m'],
"authority_number" => $aut_710[0][3]) ;
}
/* renseignement de aut1 */
for ($i=0 ; $i < $nb_repet_701 ; $i++) {
$this->aut_array[] = array(
"entree" => $aut_701[$i]['a'],
"rejete" => $aut_701[$i]['b'],
"author_comment" => $aut_701[$i]['c']." ".$aut_701[$i]['d'],
"date" => $aut_701[$i]['f'],
"type_auteur" => "70",
"fonction" => $aut_701[$i][4],
"id" => 0,
"responsabilite" => 1,
"ordre" => ($i+1) ,
"authority_number" => $aut_701[$i][3]) ;
}
for ($i=0 ; $i < $nb_repet_711 ; $i++) {
if(substr($indicateur["711"][$i],0,1)=="1") $type_auteur="72";
else $type_auteur="71";
$lieu=$aut_711[$i]['e'];
if(!$lieu)$lieu=$aut_711[$i]['k'];
$this->aut_array[] = array(
"entree" => $aut_711[$i]['a'],
"rejete" => $aut_711[$i]['g'],
"subdivision" => $aut_711[$i]['b'],
"author_comment" => $aut_711[$i]['c'],
"numero" => $aut_711[$i]['d'],
"ville" => $aut_711[$i]['l'],
"web" => $aut_711[$i]['n'],
"date" => $aut_711[$i]['f'],
"type_auteur" => $type_auteur*1,
"fonction" => $aut_711[$i][4],
"id" => 0,
"responsabilite" => 1,
"lieu" => $lieu,
"pays" => $aut_711[$i]['m'],
"ordre" => ($i+1) ,
"authority_number" => $aut_711[$i][3]) ;
}
/* renseignement de aut2 */
for ($i=0 ; $i < $nb_repet_702 ; $i++) {
$this->aut_array[] = array(
"entree" => $aut_702[$i]['a'],
"rejete" => $aut_702[$i]['b'],
"author_comment" => $aut_702[$i]['c']." ".$aut_702[$i]['d'],
"date" => $aut_702[$i]['f'],
"type_auteur" => "70",
"fonction" => $aut_702[$i][4],
"id" => 0,
"responsabilite" => 2,
"ordre" => ($i+1) ,
"authority_number" => $aut_702[$i][3]) ;
}
for ($i=0 ; $i < $nb_repet_712 ; $i++) {
if(substr($indicateur["712"][$i],0,1)=="1") $type_auteur="72";
else $type_auteur="71";
$lieu=$aut_712[$i]['e'];
if(!$lieu)$lieu=$aut_712[$i]['k'];
$this->aut_array[] = array(
"entree" => $aut_712[$i]['a'],
"rejete" => $aut_712[$i]['g'],
"subdivision" => $aut_712[$i]['b'],
"author_comment" => $aut_712[$i]['c'],
"numero" => $aut_712[$i]['d'],
"ville" => $aut_712[$i]['l'],
"web" => $aut_712[$i]['n'],
"date" => $aut_712[$i]['f'],
"type_auteur" => $type_auteur*1,
"fonction" => $aut_712[$i][4],
"id" => 0,
"responsabilite" => 2,
"lieu" => $lieu,
"pays" => $aut_712[$i]['m'],
"ordre" => ($i+1) ,
"authority_number" => $aut_712[$i][3]) ;
}
/* Added for some italian z39.50 server
Some adjustment to clean the values from symbol like << and others */
for ($i=0 ; $i < $nb_repet_701+$nb_repet_711+$nb_repet_702 +$nb_repet_712+1 ; $i++) {
$this->aut_array[$i]['entree']=(!empty($this->aut_array[$i]['entree']) ? del_more_garbage($this->aut_array[$i]['entree']) : '');
$this->aut_array[$i]['rejete']=(!empty($this->aut_array[$i]['rejete']) ? del_more_garbage($this->aut_array[$i]['rejete']) : '');
}
/* traitement des éditeurs */
$editor=array();
if (is_array($editeur_nom)) {
foreach ( $editeur_nom as $key_nom1 => $nom1 ) {
foreach ( $nom1 as $key_nom2 => $nom2 ) {
$mon_ed=array();
$mon_ed["c"]=$nom2;
if(!empty($editeur_lieu) && !empty($editeur_lieu[$key_nom1]) && !empty($editeur_lieu[$key_nom1][$key_nom2])){
$mon_ed["a"]=$editeur_lieu[$key_nom1][$key_nom2];
}
$editor[]=$mon_ed;
}
}
}
$this->year=(!empty($editeur_date[0]) ? clean_string($editeur_date[0]) : '');
$this->editors[0]['name'] = ((!empty($editor[0]) && !empty($editor[0]['c'])) ? clean_string($editor[0]['c']) : '');
$this->editors[0]['ville'] = ((!empty($editor[0]) && !empty($editor[0]['a'])) ? clean_string($editor[0]['a']) : '');
$this->editors[1]['name'] = ((!empty($editor[1]) && !empty($editor[1]['c'])) ? clean_string($editor[1]['c']) : '');
$this->editors[1]['ville'] = ((!empty($editor[1]) && !empty($editor[1]['a'])) ? clean_string($editor[1]['a']) : '');
/* Added for some italian z39.50 server
Some adjustment to clean the values from symbol like << and others */
$this->editors[0]['name']=del_more_garbage($this->editors[0]['name']);
$this->editors[1]['name']=del_more_garbage($this->editors[1]['name']);
/* traitement des collections */
$coll_name="";
$subcoll_name="";
$coll_issn="";
$subcoll_issn="";
$nocoll_ins="";
// Collection : traitement de 225 et 410, préférence donnée au 410
if (isset($collection_410[0]['t']) && $collection_410[0]['t']) $coll_name=$collection_410[0]['t'];
elseif (isset($collection_225[0]['a']) && $collection_225[0]['a']!="") $coll_name=$collection_225[0]['a'];
if (isset($collection_410[0]['x']) && $collection_410[0]['x']) $coll_issn=$collection_410[0]['x'];
elseif (isset($collection_225[0]['x']) && $collection_225[0]['x']!="") $coll_issn=$collection_225[0]['x'];
// Sous-collection : traitement de 225$i et 411, préférence donnée au 411
if (isset($collection_411[0]['t']) && $collection_411[0]['t']) $subcoll_name=$collection_411[0]['t'];
elseif (isset($collection_225[0]['i']) && $collection_225[0]['i']!="") $subcoll_name=$collection_225[0]['i'];
if (isset($collection_411[0]['x']) && $collection_411[0]['x']) $subcoll_issn=$collection_411[0]['x'];
// Numéro dans la collection, présent en 411$v, sinon en 410$v et enfin en 225$v
if (isset($collection_411[0]['v']) && $collection_411[0]['v']!="") $this->nbr_in_collection = $collection_411[0]['v'];
elseif (isset($collection_410[0]['v']) && $collection_410[0]['v']!="") $this->nbr_in_collection = $collection_410[0]['v'];
elseif (isset($collection_225[0]['v']) && $collection_225[0]['v']!="") $this->nbr_in_collection = $collection_225[0]['v'];
else $this->nbr_in_collection = "";
$this->collection['name']=clean_string($coll_name);
$this->collection['issn']=clean_string($coll_issn);
$this->subcollection['name']=clean_string($subcoll_name);
$this->subcollection['issn']=clean_string($subcoll_issn);
/* Added for some italian z39.50 server
Some adjustment to clean the values from symbol like << and others */
$this->collection['name']=del_more_garbage($this->collection['name']);
$this->subcollection['name']=del_more_garbage($this->subcollection['name']);
//TODO AR
//nettoyage si notice de bulletin (voir import_unimarc_lien)
//TEST si perio_titre vide -> recup 530
if($this->bibliographic_level=="s" && $this->hierarchic_level=="2"){
if(!$this->perio_titre && $perio530a) {
$this->perio_titre = $perio530a;
}
if(!$this->bull_titre && $this->serie_200){
$this->bull_titre = array(clean_string($this->serie_200[0]['i']));
}elseif(!$this->bull_titre && $tit_200a){
$this->bull_titre = array(clean_string($tit_200a[0]));
}
//file_put_contents('php://stderr', print_r($tit_200a[0], true));
if(!$this->bull_num && $this->serie_200){
$this->bull_num = array(clean_string ($this->serie_200[0]['h']));
}
if(!$this->bull_date && $editeur_date_machine){
$this->bull_date = array($editeur_date_machine[0]);
}
if(!$this->bull_mention && $editeur_date){
$this->bull_mention = array(clean_string($editeur_date[0]));
}
//file_put_contents('php://stderr', print_r($this->bull_mention, true));
//file_put_contents('php://stderr', print_r($this->bull_date, true));
$this->serie_200 = array();
}
/* Series TODO: Check if it's Ok */
$this->serie = ((!empty($serie) && !empty($serie[0]) && !empty($serie[0]['t'])) ? clean_string($serie[0]['t']) : '');
if ($this->serie){
$this->nbr_in_serie = $serie[0]['v'];
}else{
$this->serie = clean_string ($this->serie_200[0]['i']);
if ($this->serie) {
$this->nbr_in_serie = $this->serie_200[0]['h'];
}else {
$this->nbr_in_serie = "";
}
}
/* Traitement des notes */
$this->general_note = "";
$this->content_note = "";
$this->abstract_note = "";
if (!$abstract_note) $abstract_note=array();
$this->abstract_note= implode("\n",$abstract_note);
if (!$general_note) $general_note=array();
$this->general_note= implode("\n",$general_note);
if (!$content_note) $content_note=array();
$this->content_note= implode("\n",$content_note);
/* traitement ressources */
$this->link_url = (isset($ressource[0]["u"]) ? $ressource[0]["u"] : "");
$this->link_format = (isset($ressource[0]["q"]) ? $ressource[0]["q"] : "");
/* Titles processing */
if (empty($tit_200a)) $tit_200a=array();
if (empty($tit_200c)) $tit_200c=array();
if (empty($tit_200d)) $tit_200d=array();
if (empty($tit_200e)) $tit_200e=array();
$tit[0]['a'] = implode (" ; ",$tit_200a);
$tit[0]['c'] = implode (" ; ",$tit_200c);
$tit[0]['d'] = implode (" ; ",$tit_200d);
$tit[0]['e'] = implode (" ; ",$tit_200e);
$this->titles[0] = clean_string($tit[0]['a']);
$this->titles[1] = clean_string($tit[0]['c']);
$this->titles[2] = clean_string($tit[0]['d']);
$this->titles[3] = clean_string($tit[0]['e']);
/* Added for some italian z39.50 server
Some adjustment to clean the values from symbol like << and others */
$this->titles[0]=del_more_garbage($this->titles[0]);
$this->titles[1]=del_more_garbage($this->titles[1]);
$this->titles[2]=del_more_garbage($this->titles[2]);
$this->titles[3]=del_more_garbage($this->titles[3]);
global $pmb_keyword_sep ;
if (!$pmb_keyword_sep) $pmb_keyword_sep=" ";
if (is_array($index_sujets)) $this->free_index = implode ($pmb_keyword_sep,$index_sujets);
else $this->free_index = $index_sujets;
if(isset($origine_notice[0]['b'])){
$this->origine_notice['nom']=clean_string($origine_notice[0]['b']);
}else{
$this->origine_notice['nom']="";
}
if(isset($origine_notice[0]['a'])){
$this->origine_notice['pays']=clean_string($origine_notice[0]['a']);
}else{
$this->origine_notice['pays']="";
}
}
public function get_isbd_display () {
$tdoc = new marc_list('doctype');
if ($this->aut_array[0]['rejete'])
$author = $this->aut_array[0]['rejete']." ".$this->aut_array[0]['entree'];
else
$author = $this->aut_array[0]['entree'];
$display =
$this->titles[0]." [".$tdoc->table[$this->document_type]."] / ".
$author.". - ".
$this->editors[0]['name'].", ".
$this->year.". - ".
$this->page_nbr." : ".
$this->illustration." ; ".
$this->size.". - (".
$this->collection['name'].". ".
$this->subcollection['name']." ; ".
$this->nbr_in_collection."). ".
$this->isbn.
" ".$this->abstract_note;
return array ($this->isbn, $this->titles[0], $author, $display);
}
/*
* Transforme les variables de classe comme si elles étaient postées
*/
public function var_to_post($no_download='1'){
global $dbh, $deflt_integration_notice_statut;
$this->document_type = addslashes($this->document_type);
$this->isbn = addslashes($this->isbn);
$this->titles[0] = addslashes($this->titles[0]);
$this->titles[1] = addslashes($this->titles[1]);
$this->titles[2] = addslashes($this->titles[2]);
$this->titles[3] = addslashes($this->titles[3]);
$this->nbr_in_serie = addslashes($this->nbr_in_serie);
$this->year = addslashes($this->year) ;
$this->page_nbr = addslashes($this->page_nbr) ;
$this->illustration = addslashes($this->illustration) ;
$this->size = addslashes($this->size) ;
$this->accompagnement = addslashes($this->accompagnement) ;
$this->nbr_in_collection = addslashes($this->nbr_in_collection);
$this->mention_edition = addslashes($this->mention_edition);
$this->general_note = addslashes($this->general_note) ;
$this->content_note = addslashes($this->content_note);
$this->abstract_note = addslashes($this->abstract_note) ;
$this->internal_index = addslashes($this->internal_index);
$this->statut = $deflt_integration_notice_statut ;
$this->commentaire_gestion = addslashes($this->commentaire_gestion);
$this->indexation_lang = addslashes($this->indexation_lang);
$this->thumbnail_url = addslashes($this->thumbnail_url) ;
$this->free_index = addslashes($this->free_index);
$this->bibliographic_level = addslashes($this->bibliographic_level);
$this->hierarchic_level = addslashes($this->hierarchic_level) ;
$this->link_url = addslashes($this->link_url) ;
$this->link_format = addslashes($this->link_format) ;
$this->orinot_id = addslashes($this->orinot_id) ;
$this->prix = addslashes($this->prix);
global $biblio_notice;
$biblio_notice = "";
if($this->bibliographic_level == 'a' && $this->hierarchic_level=='2'){
//Pério et bulletin
$this->perio_titre = addslashes($this->perio_titre[0]);
$this->perio_issn = addslashes($this->perio_issn[0]);
$this->bull_titre = addslashes($this->bull_titre[0]);
$this->bull_date = addslashes($this->bull_date[0]);
$this->bull_mention = addslashes($this->bull_mention[0]);
$this->bull_num = addslashes($this->bull_num[0]);
//On cherche si le perio existe
$num_rows_perio = 0;
if($this->perio_titre && $this->perio_issn){
$req="select notice_id, tit1, code from notices where niveau_biblio='s' and niveau_hierar='1'
and tit1='".$this->perio_titre."'
and code='".$this->perio_issn."' limit 1";
$res_perio = pmb_mysql_query($req,$dbh);
$num_rows_perio = pmb_mysql_num_rows($res_perio);
}
if (!$num_rows_perio){
if($this->perio_titre){
$req="select notice_id, tit1, code from notices where niveau_biblio='s' and niveau_hierar='1'
and tit1='".$this->perio_titre."'
limit 1";
$res_perio = pmb_mysql_query($req,$dbh);
$num_rows_perio = pmb_mysql_num_rows($res_perio);
}
}
if (!$num_rows_perio){
if($this->perio_issn){
$req="select notice_id, tit1, code from notices where niveau_biblio='s' and niveau_hierar='1'
and code='".$this->perio_issn."' limit 1";
$res_perio = pmb_mysql_query($req,$dbh);
$num_rows_perio = pmb_mysql_num_rows($res_perio);
}
}
if ($num_rows_perio == 1) {
$perio_found = pmb_mysql_fetch_object($res_perio);
$this->perio_titre = addslashes($perio_found->tit1);
$this->perio_issn = addslashes($perio_found->code);
$this->perio_id = addslashes($perio_found->notice_id);
}
//On cherche si le bulletin existe
$num_rows_bull=0;
if($this->bull_num && $this->perio_id){
$req="select bulletin_id, bulletin_numero, date_date, mention_date, bulletin_titre from bulletins where bulletin_notice='".$this->perio_id."' and bulletin_numero like '%".$this->bull_num."%' order by date_date desc, bulletin_id desc ";
$res_bull = pmb_mysql_query($req,$dbh);
$num_rows_bull = pmb_mysql_num_rows($res_bull);
}
if(!$num_rows_bull && $this->bull_date && $this->perio_id){
$req="select bulletin_id, bulletin_numero, date_date, mention_date, bulletin_titre from bulletins where bulletin_notice='".$this->perio_id."' and date_date='".$this->bull_date."' order by date_date desc, bulletin_id desc ";
$res_bull = pmb_mysql_query($req,$dbh);
$num_rows_bull = pmb_mysql_num_rows($res_bull);
}elseif(($num_rows_bull > 1) && $this->bull_date && $this->perio_id){
$req="select bulletin_id, bulletin_numero, date_date, mention_date, bulletin_titre from bulletins where bulletin_notice='".$this->perio_id."' and date_date='".$this->bull_date."' and bulletin_numero like '%".$this->bull_num."%' order by date_date desc, bulletin_id desc ";
$res_bull = pmb_mysql_query($req,$dbh);
$num_rows_bull = pmb_mysql_num_rows($res_bull);
}
if(!$num_rows_bull && $this->bull_mention && $this->bull_num && $this->perio_id){
$req="select bulletin_id, bulletin_numero, date_date, mention_date, bulletin_titre from bulletins where bulletin_notice='".$this->perio_id."' and mention_date='".$this->bull_mention."' and bulletin_numero like '%".$this->bull_num."%' order by date_date desc, bulletin_id desc ";
$res_bull = pmb_mysql_query($req,$dbh);
$num_rows_bull = pmb_mysql_num_rows($res_bull);
}elseif(($num_rows_bull > 1) && $this->bull_mention && $this->perio_id){
if($this->bull_date[0]){
$req="select bulletin_id, bulletin_numero, date_date, mention_date, bulletin_titre from bulletins where bulletin_notice='".$this->perio_id."' and date_date='".$this->bull_date."' and mention_date='".$this->bull_mention."' order by date_date desc, bulletin_id desc ";
}else{
$req="select bulletin_id, bulletin_numero, date_date, mention_date, bulletin_titre from bulletins where bulletin_notice='".$this->perio_id."' and mention_date='".$this->bull_mention."' and bulletin_numero like '%".$this->bull_num."%' order by date_date desc, bulletin_id desc ";
}
$res_bull = pmb_mysql_query($req,$dbh);
$num_rows_bull = pmb_mysql_num_rows($res_bull);
}
if ($num_rows_bull) { //Il peut y en avoir +sieurs mais on prend le plus récent
$bull_found = pmb_mysql_fetch_object($res_bull);
$this->bull_titre = addslashes($bull_found->bulletin_titre);
$this->bull_date = addslashes($bull_found->date_date);
$this->bull_mention = addslashes($bull_found->mention_date);
$this->bull_num = addslashes($bull_found->bulletin_numero);
$this->bull_id = $bull_found->bulletin_id;
}
$biblio_notice = "art";
}
//TODO AR
//si bulletin, inspiré de juste au dessus, retrouver le pério, checker si le bulletin existe déjà, mettre la global biblio_notice à bull
if($this->bibliographic_level == 's' && $this->hierarchic_level=='2'){
//Pério et bulletin
$this->perio_titre = addslashes($this->perio_titre[0]);
$this->perio_issn = addslashes($this->perio_issn[0]);
$this->bull_titre = addslashes($this->bull_titre[0]);
$this->bull_date = addslashes($this->bull_date[0]);
$this->bull_mention = addslashes($this->bull_mention[0]);
$this->bull_num = addslashes($this->bull_num[0]);
//On cherche si le perio existe
if($this->perio_titre && $this->perio_issn){
$req="select notice_id, tit1, code from notices where niveau_biblio='s' and niveau_hierar='1'
and tit1='".$this->perio_titre."'
and code='".$this->perio_issn."' limit 1";
$res_perio = pmb_mysql_query($req,$dbh);
$num_rows_perio = pmb_mysql_num_rows($res_perio);
}
if (!$num_rows_perio){
if($this->perio_titre){
$req="select notice_id, tit1, code from notices where niveau_biblio='s' and niveau_hierar='1'
and tit1='".$this->perio_titre."'
limit 1";
$res_perio = pmb_mysql_query($req,$dbh);
$num_rows_perio = pmb_mysql_num_rows($res_perio);
}
}
if (!$num_rows_perio){
if($this->perio_issn){
$req="select notice_id, tit1, code from notices where niveau_biblio='s' and niveau_hierar='1'
and code='".$this->perio_issn."' limit 1";
$res_perio = pmb_mysql_query($req,$dbh);
$num_rows_perio = pmb_mysql_num_rows($res_perio);
}
}
if ($num_rows_perio == 1) {
$perio_found = pmb_mysql_fetch_object($res_perio);
$this->perio_titre = addslashes($perio_found->tit1);
$this->perio_issn = addslashes($perio_found->code);
$this->perio_id = addslashes($perio_found->notice_id);
}
//On cherche si le bulletin existe
$num_rows_bull=0;
if($this->bull_num && $this->perio_id){
$req="select bulletin_id, bulletin_numero, date_date, mention_date, bulletin_titre, num_notice from bulletins where bulletin_notice='".$this->perio_id."' and bulletin_numero like '%".$this->bull_num."%' order by date_date desc, bulletin_id desc ";
$res_bull = pmb_mysql_query($req,$dbh);
$num_rows_bull = pmb_mysql_num_rows($res_bull);
}
if(!$num_rows_bull && $this->bull_date && $this->perio_id){
$req="select bulletin_id, bulletin_numero, date_date, mention_date, bulletin_titre, num_notice from bulletins where bulletin_notice='".$this->perio_id."' and date_date='".$this->bull_date."' order by date_date desc, bulletin_id desc ";
$res_bull = pmb_mysql_query($req,$dbh);
$num_rows_bull = pmb_mysql_num_rows($res_bull);
}elseif(($num_rows_bull > 1) && $this->bull_date && $this->perio_id){
$req="select bulletin_id, bulletin_numero, date_date, mention_date, bulletin_titre, num_notice from bulletins where bulletin_notice='".$this->perio_id."' and date_date='".$this->bull_date."' and bulletin_numero like '%".$this->bull_num."%' order by date_date desc, bulletin_id desc ";
$res_bull = pmb_mysql_query($req,$dbh);
$num_rows_bull = pmb_mysql_num_rows($res_bull);
}
if(!$num_rows_bull && $this->bull_mention && $this->bull_num && $this->perio_id){
$req="select bulletin_id, bulletin_numero, date_date, mention_date, bulletin_titre, num_notice from bulletins where bulletin_notice='".$this->perio_id."' and mention_date='".$this->bull_mention."' and bulletin_numero like '%".$this->bull_num."%' order by date_date desc, bulletin_id desc ";
$res_bull = pmb_mysql_query($req,$dbh);
$num_rows_bull = pmb_mysql_num_rows($res_bull);
}elseif(($num_rows_bull > 1) && $this->bull_mention && $this->perio_id){
if($this->bull_date[0]){
$req="select bulletin_id, bulletin_numero, date_date, mention_date, bulletin_titre, num_notice from bulletins where bulletin_notice='".$this->perio_id."' and date_date='".$this->bull_date."' and mention_date='".$this->bull_mention."' order by date_date desc, bulletin_id desc ";
}else{
$req="select bulletin_id, bulletin_numero, date_date, mention_date, bulletin_titre, num_notice from bulletins where bulletin_notice='".$this->perio_id."' and mention_date='".$this->bull_mention."' and bulletin_numero like '%".$this->bull_num."%' order by date_date desc, bulletin_id desc ";
}
$res_bull = pmb_mysql_query($req,$dbh);
$num_rows_bull = pmb_mysql_num_rows($res_bull);
}
if ($num_rows_bull) { //Il peut y en avoir +sieurs mais on prend le plus récent
$bull_found = pmb_mysql_fetch_object($res_bull);
$this->bull_titre = addslashes($bull_found->bulletin_titre);
$this->bull_date = addslashes($bull_found->date_date);
$this->bull_mention = addslashes($bull_found->mention_date);
$this->bull_num = addslashes($bull_found->bulletin_numero);
$this->bull_id = $bull_found->bulletin_id;
$this->bull_notice = $bull_found->num_notice;
//Recupérer id de notice, et avant d'appeler insert_in_database -> vérifier que la valeur n'est pas remplie
//file_put_contents('php://stderr', print_r("bulletin trouve", true));
}
$biblio_notice = "bull";
}
if($this->source_id){
$requete="select upload_doc_num from connectors_sources where source_id=".$this->source_id."";
$resultat=pmb_mysql_query($requete);
if (pmb_mysql_num_rows($resultat)) {
$r=pmb_mysql_fetch_object($resultat);
if($r->upload_doc_num){
$no_download=0;
}else{
$no_download=1;
}
}
}
//documents numeriques
if (count($this->doc_nums )) {
foreach($this->doc_nums as $k=>$v) {
$this->doc_nums[$k]['__nodownload__'] = $no_download;
}
}
}
}