Ejemplo n.º 1
0
 /**
  * Constructeur
  * @param notice $notice Instance de la classe notice associée
  */
 public function __construct($record)
 {
     $this->record = $record;
     $this->tabs = array();
     $this->add_tab($this->get_tab_records_indexed_with_concept());
     $this->add_tab($this->get_tab_authorities_indexed_with_concept());
     $this->record->set_record_tabs($this);
     $this->record->get_records_list_ui();
 }
function update_notice_categories_from_form($id_notice = 0, $id_bulletin = 0)
{
    global $dbh;
    global $f_nb_categ;
    if (!$id_notice && $id_bulletin) {
        $query = "select * from bulletins where bulletin_id=" . $id_bulletin;
        $result = pmb_mysql_query($query, $dbh);
        if ($result) {
            $row = mysql_fetch_object($result);
            if ($row->num_notice) {
                $id_notice = $row->num_notice;
            } else {
                //on crée la notice de bulletin
                global $xmlta_doctype_bulletin, $deflt_notice_statut;
                pmb_mysql_query("INSERT INTO notices SET \n\t\t\t\t\ttit1 = '" . $row->bulletin_numero . ($row->mention_date ? " - " . $row->mention_date : "") . ($row->bulletin_titre ? " - " . $row->bulletin_titre : "") . "',\n\t\t\t\t\tstatut = '" . $deflt_notice_statut . "',\t\t\n\t\t\t\t\ttypdoc = '" . $xmlta_doctype_bulletin . "',\n\t\t\t\t\tcreate_date=sysdate(), update_date=sysdate() ", $dbh);
                $id_notice = pmb_mysql_insert_id($dbh);
                // Mise à jour des index de la notice
                notice::majNoticesTotal($id_notice);
                audit::insert_creation(AUDIT_NOTICE, $id_notice);
                //Mise à jour du bulletin
                $requete = "update bulletins set num_notice=" . $id_notice . " where bulletin_id=" . $id_bulletin;
                pmb_mysql_query($requete);
                //Mise à jour des liens bulletin -> notice mère
                $requete = "insert into notices_relations (num_notice,linked_notice,relation_type,rank) values(" . $id_notice . "," . $row->bulletin_notice . ",'b',1)";
                pmb_mysql_query($requete);
            }
        }
    }
    if (!$id_notice) {
        return;
    }
    $query = "SELECT max(ordre_categorie) as ordre FROM notices_categories WHERE notcateg_notice='" . $id_notice . "' ";
    $result = pmb_mysql_query($query);
    $ordre_categ = 0;
    if ($result) {
        $row = mysql_fetch_object($result);
        if (isset($row->ordre)) {
            $ordre_categ = $row->ordre;
        }
    }
    if ($f_nb_categ) {
        $rqt_ins = "INSERT INTO notices_categories (notcateg_notice, num_noeud, ordre_categorie) VALUES ";
        for ($i = 0; $i < $f_nb_categ; $i++) {
            $var_categ = "f_categ{$i}";
            global ${$var_categ};
            if (${$var_categ}) {
                $var_categid = "f_categ_id{$i}";
                global ${$var_categid};
                $rqt_sel = "SELECT notcateg_notice FROM notices_categories WHERE notcateg_notice='" . $id_notice . "' and num_noeud='" . ${$var_categid} . "' ";
                $res_sel = pmb_mysql_query($rqt_sel, $dbh);
                if ($res_sel && !pmb_mysql_num_rows($res_sel)) {
                    $ordre_categ++;
                    $rqt = $rqt_ins . " ('" . $id_notice . "','" . ${$var_categid} . "',{$ordre_categ}) ";
                    $res_ins = @pmb_mysql_query($rqt, $dbh);
                }
            }
        }
    }
}
Ejemplo n.º 3
0
 public function action_details()
 {
     $plugin = Sprig::factory('plugin', array('id' => $this->request->param('id')))->load();
     if (!$plugin->loaded()) {
         notice::add(__('Invalid Plugin'), 'error');
         Request::instance()->redirect(Request::instance('admin')->uri(array('action' => 'list')));
     }
 }
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = notice::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'begindate' => $this->begindate, 'enddate' => $this->enddate, 'publishdate' => $this->publishdate]);
     $query->andFilterWhere(['like', 'title', $this->title])->andFilterWhere(['like', 'publisher', $this->publisher])->andFilterWhere(['like', 'importance', $this->importance])->andFilterWhere(['like', 'content', $this->content])->andFilterWhere(['like', 'category', $this->category]);
     return $dataProvider;
 }
Ejemplo n.º 5
0
 function index_action($id = '')
 {
     @(include PLUS_PATH . 'cron.cache.php');
     if (is_array($cron) && !empty($cron)) {
         foreach ($cron as $key => $value) {
             if ($id) {
                 if ($value['id'] == $id) {
                     $timestamp[$value['nexttime']] = $value;
                     $timestamp[$value['nexttime']]['cronkey'] = $key;
                 }
             } else {
                 if ($value['nexttime'] <= time()) {
                     $timestamp[$value['nexttime']] = $value;
                     $timestamp[$value['nexttime']]['cronkey'] = $key;
                 }
             }
         }
         if ($timestamp) {
             krsort($timestamp);
             $croncache = current($timestamp);
             ignore_user_abort();
             set_time_limit(600);
             if (file_exists(LIB_PATH . 'cron/' . $croncache['dir'])) {
                 include LIB_PATH . 'cron/' . $croncache['dir'];
                 if ($croncache['dir'] == "notice.php") {
                     $notice = new notice($this->obj);
                     $notice->index();
                 }
             }
             $nexttime = $this->nextexe($croncache);
             $this->obj->DB_update_all("cron", "`nowtime`='" . time() . "',`nexttime`='" . strtotime($nexttime) . "'", "`id`='" . $value['id'] . "'");
             $cron[$croncache['cronkey']]['nexttime'] = strtotime($nexttime);
             $data['cron'] = ArrayToString($cron);
             made_web_array(PLUS_PATH . 'cron.cache.php', $data);
         }
     }
 }
Ejemplo n.º 6
0
 public static function NoticePMs()
 {
     global $User;
     try {
         $message = notice::sendPMs();
     } catch (Exception $e) {
         $message = $e->getMessage();
     }
     if ($message) {
         print '<p class="notice">' . $message . '</p>';
     }
     $pms = self::getType('PM', 50);
     if (!count($pms)) {
         print '<div class="hr"></div>';
         print '<p class="notice">' . l_t('No private messages found; you can send them to other people on their profile page.') . '</p>';
         return;
     }
     print '<div class="hr"></div>';
     foreach ($pms as $pm) {
         print $pm->viewedSplitter();
         print $pm->html();
     }
 }
