当前位置: 首页>>代码示例>>PHP>>正文


PHP collection::delete_autority_sources方法代码示例

本文整理汇总了PHP中collection::delete_autority_sources方法的典型用法代码示例。如果您正苦于以下问题:PHP collection::delete_autority_sources方法的具体用法?PHP collection::delete_autority_sources怎么用?PHP collection::delete_autority_sources使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在collection的用法示例。


在下文中一共展示了collection::delete_autority_sources方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delete

 function delete()
 {
     global $dbh;
     global $msg;
     if (!$this->id) {
         // impossible d'accéder à cette notice de collection
         return $msg[406];
     }
     // récupération du nombre de notices affectées
     $requete = "SELECT COUNT(1) FROM notices WHERE ";
     $requete .= "coll_id={$this->id}";
     $res = pmb_mysql_query($requete, $dbh);
     $nbr_lignes = pmb_mysql_result($res, 0, 0);
     if (!$nbr_lignes) {
         // on regarde si la collection a des collections enfants
         $requete = "SELECT COUNT(1) FROM sub_collections WHERE ";
         $requete .= "sub_coll_parent=" . $this->id;
         $res = pmb_mysql_query($requete, $dbh);
         $nbr_lignes = pmb_mysql_result($res, 0, 0);
         if (!$nbr_lignes) {
             // On regarde si l'autorité est utilisée dans des vedettes composées
             $attached_vedettes = vedette_composee::get_vedettes_built_with_element($this->id, "collection");
             if (count($attached_vedettes)) {
                 // Cette autorité est utilisée dans des vedettes composées, impossible de la supprimer
                 return '<strong>' . $this->display . "</strong><br />" . $msg["vedette_dont_del_autority"];
             }
             // effacement dans la table des collections
             $requete = "DELETE FROM collections WHERE collection_id=" . $this->id;
             $result = pmb_mysql_query($requete, $dbh);
             //Import d'autorité
             collection::delete_autority_sources($this->id);
             // liens entre autorités
             $aut_link = new aut_link(AUT_TABLE_COLLECTIONS, $this->id);
             $aut_link->delete();
             $aut_pperso = new aut_pperso("collection", $this->id);
             $aut_pperso->delete();
             // nettoyage indexation concepts
             $index_concept = new index_concept($this->id, TYPE_COLLECTION);
             $index_concept->delete();
             // nettoyage indexation
             indexation_authority::delete_all_index($this->id, "authorities", "id_authority", AUT_TABLE_COLLECTIONS);
             // effacement de l'identifiant unique d'autorité
             $authority = new authority(0, $this->id, AUT_TABLE_COLLECTIONS);
             $authority->delete();
             audit::delete_audit(AUDIT_COLLECTION, $this->id);
             return false;
         } else {
             // Cet collection a des sous-collections, impossible de la supprimer
             return '<strong>' . $this->display . "</strong><br />{$msg[408]}";
         }
     } else {
         // Cette collection est utilisé dans des notices, impossible de la supprimer
         return '<strong>' . $this->display . "</strong><br />{$msg[407]}";
     }
 }
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:55,代码来源:collection.class.php

示例2: urldecode

}
require_once "{$class_path}/collection.class.php";
// la taille d'un paquet de notices
$lot = COLLECTION_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_collections"], ENT_QUOTES, $charset) . "</h2>";
$query = mysql_query("SELECT collection_id from collections left join notices on collection_id=coll_id left join sub_collections on sub_coll_parent=collection_id where coll_id is null and sub_coll_parent is null ");
$affected = 0;
if ($affected = mysql_num_rows($query)) {
    while ($ligne = mysql_fetch_object($query)) {
        $coll = new collection($ligne->collection_id);
        $coll->delete();
    }
}
//Nettoyage des informations d'autorités pour les collections
collection::delete_autority_sources();
$query = mysql_query("update notices left join collections ON collection_id=coll_id SET coll_id=0, subcoll_id=0 WHERE collection_id is null");
$spec = $spec - CLEAN_COLLECTIONS;
$v_state .= "<br /><img src=../../images/d.gif hspace=3>" . htmlentities($msg["nettoyage_suppr_collections"], ENT_QUOTES, $charset) . " :";
$v_state .= $affected . " " . htmlentities($msg["nettoyage_res_suppr_collections"], ENT_QUOTES, $charset);
$opt = mysql_query('OPTIMIZE TABLE collections');
// 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<img src='../../images/jauge.png' width='{$jauge_size}' height='16'></td></tr></table>\n  \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=\"" . urlencode($v_state) . "\">\n\t\t<input type='hidden' name='spec' value=\"{$spec}\">\n\t\t</form>\n\t<script type=\"text/javascript\"><!--\n\t\tdocument.forms['process_state'].submit();\n\t\t-->\n\t</script>";
开发者ID:bouchra012,项目名称:PMB,代码行数:31,代码来源:collections.inc.php


注:本文中的collection::delete_autority_sources方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。