コード例 #1
0
function list_indexint($cle, $indexint_list, $nav_bar)
{
    global $indexint_list_tmpl;
    global $charset, $id_pclass;
    $indexint_list_tmpl = str_replace("!!cle!!", $cle, $indexint_list_tmpl);
    $indexint_list_tmpl = str_replace("!!list!!", $indexint_list, $indexint_list_tmpl);
    $indexint_list_tmpl = str_replace("!!nav_bar!!", $nav_bar, $indexint_list_tmpl);
    indexint::search_form($id_pclass);
    print pmb_bidi($indexint_list_tmpl);
}
コード例 #2
0
ファイル: indexint.class.php プロジェクト: hogsim/PMB
 function update($nom, $comment, $id_pclass = 0)
 {
     global $dbh;
     global $msg;
     global $include_path;
     global $thesaurus_classement_mode_pmb, $thesaurus_classement_defaut;
     global $thesaurus_concepts_active;
     if (!$nom) {
         return false;
     }
     // nettoyage de la chaîne en entrée
     $nom = clean_string($nom);
     if ($thesaurus_classement_mode_pmb == 0 || $id_pclass == 0) {
         $id_pclass = $thesaurus_classement_defaut;
     }
     $requete = "SET indexint_name='{$nom}', ";
     $requete .= "indexint_comment='{$comment}', ";
     $requete .= "num_pclass='{$id_pclass}', ";
     $requete .= "index_indexint=' " . strip_empty_words($nom . " " . $comment) . " '";
     if ($this->indexint_id) {
         // update
         $requete = 'UPDATE indexint ' . $requete;
         $requete .= ' WHERE indexint_id=' . $this->indexint_id . ' LIMIT 1;';
         if (pmb_mysql_query($requete, $dbh)) {
             $aut_link = new aut_link(AUT_TABLE_INDEXINT, $this->indexint_id);
             $aut_link->save_form();
             $aut_pperso = new aut_pperso("indexint", $this->indexint_id);
             $aut_pperso->save_form();
             indexint::update_index($this->indexint_id);
             audit::insert_modif(AUDIT_INDEXINT, $this->indexint_id);
         } else {
             require_once "{$include_path}/user_error.inc.php";
             warning($msg[indexint_update], $msg[indexint_unable]);
             return FALSE;
         }
     } else {
         // création : s'assurer que le nom n'existe pas déjà
         $dummy = "SELECT * FROM indexint WHERE indexint_name = '" . $nom . "' and num_pclass='" . $id_pclass . "' LIMIT 1 ";
         $check = pmb_mysql_query($dummy, $dbh);
         if (pmb_mysql_num_rows($check)) {
             require_once "{$include_path}/user_error.inc.php";
             warning($msg[indexint_create], $msg[indexint_exists]);
             return FALSE;
         }
         $requete = 'INSERT INTO indexint ' . $requete . ';';
         if (pmb_mysql_query($requete, $dbh)) {
             $this->indexint_id = pmb_mysql_insert_id();
             $aut_link = new aut_link(AUT_TABLE_INDEXINT, $this->indexint_id);
             $aut_link->save_form();
             $aut_pperso = new aut_pperso("indexint", $this->indexint_id);
             $aut_pperso->save_form();
             audit::insert_creation(AUDIT_INDEXINT, $this->indexint_id);
         } else {
             require_once "{$include_path}/user_error.inc.php";
             warning($msg[indexint_create], $msg[indexint_unable_create]);
             return FALSE;
         }
     }
     // Indexation concepts
     if ($thesaurus_concepts_active == 1) {
         $index_concept = new index_concept($this->indexint_id, TYPE_INDEXINT);
         $index_concept->save();
     }
     // Mise à jour des vedettes composées contenant cette autorité
     vedette_composee::update_vedettes_built_with_element($this->indexint_id, "indexint");
     return TRUE;
 }
コード例 #3
0
ファイル: pmbesClean.class.php プロジェクト: bouchra012/PMB
 function cleanIndexint()
 {
     global $msg, $dbh, $charset, $PMBusername;
     if (SESSrights & ADMINISTRATION_AUTH) {
         $result .= "<h3>" . htmlentities($msg["nettoyage_suppr_indexint"], ENT_QUOTES, $charset) . "</h3>";
         $query = mysql_query("SELECT indexint_id from indexint left join notices on indexint=indexint_id where notice_id is null", $dbh);
         $affected = 0;
         if ($affected = mysql_num_rows($query)) {
             while ($ligne = mysql_fetch_object($query)) {
                 $tu = new indexint($ligne->indexint_id);
                 $tu->delete();
             }
         }
         $query = mysql_query("update notices left join indexint ON indexint=indexint_id SET indexint=0 WHERE indexint_id is null", $dbh);
         $result .= $affected . " " . htmlentities($msg["nettoyage_res_suppr_indexint"], ENT_QUOTES, $charset);
         $opt = mysql_query('OPTIMIZE TABLE indexint');
     } else {
         $result .= sprintf($msg["planificateur_rights_bad_user_rights"], $PMBusername);
     }
     return $result;
 }
コード例 #4
0
 function aut_list()
 {
     global $search_subject;
     global $search_indexint, $search_indexint_id;
     global $msg;
     global $charset;
     global $show_empty;
     $pair_impair = "";
     $parity = 0;
     if ($search_subject) {
         $human[] = "<b>" . $msg["histo_subject"] . "</b> " . htmlentities(stripslashes($search_subject), ENT_QUOTES, $charset);
     }
     if ($search_indexint) {
         $human[] = "<b>" . $msg["histo_indexint"] . "</b> " . htmlentities(stripslashes($search_indexint), ENT_QUOTES, $charset);
     }
     $this->human_query = implode(", ", $human);
     $this->human_aut_query = implode(", ", $human);
     if ($this->nb_s) {
         $empty = false;
         print "<strong>{$msg[23]} : " . sprintf($msg["searcher_results"], $this->nb_s) . "</strong><hr /><table>";
         while ($categ = @pmb_mysql_fetch_object($this->s_query)) {
             $pair_impair = $parity % 2 ? "even" : "odd";
             $temp = new category($categ->categ_id);
             if ($temp->voir_id) {
                 $cr = $temp->catalog_form;
                 $temp = new category($temp->voir_id);
                 $display = htmlentities($cr, ENT_QUOTES, $charset) . " -> <i>" . htmlentities($temp->catalog_form, ENT_QUOTES, $charset) . "@</i>";
             } else {
                 $display = htmlentities($temp->catalog_form, ENT_QUOTES, $charset);
             }
             if ($temp->has_notices()) {
                 $notice_count = $temp->notice_count(false);
                 $link_categ = "<td><a href='" . $this->base_url . "&aut_id=" . $temp->id . "&aut_type=categ&etat=aut_search'>{$display}</a></td><td>{$notice_count}</td>";
             } else {
                 $empty = true;
                 if ($show_empty) {
                     $link_categ = "<td>{$display}</td><td></td>";
                 } else {
                     $link_categ = "";
                 }
             }
             if ($link_categ) {
                 print "<tr class=\"{$pair_impair}\">{$link_categ}</tr>";
             }
         }
         print "</table>";
         if ($empty && !$show_empty) {
             print "<a href='#' onClick=\"document.store_search.show_empty.value=1; document.store_search.page.value=0; document.store_search.submit(); return false;\">" . $msg["searcher_categ_empty_results"] . "</a>";
         }
     }
     if ($this->nb_i || $this->nb_id) {
         if ($this->nb_id) {
             print "<br /><strong>{$msg[indexint_catal_title]} " . $msg["searcher_exact_indexint"] . ": " . sprintf($msg["searcher_results"], $this->nb_id) . "</strong><hr /><table>";
             $id_ = array();
             $empty = false;
             while ($indexint = @pmb_mysql_fetch_object($this->id_query)) {
                 $pair_impair = $parity % 2 ? "even" : "odd";
                 $id_[$indexint->indexint_id] = 1;
                 $temp = new indexint($indexint->indexint_id);
                 $display = htmlentities($temp->name . " - " . $temp->comment, ENT_QUOTES, $charset);
                 if ($temp->has_notices()) {
                     $notice_count_sql = "SELECT count(*) FROM notices WHERE indexint = " . $temp->indexint_id;
                     $notice_count = pmb_mysql_result(pmb_mysql_query($notice_count_sql), 0, 0);
                     $link = "<td><a href='" . $this->base_url . "&aut_id=" . $temp->indexint_id . "&aut_type=indexint&etat=aut_search'>{$display}</a></td><td>" . $notice_count . "</td>";
                 } else {
                     $empty = true;
                     if ($show_empty) {
                         $link = "<td>{$display}</td><td></td>";
                     } else {
                         $link = "";
                     }
                 }
                 if ($link) {
                     print "<tr class=\"{$pair_impair}\">{$link}</tr>";
                     $parity += 1;
                 }
             }
             print "</table>";
             if ($empty && !$show_empty) {
                 print "<a href='#' onClick=\"document.store_search.show_empty.value=1; document.store_search.page.value=0; document.store_search.submit(); return false;\">" . $msg["searcher_indexint_empty_results"] . "</a><br /><br />";
             }
         }
         $i_ = "";
         if ($this->nb_i) {
             $empty = false;
             while ($indexint = @pmb_mysql_fetch_object($this->i_query)) {
                 $pair_impair = $parity % 2 ? "even" : "odd";
                 if (!$id_[$indexint->indexint_id]) {
                     $temp = new indexint($indexint->indexint_id);
                     $display = htmlentities($temp->name . " - " . $temp->comment, ENT_QUOTES, $charset);
                     if ($temp->has_notices()) {
                         $notice_count_sql = "SELECT count(*) FROM notices WHERE indexint = " . $temp->indexint_id;
                         $notice_count = pmb_mysql_result(pmb_mysql_query($notice_count_sql), 0, 0);
                         $link = "<td><a href='" . $this->base_url . "&aut_id=" . $temp->indexint_id . "&aut_type=indexint&etat=aut_search'>{$display}</a></td><td>" . $notice_count . "</td>";
                     } else {
                         $empty = true;
                         if ($show_empty) {
                             $link = "<td>{$display}</td><td></td>";
                         } else {
                             $link = "";
                         }
                     }
                     if ($link) {
                         $i_ .= "<tr class=\"{$pair_impair}\">{$link}</tr>";
                         $parity += 1;
                     }
                 } else {
                     $this->nb_i--;
                 }
             }
             $i_ = "<br /><strong>{$msg[indexint_catal_title]} " . $msg["searcher_descr_indexint"] . " : " . sprintf($msg["searcher_results"], $this->nb_i) . "</strong><hr /><table>" . $i_;
             $i_ .= "</table>";
             if ($empty && !$show_empty) {
                 $i_ .= "<a href='#' onClick=\"document.store_search.show_empty.value=1; document.store_search.page.value=0; document.store_search.submit(); return false;\">" . $msg["searcher_indexint_empty_results"] . "</a>";
             }
             print $i_;
         }
     }
 }