Ejemplo n.º 7
0
 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);
         }
         $elts = mysql_query("SELECT count(1) FROM sub_collections", $dbh);
         $count = mysql_result($elts, 0, 0);
         $result .= "" . htmlentities($msg["nettoyage_reindex_sub_collections"], ENT_QUOTES, $charset) . " {$count} " . htmlentities($msg["nettoyage_res_reindex_sub_collections"], ENT_QUOTES, $charset);
         //SERIES
         $result .= "<h3>" . htmlentities($msg["nettoyage_reindex_series"], ENT_QUOTES, $charset) . "</h3>";
         $query = mysql_query("SELECT serie_id as id, serie_name from series LIMIT {$start}, {$lot}");
         if (mysql_num_rows($query)) {
             while ($row = mysql_fetch_object($query)) {
                 // constitution des pseudo-indexes
                 $ind_elt = strip_empty_words($row->serie_name);
                 $req_update = "UPDATE series ";
                 $req_update .= " SET serie_index=' {$ind_elt} '";
                 $req_update .= " WHERE serie_id={$row->id} ";
                 $update = mysql_query($req_update);
             }
             mysql_free_result($query);
         }
         $elts = mysql_query("SELECT count(1) FROM series", $dbh);
         $count = mysql_result($elts, 0, 0);
         $result .= "" . htmlentities($msg["nettoyage_reindex_series"], ENT_QUOTES, $charset) . " {$count} " . htmlentities($msg["nettoyage_res_reindex_series"], ENT_QUOTES, $charset);
         //DEWEY
         $result .= "<h3>" . htmlentities($msg["nettoyage_reindex_indexint"], ENT_QUOTES, $charset) . "</h3>";
         $query = mysql_query("SELECT indexint_id as id, concat(indexint_name,' ',indexint_comment) as index_indexint from indexint LIMIT {$start}, {$lot}");
         if (mysql_num_rows($query)) {
             while ($row = mysql_fetch_object($query)) {
                 // constitution des pseudo-indexes
                 $ind_elt = strip_empty_words($row->index_indexint);
                 $req_update = "UPDATE indexint ";
                 $req_update .= " SET index_indexint=' {$ind_elt} '";
                 $req_update .= " WHERE indexint_id={$row->id} ";
                 $update = mysql_query($req_update);
             }
             mysql_free_result($query);
         }
         $elts = mysql_query("SELECT count(1) FROM indexint", $dbh);
         $count = mysql_result($elts, 0, 0);
         $result .= "" . htmlentities($msg["nettoyage_reindex_indexint"], ENT_QUOTES, $charset) . " {$count} " . htmlentities($msg["nettoyage_res_reindex_indexint"], ENT_QUOTES, $charset);
     } else {
         $result .= sprintf($msg["planificateur_rights_bad_user_rights"], $PMBusername);
     }
     return $result;
 }
Ejemplo n.º 8
0
    $requete .= ", expl_comment='" . ${f_ex_comment} . "'";
    $requete .= ", expl_prix='{$f_ex_prix}'";
    $requete .= ", expl_owner='{$f_ex_owner}'";
    $requete .= ", type_antivol='{$type_antivol}'";
    $requete .= ", expl_nbparts='{$f_ex_nbparts}'";
    $requete .= $limiter;
    $result = pmb_mysql_query($requete, $dbh);
    if (!$expl_id) {
        $expl_id = pmb_mysql_insert_id();
        audit::insert_creation(AUDIT_EXPL, $expl_id);
    } else {
        $audit->get_new_infos("SELECT expl_statut, expl_location, transfert_location_origine, transfert_statut_origine, transfert_section_origine, expl_owner FROM exemplaires WHERE expl_cb='{$f_ex_cb}' ");
        $audit->save_info_modif(AUDIT_EXPL, $expl_id, "expl_update.inc.php");
    }
    // traitement des concepts
    if ($thesaurus_concepts_active == 1) {
        $index_concept = new index_concept($expl_id, TYPE_EXPL);
        $index_concept->save();
    }
    //Insertion des champs personalisés
    $p_perso->rec_fields_perso($expl_id);
    // Mise a jour de la table notices_mots_global_index
    notice::majNoticesMotsGlobalIndex($id, 'expl');
    // tout va bene, on réaffiche l'ISBD
    print "<div class='row'><div class='msg-perio'>" . $msg[maj_encours] . "</div></div>";
    $id_form = md5(microtime());
    $retour = "./catalog.php?categ=isbd&id={$id}";
    print "\n\t\t<form class='form-{$current_module}' name=\"dummy\" method=\"post\" action=\"{$retour}\" style=\"display:none\">\n\t\t\t<input type=\"hidden\" name=\"id_form\" value=\"{$id_form}\">\n\t\t</form>\n\t\t<script type=\"text/javascript\">document.dummy.submit();</script>\n\t\t";
} else {
    error_message($msg[301], $msg[303], 1, "./catalog.php?categ=isbd&id={$id}");
}
Ejemplo n.º 9
0
 $resa_date_fin = formatdate($resa['resa_date_fin']);
 $resa_qty = $resa['resa_qty'];
 $resa_loc_retrait = $resa['location_libelle'];
 if ($resa_idnotice) {
     // affiche la notice correspondant à la réservation
     $requete = "SELECT * FROM notices WHERE notice_id='" . $resa_idnotice . "' ";
     $res = @pmb_mysql_query($requete, $dbh);
     $obj = pmb_mysql_fetch_object($res);
     $notice = new notice($obj);
     $titre = pmb_bidi($notice->print_resume(1, $css));
 } else {
     // c'est un bulletin donc j'affiche le nom de périodique et le nom du bulletin (date ou n°)
     $requete = "SELECT bulletin_id, bulletin_numero, bulletin_notice, mention_date, date_date, date_format(date_date, '" . $msg["format_date_sql"] . "') as aff_date_date FROM bulletins WHERE bulletin_id='{$resa_idbulletin}'";
     $res = pmb_mysql_query($requete, $dbh);
     $obj = pmb_mysql_fetch_object($res);
     $notice3 = new notice($obj->bulletin_notice);
     $titre = pmb_bidi($notice3->print_resume(1, $css));
     // affichage de la mention de date utile : mention_date si existe, sinon date_date
     if ($obj->mention_date) {
         $titre .= pmb_bidi("(" . $obj->mention_date . ")\n");
     } elseif ($obj->date_date) {
         $titre .= pmb_bidi("(" . $obj->aff_date_date . ")\n");
     }
 }
 $txt_dates = $msg['resa_planning_date_debut'] . $resa_date_debut . '<br />';
 $txt_dates .= $msg['resa_planning_date_fin'] . $resa_date_fin . '<br />';
 if ($resa['resa_perimee']) {
     $txt_dates .= $msg['resa_planning_overtime'];
 } else {
     $txt_dates .= $msg['resa_planning_attente_validation'];
 }
Ejemplo n.º 10
0
 static function update_index($id)
 {
     global $dbh;
     global $include_path;
     $indexation_authority = new indexation_authority($include_path . "/indexation/authorities/titres_uniformes/champs_base.xml", "authorities", AUT_TABLE_TITRES_UNIFORMES);
     $indexation_authority->maj($id);
     // On cherche tous les n-uplet de la table notice correspondant à ce titre_uniforme.
     $found = pmb_mysql_query("select ntu_num_notice from notices_titres_uniformes where ntu_num_tu = " . $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->ntu_num_notice;
         notice::majNoticesGlobalIndex($notice_id);
         notice::majNoticesMotsGlobalIndex($notice_id, 'uniformtitle');
         //TODO preciser le datatype avant d'appeler cette fonction
     }
 }
Ejemplo n.º 11
0
 function update_notice($notice_id)
 {
     global $pmb_type_audit;
     global $webdav_current_user_name, $webdav_current_user_id;
     global $gestion_acces_active, $gestion_acces_user_notice, $gestion_acces_empr_notice;
     $obj = $this;
     $type = $obj->type;
     $obj->update_notice_infos($notice_id);
     while ($obj = $obj->parentNode) {
         if ($obj->type != $type) {
             $type = $obj->type;
             $obj->update_notice_infos($notice_id);
         }
     }
     if ($pmb_type_audit) {
         $query = "INSERT INTO audit SET ";
         $query .= "type_obj='1', ";
         $query .= "object_id='{$notice_id}', ";
         $query .= "user_id='{$webdav_current_user_id}', ";
         $query .= "user_name='{$webdav_current_user_name}', ";
         $query .= "type_modif=2 ";
         $result = @pmb_mysql_query($query);
     }
     \notice::majNoticesGlobalIndex($notice_id);
     \notice::majNoticesMotsGlobalIndex($notice_id);
     //TODO - Calcul des droits sur la notice dans les 2 domaines...
     $ac = new \acces();
     //pour la gestion
     if ($gestion_acces_active == 1 && $gestion_acces_user_notice == 1) {
         $dom_1 = $ac->setDomain(1);
         $dom_1->applyRessourceRights($notice_id);
     }
     //pour l'opac
     if ($gestion_acces_active == 1 && $gestion_acces_empr_notice == 1) {
         $dom_2 = $ac->setDomain(2);
         $dom_2->applyRessourceRights($notice_id);
     }
 }
