Esempio n. 1
0
 function move($to_bul)
 {
     global $msg;
     global $dbh;
     global $pmb_synchro_rdf;
     // rattachement du dépouillement
     $requete = 'UPDATE analysis SET analysis_bulletin=' . $to_bul . ' WHERE analysis_notice=' . $this->analysis_id;
     @pmb_mysql_query($requete, $dbh);
     //dates
     $myBul = new bulletinage($to_bul);
     $year = substr($myBul->date_date, 0, 4);
     $date_parution = $myBul->date_date;
     $requete = 'UPDATE notices SET year="' . $year . '", date_parution="' . $date_parution . '", update_date=sysdate() WHERE notice_id=' . $this->analysis_id . ' LIMIT 1';
     @pmb_mysql_query($requete, $dbh);
     //Indexation du dépouillement
     notice::majNoticesTotal($this->analysis_id);
     audit::insert_modif(AUDIT_NOTICE, $this->analysis_id);
     if ($pmb_synchro_rdf) {
         $synchro_rdf = new synchro_rdf();
         $synchro_rdf->delRdf($this->analysis_id, 0);
         $synchro_rdf->addRdf($this->analysis_id, 0);
     }
     return false;
 }
Esempio n. 2
0
                 $enCours = 1;
                 while ($enCours <= $maxAffiche) {
                     $r = pmb_mysql_fetch_object($result);
                     $nt = new mono_display($r->notice_id, 1, 'catalog.php?categ=isbd&id=' . $r->notice_id);
                     echo "\n\t\t\t\t\t<div class='row'>\n\t\t\t\t\t{$nt->result}\n\t\t\t \t    </div>\n\t\t\t\t\t<script>document.getElementById('el" . $r->notice_id . "Child').setAttribute('startOpen','Yes');</script>\n\t\t\t\t\t<script type='text/javascript'>document.forms['dummy'].elements['ok'].focus();</script>";
                     $enCours++;
                 }
                 exit;
             }
         }
     }
 }
 //fin du controle de dedoublonage
 //synchro_rdf
 if ($pmb_synchro_rdf && $id) {
     $synchro_rdf->delRdf($id, 0);
 }
 // definition de quelques variables
 $requete = "INSERT INTO notices SET create_date=sysdate(), update_date=sysdate(), ";
 $notitle_message = $msg[279];
 if ($id) {
     $requete = "UPDATE notices SET update_date=sysdate(), ";
     $postrequete = " WHERE notice_id={$id} ";
     $notitle_message = $msg[280];
 }
 $req_notice_date_is_new = "";
 if ($id) {
     $req_new = "select notice_is_new, notice_date_is_new from notices where notice_id={$id} ";
     $res_new = pmb_mysql_query($req_new, $dbh);
     if (pmb_mysql_num_rows($res_new)) {
         if ($r = pmb_mysql_fetch_object($res_new)) {
 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;
 }
Esempio n. 4
0
 } else {
     $table['year'] = substr($table['date_date'], 0, 4);
 }
 $table['date_parution'] = $table['date_date'];
 $p_perso = new parametres_perso("notices");
 $nberrors = $p_perso->check_submited_fields();
 $table['force_empty'] = $p_perso->presence_exclusion_fields();
 if ($_FILES['f_img_load']['name'] && $pmb_notice_img_folder_id) {
     $table['force_empty'] = "f_img_load";
 }
 //Pour la synchro rdf
 if ($pmb_synchro_rdf) {
     require_once $class_path . "/synchro_rdf.class.php";
     $synchro_rdf = new synchro_rdf();
     if ($bul_id) {
         $synchro_rdf->delRdf(0, $bul_id);
     }
 }
 if (!$nberrors) {
     $myBulletinage = new bulletinage($bul_id, $serial_id);
     $result = $myBulletinage->update($table);
 } else {
     error_message_history($msg["notice_champs_perso"], $p_perso->error_message, 1);
     exit;
 }
 // vignette de la notice uploadé dans un répertoire
 if ($_FILES['f_img_load']['name'] && $pmb_notice_img_folder_id && $myBulletinage->bull_num_notice) {
     $poids_fichier_max = 1024 * 1024;
     //Limite la taille de l'image à 1 Mo
     $req = "select repertoire_path from upload_repertoire where repertoire_id ='" . $pmb_notice_img_folder_id . "'";
     $res = mysql_query($req, $dbh);
Esempio n. 5
0
 $table['indexation_lang'] = $indexation_lang;
 if ($a2z_opac_show) {
     $val = 0;
 } else {
     $val = 0x10;
 }
 $table['opac_visible_bulletinage'] = $opac_visible_bulletinage | $val;
 $p_perso = new parametres_perso("notices");
 $nberrors = $p_perso->check_submited_fields();
 if (!$nberrors) {
     //Pour la synchro rdf
     if ($pmb_synchro_rdf) {
         require_once $class_path . "/synchro_rdf.class.php";
         $synchro_rdf = new synchro_rdf();
         if ($serial_id) {
             $synchro_rdf->delRdf($serial_id, 0);
         }
     }
     $serial = new serial($serial_id);
     $update_result = $serial->update($table);
 } else {
     error_message_history($msg["notice_champs_perso"], $p_perso->error_message, 1);
     exit;
 }
 // vignette de la notice uploadé dans un répertoire
 if ($_FILES['f_img_load']['name'] && $pmb_notice_img_folder_id) {
     $poids_fichier_max = 1024 * 1024;
     //Limite la taille de l'image à 1 Mo
     $req = "select repertoire_path from upload_repertoire where repertoire_id ='" . $pmb_notice_img_folder_id . "'";
     $res = mysql_query($req, $dbh);
     if (mysql_num_rows($res)) {
Esempio n. 6
0
 static function del_notice($id)
 {
     global $dbh, $class_path, $pmb_synchro_rdf, $pmb_notice_img_folder_id;
     //Suppression de la vignette de la notice si il y en a une d'uploadée
     if ($pmb_notice_img_folder_id) {
         $req = "select repertoire_path from upload_repertoire where repertoire_id ='" . $pmb_notice_img_folder_id . "'";
         $res = pmb_mysql_query($req, $dbh);
         if (pmb_mysql_num_rows($res)) {
             $rep = pmb_mysql_fetch_object($res);
             $img = $rep->repertoire_path . "img_" . $id;
             @unlink($img);
         }
     }
     //synchro_rdf (à laisser en premier : a besoin des éléments de la notice pour retirer du graphe rdf)
     if ($pmb_synchro_rdf) {
         $synchro_rdf = new synchro_rdf();
         $synchro_rdf->delRdf($id, 0);
     }
     $p_perso = new parametres_perso("notices");
     $p_perso->delete_values($id);
     $requete = "DELETE FROM notices_categories WHERE notcateg_notice='{$id}'";
     @pmb_mysql_query($requete, $dbh);
     $requete = "DELETE FROM notices_langues WHERE num_notice='{$id}'";
     @pmb_mysql_query($requete, $dbh);
     $requete = "DELETE FROM notices WHERE notice_id='{$id}'";
     @pmb_mysql_query($requete, $dbh);
     audit::delete_audit(AUDIT_NOTICE, $id);
     // Effacement de l'occurence de la notice ds la table notices_global_index :
     $requete = "DELETE FROM notices_global_index WHERE num_notice=" . $id;
     @pmb_mysql_query($requete, $dbh);
     // Effacement des occurences de la notice ds la table notices_mots_global_index :
     $requete = "DELETE FROM notices_mots_global_index WHERE id_notice=" . $id;
     @pmb_mysql_query($requete, $dbh);
     // Effacement des occurences de la notice ds la table notices_fields_global_index :
     $requete = "DELETE FROM notices_fields_global_index WHERE id_notice=" . $id;
     @pmb_mysql_query($requete, $dbh);
     $requete = "delete from notices_relations where num_notice='{$id}' OR linked_notice='{$id}' ";
     @pmb_mysql_query($requete, $dbh);
     // elimination des docs numeriques
     $req_explNum = "select explnum_id from explnum where explnum_notice=" . $id . " ";
     $result_explNum = @pmb_mysql_query($req_explNum, $dbh);
     while ($explNum = pmb_mysql_fetch_object($result_explNum)) {
         $myExplNum = new explnum($explNum->explnum_id);
         $myExplNum->delete();
     }
     // Clean des vedettes
     notice::delete_vedette_links($id);
     $requete = "DELETE FROM responsability WHERE responsability_notice='{$id}'";
     @pmb_mysql_query($requete, $dbh);
     $requete = "DELETE FROM bannette_contenu WHERE num_notice='{$id}'";
     @pmb_mysql_query($requete, $dbh);
     $requete = "delete from caddie_content using caddie, caddie_content where caddie_id=idcaddie and type='NOTI' and object_id='" . $id . "' ";
     @pmb_mysql_query($requete, $dbh);
     $requete = "delete from analysis where analysis_notice='" . $id . "' ";
     @pmb_mysql_query($requete, $dbh);
     $requete = "update bulletins set num_notice=0 where num_notice='" . $id . "' ";
     @pmb_mysql_query($requete, $dbh);
     //Suppression de la reference a la notice dans la table suggestions
     $requete = "UPDATE suggestions set num_notice = 0 where num_notice=" . $id;
     @pmb_mysql_query($requete, $dbh);
     //Suppression de la reference a la notice dans la table lignes_actes
     $requete = "UPDATE lignes_actes set num_produit=0, type_ligne=0 where num_produit='" . $id . "' and type_ligne in ('1','5') ";
     @pmb_mysql_query($requete, $dbh);
     //suppression des droits d'acces user_notice
     $requete = "delete from acces_res_1 where res_num=" . $id;
     @pmb_mysql_query($requete, $dbh);
     // suppression des tags
     $rqt_del = "delete from tags where num_notice=" . $id;
     @pmb_mysql_query($rqt_del, $dbh);
     //suppression des avis
     $requete = "delete from avis where num_notice=" . $id;
     @pmb_mysql_query($requete, $dbh);
     //suppression des droits d'acces empr_notice
     $requete = "delete from acces_res_2 where res_num=" . $id;
     @pmb_mysql_query($requete, $dbh);
     // Supression des liens avec les titres uniformes
     $requete = "DELETE FROM notices_titres_uniformes WHERE ntu_num_notice='{$id}'";
     @pmb_mysql_query($requete, $dbh);
     //Suppression dans les listes de lecture partagées
     $requete = "SELECT id_liste, notices_associees from opac_liste_lecture";
     $res = pmb_mysql_query($requete, $dbh);
     $id_tab = array();
     while ($notices = pmb_mysql_fetch_object($res)) {
         $id_tab = explode(',', $notices->notices_associees);
         for ($i = 0; $i < sizeof($id_tab); $i++) {
             if ($id_tab[$i] == $id) {
                 unset($id_tab[$i]);
             }
         }
         $requete = "UPDATE opac_liste_lecture set notices_associees='" . addslashes(implode(',', $id_tab)) . "' where id_liste='" . $notices->id_liste . "'";
         pmb_mysql_query($requete, $dbh);
     }
     // Suppression des résas
     $requete = "DELETE FROM resa WHERE resa_idnotice=" . $id;
     pmb_mysql_query($requete, $dbh);
     // Suppression des transferts_demande
     $requete = "DELETE FROM transferts_demande using transferts_demande, transferts WHERE num_transfert=id_transfert and num_notice=" . $id;
     pmb_mysql_query($requete, $dbh);
     // Suppression des transferts
     $requete = "DELETE FROM transferts WHERE num_notice=" . $id;
     pmb_mysql_query($requete, $dbh);
     //si intégré depuis une source externe, on supprime aussi la référence
     $query = "delete from notices_externes where num_notice=" . $id;
     @pmb_mysql_query($query, $dbh);
     $req = "delete from notices_authperso where notice_authperso_notice_num=" . $id;
     pmb_mysql_query($req, $dbh);
     //Suppression des emprises liées à la notice
     $req = "select map_emprise_id from map_emprises where map_emprise_type=11 and map_emprise_obj_num=" . $id;
     $result = pmb_mysql_query($req, $dbh);
     if (pmb_mysql_num_rows($result)) {
         $row = pmb_mysql_fetch_object($result);
         $query = "delete from map_emprises where map_emprise_obj_num=" . $id . " and map_emprise_type=11";
         pmb_mysql_query($query, $dbh);
         $req_areas = "delete from map_hold_areas where type_obj=11 and id_obj=" . $row->map_emprise_id;
         pmb_mysql_query($req_areas, $dbh);
     }
     $query = "update docwatch_items set item_num_notice=0 where item_num_notice = " . $id;
     pmb_mysql_query($query, $dbh);
     // Nettoyage indexation concepts
     $index_concept = new index_concept($id, TYPE_NOTICE);
     $index_concept->delete();
 }
Esempio n. 7
0
 }
 $table['f_indexint_id'] = $f_indexint_id;
 $table['f_indexation'] = clean_string($f_indexation);
 $table['f_lien'] = clean_string($f_lien);
 $table['f_eformat'] = clean_string($f_eformat);
 $table['signature'] = $signature;
 // mise à jour de l'entête de page
 echo str_replace('!!page_title!!', $msg[4000] . $msg[1003] . $msg[4023], $serial_header);
 $p_perso = new parametres_perso("notices");
 $nberrors = $p_perso->check_submited_fields();
 //Pour la synchro rdf
 if ($pmb_synchro_rdf) {
     require_once $class_path . "/synchro_rdf.class.php";
     $synchro_rdf = new synchro_rdf();
     if ($analysis_id) {
         $synchro_rdf->delRdf($analysis_id, 0);
     }
 }
 //Traitement des périos et bulletins
 global $perio_type, $bull_type;
 global $f_perio_new, $f_perio_new_issn;
 global $f_bull_new_num, $f_bull_new_date, $f_bull_new_mention, $f_bull_new_titre;
 //Perios
 if ($perio_type == 'insert_new' && !$serial_id) {
     $new_serial = new serial();
     $values = array();
     $values['tit1'] = $f_perio_new;
     $values['code'] = $f_perio_new_issn;
     $values['niveau_biblio'] = "s";
     $values['niveau_hierar'] = "1";
     $serial_id = $new_serial->update($values);
Esempio n. 8
0
 function analysis_delete()
 {
     global $dbh;
     global $pmb_synchro_rdf, $pmb_notice_img_folder_id;
     //Suppression de la vignette de la notice si il y en a une d'uploadée
     if ($pmb_notice_img_folder_id) {
         $req = "select repertoire_path from upload_repertoire where repertoire_id ='" . $pmb_notice_img_folder_id . "'";
         $res = mysql_query($req, $dbh);
         if (mysql_num_rows($res)) {
             $rep = mysql_fetch_object($res);
             $img = $rep->repertoire_path . "img_" . $this->analysis_id;
             @unlink($img);
         }
     }
     //synchro rdf
     if ($pmb_synchro_rdf) {
         $synchro_rdf = new synchro_rdf();
         $synchro_rdf->delRdf($this->analysis_id, 0);
     }
     //elimination des docs numeriques
     $req_explNum = "select explnum_id from explnum where explnum_notice=" . $this->analysis_id . " ";
     $result_explNum = @mysql_query($req_explNum, $dbh);
     while ($explNum = mysql_fetch_object($result_explNum)) {
         $myExplNum = new explnum($explNum->explnum_id);
         $myExplNum->delete();
     }
     // suppression des entrees dans les caddies
     $query_caddie = "select caddie_id from caddie_content, caddie where type='NOTI' and object_id in ({$this->analysis_id}) and caddie_id=idcaddie ";
     $result_caddie = @mysql_query($query_caddie, $dbh);
     while ($cad = mysql_fetch_object($result_caddie)) {
         $req_suppr_caddie = "delete from caddie_content where caddie_id = '{$cad->caddie_id}' and object_id in ({$this->analysis_id}) ";
         @mysql_query($req_suppr_caddie, $dbh);
     }
     //elimination des champs persos
     $p_perso = new parametres_perso("notices");
     $p_perso->delete_values($this->analysis_id);
     // on supprime l'entree dans la table 'analysis'
     $requete = "DELETE FROM analysis WHERE analysis_notice=" . $this->analysis_id;
     mysql_query($requete, $dbh);
     $result = mysql_affected_rows($dbh);
     // on supprime la notice du dépouillement
     $requete = "DELETE FROM notices WHERE notice_id='" . $this->analysis_id . "' ";
     mysql_query($requete, $dbh);
     $result += mysql_affected_rows($dbh);
     //suppression des droits d'acces user_notice
     $requete = "delete from acces_res_1 where res_num=" . $this->analysis_id;
     @mysql_query($requete, $dbh);
     //suppression des droits d'acces empr_notice
     $requete = "delete from acces_res_2 where res_num=" . $this->analysis_id;
     @mysql_query($requete, $dbh);
     // suppression des audits
     audit::delete_audit(AUDIT_NOTICE, $this->analysis_id);
     // suppression des categories
     $rqt_del = "delete from notices_categories where notcateg_notice='" . $this->analysis_id . "' ";
     @mysql_query($rqt_del, $dbh);
     // suppression des responsabilités
     $rqt_del = "delete from responsability where responsability_notice='" . $this->analysis_id . "' ";
     @mysql_query($rqt_del, $dbh);
     // suppression des liens
     $rqt_del = "delete from notices_relations where num_notice='" . $this->analysis_id . "' OR linked_notice='" . $this->analysis_id . "'";
     @mysql_query($rqt_del, $dbh);
     // suppression des bannettes
     $rqt_del = "delete from bannette_contenu where num_notice='" . $this->analysis_id . "' ";
     @mysql_query($rqt_del, $dbh);
     // suppression des tags
     $rqt_del = "delete from tags where num_notice='" . $this->analysis_id . "' ";
     @mysql_query($rqt_del, $dbh);
     // suppression des avis
     $rqt_del = "delete from avis where num_notice='" . $this->analysis_id . "' ";
     @mysql_query($rqt_del, $dbh);
     //suppression des langues
     $query = "delete from notices_langues where num_notice='" . $this->analysis_id . "' ";
     @mysql_query($query, $dbh);
     // suppression index global
     $query = "delete from notices_global_index where num_notice='" . $this->analysis_id . "' ";
     @mysql_query($query, $dbh);
     // suppression notices_mots_global_index
     $query = "delete from notices_mots_global_index where id_notice='" . $this->analysis_id . "' ";
     @mysql_query($query, $dbh);
     // suppression notices_fields_global_index
     $query = "delete from notices_fields_global_index where id_notice='" . $this->analysis_id . "' ";
     @mysql_query($query, $dbh);
     //Suppression de la reference a la notice dans la table suggestions
     $query = "UPDATE suggestions set num_notice = 0 where num_notice=" . $this->analysis_id;
     @mysql_query($query, $dbh);
     //Suppression de la reference a la notice dans la table lignes_actes
     $requete = "UPDATE lignes_actes set num_produit=0, type_ligne=0 where num_produit='" . $this->analysis_id . "' and type_ligne in ('1','5') ";
     @mysql_query($requete, $dbh);
     //Suppression de la référence de la source si exitante..
     $query = "delete from notices_externes where num_notice=" . $this->analysis_id;
     @mysql_query($query, $dbh);
     //Suppression dans les listes de lecture partagées
     $requete = "SELECT id_liste, notices_associees from opac_liste_lecture";
     $res = mysql_query($requete, $dbh);
     $id_tab = array();
     while ($notices = mysql_fetch_object($res)) {
         $id_tab = explode(',', $notices->notices_associees);
         for ($i = 0; $i < sizeof($id_tab); $i++) {
             if ($id_tab[$i] == $this->analysis_id) {
                 unset($id_tab[$i]);
             }
         }
         $requete = "UPDATE opac_liste_lecture set notices_associees='" . addslashes(implode(',', $id_tab)) . "' where id_liste='" . $notices->id_liste . "'";
         mysql_query($requete, $dbh);
     }
     return $result;
 }