コード例 #5
0
function import_new_notice_suite()
{
    global $dbh;
    global $notice_id;
    global $index_sujets;
    global $pmb_keyword_sep;
    global $id_notices_custom_opsys, $id_notices_custom_type_opsys;
    global $info_001, $info_464, $info_464_a, $info_464_e, $info_464_f, $info_461_3, $info_461_t, $info_200_a, $info_200_e, $info_210_d, $info_902_a, $info_686_a, $info_462_3, $info_462_t;
    global $num_thesaurus, $thes;
    global $info_675_a;
    global $info_600_a, $info_600_b, $info_600_j, $info_600_x, $info_600_y, $info_600_z;
    global $info_601_a, $info_601_b, $info_601_j, $info_601_x, $info_601_y, $info_601_z;
    global $info_602_a, $info_602_b, $info_602_j, $info_602_x, $info_602_y, $info_602_z;
    global $info_605_a, $info_605_b, $info_605_j, $info_605_x, $info_605_y, $info_605_z;
    global $info_606_a, $info_606_b, $info_606_j, $info_606_x, $info_606_y, $info_606_z;
    global $info_607_a, $info_607_b, $info_607_j, $info_607_x, $info_607_y, $info_607_z;
    global $info_610_a, $info_610_e, $info_610_b, $info_610_j, $info_610_x, $info_610_y, $info_610_z, $info_610_3, $info_610;
    global $bulletin_id;
    global $flag_titre_serie_recuperation;
    global $flag_depouillements_464, $flag_depouillements_464_doc_sonore, $flag_depouillements_464_doc_imprime;
    global $aut_700, $aut_701, $aut_702, $aut_710, $aut_711, $aut_712;
    global $accomp_345_c;
    global $table_responsability_function;
    global $lang, $include_path, $xml_changement;
    global $info_345_d;
    global $info_071_a, $info_071_b;
    global $thes_centre_interet, $num_thesaurus_centre_interet, $info_901;
    global $flag_import_610_in_mot_cles, $thes_610, $num_thesaurus_610;
    global $collection_225, $sous_coll;
    // prix dvd et video
    if ($info_345_d[0]) {
        $requete = "update notices set prix='" . addslashes($info_345_d[0]) . "' where notice_id='{$notice_id}' ";
        pmb_mysql_query($requete);
    }
    // EAN
    if ($info_071_a[0]) {
        $requete = "update notices set code='" . addslashes($info_071_a[0]) . "' where notice_id='{$notice_id}' ";
        pmb_mysql_query($requete);
    }
    // Producteur -> Editeur
    if ($info_071_b[0]) {
        $nom = $info_071_b[0];
        $requete = "select ed_id from publishers where ed_name='" . addslashes($nom) . "' ";
        $result = pmb_mysql_query($requete);
        if ($row = pmb_mysql_fetch_row($result)) {
            $ed_id = $row[0];
        } else {
            $requete = "insert into publishers SET ed_name='{$nom}', ";
            $requete .= "index_publisher=' " . strip_empty_words($nom) . " '";
            pmb_mysql_query($requete);
            $ed_id = pmb_mysql_insert_id();
        }
        $requete = "update notices set ed1_id='" . $ed_id . "' where notice_id='{$notice_id}' ";
        pmb_mysql_query($requete);
    }
    // 345_c Matériel d'accompagnement
    if ($accomp_345_c[0]) {
        $requete = "update notices set accomp='" . addslashes($accomp_345_c[0]) . "' where notice_id='{$notice_id}' ";
        pmb_mysql_query($requete);
    }
    update_authors_num_opsys($aut_700, 0);
    update_authors_num_opsys($aut_701, 1);
    update_authors_num_opsys($aut_702, 2);
    update_authors_num_opsys($aut_710, 2);
    update_authors_num_opsys($aut_711, 2);
    update_authors_num_opsys($aut_712, 2);
    if ($xml_changement) {
        xml_save_table("{$include_path}/marc_tables/{$lang}/function_subst.xml", $table_responsability_function);
    }
    //UDC
    if ($info_675_a[0]) {
        $indexint_id = indexint::import(clean_string($info_675_a[0]));
        $requete = "update notices set indexint='{$indexint_id}' where notice_id='{$notice_id}' ";
        pmb_mysql_query($requete);
    }
    if ($aut_700[0][a] != "") {
        if ($aut_700[0][3] != "") {
            $requete = "select author_id from authors where author_name='" . addslashes($aut_700[0][a]) . "' and author_rejete='" . addslashes($aut_700[0][b]) . "' ";
            $result = pmb_mysql_query($requete);
            if ($row = pmb_mysql_fetch_row($result)) {
                $author_id = $row[0];
                $requete = "update authors set author_comment='" . addslashes($aut_700[0][3]) . "' where author_id='{$author_id}' ";
                pmb_mysql_query($requete);
            }
        }
    }
    if ($sous_coll == '1' && $collection_225[0]['a'] != "" && $collection_225[1]['a'] != "") {
        $q = "select coll_id from notices where notice_id='{$notice_id}' ";
        $r = pmb_mysql_query($q, $dbh);
        $coll_id = pmb_mysql_result($r, 0, 0);
        if ($coll_id != '0') {
            /* sous collection */
            $subcollec['name'] = clean_string($collection_225[1]['a']);
            $subcollec['coll_parent'] = $coll_id;
            $subcoll_id = subcollection::import($subcollec);
            $requete = "update notices set subcoll_id='{$subcoll_id}' where notice_id='{$notice_id}' ";
            pmb_mysql_query($requete);
        }
    }
    $bulletin_id = 0;
    // Effacement de la notice temporaire eventuelle
    list($num_opsys, $type_opsys) = explode(" ", $info_001[0]);
    if ($type_opsys == 'UMO:13') {
        $requete = "update notices set niveau_biblio='b', niveau_hierar='2' where notice_id='{$notice_id}' ";
        //print "$requete <br />";
        pmb_mysql_query($requete);
    }
    if ($type_opsys == 'UMO:23' || $type_opsys == 'UMO:3') {
        // Titre de périodique
        $requete = "select * from notices_custom_values where notices_custom_small_text='" . $num_opsys . "'";
        //print "new $type_opsys:    $requete <br />";
        $resultat = pmb_mysql_query($requete);
        //Notice existe-t-elle comme notice temporaire?
        if (@pmb_mysql_num_rows($resultat)) {
            //Si oui, récupération id notice temporaire a supprimer
            $old_n = pmb_mysql_fetch_object($resultat);
            $notice_id_old = $old_n->notices_custom_origine;
            // modifie les anciennes relations sur la vrai notice
            $requete = "update notices_relations set linked_notice='{$notice_id}' where linked_notice='{$notice_id_old}' ";
            //print "$requete <br />";
            pmb_mysql_query($requete);
            $requete = "update bulletins set bulletin_notice='{$notice_id}' where bulletin_notice='{$notice_id_old}' ";
            //print "$requete <br />";
            pmb_mysql_query($requete);
            $requete = "update notices set niveau_biblio='s', niveau_hierar='1' where notice_id='{$notice_id}' ";
            //print "$requete <br />";
            pmb_mysql_query($requete);
            // suppression de la notice temporaire
            $requete = "delete from notices where notice_id=" . $notice_id_old;
            pmb_mysql_query($requete);
            $requete = "delete from notices_custom_values where notices_custom_origine='" . $notice_id_old . "'";
            pmb_mysql_query($requete);
            //print "$requete <br />";
        } else {
            $requete = "update notices set niveau_biblio='s', niveau_hierar='1' where notice_id='{$notice_id}' ";
            pmb_mysql_query($requete);
        }
    } else {
        if ($type_opsys == 'UMO:41' || $type_opsys == 'UMO:42') {
            // Dépouillement (hors article)
            //Rien
        } else {
            if ($type_opsys == 'UMO:43') {
                // Dépouillement article de périodique
                $requete = "select * from notices_custom_values where notices_custom_small_text='" . $num_opsys . "'";
                //print "new $type_opsys:    $requete <br />";
                $resultat = pmb_mysql_query($requete);
                //Notice existe-t-elle comme notice temporaire?
                if (@pmb_mysql_num_rows($resultat)) {
                    //Si oui, récupération id notice temporaire a supprimer
                    $old_n = pmb_mysql_fetch_object($resultat);
                    $notice_id_old = $old_n->notices_custom_origine;
                    // modifie les anciennes relations sur la vrai notice
                    $requete = "update analysis set analysis_notice='{$notice_id}' where analysis_notice='{$notice_id_old}' ";
                    //print "$requete <br />";
                    pmb_mysql_query($requete);
                    $requete = "update notices set niveau_biblio='a', niveau_hierar='2' where notice_id='{$notice_id}' ";
                    //print "$requete <br />";
                    pmb_mysql_query($requete);
                    // suppression de la notice temporaire
                    $requete = "delete from notices where notice_id=" . $notice_id_old;
                    pmb_mysql_query($requete);
                    $requete = "delete from notices_custom_values where notices_custom_origine='" . $notice_id_old . "'";
                    pmb_mysql_query($requete);
                } else {
                    $requete = "update notices set niveau_biblio='a', niveau_hierar='2' where notice_id='{$notice_id}' ";
                    pmb_mysql_query($requete);
                    //print "$requete <br />";
                }
            } else {
                // UMO 1 2 4 8 21 22 24 28
                $is_serie = $type_opsys == 'UMO:21' || $type_opsys == 'UMO:22' || $type_opsys == 'UMO:24' || $type_opsys == 'UMO:28';
                if ($flag_titre_serie_recuperation && $is_serie || !$is_serie) {
                    $requete = "select * from notices_custom_values where notices_custom_small_text='" . $num_opsys . "'";
                    //print "new $type_opsys:    $requete <br />";
                    $resultat = pmb_mysql_query($requete);
                    //Notice existe-t-elle comme notice temporaire?
                    if (@pmb_mysql_num_rows($resultat)) {
                        //Si oui, récupération id notice temporaire a supprimer
                        $old_n = pmb_mysql_fetch_object($resultat);
                        $notice_id_old = $old_n->notices_custom_origine;
                        // modifie les anciennes relations sur la vrai notice
                        $requete = "update notices_relations set linked_notice='{$notice_id}' where linked_notice='{$notice_id_old}' ";
                        //print "$requete <br />";
                        pmb_mysql_query($requete);
                        // suppression de la notice temporaire
                        $requete = "delete from notices where notice_id=" . $notice_id_old;
                        pmb_mysql_query($requete);
                        $requete = "delete from notices_custom_values where notices_custom_origine='" . $notice_id_old . "'";
                        pmb_mysql_query($requete);
                        //print "$requete <br />";
                    }
                } else {
                    if ($is_serie) {
                        // suprimer la notice car on en veut pas
                        del_notice($notice_id);
                        return;
                    }
                }
            }
        }
    }
    //Genre dans Thesaurus
    for ($i = 0; $i < count($info_902_a); $i++) {
        for ($j = 0; $j < count($info_902_a[$i]); $j++) {
            $resultat = categories::searchLibelle(addslashes($info_902_a[$i][$j]), $num_thesaurus, 'fr_FR');
            if (!$resultat) {
                /*vérification de l'existence des categs, sinon création */
                $resultat = create_categ($thes, $thes->num_noeud_racine, $info_902_a[$i][$j], ' ' . strip_empty_words($info_902_a[$i][$j]) . ' ');
            }
            /* ajout de l'indexation à la notice dans la table notices_categories*/
            $rqt_ajout = "insert into notices_categories set notcateg_notice='" . $notice_id . "', num_noeud='" . $resultat . "' ";
            $res_ajout = @pmb_mysql_query($rqt_ajout, $dbh);
        }
    }
    //centre interet dans Thesaurus
    for ($i = 0; $i < count($info_901); $i++) {
        $resultat = categories::searchLibelle(addslashes($info_901[$i]['a']), $num_thesaurus_centre_interet, 'fr_FR');
        if (!$resultat) {
            /*vérification de l'existence des categs, sinon création */
            $resultat = create_categ($thes_centre_interet, $thes_centre_interet->num_noeud_racine, $info_901[$i]['a'], ' ' . strip_empty_words($info_901[$i]['a']) . ' ', $info_901[$i][3]);
        }
        /* ajout de l'indexation à la notice dans la table notices_categories*/
        $rqt_ajout = "insert into notices_categories set notcateg_notice='" . $notice_id . "', num_noeud='" . $resultat . "' ";
        $res_ajout = @pmb_mysql_query($rqt_ajout, $dbh);
    }
    // Pcdm (686) dans le plan de classement
    //	print "<pre>";	print_r($info_686_a);print "</pre>";
    if (count($info_686_a)) {
        //vérification de l'existence des categs, sinon création
        $requete = "select indexint_id from indexint where indexint_name='" . addslashes($info_686_a[0]) . "' and num_pclass='2'";
        //print "$requete <br />";
        $result = pmb_mysql_query($requete);
        if ($row = pmb_mysql_fetch_row($result)) {
            $indexint_id = $row[0];
        } else {
            $requete = "insert into indexint SET indexint_name='" . addslashes($info_686_a[0]) . "', num_pclass='2' ";
            //print "$requete <br />";
            pmb_mysql_query($requete);
            $indexint_id = pmb_mysql_insert_id();
        }
        $requete = "update notices set indexint='{$indexint_id}' where notice_id='{$notice_id}' ";
        //	print "$requete <br />";
        @pmb_mysql_query($requete, $dbh);
    }
    //	if (is_array($index_sujets)) $mots_cles = implode (" $pmb_keyword_sep ",$index_sujets);
    //		else $mots_cles = $index_sujets;
    $mots_cles = '';
    for ($a = 0; $a < sizeof($info_600_a); $a++) {
        $mots_cles .= " {$pmb_keyword_sep} " . $info_600_a[$a][0];
        for ($j = 0; $j < sizeof($info_600_b[$a]); $j++) {
            $mots_cles .= " , " . $info_600_b[$a][0];
        }
        for ($j = 0; $j < sizeof($info_600_j[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_600_j[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_600_x[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_600_x[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_600_y[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_600_y[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_600_z[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_600_z[$a][$j];
        }
    }
    for ($a = 0; $a < sizeof($info_601_a); $a++) {
        $mots_cles .= " {$pmb_keyword_sep} " . $info_601_a[$a][0];
        for ($j = 0; $j < sizeof($info_601_b[$a]); $j++) {
            $mots_cles .= " , " . $info_601_b[$a][0];
        }
        for ($j = 0; $j < sizeof($info_601_j[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_601_j[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_601_x[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_601_x[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_601_y[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_601_y[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_601_z[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_601_z[$a][$j];
        }
    }
    for ($a = 0; $a < sizeof($info_602_a); $a++) {
        $mots_cles .= " {$pmb_keyword_sep} " . $info_602_a[$a][0];
        for ($j = 0; $j < sizeof($info_602_b[$a]); $j++) {
            $mots_cles .= " , " . $info_602_b[$a][0];
        }
        for ($j = 0; $j < sizeof($info_602_j[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_602_j[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_602_x[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_602_x[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_602_y[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_602_y[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_602_z[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_602_z[$a][$j];
        }
    }
    for ($a = 0; $a < sizeof($info_605_a); $a++) {
        $mots_cles .= " {$pmb_keyword_sep} " . $info_605_a[$a][0];
        for ($j = 0; $j < sizeof($info_605_b[$a]); $j++) {
            $mots_cles .= " , " . $info_605_b[$a][0];
        }
        for ($j = 0; $j < sizeof($info_605_j[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_605_j[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_605_x[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_605_x[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_605_y[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_605_y[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_605_z[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_605_z[$a][$j];
        }
    }
    for ($a = 0; $a < sizeof($info_606_a); $a++) {
        $mots_cles .= " {$pmb_keyword_sep} " . $info_606_a[$a][0];
        for ($j = 0; $j < sizeof($info_606_b[$a]); $j++) {
            $mots_cles .= " , " . $info_606_b[$a][0];
        }
        for ($j = 0; $j < sizeof($info_606_j[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_606_j[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_606_x[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_606_x[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_606_y[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_606_y[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_606_z[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_606_z[$a][$j];
        }
    }
    for ($a = 0; $a < sizeof($info_607_a); $a++) {
        $mots_cles .= " {$pmb_keyword_sep} " . $info_607_a[$a][0];
        for ($j = 0; $j < sizeof($info_607_b[$a]); $j++) {
            $mots_cles .= " , " . $info_607_b[$a][0];
        }
        for ($j = 0; $j < sizeof($info_607_j[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_607_j[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_607_x[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_607_x[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_607_y[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_607_y[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_607_z[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_607_z[$a][$j];
        }
    }
    if ($flag_import_610_in_mot_cles) {
        for ($a = 0; $a < sizeof($info_610_a); $a++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_610_a[$a][0];
            for ($j = 0; $j < sizeof($info_610_b[$a]); $j++) {
                $mots_cles .= " , " . $info_610_b[$a][0];
            }
            for ($j = 0; $j < sizeof($info_610_j[$a]); $j++) {
                $mots_cles .= " {$pmb_keyword_sep} " . $info_610_j[$a][$j];
            }
            for ($j = 0; $j < sizeof($info_610_x[$a]); $j++) {
                $mots_cles .= " {$pmb_keyword_sep} " . $info_610_x[$a][$j];
            }
            for ($j = 0; $j < sizeof($info_610_y[$a]); $j++) {
                $mots_cles .= " {$pmb_keyword_sep} " . $info_610_y[$a][$j];
            }
            for ($j = 0; $j < sizeof($info_610_z[$a]); $j++) {
                $mots_cles .= " {$pmb_keyword_sep} " . $info_610_z[$a][$j];
            }
            if (sizeof($info_610_e[$a])) {
                $mots_cles .= " ( ";
                for ($j = 0; $j < sizeof($info_610_e[$a]); $j++) {
                    if ($j) {
                        $mots_cles .= " , ";
                    }
                    $mots_cles .= $info_610_e[$a][$j];
                }
                $mots_cles .= " ) ";
            }
        }
    }
    //print"<pre>";print_r($info_610_a);print_r($info_610_e);print"</pre>";
    for ($a = 0; $a < sizeof($info_610_a); $a++) {
        $resultat = categories::searchLibelle(addslashes($info_610_a[$a][0]), $num_thesaurus_610, 'fr_FR', $thes_610->num_noeud_racine);
        if (!$resultat) {
            /*vérification de l'existence des categs, sinon création */
            $resultat = create_categ($thes_610, $thes_610->num_noeud_racine, $info_610_a[$a][0], ' ' . strip_empty_words($info_610_a[$a][0]) . ' ', $info_610_3[$a][0]);
        }
        for ($j = 0; $j < sizeof($info_610_e[$a]); $j++) {
            if ($info_610_e[$a][$j]) {
                $num_parent = $resultat;
                $resultat = categories::searchLibelle(addslashes($info_610_e[$a][$j]), $num_thesaurus_610, 'fr_FR', $num_parent);
                if (!$resultat) {
                    /*vérification de l'existence des categs, sinon création */
                    $resultat = create_categ($thes_610, $num_parent, $info_610_e[$a][$j], ' ' . strip_empty_words($info_610_e[$a][$j]) . ' ', $info_610_3[$a][0]);
                }
            }
        }
        /* ajout de l'indexation à la notice dans la table notices_categories*/
        $rqt_ajout = "insert into notices_categories set notcateg_notice='" . $notice_id . "', num_noeud='" . $resultat . "' ";
        $res_ajout = @pmb_mysql_query($rqt_ajout, $dbh);
    }
    if (substr($mots_cles, 0, 2) == ' ;') {
        $mots_cles = substr($mots_cles, 2);
    }
    $mots_cles ? $index_matieres = strip_empty_words($mots_cles) : ($index_matieres = '');
    $rqt_maj = "update notices set index_l='" . addslashes($mots_cles) . "', index_matieres=' " . addslashes($index_matieres) . " ' where notice_id='{$notice_id}' ";
    $res_ajout = pmb_mysql_query($rqt_maj, $dbh);
    // insert du param perso mémorisant le numero Opsys de la notice
    if (!$id_notices_custom_opsys) {
        $rqt = "select idchamp from notices_custom where name='num_opsys'";
        $res = pmb_mysql_query($rqt, $dbh);
        if ($res && ($r = pmb_mysql_fetch_object($res))) {
            $id_notices_custom_opsys = $r->idchamp;
        }
        $rqt = "select idchamp from notices_custom where name='type_opsys'";
        $res = pmb_mysql_query($rqt, $dbh);
        if ($res && ($r = pmb_mysql_fetch_object($res))) {
            $id_notices_custom_type_opsys = $r->idchamp;
        }
    }
    $requete = "insert into notices_custom_values (notices_custom_champ,notices_custom_origine,notices_custom_small_text) values({$id_notices_custom_opsys},{$notice_id},'" . addslashes($num_opsys) . "')";
    pmb_mysql_query($requete);
    $requete = "insert into notices_custom_values (notices_custom_champ,notices_custom_origine,notices_custom_small_text) values({$id_notices_custom_type_opsys},{$notice_id},'" . addslashes($type_opsys) . "')";
    pmb_mysql_query($requete);
    $requete = "select * from notices where notice_id={$notice_id}";
    $resultat = pmb_mysql_query($requete);
    $r = pmb_mysql_fetch_object($resultat);
    // $flag_depouillements_464_doc_sonore //	$flag_depouillements_464_doc_imprime=0;
    // Traiter les dépouillement du champ 464
    if ($flag_depouillements_464) {
        if (is_array($info_464)) {
            switch ($type_opsys) {
                case 'UMO:1':
                    // Documents imprimés Unimarc moyen
                    $niveau_biblio = 'm';
                    $niveau_hierar = '0';
                    break;
                case 'UMO:2':
                    // Documents sonores Unimarc moyen
                    $niveau_biblio = 'm';
                    $niveau_hierar = '0';
                    break;
                case 'UMO:13':
                    // bulletin
                    $niveau_biblio = 'a';
                    $niveau_hierar = '2';
                    break;
                case 'UMO:4':
                    // Documents audiovisuel Unimarc moyen
                    $niveau_biblio = 'm';
                    $niveau_hierar = '0';
                    break;
                case 'UMO:8':
                    // Logiciels - CDrom
                    $niveau_biblio = 'm';
                    $niveau_hierar = '0';
                    break;
                default:
                    $niveau_biblio = 'm';
                    $niveau_hierar = '0';
                    break;
            }
            //print "<pre>";print_r	($info_464);print "</pre>";
            for ($i = 0; $i < sizeof($info_464); $i++) {
                $a_464 = $e_464 = $_3_464 = array();
                $author_id = 0;
                for ($j = 0; $j < sizeof($info_464[$i]); $j++) {
                    if ($info_464[$i][$j]['label'] == 'a') {
                        $a_464[] = $info_464[$i][$j]['content'];
                    }
                    if ($info_464[$i][$j]['label'] == 'e') {
                        $e_464[] = $info_464[$i][$j]['content'];
                    }
                    // Complément du titre
                    if ($info_464[$i][$j]['label'] == '3') {
                        $_3_464[] = $info_464[$i][$j]['content'];
                    }
                    // Complément du titre
                }
                //print "<pre>";print_r	($_3_464);print "</pre>";
                for ($j = 0; $j < sizeof($a_464); $j++) {
                    if ($_3_464[$j]) {
                        $requete = "select author_id from authors where author_comment='" . addslashes($_3_464[$j]) . "' ";
                        $result = pmb_mysql_query($requete);
                        if ($row = pmb_mysql_fetch_row($result)) {
                            $author_id = $row[0];
                            //print $author_id."<br />";
                        }
                    }
                    if ($a_464[$j] != '...') {
                        $requete = "insert into notices set typdoc='{$r->typdoc}', tit1 ='" . addslashes($a_464[$j]) . "',tit2 ='" . addslashes($e_464[$j]) . "', niveau_biblio='{$niveau_biblio}',niveau_hierar='{$niveau_hierar}'  ";
                        //if ($type_opsys="UMO:2") print $requete ."<br />";
                        pmb_mysql_query($requete);
                        $depouille_id = pmb_mysql_insert_id();
                        if ($depouille_id) {
                            //link notice
                            $requete = "insert into notices_relations set num_notice='{$depouille_id}', linked_notice ='{$notice_id}', relation_type='a' ";
                            pmb_mysql_query($requete);
                            if ($author_id) {
                                $requete = "insert into responsability SET responsability_fonction='070' , responsability_notice='{$depouille_id}' , responsability_author = {$author_id}, responsability_type=0";
                                //print $requete."<br />";
                                $result = pmb_mysql_query($requete);
                            }
                        }
                    }
                }
            }
            /*
            for ($i=0; $i<sizeof($info_464); $i++) {	
            	$a_464='';	
            	$e_464='';
            	for ($j=0; $j<sizeof($info_464[$i]); $j++) {		
            		if($info_464[$i][$j]['label']=='a') $a_464=$info_464[$i][$j]['content'];
            		if($info_464[$i][$j]['label']=='e') $e_464=$info_464[$i][$j]['content'];
            	}	
            	$requete="insert into notices set typdoc='$r->typdoc', tit1 ='".addslashes($a_464)."',tit2 ='".addslashes($e_464)."', niveau_biblio='$niveau_biblio',niveau_hierar='$niveau_hierar'  ";
            	//if ($type_opsys="UMO:2") print $requete ."<br />";
            	pmb_mysql_query($requete);
            	$depouille_id=pmb_mysql_insert_id();
            	if ($depouille_id) {
            		//link notice
            		$requete="insert into notices_relations set num_notice='$depouille_id', linked_notice ='$notice_id', relation_type='a' ";
            		pmb_mysql_query($requete);
            	}
            } 	
            */
        }
    }
    // $info_461_3,$info_461_t : dépendance d'une notice chapeau
    for ($_3 = 0; $_3 < sizeof($info_461_3); $_3++) {
        switch ($type_opsys) {
            case 'UMO:1':
            case 'UMO:2':
            case 'UMO:4':
            case 'UMO:8':
                if ($flag_titre_serie_recuperation) {
                    // que si on veut
                    $requete = "select notices_custom_origine from notices_custom_values where notices_custom_small_text='" . $info_461_3[$_3] . "'";
                    //print "$requete  <br />";
                    $resultat = pmb_mysql_query($requete);
                    //Notice chapeau existe-t-elle ?
                    if (@pmb_mysql_num_rows($resultat)) {
                        //Si oui, récupération id
                        $chapeau_id = pmb_mysql_result($resultat, 0, 0);
                    } else {
                        $niveau_biblio = 'm';
                        $niveau_hierar = '1';
                        // Création de la notice temporaire chapeau
                        $requete = "insert into notices set typdoc='{$r->typdoc}', tit1 ='" . addslashes($info_461_t[$a]) . "' , niveau_biblio='{$niveau_biblio}',niveau_hierar='{$niveau_hierar}'  ";
                        //print "$requete  <br />";
                        pmb_mysql_query($requete);
                        $chapeau_id = pmb_mysql_insert_id();
                        $requete = "insert into notices_custom_values (notices_custom_champ,notices_custom_origine,notices_custom_small_text) values({$id_notices_custom_opsys},{$chapeau_id},'" . addslashes($info_461_3[$_3]) . "')";
                        //print "$requete <br />";
                        pmb_mysql_query($requete);
                    }
                    if ($chapeau_id) {
                        //link notice
                        $requete = "insert into notices_relations set num_notice='{$notice_id}', linked_notice ='{$chapeau_id}', relation_type='a' ";
                        //print "$requete  <br />";
                        pmb_mysql_query($requete);
                    }
                }
                break;
            case 'UMO:13':
                // bulletin  de périodique
                $requete = "select notices_custom_origine from notices_custom_values where notices_custom_small_text='" . $info_461_3[$_3] . "'";
                //print "$requete  <br />";
                $resultat = pmb_mysql_query($requete);
                //Notice chapeau existe-t-elle ?
                if (@pmb_mysql_num_rows($resultat)) {
                    //Si oui, récupération id
                    $chapeau_id = pmb_mysql_result($resultat, 0, 0);
                } else {
                    $niveau_biblio = 's';
                    $niveau_hierar = '1';
                    // Création de la notice temporaire chapeau
                    $requete = "insert into notices set typdoc='{$r->typdoc}', tit1 ='" . addslashes($info_461_t[$a]) . "' , niveau_biblio='{$niveau_biblio}',niveau_hierar='{$niveau_hierar}'  ";
                    //print "$requete  <br />";
                    pmb_mysql_query($requete);
                    $chapeau_id = pmb_mysql_insert_id();
                    $requete = "insert into notices_custom_values (notices_custom_champ,notices_custom_origine,notices_custom_small_text) values({$id_notices_custom_opsys},{$chapeau_id},'" . addslashes($info_461_3[$_3]) . "')";
                    //print "$requete <br />";
                    pmb_mysql_query($requete);
                }
                if ($chapeau_id) {
                    //link notice
                    $requete = "insert into notices_relations set num_notice='{$notice_id}', linked_notice ='{$chapeau_id}', relation_type='b' , rank ='1'";
                    //print "$requete  <br />";
                    pmb_mysql_query($requete);
                    // création bulletin
                    $info = array();
                    $bulletin = new bulletinage("", $chapeau_id);
                    $info['bul_titre'] = addslashes($info_200_a[0]);
                    $info['bul_no'] = addslashes($info_200_e[0]);
                    $info['bul_date'] = addslashes($info_200_e[1]);
                    $info['date_date'] = gen_date($info_200_e[1], $info_210_d[0]);
                    $bulletin->bull_num_notice = $notice_id;
                    $bulletin_id = $bulletin->update($info, true);
                }
                break;
            default:
                break;
        }
    }
    // $info_462_3,$info_462_t : Dépouillement, article
    for ($_3 = 0; $_3 < sizeof($info_462_3); $_3++) {
        switch ($type_opsys) {
            case 'UMO:1':
            case 'UMO:2':
            case 'UMO:8':
                $requete = "select notices_custom_origine from notices_custom_values where notices_custom_small_text='" . $info_462_3[$_3] . "'";
                //print "$requete  <br />";
                $resultat = pmb_mysql_query($requete);
                //Notice chapeau existe-t-elle ?
                if (@pmb_mysql_num_rows($resultat)) {
                    //Si oui, récupération id
                    $chapeau_id = pmb_mysql_result($resultat, 0, 0);
                } else {
                    $niveau_biblio = 'm';
                    $niveau_hierar = '0';
                    // Création de la notice temporaire chapeau
                    $requete = "insert into notices set typdoc='{$r->typdoc}', tit1 ='" . addslashes($info_462_t[$a]) . "' , niveau_biblio='{$niveau_biblio}',niveau_hierar='{$niveau_hierar}'  ";
                    //print "$requete  <br />";
                    pmb_mysql_query($requete);
                    $chapeau_id = pmb_mysql_insert_id();
                    $requete = "insert into notices_custom_values (notices_custom_champ,notices_custom_origine,notices_custom_small_text) values({$id_notices_custom_opsys},{$chapeau_id},'" . addslashes($info_462_3[$_3]) . "')";
                    //print "$requete <br />";
                    pmb_mysql_query($requete);
                }
                if ($chapeau_id) {
                    //link notice
                    $requete = "insert into notices_relations set num_notice='{$notice_id}', linked_notice ='{$chapeau_id}', relation_type='a' ";
                    //print "$requete  <br />";
                    pmb_mysql_query($requete);
                }
                break;
            case 'UMO:13':
                // bulletin de périodique => création des articles
                $requete = "select notices_custom_origine from notices_custom_values where notices_custom_small_text='" . $info_462_3[$_3] . "'";
                //print "$requete  <br />";
                $resultat = pmb_mysql_query($requete);
                //Notice article existe-t-elle ?
                if (@pmb_mysql_num_rows($resultat)) {
                    //Si oui, récupération id
                    $article_id = pmb_mysql_result($resultat, 0, 0);
                } else {
                    $niveau_biblio = 'a';
                    $niveau_hierar = '2';
                    // Création de la notice temporaire de l'article
                    $requete = "insert into notices set typdoc='{$r->typdoc}', tit1 ='" . addslashes($info_462_t[$a]) . "' , niveau_biblio='{$niveau_biblio}',niveau_hierar='{$niveau_hierar}'  ";
                    //print "$requete  <br />";
                    pmb_mysql_query($requete);
                    $article_id = pmb_mysql_insert_id();
                    $requete = "insert into notices_custom_values (notices_custom_champ,notices_custom_origine,notices_custom_small_text) values({$id_notices_custom_opsys},{$article_id},'" . addslashes($info_462_3[$_3]) . "')";
                    //print "$requete <br />";
                    pmb_mysql_query($requete);
                }
                if ($article_id) {
                    //lien article de bulletin créé dans table analitique
                    $requete = "insert into analysis set analysis_bulletin='{$bulletin_id}', analysis_notice ='{$article_id}' ";
                    //print "$requete  <br />";
                    pmb_mysql_query($requete);
                }
                break;
            default:
                break;
        }
    }
}
コード例 #6
0
ファイル: indexint.inc.php プロジェクト: bouchra012/PMB
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
require_once "{$class_path}/indexint.class.php";
// la taille d'un paquet de notices
$lot = SERIE_PAQUET_SIZE;
// defini dans ./params.inc.php
// taille de la jauge pour affichage
$jauge_size = GAUGE_SIZE;
// initialisation de la borne de départ
if (!isset($start)) {
    $start = 0;
}
$v_state = urldecode($v_state);
print "<br /><br /><h2 align='center'>" . htmlentities($msg["nettoyage_suppr_indexint"], ENT_QUOTES, $charset) . "</h2>";
$query = mysql_query("SELECT indexint_id from indexint left join notices on indexint=indexint_id where notice_id is null");
$affected = 0;
if ($affected = mysql_num_rows($query)) {
    while ($ligne = mysql_fetch_object($query)) {
        $tu = new indexint($ligne->indexint_id);
        $tu->delete();
    }
}
$query = mysql_query("update notices left join indexint ON indexint=indexint_id SET indexint=0 WHERE indexint_id is null");
$spec = $spec - CLEAN_INDEXINT;
$v_state .= "<br /><img src=../../images/d.gif hspace=3>" . htmlentities($msg["nettoyage_suppr_indexint"], ENT_QUOTES, $charset) . " : ";
$v_state .= $affected . " " . htmlentities($msg["nettoyage_res_suppr_indexint"], ENT_QUOTES, $charset);
$opt = mysql_query('OPTIMIZE TABLE indexint');
// mise à jour de l'affichage de la jauge
print "<table border='0' align='center' width='{$table_size}' cellpadding='0'><tr><td class='jauge'>\n  \t\t\t<img src='../../images/jauge.png' width='{$jauge_size}' height='16'></td></tr></table>\n \t\t\t<div align='center'>100%</div>";
print "\n\t<form class='form-{$current_module}' name='process_state' action='./clean.php' method='post'>\n\t\t<input type='hidden' name='v_state' value=\"{$v_state}\">\n\t\t<input type='hidden' name='spec' value=\"{$spec}\">\n\t</form>\n\t<script type=\"text/javascript\"><!--\n\t\tdocument.forms['process_state'].submit();\n\t\t-->\n\t</script>";
コード例 #7
0
}
// affichage des membres de la page
if ($bt_ajouter == "no") {
    $bouton_ajouter = "";
} else {
    $bouton_ajouter = "<div class='row'><input type='button' class='bouton_small' onclick=\"document.location='{$base_url}&action=add&deb_rech='+document.forms['search_form'].f_user_input.value+'{$pclass_url}'\" value='{$msg['indexint_create_button']}'></div>";
}
switch ($action) {
    case 'add':
        $indexint_form = str_replace("!!deb_saisie!!", htmlentities(stripslashes($f_user_input), ENT_QUOTES, $charset), $indexint_form);
        print $indexint_form;
        break;
    case 'update':
        $value = $indexint_nom;
        require_once "{$class_path}/indexint.class.php";
        $indexint = new indexint(0);
        $indexint->update($value, $indexint_comment, $id_pclass);
        $sel_search_form = str_replace("!!bouton_ajouter!!", $bouton_ajouter, $sel_search_form);
        $sel_search_form = str_replace("!!deb_rech!!", htmlentities(stripslashes($f_user_input), ENT_QUOTES, $charset), $sel_search_form);
        if ((string) $exact == "") {
            $exact = 1;
        }
        if ($exact) {
            $sel_search_form = str_replace("!!check1!!", "checked", $sel_search_form);
            $sel_search_form = str_replace("!!check0!!", "", $sel_search_form);
        } else {
            $sel_search_form = str_replace("!!check1!!", "", $sel_search_form);
            $sel_search_form = str_replace("!!check0!!", "checked", $sel_search_form);
        }
        print $sel_search_form;
        print $jscript;
コード例 #8
0
 function update_in_database($id_notice = 0)
 {
     global $dbh;
     global $pmb_synchro_rdf;
     $new_notice = 2;
     $notice_retour = $id_notice;
     if (!$id_notice) {
         $retour = array(2, 0);
         return $retour;
     }
     //synchro_rdf
     if ($pmb_synchro_rdf) {
         $synchro_rdf = new synchro_rdf();
         $synchro_rdf->delRdf($notice_retour, 0);
     }
     // traitement des titres uniformes
     global $pmb_use_uniform_title;
     if ($pmb_use_uniform_title) {
         if (count($this->titres_uniformes)) {
             $ntu = new tu_notice($id_notice);
             $ntu->update($this->titres_uniformes);
         }
     }
     for ($i = 0; $i < 2; $i++) {
         if ($this->editors[$i]['id']) {
             $editor_ids[$i] = $this->editors[$i]['id'];
         } else {
             $editor_ids[$i] = editeur::import($this->editors[$i]);
         }
     }
     if ($this->collection["id"]) {
         $collection_id = $this->collection["id"];
     } else {
         $this->collection['parent'] = $editor_ids[0];
         $collection_id = collection::import($this->collection);
     }
     if ($this->subcollection["id"]) {
         $subcollection_id = $this->subcollection["id"];
     } else {
         $this->subcollection['coll_parent'] = $collection_id;
         $subcollection_id = subcollection::import($this->subcollection);
         $serie_id = serie::import(stripslashes($this->serie));
     }
     /* traitement de Dewey */
     if (!$this->internal_index) {
         if (!$this->dewey["new_comment"]) {
             $this->dewey["new_comment"] = "";
         }
         if (!$this->dewey["new_pclass"]) {
             $this->dewey["new_pclass"] = "";
         }
         $this->internal_index = indexint::import(clean_string($this->dewey[0]), clean_string($this->dewey["new_comment"]), clean_string($this->dewey["new_pclass"]));
     }
     $date_parution_z3950 = notice::get_date_parution($this->year);
     /* Origine de la notice */
     $this->orinot_id = origine_notice::import($this->origine_notice);
     if ($this->orinot_id == 0) {
         $this->orinot_id = 1;
     }
     $sql_ins = "update notices set\n\t\t\ttypdoc           \t='" . $this->document_type . "',\n\t\t\tcode        \t        ='" . $this->isbn . "',\t            \n\t\t\ttit1                    ='" . $this->titles[0] . "',             \n\t\t\ttit2                    ='" . $this->titles[1] . "',             \n\t\t\ttit3                    ='" . $this->titles[2] . "',             \n\t\t\ttit4                    ='" . $this->titles[3] . "',             \n\t\t\ttparent_id              ='" . $serie_id . "',                    \n\t\t\ttnvol                   ='" . $this->nbr_in_serie . "',          \n\t\t\ted1_id                  =" . $editor_ids[0] . " ,                \n\t\t\ted2_id                  =" . $editor_ids[1] . " ,                \n\t\t\tyear                    ='" . $this->year . "',                  \n\t\t\tnpages                  ='" . $this->page_nbr . "',              \n\t\t\till                     ='" . $this->illustration . "',          \n\t\t\tsize                    ='" . $this->size . "',                  \n\t\t\taccomp                  ='" . $this->accompagnement . "',        \n\t\t\tcoll_id                 =" . $collection_id . " ,                \n\t\t\tsubcoll_id              =" . $subcollection_id . " ,             \n\t\t\tnocoll                  ='" . $this->nbr_in_collection . "',     \n\t\t\tmention_edition         ='" . $this->mention_edition . "',       \n\t\t\tn_gen                   ='" . $this->general_note . "',          \n\t\t\tn_contenu               ='" . $this->content_note . "',          \n\t\t\tn_resume                ='" . $this->abstract_note . "',         \n\t\t\tindexint                ='" . $this->internal_index . "',          \n\t\t\tstatut\t\t\t\t\t='" . $this->statut . "',\n\t\t\tcommentaire_gestion\t\t='" . $this->commentaire_gestion . "',\n\t\t\tindexation_lang\t\t\t='" . $this->indexation_lang . "',\n\t\t\tthumbnail_url\t\t\t='" . $this->thumbnail_url . "',\n\t\t\tindex_l                 ='" . clean_tags($this->free_index) . "',                \n\t\t\tniveau_biblio           ='" . $this->bibliographic_level . "',   \n\t\t\tniveau_hierar           ='" . $this->hierarchic_level . "',      \n\t\t\tlien                    ='" . $this->link_url . "',              \n\t\t\teformat                 ='" . $this->link_format . "',           \n\t\t\torigine_catalogage      ='" . $this->orinot_id . "',             \n\t\t\tprix                    ='" . $this->prix . "',\n\t\t\tdate_parution \t\t\t='" . $date_parution_z3950 . "'             \n\t\t\twhere notice_id='{$id_notice}' ";
     //echo "<pre>";
     //print_r($this->aut_array);
     //echo "</pre>";
     //echo $sql_ins."<br />";
     //echo "<pre>";
     //print_r($this->categories);
     //echo "</pre>";
     //exit;
     $sql_result_ins = pmb_mysql_query($sql_ins) or die("Couldn't update notices : " . $sql_ins);
     $notice_retour = $id_notice;
     audit::insert_modif(AUDIT_NOTICE, $id_notice);
     // purge de la base des responsabilités de la notice intégrée...
     if ($notice_retour) {
         $rqt_del = "delete from responsability where responsability_notice='{$notice_retour}'";
         $sql_result_del = pmb_mysql_query($rqt_del) or die("Couldn't purge table responsability : " . $rqt_del);
     }
     $rqt_ins = "insert into responsability (responsability_author, responsability_notice, responsability_fonction, responsability_type, responsability_ordre) VALUES ";
     for ($i = 0; $i < sizeof($this->aut_array); $i++) {
         $aut['id'] = clean_string($this->aut_array[$i]['id']);
         $aut['name'] = clean_string($this->aut_array[$i]['entree']);
         $aut['rejete'] = clean_string($this->aut_array[$i]['rejete']);
         $aut['date'] = clean_string($this->aut_array[$i]['date']);
         $aut['type'] = $this->aut_array[$i]['type_auteur'];
         $aut['subdivision'] = clean_string($this->aut_array[$i]['subdivision']);
         $aut['numero'] = clean_string($this->aut_array[$i]['numero']);
         $aut['lieu'] = clean_string($this->aut_array[$i]['lieu']);
         $aut['ville'] = clean_string($this->aut_array[$i]['ville']);
         $aut['pays'] = clean_string($this->aut_array[$i]['pays']);
         $aut['web'] = clean_string($this->aut_array[$i]['web']);
         $aut['author_comment'] = clean_string($this->aut_array[$i]['author_comment']);
         $aut['authority_number'] = clean_string($this->aut_array[$i]['authority_number']);
         /* Origine de l'autorité : on reprend les infos d'origine de la notice pour les attribuées aux origines des autorités */
         $id_origine_auth = 0;
         $id_origine_auth = origin_authorities::import($this->origine_notice);
         if ($id_origine_auth == 0) {
             $id_origine_auth = 1;
         }
         // import de l'autorité auteur si elle n'existe pas et conservation des infos sur l'origine de l'autorité
         if ($aut['authority_number'] != '' && $id_origine_auth) {
             $this->aut_array[$i]["id"] = $this->insert_authority_infos($aut['authority_number'], "author", $id_origine_auth, $aut);
         }
         if (!$this->aut_array[$i]["id"]) {
             $this->aut_array[$i]["id"] = auteur::import($aut);
         }
         if ($this->aut_array[$i]["id"]) {
             $rqt = $rqt_ins . " (" . $this->aut_array[$i]["id"] . "," . $notice_retour . ",'" . $this->aut_array[$i]['fonction'] . "'," . $this->aut_array[$i]['responsabilite'] . "," . $i . ") ";
             $res_ins = pmb_mysql_query($rqt, $dbh);
         }
     }
     // traitement des categories
     if ($this->categorisation_type == "categorisation_auto") {
         traite_categories_enreg($notice_retour, $this->categories);
     } else {
         $rqt_del = "delete from notices_categories where notcateg_notice='{$notice_retour}' ";
         $res_del = @pmb_mysql_query($rqt_del, $dbh);
         $rqt_ins = "insert into notices_categories (notcateg_notice, num_noeud, ordre_categorie) VALUES ";
         $rqt_ins_values = array();
         foreach ($this->categories as $i => $category) {
             $id_categ = $category['categ_id'];
             if ($id_categ) {
                 $rqt_ins_values[] = " ('{$notice_retour}','{$id_categ}', {$i}) ";
             }
         }
         $rqt_ins .= implode(",", $rqt_ins_values);
         $res_ins = @pmb_mysql_query($rqt_ins, $dbh);
     }
     // traitement des langues
     // langues de la publication
     $rqt_del = "delete from notices_langues where num_notice='{$notice_retour}' ";
     $res_del = pmb_mysql_query($rqt_del, $dbh);
     if (is_array($this->language_code) && count($this->language_code)) {
         $rqt_ins = "insert into notices_langues (num_notice, type_langue, code_langue, ordre_langue) VALUES ";
         foreach ($this->language_code as $ordre_lang => $code_lang) {
             if ($code_lang) {
                 $rqt = $rqt_ins . " ('{$notice_retour}',0, '{$code_lang}', {$ordre_lang}) ";
                 $res_ins = @pmb_mysql_query($rqt, $dbh);
             }
         }
     }
     // langues originales
     if (is_array($this->original_language_code) && count($this->original_language_code)) {
         $rqt_ins = "insert into notices_langues (num_notice, type_langue, code_langue, ordre_langue) VALUES ";
         foreach ($this->original_language_code as $ordre_lang => $code_lang) {
             if ($code_lang) {
                 $rqt = $rqt_ins . " ('{$notice_retour}',1, '{$code_lang}', {$ordre_lang}) ";
                 $res_ins = @pmb_mysql_query($rqt, $dbh);
             }
         }
     }
     //Traitement des champs personnalisés (du formulaire !!!)
     $p_perso = new parametres_perso("notices");
     $nberrors = $p_perso->check_submited_fields();
     $p_perso->rec_fields_perso($notice_retour);
     //Traitement import perso
     global $notice_id, $notice_org, $notice_type_org;
     if (function_exists('z_recup_noticeunimarc_suite') && function_exists('recup_noticeunimarc_suite')) {
         //Suppression des champs persos
         $requete = "delete from notices_custom_values where notices_custom_origine=" . $notice_retour;
         @pmb_mysql_query($requete);
         $notice_id = $notice_retour;
         z_recup_noticeunimarc_suite($notice_org);
         z_import_new_notice_suite();
     }
     // Mise à jour des index de la notice
     notice::majNotices($notice_retour);
     // Mise à jour de la table notices_global_index
     notice::majNoticesGlobalIndex($notice_retour);
     // Mise à jour de la table notices_mots_global_index
     notice::majNoticesMotsGlobalIndex($notice_retour);
     //Documents numériques
     foreach ($this->doc_nums as $doc_num) {
         if (!$doc_num["a"]) {
             continue;
         }
         explnum_add_from_url($notice_retour, $this->bull_id, $doc_num["b"], $doc_num["a"], false, $this->source_id, $doc_num["f"], '', $doc_num["s"]);
     }
     //synchro_rdf
     if ($pmb_synchro_rdf) {
         $synchro_rdf->addRdf($notice_retour, 0);
     }
     $retour = array($new_notice, $notice_retour);
     return $retour;
 }
コード例 #9
0
ファイル: indexint.inc.php プロジェクト: hogsim/PMB
     break;
 case 'update':
     // mettre à jour
     $indexint = new indexint($id, $id_pclass);
     $indexint->update($indexint_nom, $indexint_comment, $id_pclass);
     include './autorites/indexint/indexint_list.inc.php';
     break;
 case 'indexint_form':
     // création
     if (!$id) {
         // affichage du form pour création
         $indexint = new indexint(0, $id_pclass);
         $indexint->show_form();
     } else {
         // affichage du form pour modification
         $indexint = new indexint($id, $id_pclass);
         $indexint->show_form($id);
     }
     break;
 case 'indexint_last':
     $last_param = 1;
     $tri_param = "order by indexint_id desc ";
     $limit_param = "limit 0, {$pmb_nb_lastautorities} ";
     $clef = "";
     $nbr_lignes = 0;
     include './autorites/indexint/indexint_list.inc.php';
     break;
 case 'pclass':
     include './autorites/indexint/pclass.inc.php';
     break;
 case 'pclass_form':
コード例 #10
0
ファイル: import_func.inc.php プロジェクト: bouchra012/PMB
function import_new_notice()
{
    global $dbh;
    global $notice_id;
    global $bulletin_ex;
    //Identifiant du bulletin
    $bulletin_ex = 0;
    global $id_unimarc;
    global $notices_crees;
    global $bulletins_crees;
    global $notices_a_creer;
    global $bulletins_a_creer;
    global $base_path;
    global $pmb_keyword_sep;
    global $link_generate;
    global $doc_type;
    global $hierarchic_level;
    global $bibliographic_level;
    global $isbn_OK;
    global $prix;
    global $prix_cd;
    global $cb;
    global $tit_200a;
    global $tit_200c;
    global $tit_200d;
    global $tit_200e;
    global $tit_200v;
    global $serie_200;
    global $editor;
    global $editeur_lieu;
    global $editeur_adr;
    global $editeur_nom;
    global $editeur_date;
    global $editeur_pays;
    global $editeur_pmbfields;
    global $no_edition;
    global $npages;
    global $ill;
    global $size;
    global $accomp;
    global $collection_225;
    global $n_contenu;
    global $n_resume;
    global $n_gen;
    global $EAN;
    global $collection_410;
    global $collection_411;
    global $tu_500;
    global $tu_500_r;
    global $tu_500_s;
    global $tu_500_j;
    global $serie;
    global $index_sujets;
    global $dewey;
    global $dewey_l;
    global $aut_700;
    global $aut_701;
    global $aut_702;
    global $aut_710;
    global $aut_711;
    global $aut_712;
    global $origine_notice;
    global $lien;
    global $eformat;
    global $analytique;
    global $statutnot;
    global $indicateur;
    global $add_explnum;
    global $info_686;
    global $authorities_notices;
    global $authorities_default_origin;
    $origin_authority = $authorities_default_origin;
    $add_explnum = FALSE;
    /* traitement des éditeurs */
    $coll_id = 0;
    $subcoll_id = 0;
    $serie_id = 0;
    $tnvol_ins = "";
    $ed1_id = 0;
    $ed2_id = 0;
    $year = "";
    $date_parution = "0000-00-00";
    //On récupère le tableau des notices créées à partir du fichier temporaire (rechargement d'iframe)
    if ($link_generate && !isset($notices_crees)) {
        $tabimport_id = file_get_contents("{$base_path}/temp/liste_id" . SESSid . ".txt");
        if ($tabimport_id) {
            $tabimport_id = unserialize($tabimport_id);
            $notices_crees = $tabimport_id['notices_existantes'];
            $notices_a_creer = $tabimport_id['notices_a_creer'];
            $bulletins_crees = $tabimport_id['bulletins_crees'];
            $bulletins_a_creer = $tabimport_id['bulletins_a_creer'];
        }
    }
    if (!is_array($notices_crees)) {
        $notices_crees = array();
    }
    //Pour le cas ou on est sur une notice (bidon) d'article juste pour les exemplaires de bulletin
    if ($bibliographic_level == "a" && $tit_200d[0] == "Article_expl_bulletin") {
        //On importe rien
        return;
    } elseif ($tit_200d[0] == "Article_expl_bulletin") {
        //Pour le cas ou on import sans les liens un fichier exporter avec les exemplaires et les liens
        $tit_200d[0] = "";
    }
    if ($bibliographic_level != "a" && $bibliographic_level != "b") {
        //Pour les articles et les bulletins on ne garde pas les informations suivantes
        $year = clean_string($editeur_date[0]);
        $date_parution = notice::get_date_parution($year);
        //traitement des éditeurs
        $editor = array();
        foreach ($editeur_nom as $key_nom1 => $nom1) {
            foreach ($nom1 as $key_nom2 => $nom2) {
                $mon_ed = array();
                $mon_ed["c"] = $nom2;
                if ($editeur_adr[$key_nom1][$key_nom2]) {
                    $mon_ed["b"] = $editeur_adr[$key_nom1][$key_nom2];
                }
                if ($editeur_lieu[$key_nom1][$key_nom2]) {
                    $mon_ed["a"] = $editeur_lieu[$key_nom1][$key_nom2];
                }
                if ($editeur_pays[$key_nom1][$key_nom2]) {
                    $mon_ed["z"] = $editeur_pays[$key_nom1][$key_nom2];
                }
                if ($editeur_pmbfields[$key_nom1][$key_nom2]) {
                    //Si j'ai ces informations c'est un export PMB donc je n'ai pas deux editeurs dans le même 210
                    foreach ($editeur_pmbfields[$key_nom1] as $val9) {
                        if (preg_match("/^(.+?):(.+)\$/", $val9, $matches)) {
                            $mon_ed[trim($matches[1])] = $matches[2];
                        }
                    }
                }
                $editor[] = $mon_ed;
            }
        }
        $ed = array();
        $ed['name'] = clean_string($editor[0]['c']);
        $ed['adr'] = clean_string($editor[0]['b']);
        if ($editor[0]['adr1']) {
            $ed['adr'] = clean_string($editor[0]['adr1']);
        }
        //Si cela vient de PMB dans $b j'ai un concat
        $ed['ville'] = clean_string($editor[0]['a']);
        $ed['adr2'] = clean_string($editor[0]['adr2']);
        $ed['cp'] = clean_string($editor[0]['cp']);
        $ed['pays'] = clean_string($editor[0]['z']);
        $ed['web'] = clean_string($editor[0]['web']);
        $ed['ed_comment'] = clean_string($editor[0]['comment']);
        $ed1_id = editeur::import($ed);
        $ed = array();
        $ed['name'] = clean_string($editor[1]['c']);
        $ed['adr'] = clean_string($editor[1]['b']);
        if ($editor[1]['adr1']) {
            $ed['adr'] = clean_string($editor[1]['adr1']);
        }
        //Si cela vient de PMB dans $b j'ai un concat
        $ed['ville'] = clean_string($editor[1]['a']);
        $ed['adr2'] = clean_string($editor[1]['adr2']);
        $ed['cp'] = clean_string($editor[1]['cp']);
        $ed['pays'] = clean_string($editor[1]['z']);
        $ed['web'] = clean_string($editor[1]['web']);
        $ed['ed_comment'] = clean_string($editor[1]['comment']);
        $ed2_id = editeur::import($ed);
        if ($bibliographic_level != "s") {
            //Pour les periodiques on ne garde pas les informations suivantes
            /* traitement des collections */
            $coll_name = "";
            $subcoll_name = "";
            $coll_issn = "";
            $subcoll_issn = "";
            $nocoll_ins = "";
            /* traitement de 225$a, si rien alors 410$t pour la collection */
            if ($collection_225[0]['a'] != "") {
                $coll_name = $collection_225[0]['a'];
                $coll_issn = $collection_225[0]['x'];
            } elseif ($collection_410[0]['t'] != "") {
                $coll_name = $collection_410[0]['t'];
                $coll_issn = $collection_410[0]['x'];
                $coll_aut_number = $collection_410[0]['3'];
            }
            /* traitement de 225$i, si rien alors 411$t pour la sous-collection */
            if ($collection_225[0]['i'] != "") {
                $subcoll_name = $collection_225[0]['i'];
                $subcoll_issn = $collection_225[1]['x'];
            } elseif ($collection_411[0]['t'] != "") {
                $subcoll_name = $collection_411[0]['t'];
                $subcoll_issn = $collection_411[0]['x'];
                $coll_aut_number = $collection_411[0]['3'];
            }
            /* gaffe au nocoll, en principe en 225$v selon FL  sinon en 410$v ou 411$v*/
            if ($collection_225[0]['v'] != "") {
                $nocoll_ins = $collection_225[0]['v'];
            } elseif ($collection_410[0]['v'] != "") {
                $nocoll_ins = $collection_410[0]['v'];
            } elseif ($collection_411[0]['v'] != "") {
                $nocoll_ins = $collection_411[0]['v'];
            } else {
                $nocoll_ins = "";
            }
            $collec['name'] = clean_string($coll_name);
            $collec['parent'] = $ed1_id;
            $collec['issn'] = clean_string($coll_issn);
            $collec['authority_number'] = $coll_aut_number;
            if ($collec['authority_number']) {
                $coll_id = keep_authority_infos($collec['authority_number'], "collection", $origin_authority, 0, $collec);
            } else {
                $coll_id = collection::import($collec);
            }
            /* sous collection */
            $subcollec['name'] = clean_string($subcoll_name);
            $subcollec['coll_parent'] = $coll_id;
            $subcollec['issn'] = clean_string($subcoll_issn);
            $subcollec['authority_number'] = $subcoll_aut_number;
            if ($subcollec['authority_number']) {
                $subcoll_id = keep_authority_infos($subcollec['authority_number'], "subcollection", $origin_authority, 0, $subcollec);
            } else {
                $subcoll_id = collection::import($subcollec);
            }
            $subcoll_id = subcollection::import($subcollec);
            /* traitement des séries */
            $serie_id = serie::import(clean_string($serie[0]['t']));
            $tnvol_ins = $serie[0]['v'];
            if (!$serie_id) {
                $serie_id = serie::import(clean_string($serie_200[0]['i']));
                $serie[0]['t'] = $serie_200[0]['i'];
                //$tnvol_ins=$serie_200[0]['h'];
            }
            if (!$tnvol_ins) {
                $tnvol_ins = $serie_200[0]['h'];
            }
        }
    }
    /* traitement de Dewey */
    $indexint_id = indexint::import(clean_string($dewey[0]), $dewey_l[0]);
    if (!$indexint_id and count($info_686)) {
        $indexint_id = indexint::import(clean_string($info_686[0]["a"]), $info_686[0]["l"], 99);
    }
    /* Traitement des notes */
    $n_resume_total = "";
    $n_gen_total = "";
    $n_contenu_total = "";
    if (!$n_resume) {
        $n_resume = array();
    }
    $n_resume_total = implode("\n", $n_resume);
    if (!$n_gen) {
        $n_gen = array();
    }
    $n_gen_total = implode("\n", $n_gen);
    if (!$n_contenu) {
        $n_contenu = array();
    }
    $n_contenu_total = implode("\n", $n_contenu);
    // ajout : les 464$a sont ajouté aux notes de contenu à déporter éventuellement dans func_bdp41 si besoin
    for ($i = 0; $i < count($analytique); $i++) {
        $ana = array();
        for ($j = 0; $j < count($analytique[$i]); $j++) {
            $ana[$analytique[$i][$j]["label"]][] = $analytique[$i][$j]["content"];
        }
        if (count($ana["a"]) == 1) {
            //Selon la norme le $a n'est pas répétable dans le même champ 4XX
            $n_contenu_total .= $ana["a"][0] . (count($ana["e"]) ? " ; " . implode(" ; ", $ana["e"]) : "") . (count($ana["f"]) ? " / " . implode(" / ", $ana["f"]) : "") . (count($ana["g"]) ? " / " . implode(" / ", $ana["g"]) : "") . "\n";
        } else {
            //Au cas où
            for ($j = 0; $j < count($ana["a"]); $j++) {
                $n_contenu_total .= $ana["a"][$j] . ($ana["e"][$j] ? " ; " . $ana["e"][$j] : "") . ($ana["f"][$j] ? " / " . $ana["f"][$j] : "") . ($ana["g"][$j] ? " / " . $ana["g"][$j] : "") . "\n";
            }
        }
    }
    // Préparation des titres
    $tit[0]['a'] = implode(" ; ", $tit_200a);
    if ($bibliographic_level != "a" && $bibliographic_level != "b" && $bibliographic_level != "s") {
        //Pour les articles et les bulletins on ne garde pas les informations suivantes
        $tit[0]['c'] = implode(" ; ", $tit_200c);
    } else {
        $tit[0]['c'] = "";
    }
    $tit[0]['d'] = implode(" ; ", $tit_200d);
    $tit[0]['e'] = implode(" ; ", $tit_200e);
    if (is_array($index_sujets)) {
        $index_l = implode(' ' . $pmb_keyword_sep . ' ', $index_sujets);
    } else {
        $index_l = $index_sujets;
    }
    // if (trim($n_resume_total)=="") $n_resume_total = $n_gen_total." ".$n_contenu_total ;
    /* Origine de la notice */
    $origine_not['nom'] = clean_string($origine_notice[0]['b']);
    $origine_not['pays'] = clean_string($origine_notice[0]['a']);
    $orinot_id = origine_notice::import($origine_not);
    if ($orinot_id == 0) {
        $orinot_id = 1;
    }
    if ($bibliographic_level != "a" && $bibliographic_level != "s") {
        //Pour les articles et les periodiques on ne garde pas les informations suivantes
        // prix
        $price = $prix[0];
        //Pour les CDs
        if (!$price) {
            $price = $prix_cd[0];
        }
        $illustration = implode(" : ", $ill);
        $taille = implode(" ; ", $size);
        $mat_accomp = implode(" + ", $accomp);
        if ($bibliographic_level != "b") {
            $mention_edit = implode(", ", $no_edition);
        } else {
            $mention_edit = "";
        }
    } else {
        $illustration = "";
        $taille = "";
        $mat_accomp = "";
    }
    if ($bibliographic_level != "s") {
        //Pour les periodiques on ne garde pas les informations suivantes
        $nbpages = implode(" - ", $npages);
    } else {
        $nbpages = "";
    }
    /* and at least, the insertion in notices table */
    $sql_ins = "insert into notices (\n\t\t\t\t\t\ttypdoc\t\t\t,\n\t\t\t\t\t\tcode        \t,\n\t\t\t\t\t\tstatut\t\t\t,\n\t\t                tit1            ,\n\t\t                tit2            ,\n\t\t                tit3            ,\n\t\t                tit4            ,\n\t\t                tparent_id      ,\n\t\t                tnvol           ,\n\t\t                ed1_id          ,\n\t\t                ed2_id          ,\n\t\t                year            ,\n\t\t                npages          ,\n\t\t                ill             ,\n\t\t                size            ,\n\t\t                accomp          ,\n\t\t                coll_id         ,\n\t\t                subcoll_id      ,\n\t\t                nocoll          ,\n\t\t                mention_edition\t,\n\t\t                n_gen           ,\n\t\t                n_contenu       ,\n\t\t                n_resume        ,\n\t\t                index_l,\n\t\t                indexint,\n\t\t                niveau_biblio,\n\t\t                niveau_hierar,\n\t\t                lien,\n\t\t                eformat,\n\t\t                origine_catalogage,\n\t\t                prix,\n\t\t\t\t\t\tcreate_date,\n\t\t\t\t\t\tdate_parution\n\t\t\t\t) values (\n\t\t\t\t\t\t'" . $doc_type . "',\t\n\t\t\t\t\t\t'" . addslashes($isbn_OK) . "',\t\n\t\t\t\t\t\t'" . $statutnot . "',\n\t\t                '" . addslashes(clean_string($tit[0]['a'])) . "',\n\t\t                '" . addslashes(clean_string($tit[0]['c'])) . "',\n\t\t                '" . addslashes(clean_string($tit[0]['d'])) . "',\n\t\t                '" . addslashes(clean_string($tit[0]['e'])) . "',\n\t\t                '" . $serie_id . "',\n\t\t                '" . addslashes($tnvol_ins) . "',\n\t\t                 " . $ed1_id . " ,\n\t\t                 " . $ed2_id . " ,\n\t\t                '" . addslashes($year) . "',\n\t\t                '" . addslashes($nbpages) . "',\n\t\t                '" . addslashes($illustration) . "',\n\t\t                '" . addslashes($taille) . "',\n\t\t                '" . addslashes($mat_accomp) . "',\n\t\t                 " . $coll_id . " ,\n\t\t                 " . $subcoll_id . " ,\n\t\t                '" . addslashes($nocoll_ins) . "',\n\t\t                '" . addslashes($mention_edit) . "',\n\t\t                '" . addslashes($n_gen_total) . "',\n\t\t             \t'" . addslashes($n_contenu_total) . "',\n\t\t             \t'" . addslashes($n_resume_total) . "',\n\t\t                '" . addslashes($index_l) . "',\n\t\t                '" . $indexint_id . "',\n\t\t                '" . $bibliographic_level . "',\n\t\t                '" . $hierarchic_level . "',\n\t\t                '" . addslashes($lien[0]) . "',\n\t\t                '" . addslashes($eformat[0]) . "',\n\t\t                '" . $orinot_id . "',\n\t\t                '" . addslashes($price) . "',\n\t\t\t\t\t\tsysdate(),\n\t\t\t\t\t\t'" . addslashes($date_parution) . "'\n\t\t\t\t\t\t)";
    mysql_query($sql_ins, $dbh) or die("Couldn't insert into notices ! = " . $sql_ins);
    $notice_id = mysql_insert_id($dbh);
    notice::majNotices($notice_id);
    audit::insert_creation(AUDIT_NOTICE, $notice_id);
    //calcul des droits d'accès s'ils sont activés
    calc_notice_acces_rights($notice_id);
    // on devait attendre que la notice soit intégrée pour faire l'association avec la notice..;
    if ($collec['authority_number']) {
        keep_authority_infos($collec['authority_number'], "scollection", $origin_authority, $notice_id, $collec);
    }
    if ($subcollec['authority_number']) {
        keep_authority_infos($subcollec['authority_number'], "subcollection", $origin_authority, $notice_id, $subcollec);
    }
    /* INSERT de la notice OK, on va traiter les auteurs
    		70# : personnal : type auteur 70                71# : collectivités : type auteur 71
    		1 seul en 700                                   idem pour les déclinaisons          
    		n en 701 n en 702
    		les 7#0 tombent en auteur principal : responsability_type = 0
    		les 7#1 tombent en autre auteur : responsability_type = 1
    		les 7#2 tombent en auteur secondaire : responsability_type = 2
    		*/
    $aut_array = array();
    /* on compte tout de suite le nbre d'enreg dans les répétables */
    $nb_repet_701 = sizeof($aut_701);
    $nb_repet_711 = sizeof($aut_711);
    $nb_repet_702 = sizeof($aut_702);
    $nb_repet_712 = sizeof($aut_712);
    //indicateur["710"];
    /* renseignement de aut0 */
    if ($aut_700[0][a] != "") {
        /* auteur principal en 700 ? */
        $aut_array[] = array("entree" => $aut_700[0]['a'], "rejete" => $aut_700[0]['b'], "author_comment" => $aut_700[0]['c'] . " " . $aut_700[0]['d'], "date" => $aut_700[0]['f'], "type_auteur" => "70", "fonction" => $aut_700[0][4], "id" => 0, "responsabilite" => 0, "ordre" => 0, 'authority_number' => $aut_700[0][3]);
    } elseif ($aut_710[0]['a'] != "") {
        /* auteur principal en 710 ? */
        if (substr($indicateur["710"][0], 0, 1) == "1") {
            $type_auteur = "72";
        } else {
            $type_auteur = "71";
        }
        $lieu = $aut_710[0]['e'];
        if (!$lieu) {
            $lieu = $aut_710[0]['k'];
        }
        $aut_array[] = array("entree" => $aut_710[0]['a'], "rejete" => $aut_710[0]['g'], "subdivision" => $aut_710[0]['b'], "author_comment" => $aut_710[0]['c'], "numero" => $aut_710[0]['d'], "lieu" => $lieu, "ville" => $aut_710[0]['l'], "pays" => $aut_710[0]['m'], "web" => $aut_710[0]['n'], "date" => $aut_710[0]['f'], "type_auteur" => $type_auteur, "fonction" => $aut_710[0][4], "id" => 0, "responsabilite" => 0, "ordre" => 0, 'authority_number' => $aut_710[0][3]);
    }
    /* renseignement de aut1 */
    for ($i = 0; $i < $nb_repet_701; $i++) {
        $aut_array[] = array("entree" => $aut_701[$i]['a'], "rejete" => $aut_701[$i]['b'], "author_comment" => $aut_701[$i]['c'] . " " . $aut_701[$i]['d'], "date" => $aut_701[$i]['f'], "type_auteur" => "70", "fonction" => $aut_701[$i][4], "id" => 0, "responsabilite" => 1, "ordre" => $i + 1, 'authority_number' => $aut_701[$i][3]);
    }
    for ($i = 0; $i < $nb_repet_711; $i++) {
        if (substr($indicateur["711"][$i], 0, 1) == "1") {
            $type_auteur = "72";
        } else {
            $type_auteur = "71";
        }
        $lieu = $aut_711[$i]['e'];
        if (!$lieu) {
            $lieu = $aut_711[$i]['k'];
        }
        $aut_array[] = array("entree" => $aut_711[$i]['a'], "rejete" => $aut_711[$i]['g'], "subdivision" => $aut_711[$i]['b'], "author_comment" => $aut_711[$i]['c'], "numero" => $aut_711[$i]['d'], "lieu" => $lieu, "ville" => $aut_711[$i]['l'], "pays" => $aut_711[$i]['m'], "web" => $aut_711[$i]['n'], "date" => $aut_711[$i]['f'], "type_auteur" => $type_auteur, "fonction" => $aut_711[$i][4], "id" => 0, "responsabilite" => 1, "ordre" => $i + 1, 'authority_number' => $aut_711[$i][3]);
    }
    /* renseignement de aut2 */
    for ($i = 0; $i < $nb_repet_702; $i++) {
        $aut_array[] = array("entree" => $aut_702[$i]['a'], "rejete" => $aut_702[$i]['b'], "author_comment" => $aut_702[$i]['c'] . " " . $aut_702[$i]['d'], "date" => $aut_702[$i]['f'], "type_auteur" => "70", "fonction" => $aut_702[$i][4], "id" => 0, "responsabilite" => 2, "ordre" => $i + 1, 'authority_number' => $aut_702[$i][3]);
    }
    for ($i = 0; $i < $nb_repet_712; $i++) {
        if (substr($indicateur["712"][$i], 0, 1) == "1") {
            $type_auteur = "72";
        } else {
            $type_auteur = "71";
        }
        $lieu = $aut_712[$i]['e'];
        if (!$lieu) {
            $lieu = $aut_712[$i]['k'];
        }
        $aut_array[] = array("entree" => $aut_712[$i]['a'], "rejete" => $aut_712[$i]['g'], "subdivision" => $aut_712[$i]['b'], "author_comment" => $aut_712[$i]['c'], "numero" => $aut_712[$i]['d'], "lieu" => $lieu, "ville" => $aut_712[$i]['l'], "pays" => $aut_712[$i]['m'], "web" => $aut_712[$i]['n'], "date" => $aut_712[$i]['f'], "type_auteur" => $type_auteur, "fonction" => $aut_712[$i][4], "id" => 0, "responsabilite" => 2, "ordre" => $i + 1, 'authority_number' => $aut_712[$i][3]);
    }
    // récup des infos auteurs et mise en tableau :
    // appel de la fonction membre d'importation et insertion en table
    $rqt_ins = "insert into responsability (responsability_author, responsability_notice, responsability_fonction, responsability_type, responsability_ordre) VALUES ";
    $values = "";
    if (count($aut_array)) {
        for ($i = 0; $i < sizeof($aut_array); $i++) {
            $aut = array();
            $aut['name'] = clean_string($aut_array[$i]['entree']);
            $aut['rejete'] = clean_string($aut_array[$i]['rejete']);
            $aut['type'] = $aut_array[$i]['type_auteur'];
            $aut['date'] = clean_string($aut_array[$i]['date']);
            $aut['subdivision'] = clean_string($aut_array[$i]['subdivision']);
            $aut['numero'] = clean_string($aut_array[$i]['numero']);
            $aut['lieu'] = clean_string($aut_array[$i]['lieu']);
            $aut['ville'] = clean_string($aut_array[$i]['ville']);
            $aut['pays'] = clean_string($aut_array[$i]['pays']);
            $aut['web'] = clean_string($aut_array[$i]['web']);
            $aut['author_comment'] = clean_string($aut_array[$i]['author_comment']);
            $aut['authority_number'] = clean_string($aut_array[$i]['authority_number']);
            //si on à demander la prise en compte des numéro d'autorités
            if ($authorities_notices && $aut['authority_number'] != "") {
                $aut_array[$i]["id"] = keep_authority_infos($aut['authority_number'], "author", $origin_authority, $notice_id, $aut);
            }
            if (!$aut_array[$i]["id"]) {
                $aut_array[$i]["id"] = auteur::import($aut);
            }
            $aut_array[$i]['fonction'] = trim($aut_array[$i]['fonction']);
            if ($aut_array[$i]["id"]) {
                if ($values != "") {
                    $values .= ",";
                }
                $values .= " ('" . $aut_array[$i]["id"] . "','" . $notice_id . "','" . addslashes($aut_array[$i]['fonction']) . "','" . $aut_array[$i]['responsabilite'] . "','" . $aut_array[$i]['ordre'] . "') ";
                //				$rqt = $rqt_ins . " ('".$aut_array[$i]["id"]."','".$notice_id."','".addslashes($aut_array[$i]['fonction'])."','".$aut_array[$i]['responsabilite']."','".$aut_array[$i]['ordre']."') " ;
                //				@mysql_query($rqt, $dbh);
            }
        }
        @mysql_query($rqt_ins . $values);
    }
    // Titres uniformes
    global $pmb_use_uniform_title;
    if ($pmb_use_uniform_title) {
        $nb_tu = sizeof($tu_500);
        for ($i = 0; $i < $nb_tu; $i++) {
            $value_tu[$i]['name'] = $tu_500[$i]['a'];
            $value_tu[$i]['tonalite'] = $tu_500[$i]['u'];
            $value_tu[$i]['comment'] = $tu_500[$i]['n'];
            $value_tu[$i]['authority_number'] = $tu_500[$i]['3'];
            for ($j = 0; $j < count($tu_500_r[$i]); $j++) {
                $value_tu[$i]['distrib'][$j] = $tu_500_r[$i][$j];
            }
            for ($j = 0; $j < count($tu_500_s[$i]); $j++) {
                $value_tu[$i]['ref'][$j] = $tu_500_s[$i][$j];
            }
            for ($j = 0; $j < count($tu_500_j[$i]); $j++) {
                $value_tu[$i]['subdiv'][$j] = $tu_500_j[$i][$j];
            }
            if ($authorities_notices && $aut['authority_number'] != "") {
                $tu_id = keep_authority_infos($value_tu[$i]['authority_number'], "uniform_title", $origin_authority, $notice_id, $value_tu[$i]);
            } else {
                $tu_id = titre_uniforme::import($value_tu[$i]);
            }
            if ($tu_id) {
                $requete = "INSERT INTO notices_titres_uniformes SET \n\t\t\t\t\tntu_num_notice='{$notice_id}', \n\t\t\t\t\tntu_num_tu='{$tu_id}', \n\t\t\t\t\tntu_titre='" . addslashes($tu_500[$i]['i']) . "', \n\t\t\t\t\tntu_date='" . addslashes($tu_500[$i]['k']) . "', \n\t\t\t\t\tntu_sous_vedette='" . addslashes($tu_500[$i]['l']) . "', \n\t\t\t\t\tntu_langue='" . addslashes($tu_500[$i]['m']) . "', \n\t\t\t\t\tntu_version='" . addslashes($tu_500[$i]['q']) . "', \n\t\t\t\t\tntu_mention='" . addslashes($tu_500[$i]['w']) . "',\n\t\t\t\t\tntu_ordre={$i} \t\t\t\t\n\t\t\t\t\t";
                mysql_query($requete, $dbh);
            }
        }
    }
    global $lang_code;
    global $org_lang_code;
    $rqt_ins = "insert into notices_langues (num_notice, type_langue, code_langue, ordre_langue) VALUES ";
    $values = "";
    for ($i = 0; $i < count($lang_code); $i++) {
        $lang_code[$i] = trim($lang_code[$i]);
        if ($values != "") {
            $values .= ",";
        }
        $values .= "('{$notice_id}',0, '" . addslashes($lang_code[$i]) . "','{$i}') ";
        //$rqt_ins = "insert into notices_langues (num_notice, type_langue, code_langue) VALUES ('$notice_id',0, '".addslashes($lang_code[$i])."') " ;
        //@mysql_query($rqt_ins, $dbh);
    }
    for ($i = 0; $i < count($org_lang_code); $i++) {
        $org_lang_code[$i] = trim($org_lang_code[$i]);
        if ($values != "") {
            $values .= ",";
        }
        $values .= "('{$notice_id}',1, '" . addslashes($org_lang_code[$i]) . "','" . $i . "') ";
        //$rqt_ins = "insert into notices_langues (num_notice, type_langue, code_langue) VALUES ('$notice_id',1, '".addslashes($org_lang_code[$i])."') " ;
        // 			@mysql_query($rqt_ins, $dbh);
    }
    @mysql_query($rqt_ins . $values, $dbh);
    //Import des catégories
    category_auto::save_info_categ();
    //Calcule de la signature
    $sign = new notice_doublon();
    $val = $sign->gen_signature($notice_id);
    mysql_query("update notices set signature='{$val}' where notice_id=" . $notice_id, $dbh);
    //Si on a un id de notice et qu'il n'est pas dans le tableau des notices créées, on l'ajoute
    if ($link_generate && trim($id_unimarc) !== "" && !$notices_crees[$id_unimarc]) {
        $notices_crees[$id_unimarc] = $notice_id;
    } elseif ($link_generate && trim($id_unimarc) !== "" && $notices_crees[$id_unimarc]) {
        //Si la notice a déjà été créé (Export des liens dans les notices liées) on remplace celle précédemment par celle en cour de traitement
        $niveau_biblio = $bibliographic_level . $hierarchic_level;
        switch ($niveau_biblio) {
            case 'm0':
                //On a une notice de monographie
                $notice_a_supp = $notices_crees[$id_unimarc];
                //On garde les liens
                $requete = "UPDATE notices_relations SET num_notice='" . $notice_id . "' WHERE num_notice='" . $notice_a_supp . "' ";
                @mysql_query($requete, $dbh);
                $requete = "UPDATE notices_relations SET linked_notice='" . $notice_id . "' WHERE linked_notice='" . $notice_a_supp . "' ";
                @mysql_query($requete, $dbh);
                $ma_notice = new notice($notice_a_supp);
                $ma_notice->replace($notice_id);
                break;
            case 's1':
                //On a une notice de periodique
                $notice_a_supp = $notices_crees[$id_unimarc];
                $ma_notice = new serial($notice_a_supp);
                $ma_notice->replace($notice_id);
                break;
            case 'b2':
                //On a une notice de bulletin
                $notice_a_supp = $notices_crees[$id_unimarc];
                //Dans les bulletins
                $requete = "update bulletins set num_notice='" . $notice_id . "' where num_notice='" . $notice_a_supp . "' ";
                mysql_query($requete, $dbh);
                //Dans les relations entre notice
                $requete = "update notices_relations set num_notice='" . $notice_id . "' where num_notice='" . $notice_a_supp . "'";
                mysql_query($requete, $dbh);
                $requete = "update notices_relations set linked_notice='" . $notice_id . "' where linked_notice='" . $notice_a_supp . "'";
                mysql_query($requete, $dbh);
                notice::del_notice($notice_a_supp);
                break;
            case 'a2':
                //On a une notice d'article
                $notice_a_supp = $notices_crees[$id_unimarc];
                //Dans les bulletins
                $requete = "update analysis set analysis_notice='" . $notice_id . "' where analysis_notice='" . $notice_a_supp . "' ";
                mysql_query($requete, $dbh);
                //Dans les relations entre notice
                $requete = "update notices_relations set num_notice='" . $notice_id . "' where num_notice='" . $notice_a_supp . "'";
                mysql_query($requete, $dbh);
                $requete = "update notices_relations set linked_notice='" . $notice_id . "' where linked_notice='" . $notice_a_supp . "'";
                mysql_query($requete, $dbh);
                notice::del_notice($notice_a_supp);
                break;
        }
        $notices_crees[$id_unimarc] = $notice_id;
    }
}
コード例 #11
0
ファイル: indexint_see.inc.php プロジェクト: bouchra012/PMB
<?php

// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: indexint_see.inc.php,v 1.56.2.2 2015-02-05 09:27:44 jpermanne Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
require_once "{$class_path}/aut_link.class.php";
// instanciation de la catégorie
$ourIndexInt = new indexint($id, "");
print "<div id='aut_details'>\n\n\t\t<h3><span>{$msg['detail_indexint']}</span></h3>\n\n\t\t<div id='aut_details_container'>\n";
print "<div id='aut_see'>\n";
$index_title = $ourIndexInt->name;
if ($ourIndexInt->comment) {
    $index_title .= " : " . $ourIndexInt->comment;
}
print pmb_bidi("<h3>" . $index_title . "</h3>\n");
// si la catégorie à des enfants, on les affiche
if ($ourIndexInt->has_child) {
    print pmb_bidi($ourIndexInt->child_list('./images/folder.gif', $css, 0));
}
$aut_link = new aut_link(AUT_TABLE_INDEXINT, $ourIndexInt->indexint_id);
print pmb_bidi($aut_link->get_display());
print "\t</div><!-- fermeture #aut_see -->\n\n\t\t<div id=\"aut_details_liste\">\n";
$indexint_notices = "<h3><span>" . $msg["indexint_see_title"] . " !!indexint_name!!</span></h3>";
print pmb_bidi(str_replace('!!indexint_name!!', htmlentities($ourIndexInt->name, ENT_QUOTES, $charset), $indexint_notices));
//droits d'acces emprunteur/notice
$acces_j = '';
if ($gestion_acces_active == 1 && $gestion_acces_empr_notice == 1) {
コード例 #12
0
ファイル: func_bdp_pcdm3.inc.php プロジェクト: bouchra012/PMB
function import_new_notice_suite()
{
    global $dbh;
    global $notice_id;
    global $index_sujets;
    global $pmb_keyword_sep;
    global $info_600_a, $info_600_j, $info_600_x, $info_600_y, $info_600_z;
    global $info_601_a, $info_601_j, $info_601_x, $info_601_y, $info_601_z;
    global $info_602_a, $info_602_j, $info_602_x, $info_602_y, $info_602_z;
    global $info_605_a, $info_605_j, $info_605_x, $info_605_y, $info_605_z;
    global $info_606_a, $info_606_j, $info_606_x, $info_606_y, $info_606_z;
    global $info_607_a, $info_607_j, $info_607_x, $info_607_y, $info_607_z;
    global $info_686;
    global $dewey;
    if (is_array($index_sujets)) {
        $mots_cles = implode(" {$pmb_keyword_sep} ", $index_sujets);
    } else {
        $mots_cles = $index_sujets;
    }
    for ($a = 0; $a < sizeof($info_600_a); $a++) {
        $mots_cles .= " {$pmb_keyword_sep} " . $info_600_a[$a][0];
        for ($j = 0; $j < sizeof($info_600_j[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_600_j[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_600_x[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_600_x[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_600_y[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_600_y[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_600_z[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_600_z[$a][$j];
        }
    }
    for ($a = 0; $a < sizeof($info_601_a); $a++) {
        $mots_cles .= " {$pmb_keyword_sep} " . $info_601_a[$a][0];
        for ($j = 0; $j < sizeof($info_601_j[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_601_j[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_601_x[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_601_x[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_601_y[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_601_y[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_601_z[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_601_z[$a][$j];
        }
    }
    for ($a = 0; $a < sizeof($info_602_a); $a++) {
        $mots_cles .= " {$pmb_keyword_sep} " . $info_602_a[$a][0];
        for ($j = 0; $j < sizeof($info_602_j[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_602_j[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_602_x[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_602_x[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_602_y[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_602_y[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_602_z[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_602_z[$a][$j];
        }
    }
    for ($a = 0; $a < sizeof($info_605_a); $a++) {
        $mots_cles .= " {$pmb_keyword_sep} " . $info_605_a[$a][0];
        for ($j = 0; $j < sizeof($info_605_j[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_605_j[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_605_x[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_605_x[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_605_y[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_605_y[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_605_z[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_605_z[$a][$j];
        }
    }
    for ($a = 0; $a < sizeof($info_606_a); $a++) {
        $mots_cles .= " {$pmb_keyword_sep} " . $info_606_a[$a][0];
        for ($j = 0; $j < sizeof($info_606_j[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_606_j[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_606_x[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_606_x[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_606_y[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_606_y[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_606_z[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_606_z[$a][$j];
        }
    }
    for ($a = 0; $a < sizeof($info_607_a); $a++) {
        $mots_cles .= " {$pmb_keyword_sep} " . $info_607_a[$a][0];
        for ($j = 0; $j < sizeof($info_607_j[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_607_j[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_607_x[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_607_x[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_607_y[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_607_y[$a][$j];
        }
        for ($j = 0; $j < sizeof($info_607_z[$a]); $j++) {
            $mots_cles .= " {$pmb_keyword_sep} " . $info_607_z[$a][$j];
        }
    }
    $mots_cles ? $index_matieres = strip_empty_words($mots_cles) : ($index_matieres = '');
    $pcdm3 = "";
    if (!$dewey[0] && $info_686[0]) {
        $pcdm3 = indexint::import(clean_string('M ' . $info_686[0]["a"]));
    }
    $rqt_maj = "update notices set index_l='" . addslashes($mots_cles) . "', index_matieres=' " . addslashes($index_matieres) . " ' ";
    if ($pcdm3) {
        $rqt_maj .= ", indexint='" . $pcdm3 . "' ";
    }
    $rqt_maj .= "where notice_id='{$notice_id}' ";
    $res_ajout = mysql_query($rqt_maj, $dbh);
}
コード例 #13
0
 static function import($name, $comment = "", $id_pclassement = "", $statut = 1)
 {
     global $dbh;
     global $pmb_limitation_dewey;
     global $thesaurus_classement_defaut;
     // check sur la variable passée en paramètre
     if (!$name) {
         return 0;
     }
     if ($pmb_limitation_dewey < 0) {
         return 0;
     }
     if ($pmb_limitation_dewey) {
         $name = substr($name, 0, $pmb_limitation_dewey);
     }
     // tentative de récupérer l'id associée dans la base (implique que l'autorité existe)
     // préparation de la requête
     $key = addslashes($name);
     $comment = addslashes($comment);
     if (!$id_pclassement) {
         $num_pclass = $thesaurus_classement_defaut;
     } else {
         $num_pclass = $id_pclassement;
     }
     //On regarde si le plan de classement existe
     $query = "SELECT name_pclass FROM pclassement WHERE id_pclass='" . addslashes($num_pclass) . "' LIMIT 1 ";
     $result = @pmb_mysql_query($query, $dbh);
     if (!$result) {
         die("can't SELECT pclassement " . $query);
     }
     if (!pmb_mysql_num_rows($result)) {
         //Le plan de classement demandé n'existe pas
         return 0;
         // -> pas d'import
     }
     $query = "SELECT indexint_id FROM indexint WHERE indexint_name='" . rtrim(substr($key, 0, 255)) . "' and num_pclass='{$num_pclass}' LIMIT 1 ";
     $result = @pmb_mysql_query($query, $dbh);
     if (!$result) {
         die("can't SELECT indexint " . $query);
     }
     // résultat
     // récupération du résultat de la recherche
     $tindexint = pmb_mysql_fetch_object($result);
     // du résultat et récupération éventuelle de l'id
     if ($tindexint->indexint_id) {
         return $tindexint->indexint_id;
     }
     // id non-récupérée >> création
     if (!$id_pclassement) {
         $num_pclass = $thesaurus_classement_defaut;
     } else {
         $num_pclass = $id_pclassement;
     }
     $query = "INSERT INTO indexint SET indexint_name='{$key}', indexint_comment='{$comment}', index_indexint=' " . strip_empty_words($key . " " . $comment) . " ', num_pclass={$num_pclass} ";
     $result = @pmb_mysql_query($query, $dbh);
     if (!$result) {
         die("can't INSERT into indexint " . $query);
     }
     $id = pmb_mysql_insert_id($dbh);
     audit::insert_creation(AUDIT_INDEXINT, $id);
     //update authority informations
     $authority = new authority(0, $id, AUT_TABLE_INDEXINT);
     $authority->set_num_statut($statut);
     $authority->update();
     indexint::update_index($id);
     return $id;
 }