Ejemplo n.º 12
0
    $p_perso->rec_fields_perso($expl_id);
    // Mise a jour de la table notices_mots_global_index pour toutes les notices en relation avec l'exemplaire
    $req_maj = "SELECT bulletin_notice,num_notice, analysis_notice FROM bulletins LEFT JOIN analysis ON analysis_bulletin=bulletin_id WHERE bulletin_id='" . $expl_bulletin . "'";
    $res_maj = pmb_mysql_query($req_maj);
    if ($res_maj && pmb_mysql_num_rows($res_maj)) {
        $first = true;
        //Pour la premiere ligne de résultat on doit indexer aussi la notice de périodique et de bulletin au besoin
        while ($ligne = pmb_mysql_fetch_object($res_maj)) {
            if ($first) {
                if ($ligne->bulletin_notice) {
                    notice::majNoticesMotsGlobalIndex($ligne->bulletin_notice, 'expl');
                }
                if ($ligne->num_notice) {
                    notice::majNoticesMotsGlobalIndex($ligne->num_notice, 'expl');
                }
            }
            if ($ligne->analysis_notice) {
                notice::majNoticesMotsGlobalIndex($ligne->analysis_notice, 'expl');
            }
            $first = false;
        }
    }
    $id_form = md5(microtime());
    print "<div class='row'><div class='msg-perio'>" . $msg[maj_encours] . "</div></div>";
    $retour = "./catalog.php?categ=serials&sub=view&sub=bulletinage&action=view&bul_id={$expl_bulletin}";
    if ($pointage) {
        $templates = "<script type='text/javascript'>\n\t\n\t\t\tfunction Fermer(obj,type_doc) {\t\t\n\t\t\t\tvar obj_1=obj+\"_1\";\t\n\t\t\t\tvar obj_2=obj+\"_2\";\t\n\t\t\t\tvar obj_3=obj+\"_3\";\t\t\n\t\t\t\tparent.document.getElementById(obj_1).disabled = true;\n\t\t\t\tparent.document.getElementById(obj_2).disabled = true;\n\t\t\t\tparent.document.getElementById(obj_3).disabled = true;\t\t\t\t\t\t\t\t\n\t\t\t \tparent.kill_frame_periodique();\n\t\t\t}\t\n\t\n\t\t</script>\n\t\t<script type='text/javascript'>Fermer('{$id_bull}','{$type_doc}');</script>\n\t\t";
    } else {
        print "<form class='form-{$current_module}' name=\"dummy\" method=\"post\" action=\"{$retour}\" style=\"display:none\">\n\t\t<input type=\"hidden\" name=\"id_form\" value=\"{$id_form}\">\n\t\t</form>\n\t\t<script type=\"text/javascript\">document.dummy.submit();</script>";
    }
}
Ejemplo n.º 13
0
 function show_notice_form()
 {
     // affichage du form de création/modification d'une notice
     $myNotice = new notice($this->num_notice);
     if (!$myNotice->id) {
         $myNotice->tit1 = $this->titre_demande;
     }
     $myNotice->action = "./demandes.php?categ=gestion&act=upd_notice&iddemande=" . $this->id_demande . "&id=";
     $myNotice->link_annul = "./demandes.php?categ=gestion&act=see_dmde&iddemande=" . $this->id_demande;
     print $myNotice->show_form();
 }
Ejemplo n.º 14
0
 function update_in_database($id_notice = 0)
 {
     global $dbh;
     global $pmb_synchro_rdf;
     $new_notice = 2;
     $notice_retour = $id_notice;
     if (!$id_notice) {
         $retour = array(2, 0);
         return $retour;
     }
     //synchro_rdf
     if ($pmb_synchro_rdf) {
         $synchro_rdf = new synchro_rdf();
         $synchro_rdf->delRdf($notice_retour, 0);
     }
     // traitement des titres uniformes
     global $pmb_use_uniform_title;
     if ($pmb_use_uniform_title) {
         if (count($this->titres_uniformes)) {
             $ntu = new tu_notice($id_notice);
             $ntu->update($this->titres_uniformes);
         }
     }
     for ($i = 0; $i < 2; $i++) {
         if ($this->editors[$i]['id']) {
             $editor_ids[$i] = $this->editors[$i]['id'];
         } else {
             $editor_ids[$i] = editeur::import($this->editors[$i]);
         }
     }
     if ($this->collection["id"]) {
         $collection_id = $this->collection["id"];
     } else {
         $this->collection['parent'] = $editor_ids[0];
         $collection_id = collection::import($this->collection);
     }
     if ($this->subcollection["id"]) {
         $subcollection_id = $this->subcollection["id"];
     } else {
         $this->subcollection['coll_parent'] = $collection_id;
         $subcollection_id = subcollection::import($this->subcollection);
         $serie_id = serie::import(stripslashes($this->serie));
     }
     /* traitement de Dewey */
     if (!$this->internal_index) {
         if (!$this->dewey["new_comment"]) {
             $this->dewey["new_comment"] = "";
         }
         if (!$this->dewey["new_pclass"]) {
             $this->dewey["new_pclass"] = "";
         }
         $this->internal_index = indexint::import(clean_string($this->dewey[0]), clean_string($this->dewey["new_comment"]), clean_string($this->dewey["new_pclass"]));
     }
     $date_parution_z3950 = notice::get_date_parution($this->year);
     /* Origine de la notice */
     $this->orinot_id = origine_notice::import($this->origine_notice);
     if ($this->orinot_id == 0) {
         $this->orinot_id = 1;
     }
     $sql_ins = "update notices set\n\t\t\ttypdoc           \t='" . $this->document_type . "',\n\t\t\tcode        \t        ='" . $this->isbn . "',\t            \n\t\t\ttit1                    ='" . $this->titles[0] . "',             \n\t\t\ttit2                    ='" . $this->titles[1] . "',             \n\t\t\ttit3                    ='" . $this->titles[2] . "',             \n\t\t\ttit4                    ='" . $this->titles[3] . "',             \n\t\t\ttparent_id              ='" . $serie_id . "',                    \n\t\t\ttnvol                   ='" . $this->nbr_in_serie . "',          \n\t\t\ted1_id                  =" . $editor_ids[0] . " ,                \n\t\t\ted2_id                  =" . $editor_ids[1] . " ,                \n\t\t\tyear                    ='" . $this->year . "',                  \n\t\t\tnpages                  ='" . $this->page_nbr . "',              \n\t\t\till                     ='" . $this->illustration . "',          \n\t\t\tsize                    ='" . $this->size . "',                  \n\t\t\taccomp                  ='" . $this->accompagnement . "',        \n\t\t\tcoll_id                 =" . $collection_id . " ,                \n\t\t\tsubcoll_id              =" . $subcollection_id . " ,             \n\t\t\tnocoll                  ='" . $this->nbr_in_collection . "',     \n\t\t\tmention_edition         ='" . $this->mention_edition . "',       \n\t\t\tn_gen                   ='" . $this->general_note . "',          \n\t\t\tn_contenu               ='" . $this->content_note . "',          \n\t\t\tn_resume                ='" . $this->abstract_note . "',         \n\t\t\tindexint                ='" . $this->internal_index . "',          \n\t\t\tstatut\t\t\t\t\t='" . $this->statut . "',\n\t\t\tcommentaire_gestion\t\t='" . $this->commentaire_gestion . "',\n\t\t\tindexation_lang\t\t\t='" . $this->indexation_lang . "',\n\t\t\tthumbnail_url\t\t\t='" . $this->thumbnail_url . "',\n\t\t\tindex_l                 ='" . clean_tags($this->free_index) . "',                \n\t\t\tniveau_biblio           ='" . $this->bibliographic_level . "',   \n\t\t\tniveau_hierar           ='" . $this->hierarchic_level . "',      \n\t\t\tlien                    ='" . $this->link_url . "',              \n\t\t\teformat                 ='" . $this->link_format . "',           \n\t\t\torigine_catalogage      ='" . $this->orinot_id . "',             \n\t\t\tprix                    ='" . $this->prix . "',\n\t\t\tdate_parution \t\t\t='" . $date_parution_z3950 . "'             \n\t\t\twhere notice_id='{$id_notice}' ";
     //echo "<pre>";
     //print_r($this->aut_array);
     //echo "</pre>";
     //echo $sql_ins."<br />";
     //echo "<pre>";
     //print_r($this->categories);
     //echo "</pre>";
     //exit;
     $sql_result_ins = pmb_mysql_query($sql_ins) or die("Couldn't update notices : " . $sql_ins);
     $notice_retour = $id_notice;
     audit::insert_modif(AUDIT_NOTICE, $id_notice);
     // purge de la base des responsabilités de la notice intégrée...
     if ($notice_retour) {
         $rqt_del = "delete from responsability where responsability_notice='{$notice_retour}'";
         $sql_result_del = pmb_mysql_query($rqt_del) or die("Couldn't purge table responsability : " . $rqt_del);
     }
     $rqt_ins = "insert into responsability (responsability_author, responsability_notice, responsability_fonction, responsability_type, responsability_ordre) VALUES ";
     for ($i = 0; $i < sizeof($this->aut_array); $i++) {
         $aut['id'] = clean_string($this->aut_array[$i]['id']);
         $aut['name'] = clean_string($this->aut_array[$i]['entree']);
         $aut['rejete'] = clean_string($this->aut_array[$i]['rejete']);
         $aut['date'] = clean_string($this->aut_array[$i]['date']);
         $aut['type'] = $this->aut_array[$i]['type_auteur'];
         $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;
 }
Ejemplo n.º 15
0
 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;
 }
