Example #1
0
 function mono_display($id, $level = 1, $action = '', $expl = 1, $expl_link = '', $lien_suppr_cart = "", $explnum_link = '', $show_resa = 0, $print = 0, $show_explnum = 1, $show_statut = 0, $anti_loop = '', $draggable = 0, $no_link = false, $show_opac_hidden_fields = true, $ajax_mode = 0, $show_planning = 0, $show_map = 1)
 {
     global $pmb_recherche_ajax_mode;
     global $categ;
     global $id_empr;
     $this->show_map = $show_map;
     if ($pmb_recherche_ajax_mode) {
         $this->ajax_mode = $ajax_mode;
         if ($this->ajax_mode) {
             if (is_object($id)) {
                 $param['id'] = $id->notice_id;
             } else {
                 $param['id'] = $id;
             }
             $param['function_to_call'] = "mono_display";
             //if($level)$param['level']=$level;	// à 6
             if ($action) {
                 $param['action'] = $action;
             }
             if ($expl) {
                 $param['expl'] = $expl;
             }
             if ($expl_link) {
                 $param['expl_link'] = $expl_link;
             }
             //		  	if($lien_suppr_cart)$param['lien_suppr_cart']=$lien_suppr_cart;
             if ($explnum_link) {
                 $param['explnum_link'] = $explnum_link;
             }
             //if($show_resa)$param['show_resa']=$show_resa;
             if ($print) {
                 $param['print'] = $print;
             }
             //if($show_explnum)$param['show_explnum']=$show_explnum;
             //if($show_statut)$param['show_statut']=$show_statut;
             //if($anti_loop)$param['anti_loop']=$anti_loop;
             //if($draggable)$param['draggable']=$draggable;
             if ($no_link) {
                 $param['no_link'] = $no_link;
             }
             if ($categ) {
                 $param['categ'] = $categ;
             }
             if ($id_empr) {
                 $param['id_empr'] = $id_empr;
             }
             //if($show_opac_hidden_fields)$param['show_opac_hidden_fields']=$show_opac_hidden_fields;
             $this->mono_display_cmd = serialize($param);
         }
     }
     if (!$id) {
         return;
     } else {
         if (is_object($id)) {
             $this->notice_id = $id->notice_id;
             $this->notice = $id;
             $this->langues = get_notice_langues($this->notice_id, 0);
             // langues de la publication
             $this->languesorg = get_notice_langues($this->notice_id, 1);
             // langues originales
             $this->isbn = $id->code;
             //Récupération titre de série
             if ($id->tparent_id) {
                 $parent = new serie($id->tparent_id);
                 $this->tit_serie = $parent->name;
                 $this->tit_serie_lien_gestion = $parent->isbd_entry_lien_gestion;
             }
         } else {
             $this->notice_id = $id;
             $this->mono_display_fetch_data();
         }
         if (!$this->ajax_mode || !$level) {
             $this->childs = array();
             $requete = "select num_notice as notice_id,relation_type from notices_relations,notices where linked_notice=" . $this->notice_id . " and num_notice=notice_id order by relation_type, rank,create_date";
             $resultat = pmb_mysql_query($requete);
             if (pmb_mysql_num_rows($resultat)) {
                 while ($r = pmb_mysql_fetch_object($resultat)) {
                     $this->childs[$r->relation_type][] = $r->notice_id;
                 }
             }
         }
     }
     global $memo_p_perso_notice;
     if (!$this->ajax_mode || !$level) {
         if (!$memo_p_perso_notice) {
             $memo_p_perso_notice = new parametres_perso("notices");
         }
         $this->p_perso = $memo_p_perso_notice;
     }
     $this->level = $level;
     $this->expl = $expl;
     $this->show_resa = $show_resa;
     $this->link_expl = $expl_link;
     $this->link_explnum = $explnum_link;
     $this->lien_suppr_cart = $lien_suppr_cart;
     // mise à jour des liens
     $this->action = $action;
     $this->drag = $draggable;
     $this->print_mode = $print;
     $this->show_explnum = $show_explnum;
     $this->show_statut = $show_statut;
     $this->no_link = $no_link;
     $this->anti_loop = $anti_loop;
     //affichage ou pas des champs persos OPAC masqués
     $this->show_opac_hidden_fields = $show_opac_hidden_fields;
     $this->action = str_replace('!!id!!', $this->notice_id, $this->action);
     $this->responsabilites = get_notice_authors($this->notice_id);
     // mise à jour des catégories
     if (!$this->ajax_mode || !$level) {
         $this->categories = get_notice_categories($this->notice_id);
     }
     $this->show_planning = $show_planning;
     $this->do_header();
     switch ($level) {
         case 0:
             // là, c'est le niveau 0 : juste le header
             $this->result = $this->header;
             break;
         default:
             global $pmb_map_activate;
             $this->map = new stdClass();
             $this->map_info = new stdClass();
             if ($pmb_map_activate) {
                 $ids[] = $this->notice_id;
                 $this->map = new map_objects_controler(TYPE_RECORD, $ids);
                 $this->map_info = new map_info($this->notice_id);
             }
             // niveau 1 et plus : header + isbd à générer
             $this->init_javascript();
             if (!$this->ajax_mode) {
                 $this->do_isbd();
             }
             $this->finalize();
             break;
     }
     return;
 }
