本文整理汇总了PHP中notice::del_notice方法的典型用法代码示例。如果您正苦于以下问题:PHP notice::del_notice方法的具体用法?PHP notice::del_notice怎么用?PHP notice::del_notice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类notice
的用法示例。
在下文中一共展示了notice::del_notice方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete_notice
function delete_notice()
{
global $dbh;
global $demandes_statut_notice, $pmb_type_audit;
notice::del_notice($this->num_notice);
// mise à jour de la demande
$req = "UPDATE demandes SET num_notice=0 WHERE id_demande=" . $this->id_demande;
pmb_mysql_query($req, $dbh);
$this->num_notice = 0;
}
示例2: delete
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) {
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);
}
示例3: import_new_notice_suite
//.........这里部分代码省略.........
$chapeau_id = $chapeau->serial_id;
$bulletin = new bulletinage("", $chapeau_id);
$info = array();
$info['bul_titre'] = "Bulletin " . $info_463[0]['v'];
if ($info_463[0]['e']) {
$info['bul_titre'] .= " - " . $info_463[0]['e'];
}
$info['bul_titre'] = addslashes($info['bul_titre']);
$info['bul_no'] = addslashes($info_463[0]['v']);
$info['bul_date'] = addslashes($info_463[0]['e']);
$date_date = explode("/", $info_463[0]['e']);
if (count($date_date)) {
if (count($date_date) == 1) {
$info['date_date'] = $date_date[0] . "-01-01";
}
if (count($date_date) == 2) {
$info['date_date'] = $date_date[1] . "-" . $date_date[0] . "-01";
}
if (count($date_date) == 3) {
$info['date_date'] = $date_date[2] . "-" . $date_date[1] . "-" . $date_date[0];
}
} else {
if ($info_904[0]) {
$info['date_date'] = $info_904[0];
}
}
$bulletin_id = $bulletin->update($info);
}
$bulletin_ex = $bulletin_id;
if ($r->tit1 == '_OBJECT_BULLETIN_' || is_array($info_464) && $info_464[0]['z'] == 'objet') {
//$info_464[0]['z']=='objet' >> Compatibilite import memonotices
$is_object = true;
//notice de bulletin a supprimer
notice::del_notice($notice_id);
} else {
//Passage de la notice en article
$np = '';
if (is_array($info_464) && $info_464[0]['p'] != '') {
$np = ", npages='" . addslashes($info_464[0]['p']) . "' ";
}
$requete = "update notices set niveau_biblio='a', niveau_hierar='2', year='" . addslashes($info_463[0]['e']) . "'" . $np . ", date_parution='" . $info['date_date'] . "' where notice_id={$notice_id}";
mysql_query($requete);
$requete = "insert into analysis (analysis_bulletin,analysis_notice) values({$bulletin_id},{$notice_id})";
mysql_query($requete);
}
}
if (!$is_object) {
//Traitement du thésaurus
$unknown_desc = array();
$ordre_categ = 0;
for ($i = 0; $i < count($info_606_a); $i++) {
for ($j = 0; $j < count($info_606_a[$i]); $j++) {
$descripteur = $info_606_a[$i][$j];
//Recherche du terme
//dans le thesaurus par defaut et dans la langue de l'interface
$libelle = addslashes($descripteur);
$categ_id = categories::searchLibelle($libelle);
if ($categ_id) {
$requete = "INSERT INTO notices_categories (notcateg_notice,num_noeud,ordre_categorie) values({$notice_id},{$categ_id},{$ordre_categ})";
mysql_query($requete, $dbh);
$ordre_categ++;
} else {
$unknown_desc[] = $descripteur;
}
}
}
示例4: rtrim
//.........这里部分代码省略.........
//Perios
if (!$this->perio_id) {
$new_perio = new serial();
$values = array();
$values['tit1'] = $this->perio_titre;
$values['code'] = $this->perio_issn;
$values['niveau_biblio'] = "s";
$values['niveau_hierar'] = "1";
$this->perio_id = $new_perio->update($values);
//synchro_rdf
if ($pmb_synchro_rdf) {
$synchro_rdf->addRdf($this->perio_id, 0);
}
}
if (!$this->bull_id) {
$new_bull = new bulletinage(0, $this->perio_id);
$values = array();
$values['bul_no'] = $this->bull_num;
$values['bul_date'] = $this->bull_mention;
$values['date_date'] = $this->bull_date;
$values['bul_titre'] = $this->bull_titre;
$new_bull->update($values);
$this->bull_id = $new_bull->bulletin_id;
//synchro_rdf
if ($pmb_synchro_rdf) {
$synchro_rdf->addRdf(0, $this->bull_id);
}
// $req = "update bulletins set bulletin_notice='".$this->perio_id."',num_notice='".$notice_retour."' where bulletin_id='".$this->bull_id."'";
// pmb_mysql_query($req,$dbh); //Faire un update en mettant l'id de la notice crée
//file_put_contents('php://stderr', print_r($this->bull_id, true));
}
if ($this->bull_notice) {
$notice_bulletin = new notice();
$notice_bulletin->del_notice($notice_retour);
$notice_retour = $this->bull_notice;
}
//Mise à jour de la table bulletins, ajout de la relation entre le bulletins et sa notice
$req = "update bulletins set bulletin_notice='" . $this->perio_id . "',num_notice='" . $notice_retour . "' where bulletin_id='" . $this->bull_id . "'";
pmb_mysql_query($req, $dbh);
//Insertion dans la table notices_relation, ajout de la relatioin entre la notice de bulletin et la notice de perio
$req = "insert into notices_relations (num_notice, linked_notice, relation_type,rank) values('" . $notice_retour . "', '" . $this->perio_id . "', 'b','1')";
pmb_mysql_query($req, $dbh);
}
}
//file_put_contents('php://stderr', print_r($notice_retour."\n", true));
//Exemplaires
if (count($this->exemplaires)) {
// global $section_995, $typdoc_995, $codstatdoc_995;
// , $nb_expl_ignores;
$section_995_ = new marc_list("section_995");
$section_995 = $section_995_->table;
$typdoc_995_ = new marc_list("typdoc_995");
$typdoc_995 = $typdoc_995_->table;
$codstatdoc_995_ = new marc_list("codstatdoc_995");
$codstatdoc_995 = $codstatdoc_995_->table;
// $nb_expl_ignores=0;
global $deflt_docs_statut, $deflt_docs_location, $deflt_lenders;
foreach ($this->exemplaires as $info_expl) {
/* RAZ expl */
$expl = array();
if ($notice_retour) {
/* préparation du tableau à passer à la méthode */
$expl['cb'] = $info_expl['f'];
//TODO AR
// les raccrocher au bulletin et non sa notice
// dans un second temps
示例5: genere_bulletin
function genere_bulletin($perio_info, $bull_info, $isbull = true)
{
global $bl, $hl, $notice_id;
//on récup et/ou génère le pério
$perio_id = genere_perio($perio_info);
//on s'occupe du cas ou on a pas de titre pour le bulletin
// num (mention) [date]
if ($bull_info['titre'] == "") {
$bull_info['titre'] = $bull_info['num'] . ($bull_info['mention'] ? " (" . $bull_info['mention'] . ") " : " ") . ($bull_info['date'] ? "[" . $bull_info['date'] . "]" : "");
}
$search = "select bulletin_id from bulletins where bulletin_titre LIKE '" . addslashes($bull_info['titre']) . "' and mention_date LIKE '" . $bull_info['mention'] . "' and bulletin_numero LIKE '" . $bull_info['num'] . "' and bulletin_notice = {$perio_id}";
$res = mysql_query($search);
if (mysql_num_rows($res) == 0) {
$insert = "insert into bulletins set bulletin_titre = '" . $bull_info['titre'] . "', date_date = '" . $bull_info['date'] . "', mention_date = '" . $bull_info['mention'] . "', bulletin_numero = '" . $bull_info['num'] . "', bulletin_notice = {$perio_id}";
if ($bl == "s" && $hl == "2") {
$insert .= ", num_notice = {$notice_id}";
update_notice("b", "2");
}
$result = mysql_query($insert);
$bull_id = mysql_insert_id();
} else {
$bull_id = mysql_result($res, 0, 0);
//on regarde si une notice n'existe pas déjà pour ce bulletin
$req = "select num_notice from bulletins where bulletin_id = {$bull_id} and num_notice != 0";
$res = mysql_query($req);
//si oui on retire l'enregistrement en cours, et on continue sur la notice existante...
if (mysql_num_rows($res) > 0) {
notice::del_notice($notice_id);
$notice_id = mysql_result($res, 0, 0);
}
}
return $bull_id;
}
示例6: import_new_notice_suite
function import_new_notice_suite()
{
global $dbh;
global $notice_id;
global $bl, $hl;
global $infos_4XX;
global $hierarchic_level;
global $bibliographic_level;
global $doc_type;
global $origine_notice;
global $notices_crees;
global $issn_011, $info_900;
global $tit_200a;
global $isbn;
global $statutnot;
global $info_003;
global $info_336, $info_337;
global $isbn_only, $isbn_dedoublonnage;
if (isset($bibliographic_level) && isset($hierarchic_level)) {
$niveau_biblio = $bibliographic_level . $hierarchic_level;
} else {
$niveau_biblio = $bl . $hl;
}
//num_notice = fille
//linked_notice = mere
$sens = array('mother' => array("linked_notice", "num_notice"), 'child' => array("num_notice", "linked_notice"));
$link_type = array('412' => array('code' => "v", 'sens_link' => "child"), '413' => array('code' => "v", 'sens_link' => "mother"), '421' => array('code' => "e", 'sens_link' => "mother"), '422' => array('code' => "e", 'sens_link' => "child"), '423' => array('code' => "k", 'sens_link' => "child"), '430' => array('code' => "l", 'sens_link' => "child"), '431' => array('code' => "o", 'sens_link' => "mother"), '432' => array('code' => "t", 'sens_link' => "child"), '433' => array('code' => "o", 'sens_link' => "mother"), '434' => array('code' => "m", 'sens_link' => "child"), '435' => array('code' => "s", 'sens_link' => "child"), '436' => array('code' => "n", 'sens_link' => "mother"), '437' => array('code' => "o", 'sens_link' => "mother"), '440' => array('code' => "l", 'sens_link' => "mother"), '441' => array('code' => "o", 'sens_link' => "child"), '442' => array('code' => "t", 'sens_link' => "mother"), '443' => array('code' => "o", 'sens_link' => "child"), '444' => array('code' => "m", 'sens_link' => "mother"), '445' => array('code' => "s", 'sens_link' => "mother"), '446' => array('code' => "o", 'sens_link' => "child"), '447' => array('code' => "n", 'sens_link' => "child"), '451' => array('code' => "u", 'sens_link' => "child"), '452' => array('code' => "p", 'sens_link' => "child"), '453' => array('code' => "h", 'sens_link' => "mother"), '454' => array('code' => "h", 'sens_link' => "child"), '455' => array('code' => "q", 'sens_link' => "mother"), '456' => array('code' => "q", 'sens_link' => "child"), '520' => array('code' => "f", 'sens_link' => "child"));
//dédoublonnage !
if ($isbn && $isbn_dedoublonnage) {
$query = "select notice_id from notices where code like '" . $isbn . "' and notice_id != " . $notice_id;
$result = mysql_query($query);
if (mysql_num_rows($result)) {
$row = mysql_fetch_object($result);
notice::del_notice($notice_id);
$notice_id = $row->notice_id;
mysql_query("insert into error_log (error_origin, error_text) values ('import_expl_" . addslashes(SESSid) . ".inc', '" . addslashes("La notice (" . $tit_200a[0] . ", " . $isbn . ") n'a pas été reprise car elle existe déjà en base (notice id: " . $notice_id . ")") . "') ");
}
}
if (!$isbn_dedoublonnage || $isbn_only == 1) {
$rq = "UPDATE notices SET code=REPLACE(code, '_pasToucheACa', '') WHERE notice_id = " . $notice_id;
mysql_query($rq);
} elseif ($issn_011[0]) {
$query = "select notice_id from notices where code like '" . $issn_011[0] . "' and notice_id != " . $notice_id;
$result = mysql_query($query);
if (mysql_num_rows($result)) {
while ($row = mysql_fetch_object($result)) {
if (in_array($row->notice_id, $notices_crees)) {
$old = new notice($row->notice_id);
$old->replace($notice_id);
$tab = array_flip($notices_crees);
unset($tab[$row->notice_id]);
$notices_crees = array_flip($tab);
} else {
notice::del_notice($notice_id);
$notice_id = $row->notice_id;
mysql_query("insert into error_log (error_origin, error_text) values ('import_expl_" . addslashes(SESSid) . ".inc', '" . addslashes("La notice (" . $tit_200a[0] . ", " . $isbn . ") n'a pas été reprise car elle existe déjà en base (notice id: " . $notice_id . ")") . "') ");
}
}
}
}
$n_gen_plus = "";
if (count($info_336)) {
foreach ($info_336 as $value) {
if ($tmp = trim($value)) {
if ($n_gen_plus) {
$n_gen_plus .= "\n";
}
$n_gen_plus .= $tmp;
}
}
}
if (count($info_337)) {
foreach ($info_337 as $value) {
if ($tmp = trim($value)) {
if ($n_gen_plus) {
$n_gen_plus .= "\n";
}
$n_gen_plus .= $tmp;
}
}
}
if ($n_gen_plus) {
$requ = "UPDATE notices SET n_gen=IF(n_gen != '',CONCAT(n_gen,'\n" . addslashes($n_gen_plus) . "'),'" . addslashes($n_gen_plus) . "') WHERE notice_id = " . $notice_id;
if (!mysql_query($requ)) {
echo "Requête echoué: " . $requ . "<br/>";
}
}
switch ($niveau_biblio) {
case "s1":
case "s0":
foreach ($infos_4XX as $key => $children) {
foreach ($children as $child) {
$issn = "";
//on commence par chercher si la notice existe
$issn = traite_code_ISSN($child['x']);
if ($issn) {
$query = "select notice_id from notices where code ='" . $issn . "' and niveau_biblio = 's' and niveau_hierar = '1'";
$result = mysql_query($query);
if (!mysql_num_rows($result)) {
//la notice n'existe pas, il faut la créer...
//.........这里部分代码省略.........
示例7: mysql_query
$ret_param = "";
$query = "select linked_notice from notices_relations where num_notice={$id}";
$result = mysql_query($query, $dbh);
$not_mere = 0;
if (mysql_numrows($result)) {
$not_mere = mysql_result($result, 0, 0);
}
if ($not_mere > 0) {
// perio ou mono?
$n = mysql_fetch_object(@mysql_query("select * from notices where notice_id=" . $not_mere));
if ($n->niveau_biblio == 'm' || $n->niveau_biblio == 'b') {
$ret_param = "?categ=isbd&id={$not_mere}";
} elseif ($n->niveau_biblio == 's' || $n->niveau_biblio == 'a') {
$ret_param = "?categ=serials&sub=view&serial_id={$not_mere}";
}
}
//archivage
if ($pmb_archive_warehouse) {
notice::save_to_agnostic_warehouse(array(0 => $id), $pmb_archive_warehouse);
}
notice::del_notice($id);
// affichage du message suppression en cours puis redirect vers page de catalogage
print "<div class=\"row\"><div class='msg-perio'>" . $msg['suppression_en_cours'] . "</div></div>\n\t\t\t\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t\t\t\tdocument.location='./catalog.php" . $ret_param . "';\n\t\t\t\t\t\t\t</script>";
}
}
}
}
} else {
error_message($msg[416], "{$msg[417]} : {$msg[418]}", 1, "./catalog.php");
}
}
示例8: del_item_base
function del_item_base($item = 0, $forcage = array())
{
global $dbh;
if (!$item) {
return CADDIE_ITEM_NULL;
}
switch ($this->type) {
case "EXPL":
if (!$this->verif_expl_item($item)) {
if ($forcage['source_id']) {
exemplaire::save_to_agnostic_warehouse(array(0 => $item), $forcage['source_id']);
}
if (exemplaire::del_expl($item)) {
return CADDIE_ITEM_SUPPR_BASE_OK;
} else {
return 0;
}
} else {
return CADDIE_ITEM_EXPL_PRET;
}
break;
case "BULL":
if (!$this->verif_bull_item($item, $forcage)) {
// aucun prêt d'exemplaire de ce bulletin en cours, on supprime :
$myBulletinage = new bulletinage($item);
$myBulletinage->delete();
return CADDIE_ITEM_SUPPR_BASE_OK;
} else {
return CADDIE_ITEM_BULL_USED;
}
break;
case "NOTI":
if (!$this->verif_noti_item($item, $forcage)) {
if ($forcage['source_id']) {
notice::save_to_agnostic_warehouse(array(0 => $item), $forcage['source_id']);
}
$requete = "SELECT niveau_biblio, niveau_hierar FROM notices WHERE notice_id='" . $item . "'";
$res = pmb_mysql_query($requete, $dbh);
if (pmb_mysql_num_rows($res) && pmb_mysql_result($res, 0, 0) == "s" && pmb_mysql_result($res, 0, 1) == "1") {
$myBulletinage = new serial($item);
$myBulletinage->serial_delete();
} else {
notice::del_notice($item);
}
return CADDIE_ITEM_SUPPR_BASE_OK;
} else {
return CADDIE_ITEM_NOTI_USED;
}
break;
}
return CADDIE_ITEM_OK;
}
示例9: replace
function replace($by, $supp_notice = true)
{
global $msg;
global $dbh;
global $keep_categories;
if ($this->id == $by) {
return $msg[223];
}
if ($this->id == $by || !$this->id) {
return $msg[223];
}
$by_notice = new notice($by);
if ($this->biblio_level != $by_notice->biblio_level || $this->hierar_level != $by_notice->hierar_level) {
return $msg[catal_rep_not_err1];
}
// traitement des catégories (si conservation cochée)
if ($keep_categories) {
update_notice_categories_from_form($by);
}
// remplacement dans les exemplaires numériques
$requete = "UPDATE explnum SET explnum_notice='{$by}' WHERE explnum_notice='{$this->id}' ";
pmb_mysql_query($requete, $dbh);
// remplacement dans les exemplaires
$requete = "UPDATE exemplaires SET expl_notice='{$by}' WHERE expl_notice='{$this->id}' ";
pmb_mysql_query($requete, $dbh);
// remplacement dans les depouillements
$requete = "UPDATE analysis SET analysis_notice='{$by}' WHERE analysis_notice='{$this->id}' ";
pmb_mysql_query($requete, $dbh);
// remplacement dans les bulletins
$requete = "UPDATE bulletins SET bulletin_notice='{$by}' WHERE bulletin_notice='{$this->id}' ";
pmb_mysql_query($requete, $dbh);
// remplacement dans les notices filles
/*$requete = "UPDATE notices_relations SET num_notice='$by' WHERE num_notice='$this->id' ";
@pmb_mysql_query($requete, $dbh);
$requete = "UPDATE notices_relations SET linked_notice='$by' WHERE linked_notice='$this->id' ";
@pmb_mysql_query($requete, $dbh);*/
// remplacement dans les resas
$requete = "UPDATE resa SET resa_idnotice='{$by}' WHERE resa_idnotice='{$this->id}' ";
pmb_mysql_query($requete, $dbh);
$req = "UPDATE notices_authperso SET notice_authperso_notice_num='{$by}' where notice_authperso_notice_num='{$this->id}' ";
pmb_mysql_query($req, $dbh);
//Suppression de la notice
if ($supp_notice) {
notice::del_notice($this->id);
}
return FALSE;
}
示例10: creer_lien_notice_bulletin
function creer_lien_notice_bulletin($ancien_id = 0, $id_perio = 0, $id_bulletin = 0, $id_not_bull = 0, $titre_not_bull = "", $bulletin)
{
global $dbh, $msg, $isbn_OK, $tit_200a, $notice_id, $notices_crees, $statutnot;
//On control que ce bulletin n'a pas déjà une notice
$requete = "select num_notice from bulletins where bulletin_id='" . $id_bulletin . "'";
if ($id_not_bull) {
$requete .= " and num_notice!='" . $id_not_bull . "'";
}
$res = mysql_query($requete, $dbh);
if (mysql_num_rows($res) && mysql_result($res, 0, 0)) {
//Si j'ai déja une notice associé à ce bulletin je la récupère
if ($id_not_bull) {
//Si j'ai aussi un identifiant de notice de bulletin, je supprime le plus récent
notice::del_notice($id_not_bull);
mysql_query("insert into error_log (error_origin, error_text) values ('import_" . addslashes(SESSid) . ".inc', '" . $msg[542] . " {$id_unimarc} " . " {$isbn_OK} " . addslashes(clean_string(implode(" ; ", $tit_200a))) . "') ", $dbh);
$id_notice_bulletin = mysql_result($res, 0, 0);
//A voir pr modif
} else {
$id_notice_bulletin = mysql_result($res, 0, 0);
}
$notice_id = $id_notice_bulletin;
} else {
if ($titre_not_bull) {
//Si j'ai un titre je créé la notice de bulletin
$requete = "insert into notices (tit1,niveau_biblio, niveau_hierar,statut) values ('" . addslashes(clean_string($titre_not_bull)) . "', 'b', '2','" . $statutnot . "')";
mysql_query($requete, $dbh);
$id_notice_bulletin = mysql_insert_id();
audit::insert_creation(AUDIT_NOTICE, $id_notice_bulletin);
//calcul des droits d'accès s'ils sont activés
calc_notice_acces_rights($id_notice_bulletin);
// Mise à jour des index de la notice
notice::majNotices($id_notice_bulletin);
// Mise à jour de la table "notices_global_index"
notice::majNoticesGlobalIndex($id_notice_bulletin);
// Mise à jour de la table "notices_mots_global_index"
notice::majNoticesMotsGlobalIndex($id_notice_bulletin);
} else {
$id_notice_bulletin = $id_not_bull;
}
//On créer le lien entre le bulletin et la notice de bulletin
$requete = "update bulletins set num_notice='" . $id_notice_bulletin . "' where bulletin_id='" . $id_bulletin . "'";
mysql_query($requete, $dbh);
}
$notices_crees[$ancien_id] = $id_notice_bulletin;
//Lien entre la notice de bulletin et la notice de periodique
$requete = "insert into notices_relations(num_notice,linked_notice,relation_type) values ('" . $id_notice_bulletin . "','" . $id_perio . "','b')";
mysql_query($requete);
if ($id_notice_bulletin && $bulletin["date"]) {
$requete = "UPDATE notices SET year='" . addslashes(substr($bulletin["date"], 0, 4)) . "', date_parution='" . addslashes($bulletin["date"]) . "' WHERE notice_id='" . $id_notice_bulletin . "'";
mysql_query($requete);
}
return $id_notice_bulletin;
}
示例11: dedoublonne
protected function dedoublonne($notice_id)
{
global $pmb_notice_controle_doublons;
$sign = new \notice_doublon();
$signature = $sign->gen_signature($notice_id);
if ($pmb_notice_controle_doublons) {
$q = "select notice_id from notices where signature='" . $signature . "' and notice_id != " . $notice_id . " limit 1";
$res = pmb_mysql_query($q);
if (pmb_mysql_num_rows($res)) {
$r = pmb_mysql_fetch_object($res);
// doublon existe, on supprime la notice créée
\notice::del_notice($notice_id);
return $r->notice_id;
}
}
pmb_mysql_query("update notices set signature = '" . $signature . "' where notice_id = " . $notice_id);
return $notice_id;
}
示例12: replace
function replace($by, $supp_notice = true)
{
global $msg;
global $dbh;
if ($this->id == $by) {
return $msg[223];
}
if ($this->id == $by || !$this->id) {
return $msg[223];
}
$by_notice = new notice($by);
if ($this->biblio_level != $by_notice->biblio_level || $this->hierar_level != $by_notice->hierar_level) {
return $msg[catal_rep_not_err1];
}
// remplacement dans les exemplaires numériques
$requete = "UPDATE explnum SET explnum_notice='{$by}' WHERE explnum_notice='{$this->id}' ";
mysql_query($requete, $dbh);
// remplacement dans les exemplaires
$requete = "UPDATE exemplaires SET expl_notice='{$by}' WHERE expl_notice='{$this->id}' ";
mysql_query($requete, $dbh);
// remplacement dans les depouillements
$requete = "UPDATE analysis SET analysis_notice='{$by}' WHERE analysis_notice='{$this->id}' ";
mysql_query($requete, $dbh);
// remplacement dans les bulletins
$requete = "UPDATE bulletins SET bulletin_notice='{$by}' WHERE bulletin_notice='{$this->id}' ";
mysql_query($requete, $dbh);
// remplacement dans les notices filles
/*$requete = "UPDATE notices_relations SET num_notice='$by' WHERE num_notice='$this->id' ";
@mysql_query($requete, $dbh);
$requete = "UPDATE notices_relations SET linked_notice='$by' WHERE linked_notice='$this->id' ";
@mysql_query($requete, $dbh);*/
// remplacement dans les resas
$requete = "UPDATE resa SET resa_idnotice='{$by}' WHERE resa_idnotice='{$this->id}' ";
mysql_query($requete, $dbh);
//Suppression de la notice
if ($supp_notice) {
notice::del_notice($this->id);
}
return FALSE;
}
示例13: doSync
//.........这里部分代码省略.........
if (!$rs_s->cancel) {
$result[] = $conn->msg["connecteurs_sync_currentexists"];
$is_already_sync = true;
} else {
$recover = true;
$recover_env = $rs_s->env;
$env = array();
}
} else {
$env = $conn->get_maj_environnement($id_source);
}
if (!$is_already_sync) {
if (!$recover) {
$requete = "insert into source_sync (source_id,nrecu,ntotal,date_sync) values({$id_source},0,0,now())";
$r = pmb_mysql_query($requete, $dbh);
} else {
$requete = "update source_sync set cancel=0 where source_id={$id_source}";
$r = pmb_mysql_query($requete, $dbh);
}
if ($r) {
$n_maj = $conn->maj_entrepot($id_source, array(&$this, "callback_progress"), $recover, $recover_env);
$result[] = sprintf($msg["connecteurs_count_notices"], $n_maj);
$result[] = $conn->error_message;
if (!$conn->error) {
$this->callback_progress(1, $n_maj, $n_maj);
$percent = 1;
$requete = "update source_sync set percent=" . round($percent * 100) . " where source_id={$id_source}";
$r = pmb_mysql_query($requete, $dbh);
$requete = "delete from source_sync where source_id=" . $id_source;
pmb_mysql_query($requete);
$requete = "update connectors_sources set last_sync_date=now() where source_id=" . $id_source;
pmb_mysql_query($requete, $dbh);
} else {
if ($conn->break_maj($id_source)) {
$requete = "delete from source_sync where source_id=" . $id_source;
} else {
$requete = "update source_sync set cancel=2 where source_id=" . $id_source;
}
pmb_mysql_query($requete, $dbh);
$result[] = $conn->error_message;
}
} else {
$result[] = pmb_mysql_error();
}
} else {
$result[] = $msg["connecteurs_sync_currentexists"];
}
//si l'import automatique est activé
if ($auto_import) {
//on va chercher les notices non intégrées
$query = "select distinct entrepot_source_" . $id_source . ".recid from entrepot_source_" . $id_source . " left join notices_externes on notices_externes.recid = concat(connector_id,' " . $id_source . " ',ref) where num_notice is null";
$result = pmb_mysql_query($query);
if (pmb_mysql_num_rows($result)) {
while ($row = pmb_mysql_fetch_object($result)) {
$infos = entrepot_to_unimarc($row->recid);
if ($infos['notice']) {
$z = new z3950_notice("unimarc", $infos['notice'], $infos['source_id']);
if ($pmb_notice_controle_doublons != 0) {
$sign = new notice_doublon(true, $infos['source_id']);
$signature = $sign->gen_signature($row->recid);
} else {
$signature = "";
}
$z->signature = $signature;
if ($infos['notice']) {
$z->notice = $infos['notice'];
}
if ($infos['source_id']) {
$z->source_id = $infos['source_id'];
}
$z->var_to_post();
$ret = $z->insert_in_database(false);
$id_notice = $ret[1];
$rqt = "select recid from external_count where rid = '{$row->recid}'";
$res = pmb_mysql_query($rqt);
if (pmb_mysql_num_rows($res)) {
$recid = pmb_mysql_result($res, 0, 0);
}
$req = "insert into notices_externes set num_notice = '" . $id_notice . "', recid = '" . $recid . "'";
pmb_mysql_query($req);
}
}
}
if (!$conn->error && $auto_delete) {
// On gère la suppression des notices qui ne sont plus présentes dans l'entrepôt
$query = "select distinct num_notice from notices_externes left join external_count on notices_externes.recid = external_count.recid where rid is null and notices_externes.recid like '% " . $id_source . " %'";
$result = pmb_mysql_query($query, $dbh);
if ($result && pmb_mysql_num_rows($result)) {
while ($row = pmb_mysql_fetch_object($result)) {
// suppression de la notice
notice::del_notice($row->num_notice);
}
}
}
}
return $result;
} else {
return array();
}
}