function bulletin_affichage($id, $type = "")
{
    global $dbh, $msg;
    global $opac_show_exemplaires;
    $display = "";
    $requete = "SELECT bulletin_id, bulletin_numero, bulletin_notice, mention_date, date_date, bulletin_titre, bulletin_cb, date_format(date_date, '" . $msg["format_date_sql"] . "') as aff_date_date,num_notice FROM bulletins WHERE bulletin_id='{$id}'";
    $res = @pmb_mysql_query($requete, $dbh);
    while ($obj = pmb_mysql_fetch_array($res)) {
        $requete3 = "SELECT notice_id FROM notices WHERE notice_id='" . $obj["bulletin_notice"] . "' ";
        $res3 = @pmb_mysql_query($requete3, $dbh);
        while ($obj3 = pmb_mysql_fetch_object($res3)) {
            $notice3 = new notice($obj3->notice_id);
        }
        $notice3->fetch_visibilite();
        //on vient poser l'ancre des docnums...
        $req = "select explnum_id from explnum where explnum_bulletin = " . $obj["bulletin_id"];
        $resultat = pmb_mysql_query($req, $dbh) or die($req . " " . pmb_mysql_error());
        $nb_ex = pmb_mysql_num_rows($resultat);
        $res_print = "<h3><img src=./images/icon_per.gif> " . $notice3->print_resume(1, $css) . "." . " <b>" . $obj["bulletin_numero"] . "</b>" . ($nb_ex ? "&nbsp;<a href='#docnum'>" . ($nb_ex > 1 ? "<img src='" . get_url_icon("globe_rouge.png") . "' />" : "<img src='" . get_url_icon("globe_orange.png") . "' />") . "</a>" : "") . "</h3>\n";
        $num_notice = $obj['num_notice'];
        if ($obj['bulletin_titre']) {
            $res_print .= htmlentities($obj['bulletin_titre'], ENT_QUOTES, $charset) . "<br />";
        }
        if ($obj['mention_date']) {
            $res_print .= $msg['bull_mention_date'] . " &nbsp;" . $obj['mention_date'] . "\n";
        }
        if ($obj['date_date']) {
            $res_print .= "<br />" . $msg['bull_date_date'] . " &nbsp;" . $obj['aff_date_date'] . " \n";
        }
        if ($type != "visionneuse" && $nb_ex) {
            $res_print .= "<br /><a href='#docnum'>" . ($nb_ex > 1 ? "<img src='" . get_url_icon("globe_rouge.png") . "' />" : "<img src='" . get_url_icon("globe_orange.png") . "' />") . "</a>";
        }
        if ($obj['bulletin_cb']) {
            $res_print .= "<br />" . $msg["code_start"] . " " . htmlentities($obj['bulletin_cb'], ENT_QUOTES, $charset) . "\n";
            $code_cb_bulletin = $obj['bulletin_cb'];
        }
    }
    do_image($res_print, $code_cb_bulletin, 0);
    if ($num_notice) {
        // Il y a une notice de bulletin
        $display .= $res_print;
        $opac_notices_depliable = 0;
        $seule = 1;
        //$display .= pmb_bidi(aff_notice($num_notice,0,0)) ;
        if ($type == "visionneuse") {
            $display .= pmb_bidi(aff_notice($num_notice, 1, 1, 0, "", 0, 1));
        } else {
            $display .= pmb_bidi(aff_notice($num_notice, 0, 1, 0, "", 0));
        }
    } else {
        // construction des dépouillements
        $depouill = "<br /><h3>" . $msg['bull_dep'] . "</h3>";
        $requete = "SELECT * FROM analysis, notices, notice_statut WHERE analysis_bulletin='{$id}' AND notice_id = analysis_notice AND statut = id_notice_statut and ((notice_visible_opac=1 and notice_visible_opac_abon=0)" . ($_SESSION["user_code"] ? " or (notice_visible_opac_abon=1 and notice_visible_opac=1)" : "") . ") ";
        $res = @pmb_mysql_query($requete, $dbh);
        if (pmb_mysql_num_rows($res)) {
            if ($opac_notices_depliable) {
                $depouill .= $begin_result_liste;
            }
            if ($opac_cart_allow) {
                $depouill .= "<a href=\"cart_info.php?id=" . $id . "&lvl=analysis&header=" . rawurlencode(strip_tags($notice_header)) . "\" target=\"cart_info\" class=\"img_basket\" title='" . $msg["cart_add_result_in"] . "'>" . $msg["cart_add_result_in"] . "</a>";
            }
            $depouill .= "<blockquote>";
            while ($obj = pmb_mysql_fetch_array($res)) {
                $depouill .= pmb_bidi(aff_notice($obj["analysis_notice"]));
            }
            $depouill .= "</blockquote>";
        } else {
            $depouill = $msg["no_analysis"];
        }
        $display .= $res_print;
        $display .= $depouill;
        if ($notice3->visu_expl && (!$notice3->visu_expl_abon || $notice3->visu_expl_abon && $_SESSION["user_code"])) {
            if (!$opac_resa_planning) {
                $resa_check = check_statut(0, $id);
                if ($resa_check) {
                    $requete_resa = "SELECT count(1) FROM resa WHERE resa_idbulletin='{$id}'";
                    $nb_resa_encours = pmb_mysql_result(pmb_mysql_query($requete_resa, $dbh), 0, 0);
                    if ($nb_resa_encours) {
                        $message_nbresa = str_replace("!!nbresa!!", $nb_resa_encours, $msg["resa_nb_deja_resa"]);
                    }
                    if ($_SESSION["user_code"] && $allow_book && $opac_resa && !$popup_resa) {
                        $ret_resa .= "<h3>" . $msg["bulletin_display_resa"] . "</h3>";
                        if ($opac_max_resa == 0 || $opac_max_resa > $nb_resa_encours) {
                            if ($opac_resa_popup) {
                                $ret_resa .= "<a href='#' onClick=\"if(confirm('" . $msg["confirm_resa"] . "')){w=window.open('./do_resa.php?lvl=resa&id_bulletin=" . $id . "&oresa=popup','doresa','scrollbars=yes,width=500,height=600,menubar=0,resizable=yes'); w.focus(); return false;}else return false;\" id=\"bt_resa\">" . $msg["bulletin_display_place_resa"] . "</a>";
                            } else {
                                $ret_resa .= "<a href='./do_resa.php?lvl=resa&id_bulletin=" . $id . "&oresa=popup' onClick=\"return confirm('" . $msg["confirm_resa"] . "')\" id=\"bt_resa\">" . $msg["bulletin_display_place_resa"] . "</a>";
                            }
                            $ret_resa .= $message_nbresa;
                        } else {
                            $ret_resa .= str_replace("!!nb_max_resa!!", $opac_max_resa, $msg["resa_nb_max_resa"]);
                        }
                        $ret_resa .= "<br />";
                    } elseif (!$_SESSION["user_code"] && $opac_resa && !$popup_resa) {
                        // utilisateur pas connecté
                        // préparation lien réservation sans être connecté
                        $ret_resa .= "<h3>" . $msg["bulletin_display_resa"] . "</h3>";
                        if ($opac_resa_popup) {
                            $ret_resa .= "<a href='#' onClick=\"if(confirm('" . $msg["confirm_resa"] . "')){w=window.open('./do_resa.php?lvl=resa&id_bulletin=" . $id . "&oresa=popup','doresa','scrollbars=yes,width=500,height=600,menubar=0,resizable=yes'); w.focus(); return false;}else return false;\" id=\"bt_resa\">" . $msg["bulletin_display_place_resa"] . "</a>";
                        } else {
                            $ret_resa .= "<a href='./do_resa.php?lvl=resa&id_bulletin=" . $id . "&oresa=popup' onClick=\"return confirm('" . $msg["confirm_resa"] . "')\" id=\"bt_resa\">" . $msg["bulletin_display_place_resa"] . "</a>";
                        }
                        $ret_resa .= $message_nbresa;
                        $ret_resa .= "<br />";
                    } elseif ($fonction == 'notice_affichage_custom_bretagne') {
                        if ($opac_resa_popup) {
                            $reserver = "<a href='#' onClick=\"if(confirm('" . $msg["confirm_resa"] . "')){w=window.open('./do_resa.php?lvl=resa&id_notice=" . $this->notice_id . "&oresa=popup','doresa','scrollbars=yes,width=500,height=600,menubar=0,resizable=yes'); w.focus(); return false;}else return false;\" id=\"bt_resa\">" . $msg["bulletin_display_place_resa"] . "</a>";
                        } else {
                            $reserver = "<a href='./do_resa.php?lvl=resa&id_notice=" . $this->notice_id . "&oresa=popup' onClick=\"return confirm('" . $msg["confirm_resa"] . "')\" id=\"bt_resa\">" . $msg["bulletin_display_place_resa"] . "</a>";
                        }
                        $reservernbre = $message_nbresa;
                    } else {
                        $ret_resa = "";
                    }
                    $display .= pmb_bidi($ret_resa);
                }
            }
            if ($opac_show_exemplaires) {
                if ($fonction == 'notice_affichage_custom_bretagne') {
                    $display .= pmb_bidi(notice_affichage_custom_bretagne::expl_list("m", 0, $id));
                } else {
                    $display .= pmb_bidi(notice_affichage::expl_list("m", 0, $id));
                }
            }
        }
        if ($type != "visionneuse" && $notice3->visu_explnum && (!$notice3->visu_explnum_abon || $notice3->visu_explnum_abon && $_SESSION["user_code"])) {
            if ($explnum = show_explnum_per_notice(0, $id, '')) {
                $display .= pmb_bidi("<a name='docnum'><h3>" . $msg["explnum"] . "</h3></a>" . $explnum);
            }
        }
    }
    pmb_mysql_free_result($res);
    $display .= notice_affichage::autres_lectures(0, $id);
    return $display;
}
Ejemplo n.º 17
0
function import_new_notice_suite()
{
    global $dbh;
    global $notice_id, $bulletin_ex;
    global $info_461, $info_463, $info_464;
    global $info_606_a;
    global $info_900, $info_901, $info_902, $info_903, $info_904, $info_905, $info_906;
    global $pmb_keyword_sep;
    $bulletin_ex = 0;
    $is_object = false;
    //compatibilite avec import memonotices
    if (is_array($info_464)) {
        unset($info_461);
        unset($info_463);
        $info_461[0]['t'] = $info_464[0]['t'];
        $info_461[0]['9'] = 'lnk:perio';
        $info_463[0]['v'] = $info_464[0]['v'];
        $info_463[0]['e'] = $info_464[0]['d'];
        $info_463[0]['9'] = 'lnk:bull';
        if (strpos($info_904[0], "/") !== FALSE) {
            $dc = substr($info_904[0], 6, 4) . '-' . substr($info_904[0], 3, 2) . '-' . substr($info_904[0], 0, 2);
            $info_904[0] = $dc;
        }
    }
    //Si article
    if (is_array($info_461) && is_array($info_463)) {
        //recuperation infos notice
        $requete = "select * from notices where notice_id={$notice_id}";
        $resultat = mysql_query($requete);
        $r = mysql_fetch_object($resultat);
        //Notice chapeau existe-t-elle ?
        $requete = "select notice_id from notices where tit1='" . addslashes($info_461[0]['t']) . "' and niveau_hierar='1' and niveau_biblio='s'";
        $resultat = mysql_query($requete);
        if (@mysql_num_rows($resultat)) {
            //Si oui, récupération id
            $chapeau_id = mysql_result($resultat, 0, 0);
            //Bulletin existe-t-il ?
            $requete = "select bulletin_id from bulletins where bulletin_numero='" . addslashes($info_463[0]['v']) . "' and  mention_date='" . addslashes($info_463[0]['e']) . "' and bulletin_notice={$chapeau_id} ";
            $resultat = mysql_query($requete);
            if (@mysql_num_rows($resultat)) {
                //Si oui, récupération id bulletin
                $bulletin_id = mysql_result($resultat, 0, 0);
            } else {
                //Si non, création bulletin
                $info = array();
                $bulletin = new bulletinage("", $chapeau_id);
                $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);
            }
        } else {
            //Si non, création notice chapeau et bulletin
            $chapeau = new serial();
            $info = array();
            $info['tit1'] = addslashes($info_461[0]['t']);
            $info['niveau_biblio'] = 's';
            $info['niveau_hierar'] = '1';
            $info['typdoc'] = $r->typdoc;
            $chapeau->update($info);
            $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;
                }
            }
        }
        if ($unknown_desc) {
            $mots_cles = implode($pmb_keyword_sep, $unknown_desc);
            $il = '';
            $qil = "select index_l from notices where notice_id={$notice_id} ";
            $ril = mysql_query($qil, $dbh);
            $il = trim(mysql_result($ril, 0, 0));
            if ($il) {
                $mots_cles = $il . $pmb_keyword_sep . $mots_cles;
            }
            $requete = "update notices set index_l='" . addslashes($mots_cles) . "', index_matieres=' " . addslashes(strip_empty_words($mots_cles)) . " ' where notice_id={$notice_id}";
            mysql_query($requete, $dbh);
        }
        $notes = '';
        //Thème
        $qn = "select idchamp from notices_custom where name='theme' ";
        $rn = mysql_query($qn, $dbh);
        if (mysql_num_rows($rn)) {
            $idc_theme = mysql_result($rn, 0, 0);
        }
        if (count($info_900) && $idc_theme) {
            for ($i = 0; $i < count($info_900); $i++) {
                for ($j = 0; $j < count($info_900[$i]); $j++) {
                    $requete = "select notices_custom_list_value from notices_custom_lists where notices_custom_list_lib='" . addslashes($info_900[$i][$j]) . "' and notices_custom_champ={$idc_theme} ";
                    $resultat = mysql_query($requete, $dbh);
                    if (mysql_num_rows($resultat)) {
                        $value = mysql_result($resultat, 0, 0);
                        $requete = "insert into notices_custom_values (notices_custom_champ,notices_custom_origine,notices_custom_integer) values({$idc_theme},{$notice_id},{$value})";
                        mysql_query($requete, $dbh);
                    } else {
                        //sinon dans notes
                        $notes .= 'thème : ' . $info_900[$i][$j];
                    }
                }
            }
        }
        //Genres
        $qn = "select idchamp from notices_custom where name='genre' ";
        $rn = mysql_query($qn, $dbh);
        if (mysql_num_rows($rn)) {
            $idc_genre = mysql_result($rn, 0, 0);
        }
        if (count($info_901) && $idc_genre) {
            for ($i = 0; $i < count($info_901); $i++) {
                for ($j = 0; $j < count($info_901[$i]); $j++) {
                    $requete = "select notices_custom_list_value from notices_custom_lists where notices_custom_list_lib='" . addslashes($info_901[$i][$j]) . "' and notices_custom_champ={$idc_genre} ";
                    $resultat = mysql_query($requete, $dbh);
                    if (mysql_num_rows($resultat)) {
                        $value = mysql_result($resultat, 0, 0);
                        $requete = "insert into notices_custom_values (notices_custom_champ,notices_custom_origine,notices_custom_integer) values({$idc_genre},{$notice_id},{$value})";
                        mysql_query($requete, $dbh);
                    } else {
                        //sinon dans notes
                        if ($notes) {
                            $notes .= "\n";
                        }
                        $notes .= 'genre : ' . $info_901[$i][$j];
                    }
                }
            }
        }
        //Discipline
        $qn = "select idchamp from notices_custom where name='discipline' ";
        $rn = mysql_query($qn, $dbh);
        if (mysql_num_rows($rn)) {
            $idc_discipline = mysql_result($rn, 0, 0);
        }
        if (count($info_902) && $idc_discipline) {
            for ($i = 0; $i < count($info_902); $i++) {
                for ($j = 0; $j < count($info_902[$i]); $j++) {
                    $requete = "select notices_custom_list_value from notices_custom_lists where notices_custom_list_lib='" . addslashes($info_902[$i][$j]) . "' and notices_custom_champ={$idc_discipline} ";
                    $resultat = mysql_query($requete, $dbh);
                    if (mysql_num_rows($resultat)) {
                        $value = mysql_result($resultat, 0, 0);
                        $requete = "insert into notices_custom_values (notices_custom_champ,notices_custom_origine,notices_custom_integer) values({$idc_discipline},{$notice_id},{$value})";
                        mysql_query($requete, $dbh);
                    } else {
                        //sinon dans notes
                        if ($notes) {
                            $notes .= "\n";
                        }
                        $notes .= 'discipline : ' . $info_902[$i][$j];
                    }
                }
            }
        }
        //Type de nature
        $qn = "select idchamp from notices_custom where name='type_nature' ";
        $rn = mysql_query($qn, $dbh);
        if (mysql_num_rows($rn)) {
            $idc_type_nature = mysql_result($rn, 0, 0);
        }
        $qn = "select idchamp from notices_custom where name='pays' ";
        $rn = mysql_query($qn, $dbh);
        if (mysql_num_rows($rn)) {
            $idc_pays = mysql_result($rn, 0, 0);
        }
        $qn = "select idchamp from notices_custom where name='periode' ";
        $rn = mysql_query($qn, $dbh);
        if (mysql_num_rows($rn)) {
            $idc_periode = mysql_result($rn, 0, 0);
        }
        if (count($info_905)) {
            for ($i = 0; $i < count($info_905); $i++) {
                for ($j = 0; $j < count($info_905[$i]); $j++) {
                    //essai dans type de nature
                    $done = FALSE;
                    if ($idc_type_nature) {
                        $requete = "select notices_custom_list_value from notices_custom_lists where notices_custom_list_lib='" . addslashes($info_905[$i][$j]) . "' and notices_custom_champ={$idc_type_nature} ";
                        $resultat = mysql_query($requete, $dbh);
                        if (mysql_num_rows($resultat)) {
                            $value = mysql_result($resultat, 0, 0);
                            $requete = "insert into notices_custom_values (notices_custom_champ,notices_custom_origine,notices_custom_integer) values({$idc_type_nature},{$notice_id},{$value})";
                            mysql_query($requete, $dbh);
                            $done = TRUE;
                        }
                    }
                    //essai dans genre
                    if (!$done && $idc_genre) {
                        $requete = "select notices_custom_list_value from notices_custom_lists where notices_custom_list_lib='" . addslashes($info_905[$i][$j]) . "' and notices_custom_champ={$idc_genre} ";
                        $resultat = mysql_query($requete, $dbh);
                        if (mysql_num_rows($resultat)) {
                            $value = mysql_result($resultat, 0, 0);
                            $requete = "insert into notices_custom_values (notices_custom_champ,notices_custom_origine,notices_custom_integer) values({$idc_genre},{$notice_id},{$value})";
                            mysql_query($requete, $dbh);
                            $done = TRUE;
                        }
                    }
                    //essai dans theme
                    if (!$done && $idc_theme) {
                        $requete = "select notices_custom_list_value from notices_custom_lists where notices_custom_list_lib='" . addslashes($info_905[$i][$j]) . "' and notices_custom_champ={$idc_theme} ";
                        $resultat = mysql_query($requete, $dbh);
                        if (mysql_num_rows($resultat)) {
                            $value = mysql_result($resultat, 0, 0);
                            $requete = "insert into notices_custom_values (notices_custom_champ,notices_custom_origine,notices_custom_integer) values({$idc_theme},{$notice_id},{$value})";
                            mysql_query($requete, $dbh);
                            $done = TRUE;
                        }
                    }
                    //essai dans discipline
                    if (!$done && $idc_discipline) {
                        $requete = "select notices_custom_list_value from notices_custom_lists where notices_custom_list_lib='" . addslashes($info_905[$i][$j]) . "' and notices_custom_champ={$idc_discipline} ";
                        $resultat = mysql_query($requete, $dbh);
                        if (mysql_num_rows($resultat)) {
                            $value = mysql_result($resultat, 0, 0);
                            $requete = "insert into notices_custom_values (notices_custom_champ,notices_custom_origine,notices_custom_integer) values({$idc_discipline},{$notice_id},{$value})";
                            mysql_query($requete, $dbh);
                            $done = TRUE;
                        }
                    }
                    //essai dans pays
                    if (!$done) {
                        $done_pa = FALSE;
                        if (!$done && $idc_pays) {
                            $i_pays = strip_empty_chars($info_905[$i][$j]);
                            $requete = "select notices_custom_list_value,notices_custom_list_lib from notices_custom_lists where notices_custom_champ={$idc_pays} ";
                            $resultat = mysql_query($requete, $dbh);
                            if (mysql_num_rows($resultat)) {
                                while ($row = mysql_fetch_object($resultat)) {
                                    $r_pays = strip_empty_chars($row->notices_custom_list_lib);
                                    if (strpos($i_pays, $r_pays) !== FALSE) {
                                        $value = $row->notices_custom_list_value;
                                        $requete = "insert into notices_custom_values (notices_custom_champ,notices_custom_origine,notices_custom_integer) values({$idc_pays},{$notice_id},{$value})";
                                        mysql_query($requete, $dbh);
                                        $done_pa = TRUE;
                                        break;
                                    }
                                }
                            }
                        }
                        //essai dans periode
                        $done_pe = FALSE;
                        if (!$done && $idc_periode) {
                            $i_periode = strip_empty_chars($info_905[$i][$j]);
                            $requete = "select notices_custom_list_value,notices_custom_list_lib from notices_custom_lists where notices_custom_champ={$idc_periode} ";
                            $resultat = mysql_query($requete, $dbh);
                            if (mysql_num_rows($resultat)) {
                                while ($row = mysql_fetch_object($resultat)) {
                                    $r_periode = strip_empty_chars($row->notices_custom_list_lib);
                                    if (strpos($i_periode, $r_periode) !== FALSE) {
                                        $value = $row->notices_custom_list_value;
                                        $requete = "insert into notices_custom_values (notices_custom_champ,notices_custom_origine,notices_custom_integer) values({$idc_periode},{$notice_id},{$value})";
                                        mysql_query($requete, $dbh);
                                        $done_pe = TRUE;
                                        break;
                                    }
                                }
                            }
                        }
                        if ($done_pa && $done_pe) {
                            $done = TRUE;
                        }
                    }
                    //sinon dans notes
                    if (!$done) {
                        if ($notes) {
                            $notes .= "\n";
                        }
                        $notes .= 'type de nature : ' . $info_905[$i][$j];
                    }
                }
            }
        }
        //Niveau
        if (count($info_906)) {
            $qn = "select idchamp from notices_custom where name='niveau' ";
            $rn = mysql_query($qn, $dbh);
            if (mysql_num_rows($rn)) {
                $idc_niveau = mysql_result($rn, 0, 0);
                for ($i = 0; $i < count($info_906); $i++) {
                    for ($j = 0; $j < count($info_906[$i]); $j++) {
                        $requete = "select notices_custom_list_value from notices_custom_lists where notices_custom_list_lib='" . addslashes($info_906[$i][$j]) . "' and notices_custom_champ={$idc_niveau} ";
                        $resultat = mysql_query($requete, $dbh);
                        if (mysql_num_rows($resultat)) {
                            $value = mysql_result($resultat, 0, 0);
                            $requete = "insert into notices_custom_values (notices_custom_champ,notices_custom_origine,notices_custom_integer) values({$idc_niveau},{$notice_id},{$value})";
                            mysql_query($requete, $dbh);
                        } else {
                            //sinon dans notes
                            if ($notes) {
                                $notes .= "\n";
                            }
                            $notes .= 'niveau : ' . $info_906[$i][$j];
                        }
                    }
                }
            }
        }
        //notes
        if ($notes) {
            $notes .= "\n";
            $notes = addslashes($notes);
            $q = "update notices set n_contenu=concat('" . $notes . "',n_contenu) where notice_id='" . $notice_id . "' ";
            mysql_query($q, $dbh);
        }
        //Année de péremption
        if ($info_903[0]) {
            $qn = "select idchamp from notices_custom where name='annee_peremption' ";
            $rn = mysql_query($qn, $dbh);
            if (mysql_num_rows($rn)) {
                $idc_ap = mysql_result($rn, 0, 0);
                $requete = "insert into notices_custom_values (notices_custom_champ,notices_custom_origine,notices_custom_small_text) values({$idc_ap},{$notice_id},'" . addslashes($info_903[0]) . "')";
                mysql_query($requete, $dbh);
            }
        }
        //Date de saisie
        if ($info_904[0]) {
            $qn = "select idchamp from notices_custom where name='date_creation' ";
            $rn = mysql_query($qn, $dbh);
            if (mysql_num_rows($rn)) {
                $idc_ds = mysql_result($rn, 0, 0);
                $requete = "insert into notices_custom_values (notices_custom_champ,notices_custom_origine,notices_custom_date) values({$idc_ds},{$notice_id},'" . $info_904[0] . "')";
                mysql_query($requete, $dbh);
            }
        }
    }
}
 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);
 }