Example #2
0
 function serial_display($id, $level = '1', $action_serial = '', $action_analysis = '', $action_bulletin = '', $lien_suppr_cart = "", $lien_explnum = "", $bouton_explnum = 1, $print = 0, $show_explnum = 1, $show_statut = 0, $show_opac_hidden_fields = true, $draggable = 0, $ajax_mode = 0, $anti_loop = '', $no_link = false, $show_map = 1)
 {
     global $pmb_recherche_ajax_mode;
     $this->show_map = $show_map;
     if ($pmb_recherche_ajax_mode) {
         $this->ajax_mode = $ajax_mode;
         if ($this->ajax_mode) {
             if (is_object($id)) {
                 $param['id'] = $id->notice_id;
             } else {
                 $param['id'] = $id;
             }
             $param['function_to_call'] = "serial_display";
             //if($level)$param['level']=$level;	//6
             if ($action_serial) {
                 $param['action_serial'] = $action_serial;
             }
             if ($action_analysis) {
                 $param['action_analysis'] = $action_analysis;
             }
             if ($action_bulletin) {
                 $param['action_bulletin'] = $action_bulletin;
             }
             //			  	if($lien_suppr_cart)$param['lien_suppr_cart']=$lien_suppr_cart;
             if ($lien_explnum) {
                 $param['lien_explnum'] = $lien_explnum;
             }
             if ($bouton_explnum) {
                 $param['bouton_explnum'] = $bouton_explnum;
             }
             if ($print) {
                 $param['print'] = $print;
             }
             //	if($show_explnum)$param['show_explnum']=$show_explnum;
             //if($show_statut)$param['show_statut']=$show_statut;
             //if($show_opac_hidden_fields)$param['show_opac_hidden_fields']=$show_opac_hidden_fields;
             //if($draggable)$param['draggable']=$draggable;//1
             $this->mono_display_cmd = serialize($param);
         }
     }
     $this->lien_explnum = $lien_explnum;
     $this->bouton_explnum = $bouton_explnum;
     $this->print_mode = $print;
     $this->show_explnum = $show_explnum;
     $this->show_statut = $show_statut;
     $this->anti_loop = $anti_loop;
     $this->no_link = $no_link;
     if (!$id) {
         return;
     } else {
         if (is_object($id)) {
             $this->notice_id = $id->notice_id;
             $this->notice = $id;
         } else {
             $this->notice_id = $id;
             $this->serial_display_fetch_data();
         }
     }
     $this->show_opac_hidden_fields = $show_opac_hidden_fields;
     if (!$this->ajax_mode) {
         $this->p_perso = new parametres_perso("notices");
     }
     $this->responsabilites = get_notice_authors($this->notice_id);
     // mise à jour des catégories
     if (!$this->ajax_mode) {
         $this->categories = get_notice_categories($this->notice_id);
     }
     //récupération des langues
     $this->langues = get_notice_langues($this->notice_id, 0);
     // langues de la publication
     $this->languesorg = get_notice_langues($this->notice_id, 1);
     // langues originales
     $this->level = $level;
     $this->lien_suppr_cart = $lien_suppr_cart;
     // si la notice est a2 (dépouillement), on récupère les données du bulletinage
     if ($this->notice->niveau_biblio == 'a' && $this->notice->niveau_hierar == 2) {
         $this->get_bul_info();
     }
     // mise à jour des liens
     if (SESSrights & CATALOGAGE_AUTH) {
         $this->action_serial_org = $action_serial;
         $this->action_analysis = $action_analysis;
         $this->action_bulletin = $action_bulletin;
         if ($action_serial && $this->notice->niveau_biblio == 's' && $this->notice->niveau_hierar == '1') {
             $this->action_serial = str_replace('!!id!!', $this->notice_id, $action_serial);
         }
         if ($action_analysis && $this->notice->niveau_biblio == 'a' && $this->notice->niveau_hierar == '2') {
             $this->action_analysis = str_replace('!!id!!', $this->notice_id, $this->action_analysis);
             $this->action_analysis = str_replace('!!bul_id!!', $this->bul_id, $this->action_analysis);
         }
         $this->lien_explnum = str_replace('!!serial_id!!', $this->notice_id, $this->lien_explnum);
         $this->lien_explnum = str_replace('!!analysis_id!!', $this->notice_id, $this->lien_explnum);
         $this->lien_explnum = str_replace('!!bul_id!!', $this->bul_id, $this->lien_explnum);
         $this->drag = $draggable;
     } else {
         $this->action_serial_org = "";
         $this->action_analysis = "";
         $this->action_bulletin = "";
         $this->action_serial = "";
         $this->lien_explnum = "";
         $this->drag = "";
     }
     $this->do_header();
     if ($level) {
         $this->init_javascript();
     }
     $this->isbd = 'ISBD';
     if (!$this->ajax_mode) {
         $this->childs = array();
         $requete = "select num_notice as notice_id,relation_type from notices_relations,notices where linked_notice=" . $this->notice_id . " and num_notice=notice_id order by relation_type, rank,create_date";
         $resultat = pmb_mysql_query($requete);
         if (pmb_mysql_num_rows($resultat)) {
             while ($r = pmb_mysql_fetch_object($resultat)) {
                 $this->childs[$r->relation_type][] = $r->notice_id;
             }
         }
     }
     switch ($level) {
         case 0:
             // là, c'est le niveau 0 : juste le header
             //$this->do_header();
             $this->result = $this->header;
             break;
         default:
             global $pmb_map_activate;
             $this->map = array();
             if ($pmb_map_activate) {
                 $ids[] = $this->notice_id;
                 $this->map = new map_objects_controler(TYPE_RECORD, $ids);
                 $this->map_info = new map_info($this->notice_id);
             }
             // niveau 1 et plus : header + isbd à générer
             //$this->do_header();
             if (!$this->ajax_mode) {
                 $this->do_isbd();
             }
             if (!$this->ajax_mode) {
                 $this->finalize();
             }
             break;
     }
     return;
 }
