Esempio n. 1
0
 function delete()
 {
     global $dbh;
     global $pmb_synchro_rdf;
     //suppression des notices de dépouillement
     $this->delete_analysis();
     //synchro rdf
     if ($pmb_synchro_rdf) {
         $synchro_rdf = new synchro_rdf();
         $synchro_rdf->delRdf(0, $this->bulletin_id);
     }
     //suppression des exemplaires
     $req_expl = "select expl_id from exemplaires where expl_bulletin ='" . $this->bulletin_id . "' ";
     $result_expl = @pmb_mysql_query($req_expl, $dbh);
     while ($expl = pmb_mysql_fetch_object($result_expl)) {
         exemplaire::del_expl($expl->expl_id);
     }
     // expl numériques
     $req_explNum = "select explnum_id from explnum where explnum_bulletin=" . $this->bulletin_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();
     }
     $requete = "delete from caddie_content using caddie, caddie_content where caddie_id=idcaddie and type='BULL' and object_id='" . $this->bulletin_id . "' ";
     @pmb_mysql_query($requete, $dbh);
     // Suppression des résas du bulletin
     $requete = "DELETE FROM resa WHERE resa_idbulletin=" . $this->bulletin_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_bulletin=" . $this->bulletin_id;
     pmb_mysql_query($requete, $dbh);
     // Suppression des transferts
     $requete = "DELETE FROM transferts WHERE num_bulletin=" . $this->bulletin_id;
     pmb_mysql_query($requete, $dbh);
     //suppression de la notice du bulletin
     $requete = "select num_notice from bulletins where bulletin_id=" . $this->bulletin_id;
     $res_nbul = pmb_mysql_query($requete);
     if (pmb_mysql_num_rows($res_nbul)) {
         $num_notice = pmb_mysql_result($res_nbul, 0, 0);
         if ($num_notice) {
             // suppression des vedettes
             bulletinage::delete_vedette_links($this->bulletin_id);
             notice::del_notice($num_notice);
         }
     }
     // Suppression de ce bulletin
     $requete = "DELETE FROM bulletins WHERE bulletin_id=" . $this->bulletin_id;
     pmb_mysql_query($requete, $dbh);
     audit::delete_audit(AUDIT_BULLETIN, $this->bulletin_id);
 }
Esempio n. 2
0
 //Traitement des liens
 $requete = "\n\t\tDELETE notices_relations FROM notices_relations\n\t\tLEFT OUTER JOIN bulletins ON bulletins.num_notice=notices_relations.num_notice AND bulletins.bulletin_notice=notices_relations.linked_notice\n\t\tWHERE (notices_relations.num_notice={$update_result} OR notices_relations.linked_notice={$update_result})\n\t\tAND (bulletin_notice IS NULL OR bulletins.bulletin_notice!={$serial_id})";
 pmb_mysql_query($requete);
 foreach ($table['rel'] as $rel) {
     if ($rel['id_notice']) {
         if ($rel['relation_direction'] == 'up') {
             $requete = "INSERT INTO notices_relations VALUES('{$update_result}','" . $rel['id_notice'] . "','" . $rel['relation_type'] . "','" . $rel['rank'] . "')";
             @pmb_mysql_query($requete);
         } elseif ($rel['relation_direction'] == 'down') {
             $requete = "INSERT INTO notices_relations VALUES('" . $rel['id_notice'] . "','{$update_result}','" . $rel['relation_type'] . "','" . $rel['rank'] . "')";
             @pmb_mysql_query($requete);
         }
     }
 }
 // Clean des vedettes
 bulletinage::delete_vedette_links($update_result);
 // traitement des auteurs
 $rqt_del = "DELETE FROM responsability WHERE responsability_notice='{$update_result}' ";
 $res_del = pmb_mysql_query($rqt_del, $dbh);
 $rqt_ins = "INSERT INTO responsability (responsability_author, responsability_notice, responsability_fonction, responsability_type, responsability_ordre) VALUES ";
 $i = 0;
 $var_name = 'notice_role_composed';
 $role_composed = ${$var_name};
 $var_name = 'notice_role_autre_composed';
 $role_composed_autre = ${$var_name};
 $var_name = 'notice_role_secondaire_composed';
 $role_composed_secondaire = ${$var_name};
 while ($i <= count($f_aut) - 1) {
     $id_aut = $f_aut[$i]['id'];
     if ($id_aut) {
         $fonc_aut = $f_aut[$i]['fonction'];