Ejemplo n.º 19
0
 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);
 }
Ejemplo n.º 20
0
 static function update_index($id)
 {
     global $dbh;
     // On cherche tous les n-uplet de la table notice correspondant à ce titre_uniforme.
     $found = pmb_mysql_query("select ntu_num_notice from notices_titres_uniformes where ntu_num_tu = " . $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->ntu_num_notice;
         notice::majNoticesGlobalIndex($notice_id);
         notice::majNoticesMotsGlobalIndex($notice_id);
     }
 }
Ejemplo n.º 21
0
     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);
         }
     }
 }
Ejemplo n.º 22
0
 function sendPM(User $FromUser, $message)
 {
     $message = htmlentities($message, ENT_NOQUOTES, 'UTF-8');
     require_once l_r('lib/message.php');
     $message = message::linkify($message);
     if ($FromUser->isSilenced()) {
         notice::send($FromUser->id, $this->id, 'PM', 'No', 'Yes', l_t('Could not deliver message, you are currently silenced.') . '(' . $FromUser->getActiveSilence()->reason . ')', l_t('To:') . ' ' . $this->username, $this->id);
         return false;
     } else {
         if ($this->isUserMuted($FromUser->id)) {
             notice::send($FromUser->id, $this->id, 'PM', 'No', 'Yes', l_t('Could not deliver message, user has muted you.'), l_t('To:') . ' ' . $this->username, $this->id);
             return false;
         } else {
             notice::send($this->id, $FromUser->id, 'PM', 'Yes', 'Yes', $message, $FromUser->username, $FromUser->id);
             $this->setNotification('PrivateMessage');
             notice::send($FromUser->id, $this->id, 'PM', 'No', 'Yes', l_t('You sent:') . ' <em>' . $message . '</em>', l_t('To:') . ' ' . $this->username, $this->id);
             return true;
         }
     }
 }
