require_once $base_path . "/catalog/z3950/" . $z3950_import_modele; } else { error_message("", sprintf($msg["admin_error_file_import_modele_z3950"], $z3950_import_modele), 1, "./admin.php?categ=param"); exit; } } else { require_once $base_path . "/catalog/z3950/func_other.inc.php"; } print "<form class='form-{$current_module}' name='back' method=\"post\" action=\"catalog.php?categ=search&mode=7&sub=launch\">\n\t<input type='hidden' name='serialized_search' value='" . htmlentities(stripslashes($serialized_search), ENT_QUOTES, $charset) . "'/>\n\t<input type='submit' name='ok' class='bouton' value='" . $msg["connecteurs_back_to_list"] . "' /> \n</form>\n<script type='text/javascript'>\n\tfunction force_integer(ext_id){\n\t\tvar ajax = new http_request();\n\t\tajax.request('" . $base_path . "/ajax.php?module=catalog&categ=force_integer&item='+ext_id,true,'&serialized_search=" . $sc->serialize_search() . "&page=" . $page . "',true,integer_callback);\n\t}\n\t\n\tfunction integer_callback(response){\n\t\tdata = eval('('+response+')');\n\t\tvar div = document.createElement('div');\n\t\tdiv.setAttribute('id','notice_externe_'+data.id);\n\t\tdiv.innerHTML = data.html;\n\t\tdocument.getElementById('notice_externe_'+data.id).parentNode.replaceChild(div,document.getElementById('notice_externe_'+data.id));\n\t}\n</script>\n"; if (is_array($external_notice_to_integer) && count($external_notice_to_integer)) { foreach ($external_notice_to_integer as $external_notice) { //Construction de la notice UNIMARC $infos = entrepot_to_unimarc($external_notice); $biblio_notice = ""; if ($infos['notice']) { $z = new z3950_notice("unimarc", $infos['notice'], $infos['source_id']); if ($z->bibliographic_level == "a" && $z->hierarchic_level == "2") { $biblio_notice = "art"; } if ($pmb_notice_controle_doublons != 0) { $sign = new notice_doublon(true, $infos['source_id']); $signature = $sign->gen_signature($external_notice); $requete = "select signature, niveau_biblio ,niveau_hierar ,notice_id from notices where signature='{$signature}'"; $result = mysql_query($requete); if ($dbls = mysql_num_rows($result)) { //affichage de l'erreur, en passant tous les param postes (serialise) pour l'eventuel forcage require_once "{$class_path}/mono_display.class.php"; print "\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t<div id='notice_externe_" . $external_notice . "'>\n\t\t\t\t\t\t<div class='erreur'>{$msg['540']}</div>\n\t\t\t\t\t\t<script type='text/javascript' src='./javascript/tablist.js'></script>\n\t\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\t\t<div class='colonne10'>\n\t\t\t\t\t\t\t\t<img src='./images/error.gif' align='left' />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class='colonne80'>\n\t\t\t\t\t\t\t\t<strong>" . $msg["gen_signature_erreur_similaire"] . "</strong>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\t\t<input type='button' class='bouton' onclick='force_integer(" . $external_notice . ")' value=' " . htmlentities($msg["gen_signature_forcage"], ENT_QUOTES, $charset) . " '/>\n\t\t\t\t\t\t</div>"; if ($dbls < $nb_per_page_search) { $maxAffiche = $dbls; echo "<div class='row'><strong>" . sprintf($msg["gen_signature_erreur_similaire_nb"], $dbls, $dbls) . "</strong></div>";
function doSync($id_connector, $id_source, $auto_import = false, $id_tache = '', $callback_listen_command = NULL, $callback_deals_command = NULL) { global $base_path, $dbh, $PMBuserid, $PMBusername, $msg, $charset; if (!$id_connector || !$id_source) { return array(); } if (SESSrights & ADMINISTRATION_AUTH) { $this->callback_listen_command = $callback_listen_command; $this->callback_deals_command = $callback_deals_command; $result = array(); $this->id_source = $id_source; $this->id_tache = $id_tache; $contrs = new connecteurs(); require_once $base_path . "/admin/connecteurs/in/" . $contrs->catalog[$id_connector]["PATH"] . "/" . $contrs->catalog[$id_connector]["NAME"] . ".class.php"; eval("\$conn=new " . $contrs->catalog[$id_connector]["NAME"] . "(\"" . $base_path . "/admin/connecteurs/in/" . $contrs->catalog[$id_connector]["PATH"] . "\");"); //Vérification qu'il n'y a pas de synchronisation en cours... $is_already_sync = false; $recover_env = ""; $recover = false; $requete = "select * from source_sync where source_id={$id_source}"; $resultat = mysql_query($requete, $dbh); if (mysql_num_rows($resultat)) { $rs_s = mysql_fetch_object($resultat); if (!$rs_s->cancel) { $result[] = $conn->msg["connecteurs_sync_currentexists"]; $is_already_sync = true; } else { $recover = true; $recover_env = $rs_s->env; $env = array(); } } else { $env = $conn->get_maj_environnement($id_source); } if (!$is_already_sync) { if (!$recover) { $requete = "insert into source_sync (source_id,nrecu,ntotal,date_sync) values({$id_source},0,0,now())"; $r = mysql_query($requete, $dbh); } else { $requete = "update source_sync set cancel=0 where source_id={$id_source}"; $r = mysql_query($requete, $dbh); } if ($r) { $n_maj = $conn->maj_entrepot($id_source, array(&$this, "callback_progress"), $recover, $recover_env); $result[] = sprintf($msg["connecteurs_count_notices"], $n_maj); $result[] = $conn->error_message; if (!$conn->error) { $this->callback_progress(1, $n_maj, $n_maj); $percent = 1; $requete = "update source_sync set percent=" . round($percent * 100) . " where source_id={$id_source}"; $r = mysql_query($requete, $dbh); $requete = "delete from source_sync where source_id=" . $id_source; mysql_query($requete); $requete = "update connectors_sources set last_sync_date=now() where source_id=" . $id_source; mysql_query($requete, $dbh); } else { if ($conn->break_maj($id_source)) { $requete = "delete from source_sync where source_id=" . $id_source; } else { $requete = "update source_sync set cancel=2 where source_id=" . $id_source; } mysql_query($requete, $dbh); $result[] = $conn->error_message; } } else { $result[] = mysql_error(); } } else { $result[] = $msg["connecteurs_sync_currentexists"]; } //si l'import automatique est activé if ($auto_import) { //on va chercher les notices non intégrées $query = "select distinct entrepot_source_" . $id_source . ".recid from entrepot_source_" . $id_source . " left join notices_externes on notices_externes.recid = concat(connector_id,' " . $id_source . " ',ref) where num_notice is null"; $result = mysql_query($query); if (mysql_num_rows($result)) { while ($row = mysql_fetch_object($result)) { $infos = entrepot_to_unimarc($row->recid); if ($infos['notice']) { $z = new z3950_notice("unimarc", $infos['notice'], $infos['source_id']); if ($pmb_notice_controle_doublons != 0) { $sign = new notice_doublon(true, $infos['source_id']); $signature = $sign->gen_signature($row->recid); } else { $signature = ""; } $z->signature = $signature; if ($infos['notice']) { $z->notice = $infos['notice']; } if ($infos['source_id']) { $z->source_id = $infos['source_id']; } $z->var_to_post(); $ret = $z->insert_in_database(false); $id_notice = $ret[1]; $rqt = "select recid from external_count where rid = '{$row->recid}'"; $res = mysql_query($rqt); if (mysql_num_rows($res)) { $recid = mysql_result($res, 0, 0); } $req = "insert into notices_externes set num_notice = '" . $id_notice . "', recid = '" . $recid . "'"; mysql_query($req); } } } } return $result; } else { return array(); } }
//$pb = 1; //$rec=""; } } if ($pb) { $messageframe = $msg["z3950_reception_notice"] . $messageframe; } else { $messageframe = $msg["z3950_reception_notice"] . $messageframe; } affiche_jsscript($messageframe, "", $bib_id); if ($rec != "") { $total++; //if ($total % 10 == 0) { // affiche_jsscript ($msg["z3950_reception_notice"]." $total / $lim_recherche", "#99FF99", $bib_id); //} $notice = new z3950_notice($formato[$bib_id], $rec); $isbd_affichage = $notice->get_isbd_display(); $lu_isbn = $isbd_affichage[0]; $lu_titre = $isbd_affichage[1]; $lu_auteur = $isbd_affichage[2]; $lu_isbd = $isbd_affichage[3]; $sql2 = "insert into z_notices (znotices_id, znotices_query_id, znotices_bib_id, isbn, titre, auteur, isbd, z_marc) "; $sql2 .= "values(0,'{$last_query_id}', '{$bib_id}', '{$lu_isbn}', '" . addslashes($lu_titre) . "', '" . addslashes($lu_auteur) . "', '" . addslashes($lu_isbd) . "','" . addslashes($rec) . "') "; pmb_mysql_query($sql2); $ID_notice = pmb_mysql_insert_id(); } // fin du if qui vérifie que la notice n'est pas vide } // fin for yaz_close($id); $msg1 = str_replace("!!total!!", $total, $msg[z3950_recup_fini]);
function get_form($action, $id_notice = 0, $retour = 'link', $article = false) { // construit le formulaire de catalogage pré-rempli global $msg, $dbh, $charset, $current_module; global $include_path; global $base_path; global $znotices_id; global $item; $fonction = new marc_list('function'); $this->action = $action; include "{$include_path}/templates/z3950_form.tpl.php"; global $bt_undo; // mise à jour de l'entête du formulaire $form_notice = str_replace('!!libelle_form!!', $this->libelle_form, $form_notice); // mise à jour des flags de niveau hiérarchique $form_notice = str_replace('!!b_level!!', $this->bibliographic_level, $form_notice); $form_notice = str_replace('!!h_level!!', $this->hierarchic_level, $form_notice); for ($i = 0; $i < 4; $i++) { z3950_notice::substitute("title_{$i}", $this->titles[$i], $ptab[0]); } z3950_notice::substitute("serie", $this->serie, $ptab[0]); z3950_notice::substitute("nbr_in_serie", $this->nbr_in_serie, $ptab[0]); $form_notice = str_replace('!!tab0!!', $ptab[0], $form_notice); // mise à jour de l'onglet 1 // constitution de la mention de responsabilité $nb_autres_auteurs = 0; $nb_auteurs_secondaires = 0; //print "<pre>";print_r($this->aut_array);print "</pre>"; for ($as = 0; $as < sizeof($this->aut_array); $as++) { if ($this->aut_array[$as]["responsabilite"] === 0) { $numrows = 0; if ($this->aut_array[$as]["date"]) { $sql_author_find = "SELECT author_id, author_name, author_rejete, author_date FROM authors WHERE author_name = '" . addslashes($this->aut_array[$as]["entree"]) . "' AND author_rejete = '" . addslashes($this->aut_array[$as]["rejete"]) . "' AND author_type = '" . $this->aut_array[$as]["type_auteur"] . "' AND author_date ='" . addslashes($this->aut_array[$as]["date"]) . "'"; $res = pmb_mysql_query($sql_author_find); $numrows = pmb_mysql_num_rows($res); } if (!$numrows) { $sql_author_find = "SELECT author_id, author_name, author_rejete, author_date FROM authors WHERE author_name = '" . addslashes($this->aut_array[$as]["entree"]) . "' AND author_rejete = '" . addslashes($this->aut_array[$as]["rejete"]) . "' AND author_type = '" . $this->aut_array[$as]["type_auteur"] . "'"; $res = pmb_mysql_query($sql_author_find); $numrows = pmb_mysql_num_rows($res); } if ($numrows == 1) { $existing_author = pmb_mysql_fetch_array($res); $existing_author_id = $existing_author["author_id"]; } else { $existing_author_id = 0; } z3950_notice::substitute("author0_type_use_existing", $existing_author_id ? "checked" : "", $ptab[1]); z3950_notice::substitute("author0_type_insert_new", $existing_author_id ? "" : "checked", $ptab[1]); if ($existing_author_id) { z3950_notice::substitute("f_author_name_0_existing", $existing_author["author_name"] . ", " . $existing_author["author_rejete"] . ($existing_author["author_date"] ? " (" . $existing_author["author_date"] . ")" : ""), $ptab[1]); z3950_notice::substitute("f_aut0_existing_id", $existing_author_id, $ptab[1]); } else { z3950_notice::substitute("f_author_name_0_existing", '', $ptab[1]); z3950_notice::substitute("f_aut0_existing_id", 0, $ptab[1]); } z3950_notice::substitute("author_name_0", $this->aut_array[$as]["entree"], $ptab[1]); z3950_notice::substitute("author_rejete_0", $this->aut_array[$as]["rejete"], $ptab[1]); z3950_notice::substitute("author_date_0", $this->aut_array[$as]["date"], $ptab[1]); z3950_notice::substitute("author_function_0", $this->aut_array[$as]["fonction"], $ptab[1]); z3950_notice::substitute("author_function_label_0", $fonction->table[$this->aut_array[$as]["fonction"]], $ptab[1]); z3950_notice::substitute("author_lieu_0", $this->aut_array[$as]["lieu"], $ptab[1]); z3950_notice::substitute("author_pays_0", $this->aut_array[$as]["pays"], $ptab[1]); z3950_notice::substitute("author_comment_0", $this->aut_array[$as]["author_comment"], $ptab[1]); z3950_notice::substitute("author_ville_0", $this->aut_array[$as]["ville"], $ptab[1]); z3950_notice::substitute("author_subdivision_0", $this->aut_array[$as]["subdivision"], $ptab[1]); z3950_notice::substitute("author_numero_0", $this->aut_array[$as]["numero"], $ptab[1]); z3950_notice::substitute("author_web_0", $this->aut_array[$as]["web"], $ptab[1]); z3950_notice::substitute("authority_number_0", $this->aut_array[$as]["authority_number"], $ptab[1]); for ($type = 70; $type <= 72; $type++) { if ($this->aut_array[$as]["type_auteur"] == $type) { $sel = " selected"; } else { $sel = ""; } z3950_notice::substitute("author_type_" . $type . "_0", $sel, $ptab[1]); if ($this->aut_array[$as]["type_auteur"] == '70') { z3950_notice::substitute('display_0', 'none', $ptab[1]); } else { z3950_notice::substitute('display_0', '', $ptab[1]); } } } if ($this->aut_array[$as]["responsabilite"] == 1) { if ($this->aut_array[$as]["entree"] == "") { continue; } $ptab_aut_autres = str_replace('!!iaut!!', $nb_autres_auteurs, $ptab[11]); $numrows = 0; if ($this->aut_array[$as]["date"]) { $sql_author_find = "SELECT author_id, author_name, author_rejete, author_date FROM authors WHERE author_name = '" . addslashes($this->aut_array[$as]["entree"]) . "' AND author_rejete = '" . addslashes($this->aut_array[$as]["rejete"]) . "' AND author_type = '" . $this->aut_array[$as]["type_auteur"] . "' AND author_date ='" . addslashes($this->aut_array[$as]["date"]) . "'"; $res = pmb_mysql_query($sql_author_find); $numrows = pmb_mysql_num_rows($res); } if (!$numrows) { $sql_author_find = "SELECT author_id, author_name, author_rejete, author_date FROM authors WHERE author_name = '" . addslashes($this->aut_array[$as]["entree"]) . "' AND author_rejete = '" . addslashes($this->aut_array[$as]["rejete"]) . "' AND author_type = '" . $this->aut_array[$as]["type_auteur"] . "'"; $res = pmb_mysql_query($sql_author_find); $numrows = pmb_mysql_num_rows($res); } if ($numrows == 1) { $existing_author = pmb_mysql_fetch_array($res); $existing_author_id = $existing_author["author_id"]; } else { $existing_author_id = 0; } z3950_notice::substitute("author1_type_use_existing_", $existing_author_id ? "checked" : "", $ptab_aut_autres); z3950_notice::substitute("author1_type_insert_new_", $existing_author_id ? "" : "checked", $ptab_aut_autres); if ($existing_author_id) { z3950_notice::substitute("f_aut1", $existing_author["author_name"] . ", " . $existing_author["author_rejete"] . ($existing_author["author_date"] ? " (" . $existing_author["author_date"] . ")" : ""), $ptab_aut_autres); z3950_notice::substitute("f_aut1_id", $existing_author_id, $ptab_aut_autres); } else { z3950_notice::substitute("f_aut1", '', $ptab_aut_autres); z3950_notice::substitute("f_aut1_id", '', $ptab_aut_autres); } z3950_notice::substitute("author_name_1", $this->aut_array[$as]["entree"], $ptab_aut_autres); z3950_notice::substitute("author_rejete_1", $this->aut_array[$as]["rejete"], $ptab_aut_autres); z3950_notice::substitute("author_date_1", $this->aut_array[$as]["date"], $ptab_aut_autres); z3950_notice::substitute("author_function_1", $this->aut_array[$as]["fonction"], $ptab_aut_autres); z3950_notice::substitute("author_function_label_1", $fonction->table[$this->aut_array[$as]["fonction"]], $ptab_aut_autres); z3950_notice::substitute("author_lieu_1", $this->aut_array[$as]["lieu"], $ptab_aut_autres); z3950_notice::substitute("author_pays_1", $this->aut_array[$as]["pays"], $ptab_aut_autres); z3950_notice::substitute("author_comment_1", $this->aut_array[$as]["author_comment"], $ptab_aut_autres); z3950_notice::substitute("author_ville_1", $this->aut_array[$as]["ville"], $ptab_aut_autres); z3950_notice::substitute("author_subdivision_1", $this->aut_array[$as]["subdivision"], $ptab_aut_autres); z3950_notice::substitute("author_numero_1", $this->aut_array[$as]["numero"], $ptab_aut_autres); z3950_notice::substitute("author_web_1", $this->aut_array[$as]["web"], $ptab_aut_autres); z3950_notice::substitute("authority_number_1", $this->aut_array[$as]["authority_number"], $ptab_aut_autres); for ($type = 70; $type <= 72; $type++) { if ($this->aut_array[$as]["type_auteur"] == $type) { $sel = " selected"; } else { $sel = ""; } z3950_notice::substitute("author_type_" . $type . "_1", $sel, $ptab_aut_autres); if ($this->aut_array[$as]["type_auteur"] == '70') { z3950_notice::substitute('display_1' . $nb_autres_auteurs, 'none', $ptab_aut_autres); } else { z3950_notice::substitute('display_1' . $nb_autres_auteurs, '', $ptab_aut_autres); } } $autres_auteurs .= $ptab_aut_autres; $nb_autres_auteurs++; } if ($this->aut_array[$as]["responsabilite"] == 2) { if ($this->aut_array[$as]["entree"] == "") { continue; } $ptab_aut_autres = str_replace('!!iaut!!', $nb_auteurs_secondaires, $ptab[12]); $numrows = 0; if ($this->aut_array[$as]["date"]) { $sql_author_find = "SELECT author_id, author_name, author_rejete, author_date FROM authors WHERE author_name = '" . addslashes($this->aut_array[$as]["entree"]) . "' AND author_rejete = '" . addslashes($this->aut_array[$as]["rejete"]) . "' AND author_type = '" . $this->aut_array[$as]["type_auteur"] . "' AND author_date ='" . addslashes($this->aut_array[$as]["date"]) . "'"; $res = pmb_mysql_query($sql_author_find); $numrows = pmb_mysql_num_rows($res); } if (!$numrows) { $sql_author_find = "SELECT author_id, author_name, author_rejete, author_date FROM authors WHERE author_name = '" . addslashes($this->aut_array[$as]["entree"]) . "' AND author_rejete = '" . addslashes($this->aut_array[$as]["rejete"]) . "' AND author_type = '" . $this->aut_array[$as]["type_auteur"] . "'"; $res = pmb_mysql_query($sql_author_find); $numrows = pmb_mysql_num_rows($res); } if ($numrows == 1) { $existing_author = pmb_mysql_fetch_array($res); $existing_author_id = $existing_author["author_id"]; } else { $existing_author_id = 0; } z3950_notice::substitute("author2_type_use_existing_", $existing_author_id ? "checked" : "", $ptab_aut_autres); z3950_notice::substitute("author2_type_insert_new_", $existing_author_id ? "" : "checked", $ptab_aut_autres); if ($existing_author_id) { z3950_notice::substitute("f_aut2", $existing_author["author_name"] . ", " . $existing_author["author_rejete"] . ($existing_author["author_date"] ? " (" . $existing_author["author_date"] . ")" : ""), $ptab_aut_autres); z3950_notice::substitute("f_aut2_id", $existing_author_id, $ptab_aut_autres); } else { z3950_notice::substitute("f_aut2", '', $ptab_aut_autres); z3950_notice::substitute("f_aut2_id", 0, $ptab_aut_autres); } z3950_notice::substitute("author_name_2", $this->aut_array[$as]["entree"], $ptab_aut_autres); z3950_notice::substitute("author_rejete_2", $this->aut_array[$as]["rejete"], $ptab_aut_autres); z3950_notice::substitute("author_date_2", $this->aut_array[$as]["date"], $ptab_aut_autres); z3950_notice::substitute("author_function_2", $this->aut_array[$as]["fonction"], $ptab_aut_autres); z3950_notice::substitute("author_function_label_2", $fonction->table[$this->aut_array[$as]["fonction"]], $ptab_aut_autres); z3950_notice::substitute("author_lieu_2", $this->aut_array[$as]["lieu"], $ptab_aut_autres); z3950_notice::substitute("author_pays_2", $this->aut_array[$as]["pays"], $ptab_aut_autres); z3950_notice::substitute("author_comment_2", $this->aut_array[$as]["author_comment"], $ptab_aut_autres); z3950_notice::substitute("author_ville_2", $this->aut_array[$as]["ville"], $ptab_aut_autres); z3950_notice::substitute("author_subdivision_2", $this->aut_array[$as]["subdivision"], $ptab_aut_autres); z3950_notice::substitute("author_numero_2", $this->aut_array[$as]["numero"], $ptab_aut_autres); z3950_notice::substitute("author_web_2", $this->aut_array[$as]["web"], $ptab_aut_autres); z3950_notice::substitute("authority_number_2", $this->aut_array[$as]["authority_number"], $ptab_aut_autres); for ($type = 70; $type <= 72; $type++) { if ($this->aut_array[$as]["type_auteur"] == $type) { $sel = " selected"; } else { $sel = ""; } z3950_notice::substitute("author_type_" . $type . "_2", $sel, $ptab_aut_autres); if ($this->aut_array[$as]["type_auteur"] == '70') { z3950_notice::substitute('display_2' . $nb_auteurs_secondaires, 'none', $ptab_aut_autres); } else { z3950_notice::substitute('display_2' . $nb_auteurs_secondaires, '', $ptab_aut_autres); } } $auteurs_secondaires .= $ptab_aut_autres; $nb_auteurs_secondaires++; } } // au cas ou pas d'auteur principal : on fait le ménage dans le formulaire z3950_notice::substitute("author_name_0", "", $ptab[1]); z3950_notice::substitute("author_rejete_0", "", $ptab[1]); z3950_notice::substitute("author_date_0", "", $ptab[1]); z3950_notice::substitute("author_function_0", "", $ptab[1]); z3950_notice::substitute("author_function_label_0", "", $ptab[1]); z3950_notice::substitute("f_author_name_0_existing", "", $ptab[1]); z3950_notice::substitute("f_aut0_existing_id", "", $ptab[1]); z3950_notice::substitute("author0_type_use_existing", "", $ptab[1]); z3950_notice::substitute("author0_type_insert_new", "checked", $ptab[1]); z3950_notice::substitute("author_lieu_0", "", $ptab[1]); z3950_notice::substitute("author_pays_0", "", $ptab[1]); z3950_notice::substitute("author_comment_0", "", $ptab[1]); z3950_notice::substitute("author_ville_0", "", $ptab[1]); z3950_notice::substitute("author_subdivision_0", "", $ptab[1]); z3950_notice::substitute("author_numero_0", "", $ptab[1]); z3950_notice::substitute("author_web_0", "", $ptab[1]); z3950_notice::substitute("authority_number_0", "", $ptab[1]); z3950_notice::substitute('display_0', 'none', $ptab[1]); $ptab[1] = str_replace('!!max_aut1!!', $nb_autres_auteurs + 1, $ptab[1]); $ptab[1] = str_replace('!!iaut_added1!!', $nb_autres_auteurs, $ptab[1]); $ptab[1] = str_replace('!!max_aut2!!', $nb_auteurs_secondaires + 1, $ptab[1]); $ptab[1] = str_replace('!!iaut_added2!!', $nb_auteurs_secondaires, $ptab[1]); $ptab[1] = str_replace('!!autres_auteurs!!', $autres_auteurs, $ptab[1]); $ptab[1] = str_replace('!!auteurs_secondaires!!', $auteurs_secondaires, $ptab[1]); $form_notice = str_replace('!!tab1!!', $ptab[1], $form_notice); //Editeur 1 //On tente avec toutes les infos if ($this->editors[0]['name'] && $this->editors[0]['ville']) { $sql_find_publisher = "SELECT ed_id,ed_ville,ed_name FROM publishers WHERE ed_name = '" . addslashes($this->editors[0]['name']) . "' AND ed_ville = '" . addslashes($this->editors[0]['ville']) . "'"; $res = pmb_mysql_query($sql_find_publisher); if (pmb_mysql_num_rows($res) == 1) { $existing_publisher = pmb_mysql_fetch_array($res); $existing_publisher_id = $existing_publisher["ed_id"]; } } //Non? Le nom sans ville peut être alors? if (!$existing_publisher_id && $this->editors[0]['name']) { $sql_find_publisher = "SELECT ed_id,ed_ville,ed_name FROM publishers WHERE ed_name = '" . addslashes($this->editors[0]['name']) . "' AND ed_ville = ''"; $res = pmb_mysql_query($sql_find_publisher); if (pmb_mysql_num_rows($res) == 1) { $existing_publisher = pmb_mysql_fetch_array($res); $existing_publisher_id = $existing_publisher["ed_id"]; } } //Juste le nom alors? if (!$existing_publisher_id && $this->editors[0]['name'] && !$this->editors[0]['ville']) { $sql_find_publisher = "SELECT ed_id,ed_ville,ed_name FROM publishers WHERE ed_name = '" . addslashes($this->editors[0]['name']) . "'"; $res = pmb_mysql_query($sql_find_publisher); if (pmb_mysql_num_rows($res) == 1) { $existing_publisher = pmb_mysql_fetch_array($res); $existing_publisher_id = $existing_publisher["ed_id"]; } } if (!$existing_publisher_id) { $existing_publisher_id = 0; } z3950_notice::substitute("editor_type_use_existing", $existing_publisher_id ? 'checked' : '', $ptab[2]); z3950_notice::substitute("editor_type_insert_new", $existing_publisher_id ? '' : 'checked', $ptab[2]); if ($existing_publisher_id) { $editor = new editeur($existing_publisher_id); $editor_display = $editor->display; if (!$editor_display) { $info_ville = $existing_publisher["ed_ville"] ? ' (' . $existing_publisher["ed_ville"] . ')' : ""; $editor_display = $existing_publisher["ed_name"] . $info_ville; } z3950_notice::substitute("f_ed1", $editor_display, $ptab[2]); z3950_notice::substitute("f_ed1_id", $existing_publisher_id, $ptab[2]); } else { z3950_notice::substitute("f_ed1", '', $ptab[2]); z3950_notice::substitute("f_ed1_id", '', $ptab[2]); } z3950_notice::substitute("editor_name_0", $this->editors[0]['name'], $ptab[2]); z3950_notice::substitute("editor_ville_0", $this->editors[0]['ville'], $ptab[2]); //Editeur 2 //On tente avec toutes les infos if ($this->editors[1]['name'] && $this->editors[1]['ville']) { $sql_find_publisher2 = "SELECT ed_id,ed_ville,ed_name FROM publishers WHERE ed_name = '" . addslashes($this->editors[1]['name']) . "' AND ed_ville = '" . addslashes($this->editors[1]['ville']) . "'"; $res = pmb_mysql_query($sql_find_publisher2); if (pmb_mysql_num_rows($res) == 1) { $existing_publisher2 = pmb_mysql_fetch_array($res); $existing_publisher_id2 = $existing_publisher2["ed_id"]; } } //Non? Le nom sans ville peut être alors? if (!$existing_publisher_id2 && $this->editors[1]['name']) { $sql_find_publisher2 = "SELECT ed_id,ed_ville,ed_name FROM publishers WHERE ed_name = '" . addslashes($this->editors[1]['name']) . "' AND ed_ville = ''"; $res = pmb_mysql_query($sql_find_publisher2); if (pmb_mysql_num_rows($res) == 1) { $existing_publisher2 = pmb_mysql_fetch_array($res); $existing_publisher_id2 = $existing_publisher2["ed_id"]; } } //Juste le nom alors? if (!$existing_publisher_id2 && $this->editors[1]['name'] && !$this->editors[1]['ville']) { $sql_find_publisher2 = "SELECT ed_id,ed_ville,ed_name FROM publishers WHERE ed_name = '" . addslashes($this->editors[1]['name']) . "'"; $res = pmb_mysql_query($sql_find_publisher2); if (pmb_mysql_num_rows($res) == 1) { $existing_publisher2 = pmb_mysql_fetch_array($res); $existing_publisher_id2 = $existing_publisher2["ed_id"]; } } if (!$existing_publisher_id2) { $existing_publisher_id2 = 0; } z3950_notice::substitute("editor1_type_use_existing", $existing_publisher_id2 ? 'checked' : '', $ptab[2]); z3950_notice::substitute("editor1_type_insert_new", $existing_publisher_id2 ? '' : 'checked', $ptab[2]); if ($existing_publisher_id2) { $editor = new editeur($existing_publisher_id2); $editor_display = $editor->display; if (!$editor_display) { $info_ville = $existing_publisher2["ed_ville"] ? ' (' . $existing_publisher2["ed_ville"] . ')' : ""; $editor_display = $existing_publisher2["ed_name"] . $info_ville; } z3950_notice::substitute("f_ed11", $editor_display, $ptab[2]); z3950_notice::substitute("f_ed11_id", $existing_publisher_id2, $ptab[2]); } else { z3950_notice::substitute("f_ed11", '', $ptab[2]); z3950_notice::substitute("f_ed11_id", '', $ptab[2]); } z3950_notice::substitute("editor_name_1", $this->editors[1]['name'], $ptab[2]); z3950_notice::substitute("editor_ville_1", $this->editors[1]['ville'], $ptab[2]); //Collection if ($existing_publisher_id && $this->collection['name']) { $sql_collection_find = "SELECT collection_id, collection_name FROM collections WHERE collection_name = '" . addslashes($this->collection['name']) . "' AND collection_parent = '" . $existing_publisher_id . "'"; $res = pmb_mysql_query($sql_collection_find); if (pmb_mysql_num_rows($res) == 1) { $existing_collection = pmb_mysql_fetch_array($res); $existing_collection_id = $existing_collection["collection_id"]; } else { $existing_collection_id = 0; } } else { $existing_collection_id = 0; } z3950_notice::substitute("collection_type_use_existing", $existing_collection_id ? 'checked' : '', $ptab[2]); z3950_notice::substitute("collection_type_insert_new", $existing_collection_id ? '' : 'checked', $ptab[2]); if ($existing_collection_id) { z3950_notice::substitute("f_coll_existing", $existing_collection["collection_name"], $ptab[2]); z3950_notice::substitute("f_coll_existing_id", $existing_collection_id, $ptab[2]); } else { z3950_notice::substitute("f_coll_existing", '', $ptab[2]); z3950_notice::substitute("f_coll_existing_id", '0', $ptab[2]); } z3950_notice::substitute("collection_name", $this->collection['name'], $ptab[2]); z3950_notice::substitute("collection_issn", $this->collection['issn'], $ptab[2]); //Sous Collection if ($existing_collection_id && $this->subcollection['name']) { $sql_subcollection_find = "SELECT sub_coll_id, sub_coll_name FROM sub_collections WHERE sub_coll_name = '" . addslashes($this->subcollection['name']) . "' AND sub_coll_parent = '" . $existing_collection_id . "'"; $res = pmb_mysql_query($sql_subcollection_find) or die(pmb_mysql_error() . "<br />{$sql_subcollection_find}"); if (pmb_mysql_num_rows($res) == 1) { $existing_subcollection = pmb_mysql_fetch_array($res); $existing_subcollection_id = $existing_subcollection["sub_coll_id"]; } else { $existing_subcollection_id = 0; } } else { $existing_subcollection_id = 0; } z3950_notice::substitute("subcollection_type_use_existing", $existing_subcollection_id ? 'checked' : '', $ptab[2]); z3950_notice::substitute("subcollection_type_insert_new", $existing_subcollection_id ? '' : 'checked', $ptab[2]); if ($existing_subcollection_id) { z3950_notice::substitute("f_subcoll_existing", $existing_subcollection["sub_coll_name"], $ptab[2]); z3950_notice::substitute("f_subcoll_existing_id", $existing_subcollection_id, $ptab[2]); } else { z3950_notice::substitute("f_subcoll_existing", '', $ptab[2]); z3950_notice::substitute("f_subcoll_existing_id", '0', $ptab[2]); } z3950_notice::substitute("subcollection_name", $this->subcollection['name'], $ptab[2]); z3950_notice::substitute("subcollection_issn", $this->subcollection['issn'], $ptab[2]); z3950_notice::substitute("nbr_in_collection", $this->nbr_in_collection, $ptab[2]); z3950_notice::substitute("year", $this->year, $ptab[2]); z3950_notice::substitute("mention_edition", $this->mention_edition, $ptab[2]); $form_notice = str_replace('!!tab2!!', $ptab[2], $form_notice); z3950_notice::substitute("isbn", $this->isbn, $ptab[3]); $form_notice = str_replace('!!tab3!!', $ptab[3], $form_notice); z3950_notice::substitute("page_nbr", $this->page_nbr, $ptab[4]); z3950_notice::substitute("illustration", $this->illustration, $ptab[4]); z3950_notice::substitute("prix", $this->prix, $ptab[4]); z3950_notice::substitute("accompagnement", $this->accompagnement, $ptab[4]); z3950_notice::substitute("size", $this->size, $ptab[4]); $form_notice = str_replace('!!tab4!!', $ptab[4], $form_notice); z3950_notice::substitute("general_note", $this->general_note, $ptab[5]); z3950_notice::substitute("content_note", $this->content_note, $ptab[5]); z3950_notice::substitute("abstract_note", $this->abstract_note, $ptab[5]); $form_notice = str_replace('!!tab5!!', $ptab[5], $form_notice); // indexation interne $pclassement_sql = "SELECT * FROM pclassement"; $res = pmb_mysql_query($pclassement_sql); $pclassement_count = pmb_mysql_num_rows($res); if (!$pclassement_count) { $pclassement_count = 1; } if ($pclassement_count > 1) { $pclassements = array(); while ($row = pmb_mysql_fetch_assoc($res)) { $pclassements[] = array("id" => $row["id_pclass"], "name" => $row["name_pclass"]); } $pclassement_combobox = '<select name="f_indexint_new_pclass">'; foreach ($pclassements as $pclassement) { $pclassement_combobox .= '<option value="' . $pclassement["id"] . '">' . $pclassement["name"] . '</option>'; } $pclassement_combobox .= '</select>'; } else { $pclassement_combobox = ""; } $ptab[6] = str_replace("!!multiple_pclass_combo_box!!", $pclassement_combobox, $ptab[6]); $index_int_sql = "SELECT indexint_name, indexint_comment, indexint_id, name_pclass FROM indexint LEFT JOIN pclassement ON (pclassement.id_pclass = indexint.num_pclass) WHERE indexint_name = '" . addslashes($this->dewey[0]) . "'"; $res = pmb_mysql_query($index_int_sql, $dbh); $num_rows = pmb_mysql_num_rows($res); if ($num_rows == 1) { $the_row = pmb_mysql_fetch_assoc($res); z3950_notice::substitute("indexint", $the_row["indexint_name"] . ': ' . $the_row["indexint_comment"], $ptab[6]); z3950_notice::substitute("indexint_id", $the_row["indexint_id"], $ptab[6]); z3950_notice::substitute("indexint_type_use_existing", 'checked', $ptab[6]); z3950_notice::substitute("indexint_type_insert_new", '', $ptab[6]); z3950_notice::substitute("multiple_index_int_propositions", '', $ptab[6]); } else { if ($num_rows > 1) { $index_ints = array(); while ($row = pmb_mysql_fetch_assoc($res)) { $index_ints[] = array("id" => $row["indexint_id"], "name" => $row["indexint_name"], "comment" => $row["indexint_comment"], "pclass" => $row["name_pclass"]); } $form_indexint_proposition = "<ul>"; foreach ($index_ints as $index_int) { $form_indexint_proposition .= "<li><b>[" . $index_int["pclass"] . "]</b> " . $index_int["name"] . ": " . $index_int["comment"] . ' '; $jsaction = "document.getElementById('indexint_type_use_existing').checked=1; document.getElementById('f_indexint').value='" . addslashes($index_int["name"] . ' - ' . $index_int["comment"]) . "'; document.getElementById('f_indexint_id').value='" . addslashes($index_int["id"]) . "'"; $form_indexint_proposition .= '<input type="button" class="bouton" value="' . $msg["notice_integre_indexint_use"] . '" onclick="' . $jsaction . '">'; $form_indexint_proposition .= '</li>'; } $form_indexint_proposition .= "</ul>"; $ptab[6] = str_replace("!!multiple_index_int_propositions!!", $form_indexint_proposition, $ptab[6]); z3950_notice::substitute("indexint", "", $ptab[6]); z3950_notice::substitute("indexint_id", "", $ptab[6]); z3950_notice::substitute("indexint_type_use_existing", 'checked', $ptab[6]); z3950_notice::substitute("indexint_type_insert_new", '', $ptab[6]); } else { z3950_notice::substitute("indexint", "", $ptab[6]); z3950_notice::substitute("indexint_id", "", $ptab[6]); z3950_notice::substitute("indexint_type_use_existing", '', $ptab[6]); z3950_notice::substitute("indexint_type_insert_new", 'checked', $ptab[6]); z3950_notice::substitute("multiple_index_int_propositions", '', $ptab[6]); } } z3950_notice::substitute("indexint_new_name", $this->dewey[0], $ptab[6]); z3950_notice::substitute("indexint_new_comment", "", $ptab[6]); // indexation libre z3950_notice::substitute("f_free_index", $this->free_index, $ptab[6]); global $pmb_keyword_sep; $sep = "'{$pmb_keyword_sep}'"; if (!$pmb_keyword_sep) { $sep = "' '"; } if (ord($pmb_keyword_sep) == 0xa || ord($pmb_keyword_sep) == 0xd) { $sep = $msg['catalogue_saut_de_ligne']; } $ptab[6] = str_replace("!!sep!!", htmlentities($sep, ENT_QUOTES, $charset), $ptab[6]); $form_notice = str_replace('!!tab6!!', $ptab[6], $form_notice); // Gestion des titres uniformes $nb_tu = sizeof($this->tu_500); for ($i = 0; $i < $nb_tu; $i++) { $value_tu[$i]['name'] = $this->tu_500[$i]['a']; $ntu_data[$i]->tu->name = $this->tu_500[$i]['a']; $value_tu[$i]['tonalite'] = $this->tu_500[$i]['u']; for ($j = 0; $j < count($this->tu_500_r[$i]); $j++) { $value_tu[$i]['distrib'][$j] = $this->tu_500_r[$i][$j]; } for ($j = 0; $j < count($this->tu_500_s[$i]); $j++) { $value_tu[$i]['ref'][$j] = $this->tu_500_s[$i][$j]; } if ($tu_id = titre_uniforme::import_tu_exist($value_tu, 1)) { // le titre uniforme est déjà existant $ntu_data[$i]->num_tu = $tu_id; } else { // le titre uniforme n'est pas existant for ($j = 0; $j < count($this->tu_500_n[$i]); $j++) { $value_tu[$i]['comment'] .= $this->tu_500_r[$i][$j]; if ($j + 1 < count($this->tu_500_n[$i])) { $value_tu[$i]['comment'] .= "\n"; } } for ($j = 0; $j < count($this->tu_500_j[$i]); $j++) { $value_tu[$i]['subdiv'][$j] = $this->tu_500_j[$i][$j]; } } // memorisation du niveau biblio de ce titre uniforme for ($j = 0; $j < count($this->tu_500_i[$i]); $j++) { $ntu_data[$i]->titre .= $this->tu_500_i[$i][$j]; if ($j + 1 < count($this->tu_500_i[$i])) { $ntu_data[$i]->titre .= "; "; } } $ntu_data[$i]->date = $this->tu_500[$i]['k']; for ($j = 0; $j < count($this->tu_500_l[$i]); $j++) { $ntu_data[$i]->sous_vedette .= $this->tu_500_l[$i][$j]; if ($j + 1 < count($this->tu_500_l[$i])) { $ntu_data[$i]->sous_vedette .= "; "; } } $ntu_data[$i]->langue = $this->tu_500[$i]['m']; $ntu_data[$i]->version = $this->tu_500[$i]['q']; $ntu_data[$i]->mention = $this->tu_500[$i]['w']; } // serialisation des champs de l'autorité titre uniforme global $pmb_use_uniform_title; if ($pmb_use_uniform_title) { $memo_value_tu = "<input type='hidden' name='memo_value_tu' value=\"" . rawurlencode(serialize($value_tu)) . "\">"; $ptab[230] = str_replace("!!titres_uniformes!!", $memo_value_tu . tu_notice::get_form_import("notice", $ntu_data), $ptab[230]); $form_notice = str_replace('!!tab230!!', $ptab[230], $form_notice); } // mise à jour de l'onglet 7 : langues // langues répétables $lang = new marc_list('lang'); if (sizeof($this->language_code) == 0) { $max_lang = 1; } else { $max_lang = sizeof($this->language_code); } for ($i = 0; $i < $max_lang; $i++) { if ($i) { $ptab_lang = str_replace('!!ilang!!', $i, $ptab[701]); } else { $ptab_lang = str_replace('!!ilang!!', $i, $ptab[70]); } if (sizeof($this->language_code) == 0) { $ptab_lang = str_replace('!!lang_code!!', '', $ptab_lang); $ptab_lang = str_replace('!!lang!!', '', $ptab_lang); } else { $ptab_lang = str_replace('!!lang_code!!', $this->language_code[$i], $ptab_lang); $ptab_lang = str_replace('!!lang!!', htmlentities($lang->table[$this->language_code[$i]], ENT_QUOTES, $charset), $ptab_lang); } $lang_repetables .= $ptab_lang; } $ptab[7] = str_replace('!!max_lang!!', $max_lang, $ptab[7]); $ptab[7] = str_replace('!!langues_repetables!!', $lang_repetables, $ptab[7]); // langues originales répétables if (sizeof($this->original_language_code) == 0) { $max_langorg = 1; } else { $max_langorg = sizeof($this->original_language_code); } for ($i = 0; $i < $max_langorg; $i++) { if ($i) { $ptab_lang = str_replace('!!ilangorg!!', $i, $ptab[711]); } else { $ptab_lang = str_replace('!!ilangorg!!', $i, $ptab[71]); } if (sizeof($this->original_language_code) == 0) { $ptab_lang = str_replace('!!langorg_code!!', '', $ptab_lang); $ptab_lang = str_replace('!!langorg!!', '', $ptab_lang); } else { $ptab_lang = str_replace('!!langorg_code!!', $this->original_language_code[$i], $ptab_lang); $ptab_lang = str_replace('!!langorg!!', htmlentities($lang->table[$this->original_language_code[$i]], ENT_QUOTES, $charset), $ptab_lang); } $langorg_repetables .= $ptab_lang; } $ptab[7] = str_replace('!!max_langorg!!', $max_langorg, $ptab[7]); $ptab[7] = str_replace('!!languesorg_repetables!!', $langorg_repetables, $ptab[7]); $form_notice = str_replace('!!tab7!!', $ptab[7], $form_notice); z3950_notice::substitute("link_url", $this->link_url, $ptab[8]); z3950_notice::substitute("link_format", $this->link_format, $ptab[8]); $form_notice = str_replace('!!tab8!!', $ptab[8], $form_notice); // définition de la page cible du form $form_notice = str_replace('!!action!!', $this->action, $form_notice); // ajout des selecteurs $select_doc = new marc_select('doctype', 'typdoc', $this->document_type); $form_notice = str_replace('!!document_type!!', $select_doc->display, $form_notice); if ($article) { $form_notice = str_replace('!!checked_mono!!', "", $form_notice); $form_notice = str_replace('!!checked_perio!!', "", $form_notice); $form_notice = str_replace('!!checked_art!!', "selected=\"selected\"", $form_notice); } else { if ($this->bibliographic_level == 's') { $form_notice = str_replace('!!checked_mono!!', "", $form_notice); $form_notice = str_replace('!!checked_perio!!', "selected=\"selected\"", $form_notice); $form_notice = str_replace('!!checked_art!!', "", $form_notice); } else { $form_notice = str_replace('!!checked_mono!!', "selected=\"selected\"", $form_notice); $form_notice = str_replace('!!checked_perio!!', "", $form_notice); $form_notice = str_replace('!!checked_art!!', "", $form_notice); } } //Zone des perios et des bulletins pour les articles $zone_article_form = str_replace("!!perio_titre!!", $this->perio_titre[0], $zone_article_form); $zone_article_form = str_replace("!!perio_issn!!", $this->perio_issn[0], $zone_article_form); $zone_article_form = str_replace("!!bull_date!!", $this->bull_mention[0], $zone_article_form); $zone_article_form = str_replace("!!bull_titre!!", $this->bull_titre[0], $zone_article_form); $zone_article_form = str_replace("!!bull_num!!", $this->bull_num[0], $zone_article_form); if ($this->bull_date[0]) { $date_date_formatee = formatdate_input($this->bull_date[0]); $date_date_hid = $this->bull_date[0]; } else { $date_date_formatee = ''; $date_date_hid = ''; } $date_clic = "onClick=\"openPopUp('./select.php?what=calendrier&caller=notice&date_caller=¶m1=f_bull_new_date¶m2=date_date_lib&auto_submit=NO&date_anterieure=YES', 'date_date', 250, 300, -2, -2, 'toolbar=no, dependent=yes, resizable=yes')\" "; $date_date = "<input type='hidden' id='f_bull_new_date' name='f_bull_new_date' value='{$date_date_hid}' />\n\t\t\t<input class='saisie-10em' type='text' name='date_date_lib' value='" . $date_date_formatee . "' placeholder='" . $msg["format_date_input_placeholder"] . "' />\n\t\t\t<input class='bouton' type='button' name='date_date_lib_bouton' value='" . $msg["bouton_calendrier"] . "' " . $date_clic . " />"; $zone_article_form = str_replace("!!date_date!!", $date_date, $zone_article_form); //On cherche si le perio existe if ($this->perio_titre[0] && $this->perio_issn[0]) { $req = "select notice_id, tit1 from notices where niveau_biblio='s' and niveau_hierar='1' \n\t\t\t\t\tand tit1='" . addslashes($this->perio_titre[0]) . "'\n\t\t\t\t\tand code='" . addslashes($this->perio_issn[0]) . "' 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[0]) { $req = "select notice_id, tit1 from notices where niveau_biblio='s' and niveau_hierar='1' \n\t\t\t\t\tand tit1='" . addslashes($this->perio_titre[0]) . "'\n\t\t\t\t\tlimit 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[0]) { $req = "select notice_id, tit1 from notices where niveau_biblio='s' and niveau_hierar='1' \n\t\t\t\t\t\tand code='" . addslashes($this->perio_issn[0]) . "' 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); $idperio = $perio_found->notice_id; $zone_article_form = str_replace("!!f_perio_existing!!", htmlentities($perio_found->tit1, ENT_QUOTES, $charset), $zone_article_form); $zone_article_form = str_replace("!!f_perio_existing_id!!", $perio_found->notice_id, $zone_article_form); $zone_article_form = str_replace("!!perio_type_new!!", "", $zone_article_form); $zone_article_form = str_replace("!!perio_type_use_existing!!", "checked", $zone_article_form); } else { $idperio = 0; $zone_article_form = str_replace("!!f_perio_existing!!", "", $zone_article_form); $zone_article_form = str_replace("!!f_perio_existing_id!!", "", $zone_article_form); $zone_article_form = str_replace("!!perio_type_new!!", "checked", $zone_article_form); $zone_article_form = str_replace("!!perio_type_use_existing!!", "", $zone_article_form); } //On cherche si le bulletin existe $num_rows_bull = 0; if ($this->bull_num[0] && $idperio) { $req = "select bulletin_id, bulletin_numero,date_date,mention_date from bulletins where bulletin_notice='" . $idperio . "' and bulletin_numero like '%" . addslashes($this->bull_num[0]) . "%' "; $res_bull = pmb_mysql_query($req, $dbh); $num_rows_bull = pmb_mysql_num_rows($res_bull); } if (!$num_rows_bull && $this->bull_date[0] && $idperio) { $req = "select bulletin_id, bulletin_numero,date_date,mention_date from bulletins where bulletin_notice='" . $idperio . "' and date_date='" . addslashes($this->bull_date[0]) . "' "; $res_bull = pmb_mysql_query($req, $dbh); $num_rows_bull = pmb_mysql_num_rows($res_bull); } elseif ($num_rows_bull > 1 && $this->bull_date[0] && $idperio) { $req = "select bulletin_id, bulletin_numero,date_date,mention_date from bulletins where bulletin_notice='" . $idperio . "' and date_date='" . addslashes($this->bull_date[0]) . "' and bulletin_numero like '%" . addslashes($this->bull_num[0]) . "%' "; $res_bull = pmb_mysql_query($req, $dbh); $num_rows_bull = pmb_mysql_num_rows($res_bull); } if (!$num_rows_bull && $this->bull_mention[0] && $idperio) { $req = "select bulletin_id, bulletin_numero,date_date,mention_date from bulletins where bulletin_notice='" . $idperio . "' and mention_date='" . addslashes($this->bull_mention[0]) . "' "; $res_bull = pmb_mysql_query($req, $dbh); $num_rows_bull = pmb_mysql_num_rows($res_bull); } elseif ($num_rows_bull > 1 && $this->bull_mention[0] && $idperio) { if ($this->bull_date[0]) { $req = "select bulletin_id, bulletin_numero,date_date,mention_date from bulletins where bulletin_notice='" . $idperio . "' and date_date='" . addslashes($this->bull_date[0]) . "' and mention_date='" . addslashes($this->bull_mention[0]) . "' "; } else { $req = "select bulletin_id, bulletin_numero,date_date,mention_date from bulletins where bulletin_notice='" . $idperio . "' and mention_date='" . addslashes($this->bull_mention[0]) . "' and bulletin_numero like '%" . addslashes($this->bull_num[0]) . "%' "; } $res_bull = pmb_mysql_query($req, $dbh); $num_rows_bull = pmb_mysql_num_rows($res_bull); } if ($num_rows_bull) { $bull_found = pmb_mysql_fetch_object($res_bull); $f_bull_existing = trim($bull_found->bulletin_numero); if (!$f_bull_existing && trim($bull_found->date_date)) { $f_bull_existing = "[" . trim($bull_found->date_date) . "]"; } elseif (!$f_bull_existing && trim($bull_found->mention_date)) { $f_bull_existing = "(" . trim($bull_found->mention_date) . ")"; } $zone_article_form = str_replace("!!f_bull_existing!!", htmlentities($f_bull_existing, ENT_QUOTES, $charset), $zone_article_form); $zone_article_form = str_replace("!!f_bull_existing_id!!", $bull_found->bulletin_id, $zone_article_form); $zone_article_form = str_replace("!!bull_type_new!!", $num_rows_bull ? '' : "checked='checked'", $zone_article_form); $zone_article_form = str_replace("!!bull_type_use_existing!!", $num_rows_bull ? "checked='checked'" : '', $zone_article_form); } else { $zone_article_form = str_replace("!!f_bull_existing!!", "", $zone_article_form); $zone_article_form = str_replace("!!f_bull_existing_id!!", "", $zone_article_form); $zone_article_form = str_replace("!!bull_type_new!!", "checked='checked'", $zone_article_form); $zone_article_form = str_replace("!!bull_type_use_existing!!", "", $zone_article_form); } $form_notice = str_replace("!!zone_article!!", $zone_article_form, $form_notice); if ($article) { $form_notice = str_replace("!!display_zone_article!!", "", $form_notice); } else { $form_notice = str_replace("!!display_zone_article!!", "none", $form_notice); } if ($item) { $form_notice = str_replace('!!notice_entrepot!!', "<input type='hidden' name='item' value='{$item}' />", $form_notice); } else { $form_notice = str_replace('!!notice_entrepot!!', "", $form_notice); } $form_notice = str_replace('!!orinot_nom!!', $this->origine_notice[nom], $form_notice); $form_notice = str_replace('!!orinot_pays!!', $this->origine_notice[pays], $form_notice); //Traitement du 503 "titre de forme" pour le Musée des beaux arts de Nantes global $tableau_503; $tableau_503 = array("info_503" => $this->info_503, "info_503_d" => $this->info_503_d, "info_503_j" => $this->info_503_j); // traitement des catégories : affichage dans le formulaire $tableau_600 = array("info_600_3" => $this->info_600_3, "info_600_a" => $this->info_600_a, "info_600_b" => $this->info_600_b, "info_600_c" => $this->info_600_c, "info_600_d" => $this->info_600_d, "info_600_f" => $this->info_600_f, "info_600_g" => $this->info_600_g, "info_600_j" => $this->info_600_j, "info_600_p" => $this->info_600_p, "info_600_t" => $this->info_600_t, "info_600_x" => $this->info_600_x, "info_600_y" => $this->info_600_y, "info_600_z" => $this->info_600_z); $tableau_601 = array("info_601_3" => $this->info_601_3, "info_601_a" => $this->info_601_a, "info_601_b" => $this->info_601_b, "info_601_c" => $this->info_601_c, "info_601_d" => $this->info_601_d, "info_601_e" => $this->info_601_e, "info_601_f" => $this->info_601_f, "info_601_g" => $this->info_601_g, "info_601_h" => $this->info_601_h, "info_601_j" => $this->info_601_j, "info_601_t" => $this->info_601_t, "info_601_x" => $this->info_601_x, "info_601_y" => $this->info_601_y, "info_601_z" => $this->info_601_z); $tableau_602 = array("info_602_3" => $this->info_602_3, "info_602_a" => $this->info_602_a, "info_602_f" => $this->info_602_f, "info_602_j" => $this->info_602_j, "info_602_t" => $this->info_602_t, "info_602_x" => $this->info_602_x, "info_602_y" => $this->info_602_y, "info_602_z" => $this->info_602_z); $tableau_604 = array("info_604_3" => $this->info_604_3, "info_604_a" => $this->info_604_a, "info_604_h" => $this->info_604_h, "info_604_i" => $this->info_604_i, "info_604_j" => $this->info_604_j, "info_604_k" => $this->info_604_k, "info_604_l" => $this->info_604_l, "info_604_x" => $this->info_604_x, "info_604_y" => $this->info_604_y, "info_604_z" => $this->info_604_z); $tableau_605 = array("info_605_3" => $this->info_605_3, "info_605_a" => $this->info_605_a, "info_605_h" => $this->info_605_h, "info_605_i" => $this->info_605_i, "info_605_k" => $this->info_605_k, "info_605_l" => $this->info_605_l, "info_605_m" => $this->info_605_m, "info_605_n" => $this->info_605_n, "info_605_q" => $this->info_605_q, "info_605_r" => $this->info_605_r, "info_605_s" => $this->info_605_s, "info_605_u" => $this->info_605_u, "info_605_w" => $this->info_605_w, "info_605_j" => $this->info_605_j, "info_605_x" => $this->info_605_x, "info_605_y" => $this->info_605_y, "info_605_z" => $this->info_605_z); $tableau_606 = array("info_606_3" => $this->info_606_3, "info_606_a" => $this->info_606_a, "info_606_j" => $this->info_606_j, "info_606_x" => $this->info_606_x, "info_606_y" => $this->info_606_y, "info_606_z" => $this->info_606_z); $tableau_607 = array("info_607_3" => $this->info_607_3, "info_607_a" => $this->info_607_a, "info_607_j" => $this->info_607_j, "info_607_x" => $this->info_607_x, "info_607_y" => $this->info_607_y, "info_607_z" => $this->info_607_z); $tableau_608 = array("info_608_3" => $this->info_608_3, "info_608_a" => $this->info_608_a, "info_608_j" => $this->info_608_j, "info_608_x" => $this->info_608_x, "info_608_y" => $this->info_608_y, "info_608_z" => $this->info_608_z); // catégories $max_categ = 1; $ptab_categ = str_replace('!!icateg!!', 0, $ptab[60]); $ptab_categ = str_replace('!!categ_id!!', 0, $ptab_categ); $ptab_categ = str_replace('!!categ_libelle!!', '', $ptab_categ); $ptab[6] = str_replace("!!categories_repetables!!", $ptab_categ, $ptab[6]); $ptab[6] = str_replace('!!tab_categ_order!!', "", $ptab[6]); $traitement_rameau = traite_categories_for_form($tableau_600, $tableau_601, $tableau_602, $tableau_605, $tableau_606, $tableau_607, $tableau_608); if (!is_array($traitement_rameau)) { $traitement_rameau = array("form" => $traitement_rameau, "message" => ""); } $form_notice = str_replace('!!message_rameau!!', $traitement_rameau["message"], $form_notice); $form_notice = str_replace('!!traitement_rameau!!', $traitement_rameau["form"], $form_notice); $manual_categorisation_form = get_manual_categorisation_form($tableau_600, $tableau_601, $tableau_602, $tableau_604, $tableau_605, $tableau_606, $tableau_607, $tableau_608); $form_notice = str_replace('!!manual_categorisation!!', $manual_categorisation_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 (count($this->others_ids) > 0) { foreach ($p_perso->t_fields as $key => $t_field) { if ($t_field['TYPE'] == "resolve") { $field_options = _parser_text_no_function_("<?xml version='1.0' encoding='" . $charset . "'?>\n" . $t_field['OPTIONS'], "OPTIONS"); 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 < count($perso_["FIELDS"]); $i++) { $p = $perso_["FIELDS"][$i]; $perso .= "<div class='row'>\n\t\t\t\t\t<label for='" . $p["NAME"] . "' class='etiquette'>" . $p["TITRE"] . " </label>" . $p["COMMENT_DISPLAY"] . "\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class='row'>\n\t\t\t\t\t" . $p["AFF"] . "\n\t\t\t\t\t</div>\n\t\t\t\t\t"; } $perso .= $perso_["CHECK_SCRIPTS"]; $ptab[9] = str_replace("!!champs_perso!!", $perso, $ptab[9]); } else { $ptab[9] = "\n<script type='text/javascript' >function check_form() { return true; }</script>\n"; } $form_notice = str_replace('!!tab9!!', $ptab[9], $form_notice); // champs de gestion global $pmb_notice_img_folder_id; $message_folder = ""; if ($pmb_notice_img_folder_id) { $req = "select repertoire_path from upload_repertoire where repertoire_id ='" . $pmb_notice_img_folder_id . "'"; $res = pmb_mysql_query($req); if (pmb_mysql_num_rows($res)) { $rep = pmb_mysql_fetch_object($res); if (!is_dir($rep->repertoire_path)) { $notice_img_folder_error = 1; } } else { $notice_img_folder_error = 1; } if ($notice_img_folder_error) { if (SESSrights & ADMINISTRATION_AUTH) { $requete = "select * from parametres where gestion=0 and type_param='pmb' and sstype_param='notice_img_folder_id' "; $res = pmb_mysql_query($requete); $i = 0; if ($param = pmb_mysql_fetch_object($res)) { $message_folder = " <a class='erreur' href='./admin.php?categ=param&action=modif&id_param=" . $param->id_param . "' >" . $msg['notice_img_folder_admin_no_access'] . "</a> "; } } else { $message_folder = $msg['notice_img_folder_no_access']; } } } $ptab[10] = str_replace('!!message_folder!!', $message_folder, $ptab[10]); // langue de la notice global $lang, $xmlta_indexation_lang; $user_lang = $this->indexation_lang; if (!$user_lang) { $user_lang = $xmlta_indexation_lang; } // if(!$user_lang) $user_lang="fr_FR"; $langues = new XMLlist("{$include_path}/messages/languages.xml"); $langues->analyser(); $clang = $langues->table; $combo = "<select name='indexation_lang' id='indexation_lang' class='saisie-20em' >"; if (!$user_lang) { $combo .= "<option value='' selected>--</option>"; } else { $combo .= "<option value='' >--</option>"; } while (list($cle, $value) = each($clang)) { // arabe seulement si on est en utf-8 if ($charset != 'utf-8' and $user_lang != 'ar' or $charset == 'utf-8') { if (strcmp($cle, $user_lang) != 0) { $combo .= "<option value='{$cle}'>{$value} ({$cle})</option>"; } else { $combo .= "<option value='{$cle}' selected>{$value} ({$cle})</option>"; } } } $combo .= "</select>"; $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!!', htmlentities($this->commentaire_gestion, ENT_QUOTES, $charset), $ptab[10]); $ptab[10] = str_replace('!!thumbnail_url!!', htmlentities($this->thumbnail_url, ENT_QUOTES, $charset), $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 = '<a target="_blank" href="'.htmlspecialchars($doc_num["a"]).'">'.htmlspecialchars($doc_num["a"]).'</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 = '&' . $aac[2] . '&' . $aac[5] . '&' . $aac[6]; global $force; $retares = ''; switch ($retour) { case 'button': if ($this->message_retour) { $retares = "<input type='button' class='bouton' onclick='history.go(-1);' value='" . $this->message_retour . "' />"; } else { if ($force == 1) { $retares = "<a href='javascript:history.go(-2);'>" . $msg['z3950_retour_a_resultats'] . "</a>"; } else { $retares = "<a href='javascript:history.go(-1);'>" . $msg['z3950_retour_a_resultats'] . "</a>"; } } break; case 'link': $retares = "<a href='./catalog.php?categ=z3950&action=display" . $retact . "'>" . $msg['z3950_retour_a_resultats'] . "</a>"; 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 -->', $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; }
function catalog_notice() { global $dbh; if ($this->sugg_noti_unimarc && !$this->num_notice) { $z = new z3950_notice("unimarc", $this->sugg_noti_unimarc); $z->var_to_post(); $ret = $z->insert_in_database(); //On attache la notice à la suggestion $req = " update suggestions set num_notice='" . $ret[1] . "' where id_suggestion='" . $this->id_suggestion . "'"; pmb_mysql_query($req, $dbh); } }
} else { $suite_rqt = "or code='" . formatISBN($isbn_verif, 10) . "' "; } } if ($isbn_verif) { $requete = "SELECT notice_id FROM notices WHERE code='{$isbn_verif}' " . $suite_rqt; $myQuery = mysql_query($requete, $dbh); $temp_nb_notice = mysql_num_rows($myQuery); if ($temp_nb_notice) { $not_id = mysql_result($myQuery, 0, 0); } else { $not_id = 0; } } // if ($not_id) METTRE ICI TRAITEMENT DU CHOIX DU DOUBLON echo "<script> alert('Existe déjà'); </script>" ; $notice = new z3950_notice($format, $ligne['z_marc']); } } $integration_OK = "PASFAIT"; $integrationexpl_OK = "PASFAIT"; switch ($action) { case "integrer": if (!$id_notice) { $res_integration = $notice->insert_in_database(); } else { $res_integration = $notice->update_in_database($id_notice); } $new_notice = $res_integration[0]; $num_notice = $res_integration[1]; if ($new_notice == 0 && $num_notice == 0) { $integration_OK = "ECHEC";
function get_manual_categorisation_form($tableau_600 = "", $tableau_601 = "", $tableau_602 = "", $tableau_604 = "", $tableau_605 = "", $tableau_606 = "", $tableau_607 = "", $tableau_608 = "") { global $dbh, $charset, $ptab, $msg; $glue = ' -- '; $thesaurus = array(); $thesaurus_sql = "SELECT id_thesaurus, libelle_thesaurus FROM thesaurus"; $res = mysql_query($thesaurus_sql, $dbh); while ($row = mysql_fetch_assoc($res)) { $thesaurus[] = $row; } $vedettes = array(); //600 for ($i = 0, $count = count($tableau_600['info_600_a']); $i < $count; $i++) { $apieces = array(); $apieces = array_merge($apieces, $tableau_600['info_600_a'][$i]); $apieces = array_merge($apieces, $tableau_600['info_600_b'][$i]); $apieces = array_merge($apieces, $tableau_600['info_600_c'][$i]); $apieces = array_merge($apieces, $tableau_600['info_600_d'][$i]); $apieces = array_merge($apieces, $tableau_600['info_600_f'][$i]); $apieces = array_merge($apieces, $tableau_600['info_600_g'][$i]); $apieces = array_merge($apieces, $tableau_600['info_600_j'][$i]); $apieces = array_merge($apieces, $tableau_600['info_600_p'][$i]); $apieces = array_merge($apieces, $tableau_600['info_600_t'][$i]); $apieces = array_merge($apieces, $tableau_600['info_600_x'][$i]); $apieces = array_merge($apieces, $tableau_600['info_600_y'][$i]); $apieces = array_merge($apieces, $tableau_600['info_600_z'][$i]); $vedette = implode($glue, $apieces); $vedettes[] = $vedette; } //601 for ($i = 0, $count = count($tableau_601['info_601_a']); $i < $count; $i++) { $apieces = array(); $apieces = array_merge($apieces, $tableau_601['info_601_a'][$i]); $apieces = array_merge($apieces, $tableau_601['info_601_b'][$i]); $apieces = array_merge($apieces, $tableau_601['info_601_c'][$i]); $apieces = array_merge($apieces, $tableau_601['info_601_d'][$i]); $apieces = array_merge($apieces, $tableau_601['info_601_e'][$i]); $apieces = array_merge($apieces, $tableau_601['info_601_f'][$i]); $apieces = array_merge($apieces, $tableau_601['info_601_g'][$i]); $apieces = array_merge($apieces, $tableau_601['info_601_h'][$i]); $apieces = array_merge($apieces, $tableau_601['info_601_j'][$i]); $apieces = array_merge($apieces, $tableau_601['info_601_t'][$i]); $apieces = array_merge($apieces, $tableau_601['info_601_x'][$i]); $apieces = array_merge($apieces, $tableau_601['info_601_y'][$i]); $apieces = array_merge($apieces, $tableau_601['info_601_z'][$i]); $vedette = implode($glue, $apieces); $vedettes[] = $vedette; } //602 for ($i = 0, $count = count($tableau_602['info_602_a']); $i < $count; $i++) { $apieces = array(); $apieces = array_merge($apieces, $tableau_602['info_602_a'][$i]); $apieces = array_merge($apieces, $tableau_602['info_602_f'][$i]); $apieces = array_merge($apieces, $tableau_602['info_602_j'][$i]); $apieces = array_merge($apieces, $tableau_602['info_602_t'][$i]); $apieces = array_merge($apieces, $tableau_602['info_602_x'][$i]); $apieces = array_merge($apieces, $tableau_602['info_602_y'][$i]); $apieces = array_merge($apieces, $tableau_602['info_602_z'][$i]); $vedette = implode($glue, $apieces); $vedettes[] = $vedette; } //604 for ($i = 0, $count = count($tableau_604['info_604_a']); $i < $count; $i++) { $apieces = array(); $apieces = array_merge($apieces, $tableau_604['info_604_a'][$i]); $apieces = array_merge($apieces, $tableau_604['info_604_h'][$i]); $apieces = array_merge($apieces, $tableau_604['info_604_i'][$i]); $apieces = array_merge($apieces, $tableau_604['info_604_j'][$i]); $apieces = array_merge($apieces, $tableau_604['info_604_k'][$i]); $apieces = array_merge($apieces, $tableau_604['info_604_l'][$i]); $apieces = array_merge($apieces, $tableau_604['info_604_x'][$i]); $apieces = array_merge($apieces, $tableau_604['info_604_y'][$i]); $apieces = array_merge($apieces, $tableau_604['info_604_z'][$i]); $vedette = implode($glue, $apieces); $vedettes[] = $vedette; } //605 for ($i = 0, $count = count($tableau_605['info_605_a']); $i < $count; $i++) { $apieces = array(); $apieces = array_merge($apieces, $tableau_605['info_605_a'][$i]); $apieces = array_merge($apieces, $tableau_605['info_605_h'][$i]); $apieces = array_merge($apieces, $tableau_605['info_605_i'][$i]); $apieces = array_merge($apieces, $tableau_605['info_605_j'][$i]); $apieces = array_merge($apieces, $tableau_605['info_605_k'][$i]); $apieces = array_merge($apieces, $tableau_605['info_605_l'][$i]); $apieces = array_merge($apieces, $tableau_605['info_605_m'][$i]); $apieces = array_merge($apieces, $tableau_605['info_605_n'][$i]); $apieces = array_merge($apieces, $tableau_605['info_605_q'][$i]); $apieces = array_merge($apieces, $tableau_605['info_605_r'][$i]); $apieces = array_merge($apieces, $tableau_605['info_605_s'][$i]); $apieces = array_merge($apieces, $tableau_605['info_605_u'][$i]); $apieces = array_merge($apieces, $tableau_605['info_605_w'][$i]); $apieces = array_merge($apieces, $tableau_605['info_605_j'][$i]); $apieces = array_merge($apieces, $tableau_605['info_605_x'][$i]); $apieces = array_merge($apieces, $tableau_605['info_605_y'][$i]); $apieces = array_merge($apieces, $tableau_605['info_605_z'][$i]); $vedette = implode($glue, $apieces); $vedettes[] = $vedette; } //606 for ($i = 0, $count = count($tableau_606['info_606_a']); $i < $count; $i++) { $apieces = array(); $apieces = array_merge($apieces, $tableau_606['info_606_a'][$i]); $apieces = array_merge($apieces, $tableau_606['info_606_j'][$i]); $apieces = array_merge($apieces, $tableau_606['info_606_x'][$i]); $apieces = array_merge($apieces, $tableau_606['info_606_y'][$i]); $apieces = array_merge($apieces, $tableau_606['info_606_z'][$i]); $vedette = implode($glue, $apieces); $vedettes[] = $vedette; } //607 for ($i = 0, $count = count($tableau_607['info_607_a']); $i < $count; $i++) { $apieces = array(); $apieces = array_merge($apieces, $tableau_607['info_607_a'][$i]); $apieces = array_merge($apieces, $tableau_607['info_607_j'][$i]); $apieces = array_merge($apieces, $tableau_607['info_607_x'][$i]); $apieces = array_merge($apieces, $tableau_607['info_607_y'][$i]); $apieces = array_merge($apieces, $tableau_607['info_607_z'][$i]); $vedette = implode($glue, $apieces); $vedettes[] = $vedette; } //608 for ($i = 0, $count = count($tableau_608['info_608_a']); $i < $count; $i++) { $apieces = array(); $apieces = array_merge($apieces, $tableau_608['info_608_a'][$i]); $apieces = array_merge($apieces, $tableau_608['info_608_j'][$i]); $apieces = array_merge($apieces, $tableau_608['info_608_x'][$i]); $apieces = array_merge($apieces, $tableau_608['info_608_y'][$i]); $apieces = array_merge($apieces, $tableau_608['info_608_z'][$i]); $vedette = implode($glue, $apieces); $vedettes[] = $vedette; } $result = ""; $count = 0; $automap_js = "var node_to_captions = [];\n"; foreach ($vedettes as $vedette) { $automap_info = get_category_automap_information($vedette); if ($automap_info) { $thesaurus_combo_box = " <i>" . $msg["notice_integre_categorisation_manual_use_from_thesaurus"] . '</i> <select onchange="automap_category(!!name!!)" name = "!!name!!">'; $thesaurus_combo_box .= '<option value=""> </option>'; foreach ($automap_info as $automap_infuu) { $count_2 = 0; foreach ($automap_infuu as $automap_infu) { $acategory = new category($automap_infu["num_noeud"]); $dapath = "[" . $automap_infu["libelle_thesaurus"] . "] "; foreach ($acategory->path_table as $node) { $dapath .= $node["libelle"] . " -- "; } $dapath .= $automap_infu["libelle_categorie"]; $option_title = count($automap_infuu) > 1 ? $dapath : ""; $option_content = htmlentities($automap_infu["libelle_thesaurus"], ENT_QUOTES, $charset); $option_content .= $count_2 > 0 ? " - " . $count_2 : ""; $thesaurus_combo_box .= '<option title="' . $option_title . '" value="' . $automap_infu["num_noeud"] . '">' . $option_content . '</option>'; $automap_js .= "node_to_captions[" . $automap_infu["num_noeud"] . "] = '" . addslashes($dapath) . "';\n"; $count_2++; } } $thesaurus_combo_box .= '</select>'; } else { $thesaurus_combo_box = "<i>" . $msg["notice_integre_categorisation_manual_none_from_thesaurus"] . "</i>"; } $line = $ptab[60]; z3950_notice::substitute("icateg", $count, $line); z3950_notice::substitute("vedette_libelle", $vedette, $line); z3950_notice::substitute("categ_libelle", "", $line); $acombobox = $thesaurus_combo_box; z3950_notice::substitute("name", "thesaurus_select_" . $count, $acombobox); $line = str_replace("!!thesaurus_select!!", $acombobox, $line); z3950_notice::substitute("thesaurus_select", $acombobox, $line); $result .= $line; $count++; } $automap_js_function = "\n\tfunction automap_category(aselect) {\n\t\tif (aselect.value == '') {\n//\t\t\tdocument.getElementById('f_categ'+id).value = '';\n//\t\t\tdocument.getElementById('f_categ_id'+id).value = '';\n\t\t\treturn;\n\t\t}\n\n\t\tvar avalue = aselect.value;\n\t\tvar acaption = node_to_captions[aselect.value];\n\t\tcateg_count=document.notice.max_categ.value;\n\t\tfor (i=0; i<categ_count; i++) {\n\t\t\tif (document.getElementById('f_categ_id'+i).value == avalue)\n\t\t\t\treturn;\n\t\t}\n\t\tfor (i=0; i<categ_count; i++) {\n\t\t\tif ((document.getElementById('f_categ_id'+i).value == '') || (document.getElementById('f_categ_id'+i).value == '0')) {\n\t\t\t\tdocument.getElementById('f_categ'+i).value = acaption;\n\t\t\t\tdocument.getElementById('f_categ_id'+i).value = avalue;\t\t\t\t\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tadd_categ();\n\t\tid = categ_count;\n\t\tdocument.getElementById('f_categ'+id).value = acaption;\n\t\tdocument.getElementById('f_categ_id'+id).value = avalue;\n\t}\n"; $automap_js = "<script>\n" . $automap_js_function . "\n\n" . $automap_js . "</script>"; $result = $automap_js . "\n\n" . $result; return $result; }
// on est face à une notice de bulletin $requete_suite = "SELECT bulletin_id, bulletin_notice FROM bulletins where num_notice='" . $notice->notice_id . "'"; $result_suite = mysql_query($requete_suite, $dbh) or die("<br /><br />" . mysql_error() . "<br /><br />"); $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();
function import($unimarc_notice = '', $source_id = '') { global $deflt_integration_notice_statut; global $gestion_acces_active, $gestion_acces_user_notice, $gestion_acces_empr_notice; if ($unimarc_notice) { $this->converted_notice = $unimarc_notice; } if ($source_id) { $this->source_id = $source_id; } if ($this->converted_notice) { $z = new z3950_notice('unimarc', $this->converted_notice); $z->source_id = $this->source_id; $z->statut = $deflt_integration_notice_statut; $z->var_to_post(); $retour = $z->insert_in_database(); if ($retour[0]) { //parce que les droits sur une nouvelle ressource se calculent forcément sur le formulare que n'existe pas dans ce cas... if ($gestion_acces_active == 1) { $ac = new acces(); //traitement des droits acces user_notice if ($gestion_acces_user_notice == 1) { $dom_1 = $ac->setDomain(1); $dom_1->applyRessourceRights($retour[1]); } //traitement des droits acces empr_notice if ($gestion_acces_empr_notice == 1) { $dom_2 = $ac->setDomain(2); $dom_2->applyRessourceRights($retour[1]); } } } } }
function save_unimarc_notice() { global $msg, $idbibli, $id_sug, $dbh; $req_uni = "select notice_unimarc from suggestions where id_suggestion='" . $id_sug . "'"; $res = mysql_query($req_uni, $dbh); if (mysql_num_rows($res)) { $notice_uni = mysql_result($res, 0, 0); } $z = new z3950_notice("form"); if ($notice_uni) { $z->notice = $notice_uni; } $ret = $z->insert_in_database(); if ($ret[0]) { if ($z->bull_id && $z->perio_id) { $notice_display = new serial_display($ret[1], 6); } else { $notice_display = new mono_display($ret[1], 6); } $retour = "\n\t\t<script src='javascript/tablist.js'></script>\n\t\t<br /><div class='erreur'></div>\n\t\t<div class='row'>\n\t\t\t<div class='colonne10'>\n\t\t\t\t<img src='./images/tick.gif' align='left'>\n\t\t\t</div>\n\t\t\t<div class='colonne80'>\n\t\t\t\t<strong>" . $msg["z3950_integr_not_ok"] . "</strong>\n\t\t\t\t" . $notice_display->result . "\n\t\t\t</div>\n\t\t</div>\n\t\t<div class='row'>"; if ($z->bull_id && $z->perio_id) { $url_view = "catalog.php?categ=serials&sub=bulletinage&action=view&bul_id={$z->bull_id}&art_to_show={$ret['1']}"; } else { $url_view = "catalog.php?categ=isbd&id=" . $ret[1]; } $retour .= "\n\t\t<form class='form-{$current_module}' name='dummy' >\n\t\t\t<input type='hidden' name='page' value='" . htmlentities($page, ENT_QUOTES, $charset) . "'/>\t\n\t\t\t<input type='button' name='ok' class='bouton' value='" . $msg["bt_retour"] . "' onClick=\"document.location='acquisition.php?categ=sug&action=modif&id_bibli={$idbibli}&id_sug={$id_sug}'\" /> \n\t\t\t<input type='button' name='cancel' class='bouton' value='" . $msg["z3950_integr_not_lavoir"] . "' onClick=\"document.location='{$url_view}'\"/>\n\t\t</form>\n\t\t<script type='text/javascript'>\n\t\t\tdocument.forms['dummy'].elements['ok'].focus();\n\t\t</script>\n\t\t</div>\n\t\t"; print $retour; //On attache la notice à la suggestion $req = " update suggestions set num_notice='" . $ret[1] . "' where id_suggestion='" . $id_sug . "'"; mysql_query($req, $dbh); } else { if ($ret[1]) { if ($z->bull_id && $z->perio_id) { $notice_display = new serial_display($ret[1], 6); } else { $notice_display = new mono_display($ret[1], 6); } $retour = "\n\t\t<script src='javascript/tablist.js'></script>\n\t\t<br /><div class='erreur'>{$msg['540']}</div>\n\t\t<div class='row'>\n\t\t\t<div class='colonne10'>\n\t\t\t\t<img src='./images/error.gif' align='left'>\n\t\t\t</div>\n\t\t\t<div class='colonne80'>\n\t\t\t\t<strong>" . $msg["z3950_integr_not_existait"] . "</strong><br /><br />\n\t\t\t\t" . $notice_display->result . "\n\t\t\t</div>\n\t\t</div>\n\t\t<div class='row'>"; if ($z->bull_id && $z->perio_id) { $url_view = "catalog.php?categ=serials&sub=bulletinage&action=view&bul_id={$z->bull_id}&art_to_show={$ret['1']}"; } else { $url_view = "catalog.php?categ=isbd&id=" . $ret[1]; } $retour .= "\n\t\t<form class='form-{$current_module}' name='dummy'>\n\t\t\t<input type='hidden' name='page' value='" . htmlentities($page, ENT_QUOTES, $charset) . "'/>\t\n\t\t\t<input type='button' name='ok' class='bouton' value='" . $msg["bt_retour"] . "' onClick=\"document.location='acquisition.php?categ=sug&action=modif&id_bibli={$idbibli}&id_sug={$id_sug}'\" /> \n\t\t\t<input type='button' name='cancel' class='bouton' value='" . $msg["z3950_integr_not_lavoir"] . "' onClick=\"document.location='{$url_view}'\"/>\n\t\t</form>\n\t\t<script type='text/javascript'>\n\t\t\tdocument.forms['dummy'].elements['ok'].focus();\n\t\t</script>\n\t\t</div>\n\t\t"; print $retour; //On attache la notice à la suggestion $req = " update suggestions set num_notice='" . $ret[1] . "' where id_suggestion='" . $id_sug . "'"; mysql_query($req, $dbh); } else { $retour = "<script src='javascript/tablist.js'></script>"; $retour .= form_error_message($msg["connecteurs_cant_integrate_title"], $ret[1] ? $msg["z3950_integr_not_existait"] : $msg["z3950_integr_not_newrate"], $msg["connecteurs_back_to_list"], "catalog.php?categ=search&mode=7&sub=launch", array("serialized_search" => $sc->serialize_search())); print $retour; } } }
function record_notice($notice_id) { $z = new z3950_notice("form"); $ret = $z->update_in_database($notice_id); print "\n \t\t<div class='row'><div class='msg-perio'>" . $msg["maj_encours"] . "</div></div>\n\t\t\t<script type=\"text/javascript\">document.location='./catalog.php?categ=isbd&id={$notice_id}'</script>\n\t\t"; printr($ret); }
// $Id: ajax_integer.inc.php,v 1.3 2013-01-29 09:12:54 dgoron Exp $ if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) { die("no access"); } require_once $class_path . "/search.class.php"; require_once $class_path . "/searcher.class.php"; require_once $class_path . "/mono_display_unimarc.class.php"; require_once $include_path . "/external.inc.php"; require_once $class_path . "/z3950_notice.class.php"; require_once $class_path . "/notice_doublon.class.php"; if ($item) { $infos = entrepot_to_unimarc($item); } //on regarde si la signature existe déjà..; $signature = ""; $z = new z3950_notice("unimarc", $infos['notice'], $infos['source_id']); //on reporte la signature de la notice calculée ou non... if ($pmb_notice_controle_doublons != 0) { $sign = new notice_doublon(true, $infos['source_id']); $signature = $sign->gen_signature($item); } $z->signature = $signature; if ($infos['notice']) { $z->notice = $infos['notice']; } if ($infos['source_id']) { $z->source_id = $infos['source_id']; } $ret = $z->insert_in_database(true); //on conserve la trace de l'origine de la notice... $id_notice = $ret[1];
require_once "{$include_path}/bull_info.inc.php"; require_once "{$include_path}/resa_func.inc.php"; require_once "{$class_path}/suggestions.class.php"; 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);
function record() { global $pmb_notice_controle_doublons; global $recept_cat_error_form; global $integre, $serialized_post, $existant_notice_id, $existant_b_level, $existant_h_level, $signature, $id_lig, $serialized_search; $recorded = false; switch ($integre) { case 'new': $unserialized_post = unserialize(rawurldecode(stripslashes($serialized_post))); foreach ($unserialized_post as $key => $val) { if (get_magic_quotes_gpc()) { $GLOBALS[$key] = $val; } else { add_sl($val); $GLOBALS[$key] = $val; } global ${$key}; } $z = new z3950_notice("form"); $z->signature = $signature; $ret = $z->insert_in_database(); $notice_id = $ret[1]; $recorded = true; break; case 'existant': $notice_id = $existant_notice_id; $b_level = $existant_b_level; $h_level = $existant_h_level; $recorded = true; break; default: $duplicate = array(); $signature = ''; $r = object; if ($pmb_notice_controle_doublons != 0) { $sign = new notice_doublon(true); $signature = $sign->gen_signature(); $r = $sign->getDuplicate(); } if ($r->notice_id) { if ($r->niveau_biblio == 'a' && $r->niveau_hierar == 2) { //article $serial = new serial_display($r->notice_id, 6, '', '', '', '', '', 0, 2, 1, 0, 1, 0, 0, '', 0); $notice_display = $serial->result; } elseif ($r->niveau_biblio == 'm' && $r->niveau_hierar == 0) { //monographie $display = new mono_display($r->notice_id, 6, '', 1, '', '', '', 0, 2, 1, 1, '', 0, 0, 1, 0); $notice_display = $display->result; } $form = $recept_cat_error_form; $form = str_replace('!!serialized_post!!', rawurlencode(serialize($_POST)), $form); $form = str_replace('!!existant_notice_id!!', $r->notice_id, $form); $form = str_replace('!!existant_b_level!!', $r->niveau_biblio, $form); $form = str_replace('!!existant_h_level!!', $r->niveau_hierar, $form); $form = str_replace('!!signature!!', $signature, $form); $form = str_replace('!!id_lig!!', $id_lig, $form); $form = str_replace('!!serialized_search!!', stripslashes($serialized_search), $form); $form = str_replace('<!-- notice_display -->', $notice_display, $form); print $form; return false; } else { $z = new z3950_notice("form"); $z->signature = $signature; $ret = $z->insert_in_database(); $notice_id = $ret[1]; $recorded = true; } break; } if ($recorded) { global $id_bibli, $id_exer, $f_fou_code, $f_dem_code, $t_dem, $f_rub_code, $cde_query, $all_query, $chk_dev, $lgstat_filter; $unserialized_search = unserialize(rawurldecode(stripslashes($serialized_search))); $id_bibli = $unserialized_search['id_bibli']; $id_exer = $unserialized_search['id_exer']; $f_fou_code = $unserialized_search['f_fou_code']; $f_dem_code = $unserialized_search['f_dem_code']; $t_dem = $unserialized_search['t_dem']; $f_rub_code = $unserialized_search['f_rub_code']; $cde_query = $unserialized_search['cde_query']; $all_query = $unserialized_search['all_query']; $chk_dev = $unserialized_search['chk_dev']; $lgstat_filter = $unserialized_search['lgstat_filter']; if ($notice_id) { $typ_lig = 1; if ($b_level == 'a' && $h_level == 2) { $typ_lig = 5; } lignes_actes::updateFields(array(0 => $id_lig), array('num_produit' => $notice_id, 'type_ligne' => $typ_lig)); } } return $recorded; }