Example #3
0
 function fetch_analysis_data()
 {
     global $dbh;
     global $fonction_auteur;
     $myQuery = pmb_mysql_query("SELECT * FROM notices WHERE notice_id='" . $this->analysis_id . "' LIMIT 1", $dbh);
     $myAnalysis = pmb_mysql_fetch_object($myQuery);
     // type du document
     $this->analysis_typdoc = $myAnalysis->typdoc;
     // statut
     $this->analysis_statut = $myAnalysis->statut;
     $this->analysis_commentaire_gestion = $myAnalysis->commentaire_gestion;
     $this->analysis_thumbnail_url = $myAnalysis->thumbnail_url;
     // mentions de titre
     $this->analysis_tit1 = $myAnalysis->tit1;
     $this->analysis_tit2 = $myAnalysis->tit2;
     $this->analysis_tit3 = $myAnalysis->tit3;
     $this->analysis_tit4 = $myAnalysis->tit4;
     // libelle des auteurs
     $this->responsabilites_dep = get_notice_authors($this->analysis_id);
     // Mention de pagination
     $this->analysis_pages = $myAnalysis->npages;
     // zone des notes
     $this->analysis_n_gen = $myAnalysis->n_gen;
     $this->analysis_n_contenu = $myAnalysis->n_contenu;
     $this->analysis_n_resume = $myAnalysis->n_resume;
     // mise à jour des catégories
     $this->analysis_categories = get_notice_categories($this->analysis_id);
     // indexation interne
     if ($myAnalysis->indexint) {
         $this->analysis_indexint = $myAnalysis->indexint;
         $indexint = new indexint($this->analysis_indexint);
         if ($indexint->comment) {
             $this->analysis_indexint_lib = $indexint->name . " - " . $indexint->comment;
         } else {
             $this->analysis_indexint_lib = $indexint->name;
         }
     }
     // indexation libre
     $this->analysis_index_l = $myAnalysis->index_l;
     // libelle des langues
     $this->analysis_langues = get_notice_langues($this->analysis_id, 0);
     // langues de la publication
     $this->analysis_languesorg = get_notice_langues($this->analysis_id, 1);
     // langues originales
     $this->analysis_indexation_lang = $myAnalysis->indexation_lang;
     $this->analysis_is_new = $myAnalysis->notice_is_new;
     $this->analysis_date_is_new = $myAnalysis->notice_date_is_new;
     $this->notice_link = array();
     //liens vers autres notices
     $requete = "SELECT * FROM notices_relations WHERE num_notice=" . $this->analysis_id . " OR linked_notice=" . $this->analysis_id . " ORDER BY rank";
     $result_rel = pmb_mysql_query($requete);
     if (pmb_mysql_num_rows($result_rel)) {
         $i = 0;
         while ($r_rel = pmb_mysql_fetch_object($result_rel)) {
             if ($r_rel->linked_notice == $this->analysis_id) {
                 //notice en cours est notice fille
                 $this->notice_link['down'][$i]['relation_direction'] = 'down';
                 $this->notice_link['down'][$i]['id_notice'] = $r_rel->num_notice;
                 $this->notice_link['down'][$i]['title_notice'] = $this->get_notice_title($r_rel->num_notice);
                 $this->notice_link['down'][$i]['rank'] = $r_rel->rank;
                 $this->notice_link['down'][$i]['relation_type'] = $r_rel->relation_type;
             } elseif ($r_rel->num_notice == $this->analysis_id) {
                 //notice en cours est notice mere
                 $this->notice_link['up'][$i]['relation_direction'] = 'up';
                 $this->notice_link['up'][$i]['id_notice'] = $r_rel->linked_notice;
                 $this->notice_link['up'][$i]['title_notice'] = $this->get_notice_title($r_rel->linked_notice);
                 $this->notice_link['up'][$i]['rank'] = $r_rel->rank;
                 $this->notice_link['up'][$i]['relation_type'] = $r_rel->relation_type;
             }
             $i++;
         }
     }
     // lien vers une ressource électronique
     $this->analysis_lien = $myAnalysis->lien;
     if ($this->analysis_lien) {
         $this->analysis_eformat = $myAnalysis->eformat;
     } else {
         $this->analysis_eformat = "";
     }
     $this->analysis_create_date = $myAnalysis->create_date;
     $this->analysis_update_date = $myAnalysis->update_date;
     return $myQuery->nbr_rows;
 }