Ejemplo n.º 23
0
 function move($to_bul)
 {
     global $msg;
     global $dbh;
     global $pmb_synchro_rdf;
     // rattachement du dépouillement
     $requete = 'UPDATE analysis SET analysis_bulletin=' . $to_bul . ' WHERE analysis_notice=' . $this->analysis_id;
     @pmb_mysql_query($requete, $dbh);
     //dates
     $myBul = new bulletinage($to_bul);
     $year = substr($myBul->date_date, 0, 4);
     $date_parution = $myBul->date_date;
     $requete = 'UPDATE notices SET year="' . $year . '", date_parution="' . $date_parution . '", update_date=sysdate() WHERE notice_id=' . $this->analysis_id . ' LIMIT 1';
     @pmb_mysql_query($requete, $dbh);
     //Indexation du dépouillement
     notice::majNoticesTotal($this->analysis_id);
     audit::insert_modif(AUDIT_NOTICE, $this->analysis_id);
     if ($pmb_synchro_rdf) {
         $synchro_rdf = new synchro_rdf();
         $synchro_rdf->delRdf($this->analysis_id, 0);
         $synchro_rdf->addRdf($this->analysis_id, 0);
     }
     return false;
 }
Ejemplo n.º 24
0
 function send($keep, $private, $text, $fromCountryID = null)
 {
     notice::send($this->userID, $this->gameID, 'Game', $keep, $private, $text, $this->Game->name, $this->gameID);
 }
