print "<hr />\n\t\t\t\t\t<span class='msg-perio'>" . $msg[z3950_update_not_ok] . "</span>\n\t\t\t\t\t <a id='liensuite' href=\"javascript:top.document.location='./catalog.php?categ=isbd&id={$num_notice}'\">{$msg['z3950_integr_not_lavoir']}</a>"; print "<script type='text/javascript'>document.getElementById('liensuite').focus();</script>"; break; case "EXISTAIT": if ($action == "integrer") { print "<hr />\n\t\t\t\t\t<span class='msg-perio'>" . $msg[z3950_integr_not_existait] . "</span>\n\t\t\t\t\t <a id='liensuite' href=\"javascript:top.document.location='./catalog.php?categ=isbd&id={$num_notice}'\">{$msg['z3950_integr_not_lavoir']}</a>"; print "<script type='text/javascript'>document.getElementById('liensuite').focus();</script>"; } break; case "NEWRATE": if ($action == "integrer") { print "<hr />\n\t\t\t\t\t<span class='msg-perio'>" . $msg[z3950_integr_not_newrate] . "</span>"; } break; case "ECHEC": if ($action == "integrer") { print "<hr />\n\t\t\t\t\t<span class='msg-perio'>" . $msg[z3950_integr_not_echec] . "</span>"; } break; } if ($integration_OK == "PASFAIT") { echo $notice->get_form("./catalog.php?categ=z3950&" . "znotices_id={$znotices_id}&last_query_id={$last_query_id}&action=integrer&source=form&" . "tri1={$tri1}&tri2={$tri2}", $id_notice, 'link'); } if ($integration_OK == "OK" | $integration_OK == "EXISTAIT" | $integration_OK == "UPDATE_OK") { print "<hr />\n\t\t\t\t\t<span class='right'><a id='liensuite' href='./catalog.php?categ=z3950&action=display&last_query_id=" . $last_query_id . "&tri1=auteur&tri2=auteur'>" . $msg[z3950_retour_a_resultats] . "</a></span>"; print "<script type='text/javascript'>document.getElementById('liensuite').focus();</script>"; //$nex = new exemplaire('', 0, $num_notice); //$nex->zexpl_form ('./catalog.php?categ=z3950&znotices_id='.$znotices_id.'&last_query_id='.$last_query_id.'&action=integrerexpl¬ice_nbr='.$num_notice.'&tri1='.$tri1.'&tri2='.$tri2); } } /* fin while */
$notice_suite = mysql_fetch_object($result_suite); $notice->bulletin_id = $notice_suite->bulletin_id; $notice->bulletin_notice = $notice_suite->bulletin_notice; $link_bulletin = './catalog.php?categ=serials&sub=bulletinage&action=view&bul_id=' . $notice->bulletin_id; $display = new mono_display($notice, 6, $link_bulletin, 1, $link_expl, '', $link_explnum, 1, 0, 1, 1, "", 1); $notice_display = $display->result; } } } else { $integrate = false; } if ($integrate == false || $force == 1) { $z = new z3950_notice("unimarc", $infos['notice'], $infos['source_id']); $z->libelle_form = isset($notice_id) ? $msg[notice_connecteur_remplace_catal] : ''; if ($z->bibliographic_level == "a" && $z->hierarchic_level == "2") { $form = $z->get_form("catalog.php?categ=search&mode=7&sub=integre&action=record" . $notice_id_info . "&item={$item}", 0, 'button', true); } else { $form = $z->get_form("catalog.php?categ=search&mode=7&sub=integre&action=record" . $notice_id_info . "&item={$item}", 0, 'button'); } if (isset($notice_id)) { $form = str_replace("<!--!!form_title!!-->", "<h3>" . sprintf($msg["notice_replace_external_action"], $notice_id, $item) . "</h3>", $form); } else { $form = str_replace("<!--!!form_title!!-->", "<h3>" . sprintf($msg["connecteurs_integrate"], $item) . "</h3>", $form); } $form = str_replace("<!--form_suite-->", "<input type='hidden' name='serialized_search' value='" . htmlentities($sc->serialize_search(), ENT_QUOTES, $charset) . "'/><input type='hidden' name='page' value='" . htmlentities($page, ENT_QUOTES, $charset) . "'/>", $form); print $form; } else { $tab = new stdClass(); $tab->POST = $_POST; $tab->GET = $_GET; $force_url = htmlentities(serialize($tab), ENT_QUOTES, $charset);
require_once "{$class_path}/serials.class.php"; if ($pmb_prefill_cote) { require_once "./catalog/expl/{$pmb_prefill_cote}"; } else { require_once "./catalog/expl/custom_no_cote.inc.php"; } // page de catalogage //Récupération des éléments de la suggestion $sug = new suggestions($id_sug); if ($sug->sugg_noti_unimarc) { require_once "{$class_path}/z3950_notice.class.php"; //si on on une notice unimarc stockée, on la traite $z = new z3950_notice("unimarc", $sug->sugg_noti_unimarc); $z->message_retour = $msg[76]; if ($z->bibliographic_level == "a" && $z->hierarchic_level == "2") { $form = $z->get_form("acquisition.php?categ=sug&action=record_uni&id_bibli={$id_bibli}&id_sug=" . $sug->id_suggestion, 0, 'button', true); } else { $form = $z->get_form("acquisition.php?categ=sug&action=record_uni&id_bibli={$id_bibli}&id_sug=" . $sug->id_suggestion, 0, 'button'); } $form = str_replace("<!--!!form_title!!-->", "<h3>" . $msg['acquisition_catalogue_uni'] . " : " . htmlentities($sug->titre, ENT_QUOTES, $charset) . "</h3>", $form); print $form; } else { // si seulement un isbn, recherche si la notice est déjà existante pour dédoublonner if (!$id && $cod) { $id = notice::get_notice_id_from_cb($cod); } // affichage du form de création/modification d'une notice $myNotice = new notice($id, $cod); if (!$myNotice->id) { $myNotice->tit1 = $sug->titre; $myNotice->code = $sug->code;
function get_notice_externe($notice_id) { global $charset, $msg; $memo = array(); $notice_extern_to_memo = array(); $notice_uni = $this->info['notice_base']; $req = "select * from notices where notice_id=" . $notice_id . " "; $resultat = pmb_mysql_query($req); if ($r = pmb_mysql_fetch_object($resultat)) { $code = $r->code; $notice_extern = $this->info['harvest']->havest_notice($code, $notice_id); // printr($notice_extern); // printr($notice_uni); $cpt = 0; foreach ($notice_extern as $contens) { $cpt++; $profil = $this->info['profil']->info['fields'][$contens['xml_id']]; // $pmb_fields=$this->info['harvest']->fields_id[$contens['xml_id']]; //printr($pmb_fields); $harvest = $this->info['harvest']->info['fields'][$contens['xml_id']]; if ($profil) { if ($profil['flagtodo'] == 1) { // on remplace les champs par les nouvelles valeurs foreach ($notice_uni['f'] as $index => $uni_field) { // printr($contens); // printr($uni_field); if ($contens['pmb_unimacfield'] && $uni_field['c'] == $contens['pmb_unimacfield'] && $contens['pmb_unimacsubfield']) { // si champ et sous champ, on delete les anciens champs/sous-champ foreach ($uni_field['s'] as $cpt => $ss_field) { if ($ss_field['c'] == $contens['pmb_unimacsubfield']) { array_splice($notice_uni['f'][$index]['s'], $cpt, 1); } } if (!count($uni_field['s'])) { array_splice($notice_uni['f'], $index, 1); } } elseif ($contens['pmb_unimacfield'] && $uni_field['c'] == $contens['pmb_unimacfield']) { // si pas de sous champ on efface tout array_splice($notice_uni['f'], $index, 1); } } } if ($profil['flagtodo'] == 1 || $profil['flagtodo'] == 2) { $notice_extern_to_memo[] = $contens; } } } //printr($notice_uni); //printr($notice_extern_to_memo); // Pour tout les champs nouveau à insérer $memo_prev = array(); foreach ($notice_extern_to_memo as $contens) { $nb = count($notice_uni['f']); $flag_create_unimacfield = 0; if ($contens['num_source'] != $memo_prev['num_source']) { $flag_create_unimacfield = 1; } if ($contens['pmb_unimacfield'] != $memo_prev['pmb_unimacfield']) { $flag_create_unimacfield = 1; } if ($contens['field_order'] != $memo_prev['field_order']) { $flag_create_unimacfield = 1; } if ($flag_create_unimacfield) { $index = $nb; } else { $index = $memo_prev['i']; } $notice_uni['f'][$index]['c'] = $contens['pmb_unimacfield']; $notice_uni['f'][$index]['ind'] = $contens['field_ind']; if ($contens['pmb_unimacsubfield']) { $sschamp = $contens['pmb_unimacsubfield']; } else { $sschamp = $contens['usubfield']; } $nb_ss = count($notice_uni['f'][$index]['s']); $notice_uni['f'][$index]['s'][$nb_ss]['c'] = $sschamp; $notice_uni['f'][$index]['s'][$nb_ss]['value'] = $contens['value']; $memo_prev = $contens; $memo_prev['i'] = $index; // $memo de l'enregistrement en cours // printr($memo_prev); } } else { //notice inexistante return ""; } // printr($notice_uni); // conversion du tableau en xml $export = new export($notice_id); $export->xml_array = $notice_uni; $export->toxml(); $notice_xml = $export->notice; // conversion du xml en unimarc $xml_unimarc = new xml_unimarc(); $xml_unimarc->XMLtoiso2709_notice($notice_xml, $charset); $notice = $xml_unimarc->notices_[0]; $z = new z3950_notice("unimarc", $notice); $z->libelle_form = $msg["notice_connecteur_remplace_catal"]; if ($z->bibliographic_level == "a" && $z->hierarchic_level == "2") { // article //$form=$z->get_form("catalog.php?categ=update&id=".$notice_id,$notice_id,'button',true); } else { $form = $z->get_form("catalog.php?categ=harvest&action=record¬ice_id=" . $notice_id, $notice_id, 'button'); } $form = str_replace("<!--!!form_title!!-->", "<h3>" . sprintf($msg["harvest_notice_build_title"], $notice_id, $item) . "</h3>", $form); print $form; }
function catalog() { global $msg, $charset; global $id_lig, $serialized_search; $lg = new lignes_actes($id_lig); $taec = explode("\r\n", $lg->libelle); $z = new z3950_notice('from_scratch'); $z->libelle_form = ''; $z->bibliographic_level = 'm'; $z->hierarchic_level = '0'; //titre sur 1ere ligne $z->titles = array(0 => $taec[0]); $z->serie = ''; $z->nbr_in_serie = ''; //Auteur sur 2eme ligne (Entree, rejete) $taec_a = explode(',', $taec[1]); $z->aut_array[0] = array('entree' => $taec_a[0], 'rejete' => $taec_a[1], 'date' => '', 'type_auteur' => '70', 'fonction' => $value_deflt_fonction, 'id' => 0, 'responsabilite' => 0); //Editeur sur 3eme ligne (Ville : Nom, Annee) $taec_e = explode(':', $taec[2]); $taec_e1 = explode(',', $taec_e[1]); $z->editors[0] = array('name' => trim($taec_e1[0]), 'ville' => trim($taec_e[0]), 'id' => 0); //Collection sur 4eme ligne $z->collection = array('name' => trim($taec[3]), 'id' => 0); $z->nbr_in_collection = ''; $z->year = trim($taec_e1[1]); $z->mention_edition = ''; $z->isbn = $lg->code; $z->page_nbr = ''; $z->illustration = ''; $z->prix = $lg->prix; $z->accompagnement = ''; $z->size = ''; $z->general_note = ''; $z->content_note = ''; $z->abstract_note = ''; $z->dewey = array(); $z->free_index = ''; $z->tu_500 = array(); $z->language_code = array(0 => $value_deflt_lang); $z->original_language_code = array(); $z->link_url = ''; $z->link_format = ''; $z->document_type = $xmlta_doctype; $z->perio_titre = array(); $z->perio_issn = array(); $z->bull_mention = array(); $z->bull_titre = array(); $z->bull_num = array(); $z->bt_integr_value = $msg[77]; $z->bt_undo_value = $msg[76]; $z->bt_undo_action = 'history.go(-1);'; $z->message_retour = $msg[654]; $form = $z->get_form("acquisition.php?categ=ach&sub=recept&action=record", 0, false); $form = str_replace("<!--!!form_title!!-->", "<h3>" . htmlentities($msg[270], ENT_QUOTES, $charset) . "</h3>", $form); $form = str_replace("<!--form_suite-->", "<input type='hidden' name='id_lig' value='" . $id_lig . "' /><!--form_suite-->", $form); $form = str_replace("<!--form_suite-->", "<input type='hidden' name='serialized_search' value='" . stripslashes($serialized_search) . "' /><!--form_suite-->", $form); print $form; }