Example #4
0
 function notice($id)
 {
     global $fonction_auteur;
     global $base_path;
     require_once $base_path . "/classes/author.class.php";
     require_once $base_path . "/classes/marc_table.class.php";
     require_once $base_path . "/includes/notice_authors.inc.php";
     // récupération des codes de fonction
     if (!count($fonction_auteur)) {
         $fonction_auteur = new marc_list('function');
         $fonction_auteur = $fonction_auteur->table;
     }
     // on regarde si on a une notice-objet ou un id de notice
     if (is_object($id)) {
         $this->get_primaldatafrom($id);
     } else {
         $this->id = $id;
         $this->get_primaldata();
     }
     // mise à jour des catégories
     $this->categories = get_notice_categories($this->notice_id);
 }
 function mono_display_unimarc($id, $level = 1, $expl = 1, $print = 0, $show_explnum = 1, $no_link = false, $entrepots_localisations = array())
 {
     // $id = id de la notice à afficher
     // $action	 = URL associée au header
     // $level :
     //		0 : juste le header (titre  / auteur principal avec le lien si applicable)
     // 			suppression des niveaux entre 1 et 6, seul reste level
     //		1 : ISBD seul, pas de note, bouton modif, expl, explnum et r�sas
     // 		6 : cas général détaillé avec notes, categ, langues, indexation... + boutons
     // $expl -> affiche ou non les exemplaires associés
     $this->notice_id = $id;
     $this->mono_display_fetch_data();
     $this->fetch_auteurs();
     $this->fetch_categories();
     $this->level = $level;
     $this->expl = $expl;
     $this->entrepots_localisations = $entrepots_localisations;
     // mise à jour des catégories
     $this->categories = get_notice_categories($this->notice_id);
     $this->do_header();
     switch ($level) {
         case 0:
             // là, c'est le niveau 0 : juste le header
             $this->result = $this->header;
             break;
         default:
             // niveau 1 et plus : header + isbd à générer
             $this->init_javascript();
             $this->do_isbd();
             $this->finalize();
             break;
     }
     return;
 }