Ejemplo n.º 25
0
 function genDateTri()
 {
     global $msg, $dbh, $charset, $PMBusername;
     if (SESSrights & ADMINISTRATION_AUTH) {
         $result .= "<h3>" . htmlentities($msg["gen_date_tri_msg"], ENT_QUOTES, $charset) . "</h3>";
         $query = mysql_query("select notice_id, year, niveau_biblio, niveau_hierar from notices order by notice_id");
         if (mysql_num_rows($query)) {
             while ($mesNotices = mysql_fetch_assoc($query)) {
                 switch ($mesNotices['niveau_biblio'] . $mesNotices['niveau_hierar']) {
                     case 'a2':
                         //Si c'est un article, on récupère la date du bulletin associé
                         $reqAnneeArticle = "SELECT date_date FROM bulletins, analysis WHERE analysis_bulletin=bulletin_id AND analysis_notice='" . $mesNotices['notice_id'] . "'";
                         $queryArt = mysql_query($reqAnneeArticle, $dbh);
                         if (!mysql_num_rows($queryArt)) {
                             $dateArt = "";
                         } else {
                             $dateArt = mysql_result($queryArt, 0, 0);
                         }
                         if ($dateArt == '0000-00-00' || !isset($dateArt) || $dateArt == "") {
                             $annee_art_tmp = "";
                         } else {
                             $annee_art_tmp = substr($dateArt, 0, 4);
                         }
                         //On met à jour, les notices avec la date de parution et l'année
                         $reqMajArt = "UPDATE notices SET date_parution='" . $dateArt . "', year='" . $annee_art_tmp . "'\n\t\t\t\t\t\t\t\t\t\tWHERE notice_id='" . $mesNotices['notice_id'] . "'";
                         mysql_query($reqMajArt, $dbh);
                         break;
                     case 'b2':
                         //Si c'est une notice de bulletin, on récupère la date pour connaitre l'année
                         $reqAnneeBulletin = "SELECT date_date FROM bulletins WHERE num_notice='" . $mesNotices['notice_id'] . "'";
                         $queryAnnee = mysql_query($reqAnneeBulletin, $dbh);
                         if (!mysql_num_rows($queryAnnee)) {
                             $dateBulletin = "";
                         } else {
                             $dateBulletin = mysql_result($queryAnnee, 0, 0);
                         }
                         if ($dateBulletin == '0000-00-00' || !isset($dateBulletin) || $dateBulletin == "") {
                             $annee_tmp = "";
                         } else {
                             $annee_tmp = substr($dateBulletin, 0, 4);
                         }
                         //On met à jour date de parution et année
                         $reqMajBull = "UPDATE notices SET date_parution='" . $dateBulletin . "', year='" . $annee_tmp . "'\n\t\t\t\t\t\t\t\t\tWHERE notice_id='" . $mesNotices['notice_id'] . "'";
                         mysql_query($reqMajBull, $dbh);
                         break;
                     default:
                         // Mise à jour du champ date_parution des notices (monographie et pério)
                         $date_parution = notice::get_date_parution($mesNotices['year']);
                         $reqMaj = "UPDATE notices SET date_parution='" . $date_parution . "' WHERE notice_id='" . $mesNotices['notice_id'] . "'";
                         mysql_query($reqMaj, $dbh);
                         break;
                 }
             }
             mysql_free_result($query);
         }
         $not = mysql_query("SELECT count(1) FROM notices", $dbh);
         $count = mysql_result($not, 0, 0);
         $result .= $count . " " . htmlentities($msg['gen_date_tri_msg'], ENT_QUOTES, $charset);
     } else {
         $result .= sprintf($msg["planificateur_rights_bad_user_rights"], $PMBusername);
     }
     return $result;
 }
