本文整理汇总了PHP中notice::majNotices方法的典型用法代码示例。如果您正苦于以下问题:PHP notice::majNotices方法的具体用法?PHP notice::majNotices怎么用?PHP notice::majNotices使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类notice
的用法示例。
在下文中一共展示了notice::majNotices方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
function save()
{
global $dbh, $sujet, $idetat, $titre, $id_theme, $id_type;
global $date_debut, $date_fin, $date_prevue, $idempr;
global $iduser, $progression, $demandes_statut_notice, $pmb_type_audit;
global $gestion_acces_active, $gestion_acces_user_notice, $gestion_acces_empr_notice;
if ($this->id_demande) {
//MODIFICATION
$req = "update demandes set sujet_demande='" . $sujet . "', \n\t\t\t\tnum_demandeur='" . $idempr . "', \n\t\t\t\tdate_demande='" . $date_debut . "', \n\t\t\t\tdeadline_demande='" . $date_fin . "',\n\t\t\t\tdate_prevue='" . $date_prevue . "', \n\t\t\t\tprogression='" . $progression . "',\n\t\t\t\ttitre_demande='" . $titre . "',\n\t\t\t\ttype_demande='" . $id_type . "',\n\t\t\t\ttheme_demande='" . $id_theme . "'";
if ($idetat == 4 || $idetat == 5) {
$req .= " ,num_user_cloture='" . SESSuserid . "'";
}
$req .= " where id_demande='" . $this->id_demande . "'";
mysql_query($req, $dbh);
$this->titre_demande = stripslashes($titre);
$this->sujet_demande = stripslashes($sujet);
$this->date_demande = $date_debut;
$this->date_prevue = $date_prevue;
$this->deadline_demande = $date_fin;
$this->num_user = $iduser;
$this->progression = $progression;
$this->num_demandeur = $idempr;
$this->type_demande = $id_type;
$this->theme_demande = $id_theme;
} else {
//CREATION de la notice associée
$req = "insert into notices set \n\t\t\t\ttit1='" . $titre . "',\n\t\t\t\tn_contenu='" . $sujet . "',\n\t\t\t\tstatut ='" . $demandes_statut_notice . "'\n\t\t\t\t";
mysql_query($req, $dbh);
$id_notice = mysql_insert_id();
notice::majNotices($id_notice);
if ($pmb_type_audit) {
audit::insert_creation(AUDIT_NOTICE, $id_notice);
}
//droits d'acces
if ($gestion_acces_active == 1) {
$ac = new acces();
//traitement des droits acces user_notice
if ($gestion_acces_user_notice == 1) {
$dom_1 = $ac->setDomain(1);
$dom_1->storeUserRights(0, $id_notice);
}
//traitement des droits acces empr_notice
if ($gestion_acces_empr_notice == 1) {
$dom_2 = $ac->setDomain(2);
$dom_2->storeUserRights(0, $id_notice);
}
}
//CREATION de la demande
$req = "insert into demandes set sujet_demande='" . $sujet . "', \n\t\t\t\tetat_demande='" . $idetat . "', \n\t\t\t\tnum_demandeur='" . $idempr . "', \n\t\t\t\tdate_demande='" . $date_debut . "', \n\t\t\t\tdate_prevue='" . $date_prevue . "', \n\t\t\t\tdeadline_demande='" . $date_fin . "', \n\t\t\t\tprogression='" . $progression . "',\n\t\t\t\ttitre_demande='" . $titre . "',\n\t\t\t\ttype_demande='" . $id_type . "',\n\t\t\t\ttheme_demande='" . $id_theme . "',\n\t\t\t\tnum_notice='" . $id_notice . "'";
mysql_query($req, $dbh);
}
//Affectation du libellé du thème et du type
$this->id_demande ? $id = $this->id_demande : ($id = mysql_insert_id());
$req = "select libelle_theme, libelle_type from demandes d, demandes_type dy , demandes_theme dt where dt.id_theme=d.theme_demande and dy.id_type=d.type_demande and id_demande='" . $id . "'";
$res = mysql_query($req, $dbh);
$row = mysql_fetch_object($res);
$this->type_libelle = $row->libelle_type;
$this->theme_libelle = $row->libelle_theme;
//Enregistrement dans demandes_users
$date_creation = date("Y-m-d", time());
if ($this->id_demande && $iduser) {
$req = "update demandes_users set users_statut=0 where num_user not in (" . implode(',', $iduser) . ") and num_demande='" . $this->id_demande . "'";
mysql_query($req, $dbh);
$req = "update demandes_users set users_statut=1 where num_user in (" . implode(',', $iduser) . ") and num_demande='" . $this->id_demande . "'";
mysql_query($req, $dbh);
for ($i = 0; $i < sizeof($iduser); $i++) {
$req = "insert into demandes_users set num_user='" . $iduser[$i] . "', num_demande='" . $this->id_demande . "', date_creation='" . $date_creation . "', users_statut=1";
mysql_query($req, $dbh);
}
} else {
if ($iduser) {
for ($i = 0; $i < sizeof($iduser); $i++) {
$req = "insert into demandes_users set num_user='" . $iduser[$i] . "', num_demande='" . $id . "', date_creation='" . $date_creation . "', users_statut=1";
mysql_query($req, $dbh);
}
}
}
$req = "select num_user, concat(prenom,' ',nom) as nom, username from demandes_users, users where num_user=userid and num_demande='" . $id . "' and users_statut=1";
$res = mysql_query($req, $dbh);
$i = 0;
if (mysql_num_rows($res)) {
$this->users = array();
while ($user = mysql_fetch_object($res)) {
$this->users[$i]['nom'] = trim($user->nom) ? $user->nom : $user->username;
$this->users[$i]['id'] = $user->num_user;
$i++;
}
}
}
示例2: indexNotices
function indexNotices()
{
global $msg, $dbh, $charset, $PMBusername;
if (SESSrights & ADMINISTRATION_AUTH) {
//NOTICES
$result .= "<h3>" . htmlentities($msg["nettoyage_reindex_notices"], ENT_QUOTES, $charset) . "</h3>";
$query = mysql_query("SELECT notice_id FROM notices");
if (mysql_num_rows($query)) {
while ($row = mysql_fetch_object($query)) {
// constitution des pseudo-indexes
notice::majNotices($row->notice_id);
}
mysql_free_result($query);
}
$notices = mysql_query("SELECT count(1) FROM notices", $dbh);
$count = mysql_result($notices, 0, 0);
$result .= "" . htmlentities($msg["nettoyage_reindex_notices"], ENT_QUOTES, $charset) . " {$count} " . htmlentities($msg["nettoyage_res_reindex_notices"], ENT_QUOTES, $charset);
//AUTEURS
$result .= "<h3>" . htmlentities($msg["nettoyage_reindex_authors"], ENT_QUOTES, $charset) . "</h3>";
$query = mysql_query("SELECT author_id as id,concat(author_name,' ',author_rejete,' ', author_lieu, ' ',author_ville,' ',author_pays,' ',author_numero,' ',author_subdivision) as auteur from authors LIMIT {$start}, {$lot}", $dbh);
if (mysql_num_rows($query)) {
while ($row = mysql_fetch_object($query)) {
// constitution des pseudo-indexes
$ind_elt = strip_empty_chars($row->auteur);
$req_update = "UPDATE authors ";
$req_update .= " SET index_author=' {$ind_elt} '";
$req_update .= " WHERE author_id={$row->id} ";
$update = mysql_query($req_update, $dbh);
}
mysql_free_result($query);
}
$elts = mysql_query("SELECT count(1) FROM authors", $dbh);
$count = mysql_result($elts, 0, 0);
$result .= "" . htmlentities($msg["nettoyage_reindex_authors"], ENT_QUOTES, $charset) . " {$count} " . htmlentities($msg["nettoyage_res_reindex_authors"], ENT_QUOTES, $charset);
//EDITEURS
$result .= "<h3>" . htmlentities($msg["nettoyage_reindex_publishers"], ENT_QUOTES, $charset) . "</h3>";
$query = mysql_query("SELECT ed_id as id, ed_name as publisher, ed_ville, ed_pays from publishers");
if (mysql_num_rows($query)) {
while ($row = mysql_fetch_object($query)) {
// constitution des pseudo-indexes
$ind_elt = strip_empty_chars($row->publisher . " " . $row->ed_ville . " " . $row->ed_pays);
$req_update = "UPDATE publishers ";
$req_update .= " SET index_publisher=' {$ind_elt} '";
$req_update .= " WHERE ed_id={$row->id} ";
$update = mysql_query($req_update);
}
mysql_free_result($query);
}
$elts = mysql_query("SELECT count(1) FROM publishers", $dbh);
$count = mysql_result($elts, 0, 0);
$result .= "" . htmlentities($msg["nettoyage_reindex_publishers"], ENT_QUOTES, $charset) . " {$count} " . htmlentities($msg["nettoyage_res_reindex_publishers"], ENT_QUOTES, $charset);
//CATEGORIES
$result .= "<h3>" . htmlentities($msg["nettoyage_reindex_categories"], ENT_QUOTES, $charset) . "</h3>";
$req = "select num_noeud, langue, libelle_categorie from categories";
$query = mysql_query($req, $dbh);
if (mysql_num_rows($query)) {
while ($row = mysql_fetch_object($query)) {
// constitution des pseudo-indexes
$ind_elt = strip_empty_words($row->libelle_categorie, $row->langue);
$req_update = "UPDATE categories ";
$req_update .= "SET index_categorie=' {$ind_elt} '";
$req_update .= "WHERE num_noeud='" . $row->num_noeud . "' and langue='" . $row->langue . "' ";
$update = mysql_query($req_update);
}
mysql_free_result($query);
}
$elts = mysql_query("SELECT count(1) FROM categories", $dbh);
$count = mysql_result($elts, 0, 0);
$result .= "" . htmlentities($msg["nettoyage_reindex_categories"], ENT_QUOTES, $charset) . " {$count} " . htmlentities($msg["nettoyage_res_reindex_categories"], ENT_QUOTES, $charset);
//COLLECTIONS
$result .= "<h3>" . htmlentities($msg["nettoyage_reindex_collections"], ENT_QUOTES, $charset) . "</h3>";
$query = mysql_query("SELECT collection_id as id, collection_name as collection from collections");
if (mysql_num_rows($query)) {
while ($row = mysql_fetch_object($query)) {
// constitution des pseudo-indexes
$ind_elt = strip_empty_words($row->collection);
$req_update = "UPDATE collections ";
$req_update .= " SET index_coll=' {$ind_elt} '";
$req_update .= " WHERE collection_id={$row->id} ";
$update = mysql_query($req_update);
}
mysql_free_result($query);
}
$elts = mysql_query("SELECT count(1) FROM collections", $dbh);
$count = mysql_result($elts, 0, 0);
$result .= "" . htmlentities($msg["nettoyage_reindex_collections"], ENT_QUOTES, $charset) . " {$count} " . htmlentities($msg["nettoyage_res_reindex_collections"], ENT_QUOTES, $charset);
//SOUSCOLLECTIONS
$result .= "<h3>" . htmlentities($msg["nettoyage_reindex_sub_collections"], ENT_QUOTES, $charset) . "</h3>";
$query = mysql_query("SELECT sub_coll_id as id, sub_coll_name as sub_collection from sub_collections");
if (mysql_num_rows($query)) {
while ($row = mysql_fetch_object($query)) {
// constitution des pseudo-indexes
$ind_elt = strip_empty_words($row->sub_collection);
$req_update = "UPDATE sub_collections ";
$req_update .= " SET index_sub_coll=' {$ind_elt} '";
$req_update .= " WHERE sub_coll_id={$row->id} ";
$update = mysql_query($req_update);
}
mysql_free_result($query);
}
//.........这里部分代码省略.........
示例3: create_notice
public function create_notice()
{
global $dbh;
global $pmb_keyword_sep;
$fields = "\n\t\t\ttit1='" . addslashes($this->title) . "',\n\t\t\tn_resume='" . addslashes($this->summary) . "',\n\t\t\tlien='" . addslashes($this->url) . "',\n\t\t\tthumbnail_url='" . addslashes($this->logo_url) . "',\n\t\t\tdate_parution='" . addslashes($this->publication_date) . "',\n\t\t\tindex_l='" . addslashes(implode($pmb_keyword_sep, $this->tags)) . "'\n\t\t";
$req = "INSERT INTO notices SET {$fields} ";
pmb_mysql_query($req, $dbh);
$num_notice = pmb_mysql_insert_id();
if (!$num_notice) {
return array();
}
$query .= "update docwatch_items set\titem_num_notice = '" . $num_notice . "' where id_item = '" . $this->id . "'";
pmb_mysql_query($query, $dbh);
// permet de charger la bonne langue, mot vide...
$info = notice::indexation_prepare($num_notice);
// Mise a jour des index de la notice
notice::majNotices($num_notice);
// Mise a jour de la table notices_global_index
notice::majNoticesGlobalIndex($num_notice);
// Mise a jour de la table notices_mots_global_index
notice::majNoticesMotsGlobalIndex($num_notice);
// restaure l'environnement de langue
notice::indexation_restaure($info);
return array('id' => $num_notice, 'title' => $this->title, 'link' => "./catalog.php?categ=isbd&id=" . $num_notice);
}
示例4: addslashes
$requete = "select notice_id from notices where code='" . addslashes($pe_isbn) . "' " . $suite_rqt . " and niveau_biblio='m' and niveau_hierar='0' ";
$result = pmb_mysql_query($requete, $dbh);
if ($tmp_not = pmb_mysql_fetch_object($result)) {
$id_notice = $tmp_not->notice_id;
$acreer = 0;
}
}
if ($acreer) {
$requete = "INSERT INTO notices SET code='" . addslashes($pe_isbn) . "', tit1='{$pe_titre}', statut='{$pmb_pret_express_statut}', niveau_biblio='m', niveau_hierar='0', create_date=sysdate() ";
$result = pmb_mysql_query($requete, $dbh);
if (!$result) {
die('ERROR PE: insert into notice');
}
$id_notice = pmb_mysql_insert_id();
audit::insert_creation(AUDIT_NOTICE, $id_notice);
notice::majNotices($id_notice);
notice::majNoticesGlobalIndex($id_notice, 1);
notice::majNoticesMotsGlobalIndex($id_notice);
if ($gestion_acces_active == 1) {
require_once "{$class_path}/acces.class.php";
$ac = new acces();
//traitement des droits acces user_notice
if ($gestion_acces_user_notice == 1) {
$dom_1 = $ac->setDomain(1);
$dom_1->storeUserRights(0, $id_notice);
}
//traitement des droits acces empr_notice
if ($gestion_acces_empr_notice == 1) {
$dom_2 = $ac->setDomain(2);
$dom_2->storeUserRights(0, $id_notice);
}
示例5: create_notice
function create_notice()
{
global $dbh, $iddemande;
global $demandes_statut_notice, $pmb_type_audit;
// creation notice à partir de la demande
$req = "insert into notices set\n\t\t\t\ttit1='" . $this->titre_demande . "',\n\t\t\t\tn_contenu='" . $this->sujet_demande . "',\n\t\t\t\tstatut ='" . $demandes_statut_notice . "'\n\t\t\t\t";
pmb_mysql_query($req, $dbh);
$id_notice = pmb_mysql_insert_id();
notice::majNotices($id_notice);
if ($pmb_type_audit) {
audit::insert_creation(AUDIT_NOTICE, $id_notice);
}
// mise à jour de la demande
$req = "UPDATE demandes SET num_notice=" . $id_notice . " WHERE id_demande=" . $this->id_demande;
pmb_mysql_query($req, $dbh);
$this->num_notice = $id_notice;
}
示例6: create_notice
public function create_notice()
{
global $dbh;
global $pmb_keyword_sep;
if (docwatch_watch::check_watch_rights($this->num_watch)) {
/** Récupération des paramètres défini dans la veille pour la création de notice à partir de ses items **/
$query = "select watch_record_default_type, watch_record_default_status from docwatch_watches where id_watch =" . $this->num_watch;
$result = pmb_mysql_query($query, $dbh);
if (pmb_mysql_num_rows($result)) {
$row = pmb_mysql_fetch_object($result);
$record_type = $row->watch_record_default_type;
$record_status = $row->watch_record_default_status;
} else {
return array();
}
$tab_tag = array();
foreach ($this->tags as $tag) {
$tab_tag[] = $tag["label"];
}
$fields = "\n\t\t\t\ttit1='" . addslashes($this->title) . "',\n\t\t\t\tn_resume='" . addslashes($this->summary) . "',\n\t\t\t\tlien='" . addslashes($this->url) . "',\n\t\t\t\tthumbnail_url='" . addslashes($this->logo_url) . "',\n\t\t\t\tdate_parution='" . addslashes($this->publication_date) . "',\n\t\t\t\tyear='" . addslashes(format_date($this->publication_date)) . "',\n\t\t\t\ttypdoc='" . addslashes($record_type) . "',\n\t\t\t\tstatut='" . addslashes($record_status) . "',\n\t\t\t\tindex_l='" . addslashes(implode($pmb_keyword_sep, $tab_tag)) . "'\n\t\t\t";
$req = "INSERT INTO notices SET {$fields} ";
pmb_mysql_query($req, $dbh);
$num_notice = pmb_mysql_insert_id();
if (!$num_notice) {
return array();
}
foreach ($this->descriptors as $num_categ => $label) {
$query = "insert into notices_categories set notcateg_notice = '" . $num_notice . "', num_noeud='" . $num_categ . "'";
pmb_mysql_query($query, $dbh);
}
$query = "update docwatch_items set\titem_num_notice = '" . $num_notice . "' where id_item = '" . $this->id . "'";
pmb_mysql_query($query, $dbh);
$this->set_num_notice($num_notice);
// permet de charger la bonne langue, mot vide...
$info = notice::indexation_prepare($num_notice);
// Mise a jour des index de la notice
notice::majNotices($num_notice);
// Mise a jour de la table notices_global_index
notice::majNoticesGlobalIndex($num_notice);
// Mise a jour de la table notices_mots_global_index
notice::majNoticesMotsGlobalIndex($num_notice);
// restaure l'environnement de langue
notice::indexation_restaure($info);
return array('id' => $num_notice, 'title' => $this->title, 'link' => "./catalog.php?categ=isbd&id=" . $num_notice);
}
}
示例7: create_record_child
public function create_record_child($id_parent, $data)
{
global $dbh;
global $pmb_nomenclature_record_children_link;
$tit1 = "Notice fille temporaire de la nomenclature {$id_parent}";
$fields = "\r\n\t\ttit1='" . addslashes($tit1) . "'\r\n\t\t";
$req = "INSERT INTO notices SET {$fields} ";
pmb_mysql_query($req, $dbh);
$this->id = pmb_mysql_insert_id();
if (!$this->id) {
return 0;
}
if (!$data["rank"]) {
$data["rank"] = 1;
}
$requete = 'INSERT INTO notices_relations VALUES("' . $this->id . '","' . $id_parent . '","' . $pmb_nomenclature_record_children_link . '","' . $data["rank"] . '")';
pmb_mysql_query($requete, $dbh);
$this->save($data);
$this->fetch_datas();
$data = $this->get_data();
$tit1 = $data["instrument_name"] . $data["voice_name"];
if ($data["musicstand_name"]) {
$tit1 .= " / " . $data["musicstand_name"];
}
if ($data["formation_label"]) {
$tit1 .= " / " . $data["formation_label"];
}
$fields = "\r\n\t\ttit1='" . addslashes($tit1) . "'\r\n\t\t";
$req = "UPDATE notices SET {$fields} where notice_id= " . $this->id;
pmb_mysql_query($req, $dbh);
// permet de charger la bonne langue, mot vide...
$info = notice::indexation_prepare($this->id);
// Mise a jour des index de la notice
notice::majNotices($this->id);
// Mise a jour de la table notices_global_index
notice::majNoticesGlobalIndex($this->id);
// Mise a jour de la table notices_mots_global_index
notice::majNoticesMotsGlobalIndex($this->id);
// restaure l'environnement de langue
notice::indexation_restaure($info);
return array('id' => $this->id, 'title' => $tit1);
}
示例8: update_in_database
//.........这里部分代码省略.........
$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;
}
示例9: error_message
//Traitement des champs personnalises
$p_perso->rec_fields_perso($id);
if ($result) {
include './catalog/notices/isbd.inc.php';
} else {
// echec de la requete
error_message($libelle, $msg[281], 1, "./catalog.php");
}
//Recherche du titre uniforme automatique
global $opac_enrichment_bnf_sparql;
$opac_enrichment_bnf_sparql = 1;
$titre_uniforme = notice::getAutomaticTu($id);
// permet de charger la bonne langue, mot vide...
$info = notice::indexation_prepare($id);
// Mise a jour des index de la notice
notice::majNotices($id);
// Mise a jour de la table notices_global_index
notice::majNoticesGlobalIndex($id);
// Mise a jour de la table notices_mots_global_index
notice::majNoticesMotsGlobalIndex($id);
// restaure l'environnement de langue
notice::indexation_restaure($info);
//synchro_rdf
if ($pmb_synchro_rdf) {
$synchro_rdf->addRdf($id, 0);
}
} else {
if ($f_tit1 == "") {
// erreur : le champ tit1 est vide
error_message($libelle, $notitle_message, 1, "./catalog.php");
} else {
示例10: import_new_notice_suite
//.........这里部分代码省略.........
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...
/* Origine de la notice */
$origine_not['nom'] = clean_string($origine_notice[0]['b']);
$origine_not['pays'] = clean_string($origine_notice[0]['a']);
$orinot_id = origine_notice::import($origine_not);
if ($orinot_id == 0) {
$orinot_id = 1;
}
$query = "insert into notices set \n\t\t\t\t\t\t\t\ttypdoc = '" . $doc_type . "',\n\t\t\t\t\t\t\t\ttit1 = '" . addslashes(clean_string($child['t'])) . "',\n\t\t\t\t\t\t\t\tcode = '" . $issn . "',\n\t\t\t\t\t\t\t\tniveau_biblio = 's',\n\t\t\t\t\t\t\t\tniveau_hierar = '1',\n\t\t\t\t\t\t\t\tstatut = " . $statutnot . ",\n\t\t\t\t\t\t\t\torigine_catalogage = '" . $orinot_id . "',\n\t\t\t\t\t\t\t\tcreate_date = sysdate(),\n\t\t\t\t\t\t\t\tupdate_date = sysdate()\n\t\t\t\t\t\t\t";
mysql_query($query);
$child_id = mysql_insert_id();
$notices_crees[$child[0]] = $child_id;
notice::majNotices($child_id);
notice::majNoticesGlobalIndex($child_id);
notice::majNoticesMotsGlobalIndex($child_id);
} else {
$child_id = mysql_result($result, 0, 0);
}
if ($child_id) {
// on regarde si une relation similaire existe déjà...
$query = "select relation_type from notices_relations where relation_type = '" . $link_type[$key]['code'] . "' and ((num_notice = " . $notice_id . " and linked_notice = " . $child_id . ") or (num_notice = " . $child_id . " and linked_notice = " . $notice_id . "))";
$result = mysql_query($query);
if (!mysql_num_rows($result)) {
$rank = 0;
$query = "select count(rank) from notices_relations where relation_type = '" . $link_type[$key]['code'] . "' and ";
if ($link_type[$key]['sens_link'] == "mother") {
$query .= "num_notice = " . $child_id;
} else {
$query .= "num_notice = " . $notice_id;
}
$result = mysql_query($query);
if (mysql_num_rows($result)) {
$rank = mysql_result($result, 0, 0);
}
$query = "insert into notices_relations set \n\t\t\t\t\t\t\t\t\t" . $sens[$link_type[$key]['sens_link']][0] . " = " . $notice_id . ",\n\t\t\t\t\t\t\t\t\t" . $sens[$link_type[$key]['sens_link']][1] . " = " . $child_id . ",\n\t\t\t\t\t\t\t\t\trelation_type = '" . $link_type[$key]['code'] . "',\n\t\t\t\t\t\t\t\t\trank = " . ($rank + 1) . "\n\t\t\t\t\t\t\t\t";
mysql_query($query);
}
}
}
}
}
break;
}
if (count($info_900)) {
for ($i = 0; $i < count($info_900); $i++) {
if (trim($info_900[$i]["a"])) {
if (!renseigne_cp_agro($info_900[$i], $notice_id)) {
mysql_query("insert into error_log (error_origin, error_text) values ('import_expl_" . addslashes(SESSid) . ".inc', '" . addslashes("La valeur : " . $info_900[$i]["a"] . " n'a pas été reprise dans le champ personnalisé : " . $info_900[$i]["n"] . " car le champ n'existe pas ou n'est pas défini de la même façon") . "') ");
}
}
}
}
if ($tmp = trim($info_003[0])) {
$requete = "SELECT notices_custom_origine FROM notices_custom_values WHERE notices_custom_champ=22 AND notices_custom_origine='" . $notice_id . "' AND notices_custom_small_text='" . addslashes($tmp) . "' ";
$res = mysql_query($requete);
if ($res && mysql_num_rows($res)) {
} else {
$requete = "INSERT INTO notices_custom_values(notices_custom_champ, notices_custom_origine, notices_custom_small_text) VALUES('22','" . $notice_id . "','" . addslashes($tmp) . "')";
mysql_query($requete);
}
}
}
示例11: update_index
static function update_index($id)
{
global $dbh;
global $include_path;
$indexation_authority = new indexation_authority($include_path . "/indexation/authorities/series/champs_base.xml", "authorities", AUT_TABLE_SERIES);
$indexation_authority->maj($id);
// On cherche tous les n-uplet de la table notice correspondant à cette série.
$found = pmb_mysql_query("select distinct(notice_id) from notices where tparent_id='" . $id . "'", $dbh);
// Pour chaque n-uplet trouvés on met a jour la table notice_global_index avec la série modifiée :
while ($mesNotices = pmb_mysql_fetch_object($found)) {
$notice_id = $mesNotices->notice_id;
notice::majNotices($notice_id);
//Le titre de série est indexé dans les index de la notice
notice::majNoticesGlobalIndex($notice_id);
notice::majNoticesMotsGlobalIndex($notice_id, 'serie');
}
}
示例12: update_index
static function update_index($id)
{
global $dbh;
// On cherche tous les n-uplet de la table notice correspondant à cet auteur.
$found = pmb_mysql_query("select distinct(notice_id) from notices where tparent_id='" . $id . "'", $dbh);
// Pour chaque n-uplet trouvés on met a jour la table notice_global_index avec l'auteur modifié :
while ($mesNotices = pmb_mysql_fetch_object($found)) {
$notice_id = $mesNotices->notice_id;
notice::majNotices($notice_id);
//Le titre de série est indexé dans les index de la notice
notice::majNoticesGlobalIndex($notice_id);
notice::majNoticesMotsGlobalIndex($notice_id, 'serie');
}
}
示例13: majNoticesTotal
static function majNoticesTotal($notice)
{
$info = notice::indexation_prepare($notice);
notice::majNotices($notice);
notice::majNoticesGlobalIndex($notice);
notice::majNoticesMotsGlobalIndex($notice);
notice::indexation_restaure($info);
}
示例14: 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;
}
示例15: htmlentities
print "<br /><br /><h2 align='center'>" . htmlentities($msg["nettoyage_reindex_notices"], ENT_QUOTES, $charset) . "</h2>";
$query = mysql_query("SELECT notice_id FROM notices LIMIT {$start}, {$lot}");
if (mysql_num_rows($query)) {
// définition de l'état de la jauge
$state = floor($start / ($count / $jauge_size));
$state .= "px";
// mise à jour de l'affichage de la jauge
print "<table border='0' align='center' width='{$jauge_size}' cellpadding='0'><tr><td class='jauge' width='100%'>";
print "<img src='../../images/jauge.png' width='{$state}' height='16px'></td></tr></table>";
// calcul pourcentage avancement
$percent = floor($start / $count * 100);
// affichage du % d'avancement et de l'état
print "<div align='center'>{$percent}%</div>";
while ($row = mysql_fetch_object($query)) {
// constitution des pseudo-indexes
notice::majNotices($row->notice_id);
}
mysql_free_result($query);
$next = $start + $lot;
print "\n\t\t\t\t<form class='form-{$current_module}' name='current_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\t<input type='hidden' name='start' value=\"{$next}\">\n\t\t\t\t<input type='hidden' name='count' value=\"{$count}\">\n\t\t\t\t<input type='hidden' name='index_quoi' value=\"NOTICES\">\n\t\t\t\t</form>\n\t\t\t\t<script type=\"text/javascript\"><!-- \n\t\t\t\t\tsetTimeout(\"document.forms['current_state'].submit()\",1000); \n\t\t\t\t\t-->\n\t\t\t\t</script>";
} else {
// mise à jour de l'affichage de la jauge
print "<table border='0' align='center' width='{$table_size}' cellpadding='0'><tr><td class='jauge'>";
print "<img src='../../images/jauge.png' width='{$jauge_size}' height='16'></td></tr></table>";
print "<div align='center'>100%</div>";
$v_state .= "<br /><img src=../../images/d.gif hspace=3>" . htmlentities($msg["nettoyage_reindex_notices"], ENT_QUOTES, $charset) . " {$count} " . htmlentities($msg["nettoyage_res_reindex_notices"], ENT_QUOTES, $charset);
print "\n\t\t\t\t\t<form class='form-{$current_module}' name='current_state' action='./clean.php' method='post'>\n\t\t\t\t\t<input type='hidden' name='v_state' value=\"" . urlencode($v_state) . "\">\n\t\t\t\t\t<input type='hidden' name='spec' value=\"{$spec}\">\n\t\t\t\t\t<input type='hidden' name='start' value='0'>\n\t\t\t\t\t<input type='hidden' name='count' value='0'>\n\t\t\t\t\t<input type='hidden' name='index_quoi' value=\"AUTEURS\">\n\t\t\t\t\t</form>\n\t\t\t\t\t<script type=\"text/javascript\"><!-- \n\t\t\t\t\t\tsetTimeout(\"document.forms['current_state'].submit()\",1000); \n\t\t\t\t\t\t-->\n\t\t\t\t\t</script>";
}
break;
case 'AUTEURS':
if (!$count) {