コード例 #1
0
ファイル: noeuds.class.php プロジェクト: bouchra012/PMB
 function delete($id_noeud = 0)
 {
     global $dbh;
     if (!$id_noeud && is_object($this)) {
         $id_noeud = $this->id_noeud;
     }
     // Supprime les categories.
     $q = "delete from categories where num_noeud = '" . $id_noeud . "' ";
     mysql_query($q, $dbh);
     //Import d'autorité
     noeuds::delete_autority_sources($id_noeud);
     // Supprime les renvois voir_aussi vers ce noeud.
     $q = "delete from voir_aussi where num_noeud_dest = '" . $id_noeud . "' ";
     mysql_query($q, $dbh);
     // Supprime les renvois voir_aussi depuis ce noeud.
     $q = "delete from voir_aussi where num_noeud_orig = '" . $id_noeud . "' ";
     mysql_query($q, $dbh);
     // Supprime les associations avec des notices.
     $q = "delete from notices_categories where num_noeud = '" . $id_noeud . "' ";
     mysql_query($q, $dbh);
     // Supprime le noeud.
     $q = "delete from noeuds where id_noeud = '" . $id_noeud . "' ";
     mysql_query($q, $dbh);
     audit::delete_audit(AUDIT_CATEG, $id_noeud);
     // liens entre autorités
     $aut_link = new aut_link(AUT_TABLE_CATEG, $id_noeud);
     $aut_link->delete();
     $aut_pperso = new aut_pperso("categ", $id_noeud);
     $aut_pperso->delete();
 }
コード例 #2
0
 function delete($id_noeud = 0)
 {
     global $dbh;
     if (!$id_noeud && is_object($this)) {
         $id_noeud = $this->id_noeud;
     }
     // Supprime les categories.
     $q = "delete from categories where num_noeud = '" . $id_noeud . "' ";
     pmb_mysql_query($q, $dbh);
     //Import d'autorité
     noeuds::delete_autority_sources($id_noeud);
     // Supprime les renvois voir_aussi vers ce noeud.
     $q = "delete from voir_aussi where num_noeud_dest = '" . $id_noeud . "' ";
     pmb_mysql_query($q, $dbh);
     // Supprime les renvois voir_aussi depuis ce noeud.
     $q = "delete from voir_aussi where num_noeud_orig = '" . $id_noeud . "' ";
     pmb_mysql_query($q, $dbh);
     // Supprime les associations avec des notices.
     $q = "delete from notices_categories where num_noeud = '" . $id_noeud . "' ";
     pmb_mysql_query($q, $dbh);
     //Supprime les emprises du noeud
     $req = "select map_emprise_id from map_emprises where map_emprise_type=2 and map_emprise_obj_num=" . $id_noeud;
     $result = pmb_mysql_query($req, $dbh);
     if (pmb_mysql_num_rows($result)) {
         $row = pmb_mysql_fetch_object($result);
         $q = "delete from map_emprises where map_emprise_obj_num ='" . $id_noeud . "' and map_emprise_type = 2";
         pmb_mysql_query($q, $dbh);
         $req_areas = "delete from map_hold_areas where type_obj=2 and id_obj=" . $row->map_emprise_id;
         pmb_mysql_query($req_areas, $dbh);
     }
     //suppression des renvois voir restants
     $q = "update noeuds set num_renvoi_voir = '0' where num_renvoi_voir = '" . $id_noeud . "' ";
     pmb_mysql_query($q, $dbh);
     // Supprime le noeud.
     $q = "delete from noeuds where id_noeud = '" . $id_noeud . "' ";
     pmb_mysql_query($q, $dbh);
     audit::delete_audit(AUDIT_CATEG, $id_noeud);
     // liens entre autorités
     $aut_link = new aut_link(AUT_TABLE_CATEG, $id_noeud);
     $aut_link->delete();
     $aut_pperso = new aut_pperso("categ", $id_noeud);
     $aut_pperso->delete();
     // nettoyage indexation
     indexation_authority::delete_all_index($id_noeud, "authorities", "id_authority", AUT_TABLE_CATEG);
     // effacement de l'identifiant unique d'autorité
     $authority = new authority(0, $id_noeud, AUT_TABLE_CATEG);
     $authority->delete();
 }
コード例 #3
0
ファイル: category.inc.php プロジェクト: bouchra012/PMB
//			if(!$iuse) {
//				$deleted++ ;
//				noeuds::delete($id_noeud);
//			}
//	}
//
//}
$v_state = urldecode($v_state);
if ($deleted == "") {
    $deleted = 0;
}
print "<br /><br /><h2 align='center'>" . htmlentities($msg["nettoyage_suppr_categories"], ENT_QUOTES, $charset) . "</h2>";
$list_thesaurus = thesaurus::getThesaurusList();
foreach ($list_thesaurus as $id_thesaurus => $libelle_thesaurus) {
    $thes = new thesaurus($id_thesaurus);
    $noeud_rac = $thes->num_noeud_racine;
    $r = noeuds::listChilds($noeud_rac, 0);
    while ($row = mysql_fetch_object($r)) {
        noeuds::process_categ($row->id_noeud);
    }
}
//Nettoyage des informations d'autorités pour les sous collections
noeuds::delete_autority_sources();
$spec = $spec - CLEAN_CATEGORIES;
//TODO non repris >> Utilité ???
//	$delete = mysql_query("delete from categories where categ_libelle='#deleted#'");
$v_state .= "<br /><img src=../../images/d.gif hspace=3>" . htmlentities($msg["nettoyage_suppr_categories"], ENT_QUOTES, $charset) . " : ";
$v_state .= $deleted . " " . htmlentities($msg["nettoyage_res_suppr_categories"], ENT_QUOTES, $charset);
$optn = noeuds::optimize();
$optc = categories::optimize();
print "<form class='form-{$current_module}' name='process_state' action='./clean.php' method='post'>\n\t\t\t\t<input type='hidden' name='v_state' value=\"" . urlencode($v_state) . "\">\n\t\t\t\t<input type='hidden' name='spec' value=\"{$spec}\">\n\t\t\t</form>\n\t\t\t<script type=\"text/javascript\"><!--\n\t\t\t\tdocument.forms['process_state'].submit();\n\t\t\t\t-->\n\t\t\t</script>";