Ejemplo n.º 26
0
 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);
     }
 }
Ejemplo n.º 27
0
 static function update_index($id)
 {
     global $dbh;
     global $include_path;
     $indexation_authority = new indexation_authority($include_path . "/indexation/authorities/collections/champs_base.xml", "authorities", AUT_TABLE_COLLECTIONS);
     $indexation_authority->maj($id);
     // On cherche tous les n-uplet de la table notice correspondant à cette collection.
     $found = pmb_mysql_query("select distinct notice_id from notices where coll_id='" . $id . "'", $dbh);
     // Pour chaque n-uplet trouvés on met a jour la table notice_global_index avec la collection modifiée :
     while ($mesNotices = pmb_mysql_fetch_object($found)) {
         $notice_id = $mesNotices->notice_id;
         notice::majNoticesGlobalIndex($notice_id);
         notice::majNoticesMotsGlobalIndex($notice_id, 'collection');
     }
 }
Ejemplo n.º 28
0
         $res_print_docnum .= htmlentities($info_bulle, ENT_QUOTES, $charset);
         $res_print_docnum .= "\" title=\"";
         $res_print_docnum .= htmlentities($info_bulle, ENT_QUOTES, $charset);
         $res_print_docnum .= "\"/>";
         $res_print_docnum .= "</a>";
     } elseif ($nb_docnum > 1) {
         $info_bulle = $msg["info_docs_num_notice"];
         $res_print_docnum = "&nbsp;<a href='#docnum'><img src=\"./images/globe_rouge.png\" alt=\"" . htmlentities($info_bulle, ENT_QUOTES, $charset) . "\" \" title=\"" . htmlentities($info_bulle, ENT_QUOTES, $charset) . "\"/></a>";
     }
 }
 $typdocchapeau = "a";
 $icon = "";
 $requete3 = "SELECT notice_id,typdoc FROM notices WHERE notice_id='" . $perio_id . "' ";
 $res3 = @mysql_query($requete3, $dbh);
 while ($obj3 = mysql_fetch_object($res3)) {
     $notice3 = new notice($obj3->notice_id);
     $typdocchapeau = $obj3->typdoc;
 }
 $notice3->fetch_visibilite();
 if (!$icon) {
     $icon = "icon_per.gif";
 }
 $icon = $icon_doc["b" . $typdocchapeau];
 //carrousel pour la navigation
 if ($opac_show_bulletin_nav) {
     $res_print = do_carroussel($obj);
 } else {
     $res_print = "";
 }
 //$res_print .= "<h3><img src=./images/$icon /> ".$notice3->print_resume(1,$css)."."." <b>".$obj["bulletin_numero"]."</b>".($nb_docnum ? "&nbsp;<a href='#docnum'>".($nb_docnum > 1 ? "<img src='./images/globe_rouge.png' />" : "<img src='./images/globe_orange.png' />")."</a>" : "")."</h3>\n";
 $res_print .= "<h3><img src=./images/{$icon} /> " . $notice3->print_resume(1, $css) . "." . " <b>" . $obj["bulletin_numero"] . "</b>";
Ejemplo n.º 29
0
 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 indexint='" . $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::majNoticesGlobalIndex($notice_id);
         notice::majNoticesMotsGlobalIndex($notice_id, 'indexint');
     }
 }
Ejemplo n.º 30
0
                 $limit = "limit " . $nb_per_page_search * $page . ",{$nb_per_page_search}";
             }
             $requete = "select expl_id as notice_id from {$table} " . $limit;
             $object_type = "EXPL";
             break;
     }
 }
 if ($environement["caddie"]) {
     foreach ($environement["caddie"] as $environement_caddie) {
         $c = new caddie($environement_caddie);
         $nb_items_before = $c->nb_item;
         $resultat = @mysql_query($requete);
         print mysql_error();
         while ($r = mysql_fetch_object($resultat)) {
             if ($environement["include_child"]) {
                 $tab_list_child = notice::get_list_child($r->notice_id);
                 if (count($tab_list_child)) {
                     foreach ($tab_list_child as $notice_id) {
                         $c->add_item($notice_id, $object_type);
                     }
                 }
             } else {
                 $c->add_item($r->notice_id, $object_type);
             }
         }
         $c->compte_items();
         $message .= sprintf($msg["print_cart_n_added"] . "\\n", $c->nb_item - $nb_items_before, $c->name);
     }
     print "<script>alert(\"{$message}\"); self.close();</script>";
 } else {
     print "<script>alert(\"" . $msg["print_cart_no_cart_selected"] . "\"); history.go(-1);</script>";