Example #6
0
$pagination = new Pagination(10);
$limit = $pagination->getLimit($total);
$sql = "SELECT c.CID, c.UID, c.comment, c.addtime, s.username, s.photo, s.gender\n                   FROM notice_comments AS c, signup AS s \n                   WHERE c.NID = " . $NID . " AND c.status = '1' AND c.UID = s.UID\n                   ORDER BY c.addtime DESC LIMIT " . $limit;
$rs = $conn->execute($sql);
$comments = $rs->getrows();
$page_link = $pagination->getPagination('notice/' . $NID, 'p_notice_comments_' . $NID . '_');
$page_link_b = $pagination->getPagination('notice/' . $NID, 'pp_notice_comments_' . $NID . '_');
$start_num = $pagination->getStartItem();
$end_num = $pagination->getEndItem();
$smarty->assign('errors', $errors);
$smarty->assign('messages', $messages);
$smarty->assign('menu', 'home');
$smarty->assign('notice_js', true);
$smarty->assign('notice', $notice);
$smarty->assign('comments', $comments);
$smarty->assign('comments_total', $total);
$smarty->assign('page_link', $page_link);
$smarty->assign('page_link_b', $page_link_b);
$smarty->assign('start_num', $start_num);
$smarty->assign('end_num', $end_num);
$smarty->assign('arhive', get_notice_arhive());
$smarty->assign('categories', get_notice_categories());
$smarty->assign('self_title', $seo['notice_title']);
$smarty->assign('self_description', $seo['notice_desc']);
$smarty->assign('self_keywords', $seo['notice_keywords']);
$smarty->display('header.tpl');
$smarty->display('errors.tpl');
$smarty->display('messages.tpl');
$smarty->display('notice.tpl');
$smarty->display('footer.tpl');
$smarty->gzip_encode();
Example #7
0
 function notice($id = 0, $cb = '')
 {
     global $dbh;
     global $msg;
     global $include_path, $class_path;
     global $deflt_notice_is_new;
     //On nettoie la variable de liens entre notices
     $this->notice_link = array();
     if ($id) {
         $fonction = new marc_list('function');
         $this->id = $id;
         $this->libelle_form = $msg[278];
         // libelle du form : modification d'une notice
         $requete = "SELECT * FROM notices WHERE notice_id='{$id}' LIMIT 1 ";
         $result = @pmb_mysql_query($requete, $dbh);
         if ($result) {
             $notice = pmb_mysql_fetch_object($result);
             $this->type_doc = $notice->typdoc;
             // type du document
             $this->tit1 = $notice->tit1;
             // titre propre
             $this->tit2 = $notice->tit2;
             // titre propre 2
             $this->tit3 = $notice->tit3;
             // titre parallele
             $this->tit4 = $notice->tit4;
             // complement du titre
             $this->tparent_id = $notice->tparent_id;
             // id du titre parent
             // libelle du titre parent
             if ($this->tparent_id) {
                 $serie = new serie($this->tparent_id);
                 $this->tparent = $serie->name;
             } else {
                 $this->tparent = '';
             }
             $this->tnvol = $notice->tnvol;
             // numero de partie
             $this->responsabilites = get_notice_authors($this->id);
             $this->subcoll_id = $notice->subcoll_id;
             // id sous collection
             $this->coll_id = $notice->coll_id;
             // id collection
             $this->ed1_id = $notice->ed1_id;
             // id editeur 1
             require_once "{$class_path}/editor.class.php";
             if ($this->subcoll_id) {
                 require_once "{$class_path}/subcollection.class.php";
                 require_once "{$class_path}/collection.class.php";
                 $collection = new subcollection($this->subcoll_id);
                 $this->subcoll = $collection->name;
             }
             if ($this->coll_id) {
                 require_once "{$class_path}/collection.class.php";
                 $collection = new collection($this->coll_id);
                 $this->coll = $collection->name;
             }
             if ($this->ed1_id) {
                 $editeur = new editeur($this->ed1_id);
                 $this->ed1 = $editeur->display;
             }
             $this->year = $notice->year;
             // annee de publication
             $this->nocoll = $notice->nocoll;
             // no. dans la collection
             $this->mention_edition = $notice->mention_edition;
             // mention d'edition (1ere, deuxieme...)
             $this->ed2_id = $notice->ed2_id;
             // id editeur 2
             if ($this->ed2_id) {
                 // libelle editeur 2
                 $editeur = new editeur($this->ed2_id);
                 $this->ed2 = $editeur->display;
             }
             $this->code = $notice->code;
             // ISBN, code barre commercial ou no. commercial
             $this->npages = $notice->npages;
             // importance materielle (nombre de pages, d'elements...)
             $this->ill = $notice->ill;
             // mention d'illustration
             $this->size = $notice->size;
             // format
             $this->prix = $notice->prix;
             // Prix du document
             $this->accomp = $notice->accomp;
             // materiel d'accompagnement
             $this->n_gen = $notice->n_gen;
             // note generale
             $this->n_contenu = $notice->n_contenu;
             // note de contenu
             $this->n_resume = $notice->n_resume;
             // resume/extrait
             $this->categories = get_notice_categories($this->id);
             $this->indexint = $notice->indexint;
             // indexation interne
             $this->index_l = $notice->index_l;
             // indexation libre
             $this->langues = get_notice_langues($this->id, 0);
             // langues de la publication
             $this->languesorg = get_notice_langues($this->id, 1);
             // langues originales
             $this->lien = $notice->lien;
             // URL de la ressource electronique associee
             $this->eformat = $notice->eformat;
             // format de la ressource electronique associee
             $this->biblio_level = $notice->niveau_biblio;
             // niveau bibliographique
             $this->hierar_level = $notice->niveau_hierar;
             // niveau hierarchique
             $this->statut = $notice->statut;
             $this->date_parution = notice::get_date_parution($notice->year);
             $this->indexation_lang = $notice->indexation_lang;
             $this->is_new = $notice->notice_is_new;
             $this->date_is_new = $notice->notice_date_is_new;
             //liens vers autres notices
             $requete = "SELECT * FROM notices_relations WHERE num_notice=" . $this->id . " OR linked_notice=" . $this->id . " order by rank";
             $result_rel = pmb_mysql_query($requete);
             if (pmb_mysql_num_rows($result_rel)) {
                 $i = 0;
                 while ($r_rel = pmb_mysql_fetch_object($result_rel)) {
                     if ($r_rel->linked_notice == $this->id) {
                         //notice en cours est notice fille
                         $this->notice_link['down'][$i]['relation_direction'] = 'down';
                         $this->notice_link['down'][$i]['id_notice'] = $r_rel->num_notice;
                         $this->notice_link['down'][$i]['title_notice'] = $this->get_notice_title($r_rel->num_notice);
                         $this->notice_link['down'][$i]['rank'] = $r_rel->rank;
                         $this->notice_link['down'][$i]['relation_type'] = $r_rel->relation_type;
                     } elseif ($r_rel->num_notice == $this->id) {
                         //notice en cours est notice mere
                         $this->notice_link['up'][$i]['relation_direction'] = 'up';
                         $this->notice_link['up'][$i]['id_notice'] = $r_rel->linked_notice;
                         $this->notice_link['up'][$i]['title_notice'] = $this->get_notice_title($r_rel->linked_notice);
                         $this->notice_link['up'][$i]['rank'] = $r_rel->rank;
                         $this->notice_link['up'][$i]['relation_type'] = $r_rel->relation_type;
                     }
                     $i++;
                 }
             }
             $this->commentaire_gestion = $notice->commentaire_gestion;
             $this->thumbnail_url = $notice->thumbnail_url;
             $this->create_date = $notice->create_date;
             $this->update_date = $notice->update_date;
         } else {
             require_once "{$include_path}/user_error.inc.php";
             error_message("", $msg[280], 1, "./catalog.php");
             $this->ok = 0;
         }
         return;
     } else {
         // initialisation des valeurs (vides)
         $this->libelle_form = $msg[270];
         // libelle du form : creation d'une notice
         $this->id = 0;
         $this->code = $cb;
         // initialisation avec les parametres du user :
         global $value_deflt_lang, $value_deflt_relation;
         if ($value_deflt_lang) {
             $lang = new marc_list('lang');
             $this->langues[] = array('lang_code' => $value_deflt_lang, 'langue' => $lang->table[$value_deflt_lang]);
         }
         global $deflt_notice_statut;
         if ($deflt_notice_statut) {
             $this->statut = $deflt_notice_statut;
         } else {
             $this->statut = 1;
         }
         global $xmlta_doctype;
         $this->type_doc = $xmlta_doctype;
         global $notice_parent;
         //relation montante ou descendante
         global $notice_parent_direction;
         if ($notice_parent) {
             if (!$notice_parent_direction) {
                 // Si pas de sens, on force a relation descendante
                 $notice_parent_direction = 'down';
             }
             $this->notice_link[$notice_parent_direction][0]['relation_direction'] = $notice_parent_direction;
             $this->notice_link[$notice_parent_direction][0]['id_notice'] = $notice_parent;
             $this->notice_link[$notice_parent_direction][0]['title_notice'] = $this->get_notice_title($notice_parent);
             $this->notice_link[$notice_parent_direction][0]['rank'] = 1;
             //Recherche d'un type plausible
             $requete = "SELECT relation_type FROM notices_relations WHERE num_notice='{$notice_parent}' ORDER BY rank DESC LIMIT 1";
             $resultat = pmb_mysql_query($requete);
             if (@pmb_mysql_num_rows($resultat)) {
                 $this->notice_link[$notice_parent_direction][0]['relation_type'] = pmb_mysql_result($resultat, 0, 0);
             } elseif (preg_match('/' . $notice_parent_direction . '$/', $value_deflt_relation)) {
                 $this->notice_link[$notice_parent_direction][0]['relation_type'] = $value_deflt_relation;
             } else {
                 /*
                  * Comment forcer le sens ?
                  * peut-etre l'inverse de la valeur par defaut si celle-ci ne va pas dans le bon sens ...
                  */
             }
         }
         $this->is_new = $deflt_notice_is_new;
         // penser au test d'existence de la notice sur code-barre
         return;
     }
 }
 function fetch_categories()
 {
     $this->categories = get_notice_categories($this->notice_id);
     // catégories
     $categ_repetables = array();
     $max_categ = sizeof($this->categories);
     for ($i = 0; $i < $max_categ; $i++) {
         $categ_id = $this->categories[$i]["categ_id"];
         $categ = new category($categ_id);
         $categ_repetables[$categ->path_table[0]["libelle"]][$categ_id]["libelle"] = $categ->libelle;
         $categ_repetables[$categ->path_table[0]["libelle"]][$categ_id]["commentaire_public"] = $categ->commentaire_public;
     }
     $categ_final_table = array();
     while (list($key, $val) = each($categ_repetables)) {
         $categ_final_table[$key] = $key;
         asort($val);
         reset($val);
         $categ_r = array();
         while (list($categ_id, $libelle) = each($val)) {
             // Si il y a présence d'un commentaire affichage du layer
             $result_com = categorie::zoom_categ($categ_id, $libelle["commentaire_public"]);
             $categ_r[$categ_id] = inslink($libelle["libelle"], str_replace("!!id!!", $categ_id, $this->lien_rech_categ), $result_com['java_com']) . $result_com['zoom'];
         }
         $categ_final_table[$key] .= "<br />&nbsp;" . implode(", ", $categ_r);
     }
     $this->categories_toutes = implode("<br />", $categ_final_table);
 }