array(),"auteurs" => array()); // les auteurs
public $ed1_id = ''; // id editeur 1
public $ed1 =''; // libelle editeur 1
public $coll_id = ''; // id collection
public $coll = ''; // libelle collection
public $subcoll_id = ''; // id sous collection
public $subcoll = ''; // libelle sous collection
public $year = ''; // annee de publication
public $nocoll = ''; // no. dans la collection
public $mention_edition = ''; // mention d'edition (1ere, deuxieme...)
public $ed2_id = ''; // id editeur 2
public $ed2 =''; // libelle editeur 2
public $code = ''; // ISBN, code barre commercial ou no. commercial
public $npages = ''; // importance materielle (nombre de pages, d'elements...)
public $ill = ''; // mention d'illustration
public $size = ''; // format
public $prix = ''; // prix du document
public $accomp = ''; // materiel d'accompagnement
public $n_gen = ''; // note generale
public $n_contenu = ''; // note de contenu
public $n_resume = ''; // resume/extrait
public $categories = array();// les categories
public $indexint = 0; // indexation interne
public $index_l = ''; // indexation libre
public $langues = array();
public $languesorg = array();
public $lien = ''; // URL de la ressource electronique associee
public $eformat = ''; // format de la ressource electronique associee
public $ok = 1;
public $type_doc = '';
public $biblio_level = 'm'; // niveau bibliographique
public $hierar_level = '0'; // niveau hierarchique
public $action = './catalog.php?categ=update&id=';
public $link_annul = './catalog.php';
public $statut = 0 ; // statut
public $commentaire_gestion = '' ; // commentaire de gestion
public $thumbnail_url = '' ;
public $notice_link=array();
public $date_parution;
public $is_new=0; // nouveauté
public $date_is_new="0000-00-00 00:00:00"; // date nouveauté
public $create_date="0000-00-00 00:00:00"; // date création
public $update_date="0000-00-00 00:00:00"; // date modification
public $num_notice_usage = 0; // droit d'usage
public $concepts_ids;
public $indexation_lang;
/**
* Affichage des éléments contenu dans les onglets
* @var elements_list_ui
*/
private $records_list_ui = null;
/**
* Onglets à afficher
* @var records_tabs
*/
private $record_tabs = null;
/**
* Nomenclatures associées
* @var nomenclature_record_formations
*/
private $nomenclature_record_formations = null;
// methodes
private static $sphinx_indexer = null;
protected static $notice = array();
public static $indexation_record;
protected static $deleted_index = false;
protected static $aut_pperso_instance;
protected static $parametres_perso=array();
public static function get_notice($id, $cb = '') {
if (!$id || !isset(self::$notice[$id])) {
$notice = new notice($id, $cb);
if ($id) {
self::$notice[$id] = $notice;
return self::$notice[$id];
}
return $notice;
}
return self::$notice[$id];
}
// constructeur
public function __construct($id=0, $cb='') {
global $dbh;
global $msg;
global $include_path, $class_path ;
global $deflt_notice_is_new;
$this->id = $id+0;
if($this->id) {
$this->libelle_form = $msg[278]; // libelle du form : modification d'une notice
$requete = "SELECT *, date_format(create_date, '".$msg["format_date_heure"]."') as aff_create, date_format(update_date, '".$msg["format_date_heure"]."') as aff_update FROM notices WHERE notice_id='".$this->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->get_isbd();
} 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->get_isbd();
}
if($this->coll_id) {
require_once("$class_path/collection.class.php");
$collection = new collection($this->coll_id);
$this->coll = $collection->get_isbd();
}
if($this->ed1_id) {
$editeur = new editeur($this->ed1_id);
$this->ed1 = $editeur->get_isbd();
}
$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->get_isbd();
}
$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;
if ((trim($notice->date_parution)) && ($notice->date_parution!='0000-00-00')){
$this->date_parution = $notice->date_parution;
} else {
$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;
$this->num_notice_usage = $notice->num_notice_usage;
//liens vers autres notices
$this->notice_link = notice_relations::get_notice_links($this->id, 'm');
$this->commentaire_gestion = $notice->commentaire_gestion;
$this->thumbnail_url = $notice->thumbnail_url;
$this->create_date = $notice->aff_create;
$this->update_date = $notice->aff_update;
} 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->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
if ($notice_parent) {
$this->notice_link['down'][0] = new notice_relation();
$this->notice_link['down'][0]->set_linked_notice($notice_parent);
}
$this->is_new = $deflt_notice_is_new;
// penser au test d'existence de la notice sur code-barre
return;
}
}
// Donne l'id de la notice par son isbn
public static function get_notice_id_from_cb($code) {
if(!$code) return 0;
$isbn = traite_code_isbn($code);
if(isISBN10($isbn)) {
$isbn13 = formatISBN($isbn,13);
$isbn10 = $isbn;
} elseif (isISBN13($isbn)) {
$isbn10 = formatISBN($isbn,10);
$isbn13 = $isbn;
} else {
// ce n'est pas un code au format isbn
$isbn10=$code;
}
$requete = "SELECT notice_id FROM notices WHERE ( code='$isbn10' or code='$isbn13') and code !='' LIMIT 1 ";
if(($result = pmb_mysql_query($requete))) {
if (pmb_mysql_num_rows($result)) {
$notice = pmb_mysql_fetch_object($result);
return($notice->notice_id);
}
}
return 0;
}
//Récupération d'un titre de notice
public static function get_notice_title($notice_id) {
// $requete="select serie_name, tnvol, tit1, code from notices left join series on serie_id=tparent_id where notice_id=".$notice_id;
// $resultat=pmb_mysql_query($requete);
// if (pmb_mysql_num_rows($resultat)) {
// $r=pmb_mysql_fetch_object($resultat);
// return ($r->serie_name?$r->serie_name." ":"").($r->tnvol?$r->tnvol." ":"").$r->tit1.($r->code?" (".$r->code.")":"");
// }
// return '';
$mono_display = new mono_display($notice_id, 0, '', 0, '', '', '',0, 0, 0, 0,"", 0, false, true);
return strip_tags($mono_display->header_texte);
}
public static function get_notice_view_link($notice_id) {
$requete="select niveau_biblio, serie_name, tnvol, tit1, code from notices left join series on serie_id=tparent_id where notice_id=".$notice_id;
$fetch = pmb_mysql_query($requete, $dbh);
if (pmb_mysql_num_rows($fetch)) {
$header_perio='';
$r = pmb_mysql_fetch_object($fetch);
if($r->niveau_biblio == 's'){
// périodique
$link = './catalog.php?categ=serials&sub=view&serial_id='.$notice_id;
}elseif($r->niveau_biblio == 'b') {
// notice de bulletin
$query = 'select bulletin_id, bulletin_notice from bulletins where num_notice = '.$notice_id;
$result = pmb_mysql_query($query,$dbh);
if($result && pmb_mysql_num_rows($result)){
$row = pmb_mysql_fetch_object($result);
$link = './catalog.php?categ=serials&sub=view&sub=bulletinage&action=view&bul_id='.$row->bulletin_id;
$requete_perio="select tit1, code from notices where notice_id=".$row->bulletin_notice;
$fetch_perio = pmb_mysql_query($requete_perio, $dbh);
if (pmb_mysql_num_rows($fetch_perio)) {
$r_perio = pmb_mysql_fetch_object($fetch_perio);
$header_perio= $r_perio->tit1.($r_perio->code?" (".$r_perio->code.") ":" ");
}
}
}else{
// notice de monographie
$link = './catalog.php?categ=isbd&id='.$notice_id;
}
$header= ($r->serie_name?$r->serie_name." ":"").($r->tnvol?$r->tnvol." ":"").$r->tit1.($r->code?" (".$r->code.")":"");
return "".$header_perio.$header."";
}
return '';
}
//Récupérer une date au format AAAA-MM-JJ
public static function get_date_parution($annee) {
return detectFormatDate($annee);
}
// affichage du form associe
public function show_form() {
global $msg;
global $charset;
global $lang;
global $include_path, $class_path;
global $current_module ;
global $pmb_type_audit,$select_categ_prop, $z3950_accessible ;
global $value_deflt_fonction, $value_deflt_relation;
global $thesaurus_mode_pmb ;
global $PMBuserid, $pmb_form_editables,$thesaurus_classement_mode_pmb;
global $xmlta_indexation_lang;
global $thesaurus_concepts_active;
global $pmb_map_activate;
global $pmb_notices_show_dates;
global $thesaurus_categories_affichage_ordre;
include("$include_path/templates/catal_form.tpl.php");
$fonction = new marc_list('function');
// mise a jour de l'action en fonction de l'id
$this->action .= $this->id;
// mise a jour de l'en-tete du formulaire
if (isset($this->notice_mere[0]) && $this->notice_mere[0]) $this->libelle_form.=" ".$msg["catalog_notice_fille_lib"]." ".substr($this->notice_mere[0],0,100).(count($this->notice_mere)>1?", ...":"");
$form_notice = str_replace('!!libelle_form!!', $this->libelle_form, $form_notice);
// mise a jour des flags de niveau hierarchique
$form_notice = str_replace('!!b_level!!', $this->biblio_level, $form_notice);
$form_notice = str_replace('!!h_level!!', $this->hierar_level, $form_notice);
// Titre de la page
$form_notice = str_replace('!!document_title!!', addslashes(($this->tit1 ? $this->tit1.' - ' : '').$this->libelle_form), $form_notice);
// mise a jour de l'onglet 0
$ptab[0] = str_replace('!!tit1!!', htmlentities($this->tit1,ENT_QUOTES, $charset) , $ptab[0]);
$ptab[0] = str_replace('!!tit2!!', htmlentities($this->tit2,ENT_QUOTES, $charset) , $ptab[0]);
$ptab[0] = str_replace('!!tit3!!', htmlentities($this->tit3,ENT_QUOTES, $charset) , $ptab[0]);
$ptab[0] = str_replace('!!tit4!!', htmlentities($this->tit4,ENT_QUOTES, $charset) , $ptab[0]);
$ptab[0] = str_replace('!!tparent_id!!', $this->tparent_id , $ptab[0]);
$ptab[0] = str_replace('!!tparent!!', htmlentities($this->tparent,ENT_QUOTES, $charset) , $ptab[0]);
$ptab[0] = str_replace('!!tnvol!!', htmlentities($this->tnvol,ENT_QUOTES, $charset) , $ptab[0]);
$form_notice = str_replace('!!tab0!!', $ptab[0], $form_notice);
// mise a jour de l'onglet 1
// constitution de la mention de responsabilite
//$this->responsabilites
$as = array_search ("0", $this->responsabilites["responsabilites"]) ;
if ($as!== FALSE && $as!== NULL) {
$auteur_0 = $this->responsabilites["auteurs"][$as] ;
} else {
$auteur_0 = array(
'id' => 0,
'fonction' => ($value_deflt_fonction ? $value_deflt_fonction : ''),
'responsability' => '',
'id_responsability' => 0
);
}
$auteur = new auteur($auteur_0["id"]);
if($pmb_authors_qualification){
$vedette_ui = new vedette_ui(new vedette_composee(vedette_composee::get_vedette_id_from_object($auteur_0["id_responsability"],TYPE_NOTICE_RESPONSABILITY_PRINCIPAL), 'notice_authors'));
$ptab[1] = str_replace('!!vedette_author!!', $vedette_ui->get_form('role', 0, 'notice'), $ptab[1]);
}else{
$ptab[1] = str_replace('!!vedette_author!!', "", $ptab[1]);
}
$ptab[1] = str_replace('!!iaut!!', 0, $ptab[1]);
$ptab[1] = str_replace('!!aut0_id!!', $auteur_0["id"], $ptab[1]);
$ptab[1] = str_replace('!!aut0!!', htmlentities($auteur->get_isbd(),ENT_QUOTES, $charset), $ptab[1]);
$ptab[1] = str_replace('!!f0_code!!', $auteur_0["fonction"], $ptab[1]);
$ptab[1] = str_replace('!!f0!!', ($auteur_0["fonction"] ? $fonction->table[$auteur_0["fonction"]] : ''), $ptab[1]);
$autres_auteurs = '';
$as = array_keys ($this->responsabilites["responsabilites"], "1" ) ;
$max_aut1 = (count($as)) ;
if ($max_aut1==0) $max_aut1=1;
for ($i = 0 ; $i < $max_aut1 ; $i++) {
if (isset($as[$i]) && $as[$i]!== FALSE && $as[$i]!== NULL) {
$indice = $as[$i] ;
$auteur_1 = $this->responsabilites["auteurs"][$indice] ;
} else {
$auteur_1 = array(
'id' => 0,
'fonction' => ($value_deflt_fonction ? $value_deflt_fonction : ''),
'responsability' => '',
'id_responsability' => 0
);
}
$auteur = new auteur($auteur_1["id"]);
$ptab_aut_autres =$ptab[11];
if($i){
$ptab_aut_autres = str_replace('!!bouton_add_display!!', 'display:none', $ptab_aut_autres);
}else{
$ptab_aut_autres = str_replace('!!bouton_add_display!!', '', $ptab_aut_autres);
}
if($pmb_authors_qualification){
$vedette_ui = new vedette_ui(new vedette_composee(vedette_composee::get_vedette_id_from_object($auteur_1["id_responsability"],TYPE_NOTICE_RESPONSABILITY_AUTRE), 'notice_authors'));
$ptab_aut_autres = str_replace('!!vedette_author!!', $vedette_ui->get_form('role_autre', $i, 'notice','',0), $ptab_aut_autres);
}else{
$ptab_aut_autres = str_replace('!!vedette_author!!', "", $ptab_aut_autres);
}
$ptab_aut_autres = str_replace('!!iaut!!', $i, $ptab_aut_autres) ;
$ptab_aut_autres = str_replace('!!aut1_id!!', $auteur_1["id"], $ptab_aut_autres);
$ptab_aut_autres = str_replace('!!aut1!!', htmlentities($auteur->get_isbd(),ENT_QUOTES, $charset), $ptab_aut_autres);
$ptab_aut_autres = str_replace('!!f1_code!!', $auteur_1["fonction"], $ptab_aut_autres);
$ptab_aut_autres = str_replace('!!f1!!', ($auteur_1["fonction"] ? $fonction->table[$auteur_1["fonction"]] : ''), $ptab_aut_autres);
$autres_auteurs .= $ptab_aut_autres ;
}
$ptab[1] = str_replace('!!max_aut1!!', $max_aut1, $ptab[1]);
$auteurs_secondaires = '';
$as = array_keys ($this->responsabilites["responsabilites"], "2" ) ;
$max_aut2 = (count($as)) ;
if ($max_aut2==0) $max_aut2=1;
for ($i = 0 ; $i < $max_aut2 ; $i++) {
if (isset($as[$i]) && $as[$i]!== FALSE && $as[$i]!== NULL) {
$indice = $as[$i] ;
$auteur_2 = $this->responsabilites["auteurs"][$indice] ;
} else {
$auteur_2 = array(
'id' => 0,
'fonction' => ($value_deflt_fonction ? $value_deflt_fonction : ''),
'responsability' => '',
'id_responsability' => 0
);
}
$auteur = new auteur($auteur_2["id"]);
$ptab_aut_autres =$ptab[12];
if($i){
$ptab_aut_autres = str_replace('!!bouton_add_display!!', 'display:none', $ptab_aut_autres);
}else{
$ptab_aut_autres = str_replace('!!bouton_add_display!!', '', $ptab_aut_autres);
}
if($pmb_authors_qualification){
$vedette_ui = new vedette_ui(new vedette_composee(vedette_composee::get_vedette_id_from_object($auteur_2["id_responsability"],TYPE_NOTICE_RESPONSABILITY_SECONDAIRE), 'notice_authors'));
$ptab_aut_autres = str_replace('!!vedette_author!!', $vedette_ui->get_form('role_secondaire', $i, 'notice','',0), $ptab_aut_autres);
}else{
$ptab_aut_autres = str_replace('!!vedette_author!!', "", $ptab_aut_autres);
}
$ptab_aut_autres = str_replace('!!iaut!!', $i, $ptab_aut_autres);
$ptab_aut_autres = str_replace('!!aut2_id!!', $auteur_2["id"], $ptab_aut_autres);
$ptab_aut_autres = str_replace('!!aut2!!', htmlentities($auteur->get_isbd(),ENT_QUOTES, $charset), $ptab_aut_autres);
$ptab_aut_autres = str_replace('!!f2_code!!', $auteur_2["fonction"], $ptab_aut_autres);
$ptab_aut_autres = str_replace('!!f2!!', ($auteur_2["fonction"] ? $fonction->table[$auteur_2["fonction"]] : ''), $ptab_aut_autres);
$auteurs_secondaires .= $ptab_aut_autres ;
}
$ptab[1] = str_replace('!!max_aut2!!', $max_aut2, $ptab[1]);
$ptab[1] = str_replace('!!autres_auteurs!!', $autres_auteurs, $ptab[1]);
$ptab[1] = str_replace('!!auteurs_secondaires!!', $auteurs_secondaires, $ptab[1]);
$form_notice = str_replace('!!tab1!!', $ptab[1], $form_notice);
// mise a jour de l'onglet 2
$ptab[2] = str_replace('!!ed1_id!!', $this->ed1_id , $ptab[2]);
$ptab[2] = str_replace('!!ed1!!', htmlentities($this->ed1,ENT_QUOTES, $charset) , $ptab[2]);
$ptab[2] = str_replace('!!coll_id!!', $this->coll_id , $ptab[2]);
$ptab[2] = str_replace('!!coll!!', htmlentities($this->coll,ENT_QUOTES, $charset) , $ptab[2]);
$ptab[2] = str_replace('!!subcoll_id!!', $this->subcoll_id , $ptab[2]);
$ptab[2] = str_replace('!!subcoll!!', htmlentities($this->subcoll,ENT_QUOTES, $charset) , $ptab[2]);
$ptab[2] = str_replace('!!year!!', $this->year , $ptab[2]);
$ptab[2] = str_replace('!!nocoll!!', htmlentities($this->nocoll,ENT_QUOTES, $charset) , $ptab[2]);
$ptab[2] = str_replace('!!mention_edition!!', htmlentities($this->mention_edition,ENT_QUOTES, $charset) , $ptab[2]);
$ptab[2] = str_replace('!!ed2_id!!', $this->ed2_id , $ptab[2]);
$ptab[2] = str_replace('!!ed2!!', htmlentities($this->ed2,ENT_QUOTES, $charset) , $ptab[2]);
$form_notice = str_replace('!!tab2!!', $ptab[2], $form_notice);
// mise a jour de l'onglet 3
$ptab[3] = str_replace('!!cb!!', $this->code , $ptab[3]);
$ptab[3] = str_replace('!!notice_id!!', $this->id , $ptab[3]);
$form_notice = str_replace('!!tab3!!', $ptab[3], $form_notice);
// Gestion des titres uniformes
global $pmb_use_uniform_title;
if ($pmb_use_uniform_title) {
if($this->duplicate_from_id) $tu=new tu_notice($this->duplicate_from_id);
else $tu=new tu_notice($this->id);
$ptab[230] = str_replace("!!titres_uniformes!!", $tu->get_form("notice"), $ptab[230]);
$form_notice = str_replace('!!tab230!!', $ptab[230], $form_notice);
}
// mise a jour de l'onglet 4
$ptab[4] = str_replace('!!npages!!', htmlentities($this->npages ,ENT_QUOTES, $charset) , $ptab[4]);
$ptab[4] = str_replace('!!ill!!', htmlentities($this->ill ,ENT_QUOTES, $charset) , $ptab[4]);
$ptab[4] = str_replace('!!size!!', htmlentities($this->size ,ENT_QUOTES, $charset) , $ptab[4]);
$ptab[4] = str_replace('!!prix!!', htmlentities($this->prix ,ENT_QUOTES, $charset) , $ptab[4]);
$ptab[4] = str_replace('!!accomp!!', htmlentities($this->accomp ,ENT_QUOTES, $charset) , $ptab[4]);
$form_notice = str_replace('!!tab4!!', $ptab[4], $form_notice);
// mise a jour de l'onglet 5
$ptab[5] = str_replace('!!n_gen!!', htmlentities($this->n_gen ,ENT_QUOTES, $charset) , $ptab[5]);
$ptab[5] = str_replace('!!n_contenu!!', htmlentities($this->n_contenu ,ENT_QUOTES, $charset) , $ptab[5]);
$ptab[5] = str_replace('!!n_resume!!', htmlentities($this->n_resume ,ENT_QUOTES, $charset) , $ptab[5]);
$form_notice = str_replace('!!tab5!!', $ptab[5], $form_notice);
// mise a jour de l'onglet 6
// categories
$categ_repetables = '';
//tri ?
if(($thesaurus_categories_affichage_ordre==0) && count($this->categories)){
$tmp=array();
foreach ( $this->categories as $key=>$value ) {
$tmp[$key]=strip_tags($value['categ_libelle']);
}
$tmp=array_map("convert_diacrit",$tmp);//On enlève les accents
$tmp=array_map("strtoupper",$tmp);//On met en majuscule
asort($tmp);//Tri sur les valeurs en majuscule sans accent
foreach ( $tmp as $key => $value ) {
$tmp[$key]=$this->categories[$key];//On reprend les bons couples
}
$this->categories=array_values($tmp);
}
if (sizeof($this->categories)==0) $max_categ = 1 ;
else $max_categ = sizeof($this->categories) ;
$tab_categ_order="";
for ($i = 0 ; $i < $max_categ ; $i++) {
if(isset($this->categories[$i]["categ_id"]) && $this->categories[$i]["categ_id"]) {
$categ_id = $this->categories[$i]["categ_id"] ;
} else {
$categ_id = 0;
}
$categ = new category($categ_id);
if ($i==0) $ptab_categ = str_replace('!!icateg!!', $i, $ptab[60]) ;
else $ptab_categ = str_replace('!!icateg!!', $i, $ptab[601]) ;
$ptab_categ = str_replace('!!categ_id!!', $categ_id, $ptab_categ);
if ( sizeof($this->categories)==0 ) {
$ptab_categ = str_replace('!!categ_libelle!!', '', $ptab_categ);
} else {
if ($thesaurus_mode_pmb) $nom_thesaurus='['.$categ->thes->getLibelle().'] ' ;
else $nom_thesaurus='' ;
$ptab_categ = str_replace('!!categ_libelle!!', htmlentities($nom_thesaurus.$categ->catalog_form,ENT_QUOTES, $charset), $ptab_categ);
if($tab_categ_order!="")$tab_categ_order.=",";
$tab_categ_order.=$i;
}
$categ_repetables .= $ptab_categ ;
}
$ptab[6] = str_replace('!!max_categ!!', $max_categ, $ptab[6]);
$ptab[6] = str_replace('!!categories_repetables!!', $categ_repetables, $ptab[6]);
$ptab[6] = str_replace('!!tab_categ_order!!', $tab_categ_order, $ptab[6]);
// indexation interne
$ptab[6] = str_replace('!!indexint_id!!', $this->indexint, $ptab[6]);
if ($this->indexint){
$indexint = new indexint($this->indexint);
$ptab[6] = str_replace('!!indexint!!', htmlentities($indexint->get_isbd(),ENT_QUOTES, $charset), $ptab[6]);
$ptab[6] = str_replace('!!num_pclass!!', $indexint->id_pclass, $ptab[6]);
} else {
$ptab[6] = str_replace('!!indexint!!', '', $ptab[6]);
$ptab[6] = str_replace('!!num_pclass!!', '', $ptab[6]);
}
// indexation libre
$ptab[6] = str_replace('!!f_indexation!!', htmlentities($this->index_l,ENT_QUOTES, $charset), $ptab[6]);
global $pmb_keyword_sep ;
//if (!$pmb_keyword_sep) $pmb_keyword_sep=" ";
$sep="'$pmb_keyword_sep'";
if (!$pmb_keyword_sep) $sep="' '";
if(ord($pmb_keyword_sep)==0xa || ord($pmb_keyword_sep)==0xd) $sep=$msg['catalogue_saut_de_ligne'];
$ptab[6] = str_replace("!!sep!!",htmlentities($sep,ENT_QUOTES, $charset),$ptab[6]);
// Indexation concept
if($thesaurus_concepts_active == 1){
if($this->duplicate_from_id) {
$index_concept = new index_concept($this->duplicate_from_id, TYPE_NOTICE);
} else {
$index_concept = new index_concept($this->id, TYPE_NOTICE);
}
$ptab[6] = str_replace('!!index_concept_form!!', $index_concept->get_form("notice"), $ptab[6]);
}else{
$ptab[6] = str_replace('!!index_concept_form!!', "", $ptab[6]);
}
$form_notice = str_replace('!!tab6!!', $ptab[6], $form_notice);
// mise a jour de l'onglet 7 : langues
// langues repetables
$lang_repetables = '';
if (sizeof($this->langues)==0) $max_lang = 1 ;
else $max_lang = sizeof($this->langues) ;
for ($i = 0 ; $i < $max_lang ; $i++) {
if ($i) $ptab_lang = str_replace('!!ilang!!', $i, $ptab[701]) ;
else $ptab_lang = str_replace('!!ilang!!', $i, $ptab[70]) ;
if ( sizeof($this->langues)==0 ) {
$ptab_lang = str_replace('!!lang_code!!', '', $ptab_lang);
$ptab_lang = str_replace('!!lang!!', '', $ptab_lang);
} else {
$ptab_lang = str_replace('!!lang_code!!', $this->langues[$i]["lang_code"], $ptab_lang);
$ptab_lang = str_replace('!!lang!!',htmlentities($this->langues[$i]["langue"],ENT_QUOTES, $charset), $ptab_lang);
}
$lang_repetables .= $ptab_lang ;
}
$ptab[7] = str_replace('!!max_lang!!', $max_lang, $ptab[7]);
$ptab[7] = str_replace('!!langues_repetables!!', $lang_repetables, $ptab[7]);
// langues originales repetables
$langorg_repetables = '';
if (sizeof($this->languesorg)==0) $max_langorg = 1 ;
else $max_langorg = sizeof($this->languesorg) ;
for ($i = 0 ; $i < $max_langorg ; $i++) {
if ($i) $ptab_lang = str_replace('!!ilangorg!!', $i, $ptab[711]) ;
else $ptab_lang = str_replace('!!ilangorg!!', $i, $ptab[71]) ;
if ( sizeof($this->languesorg)==0 ) {
$ptab_lang = str_replace('!!langorg_code!!', '', $ptab_lang);
$ptab_lang = str_replace('!!langorg!!', '', $ptab_lang);
} else {
$ptab_lang = str_replace('!!langorg_code!!', $this->languesorg[$i]["lang_code"], $ptab_lang);
$ptab_lang = str_replace('!!langorg!!',htmlentities($this->languesorg[$i]["langue"],ENT_QUOTES, $charset), $ptab_lang);
}
$langorg_repetables .= $ptab_lang ;
}
$ptab[7] = str_replace('!!max_langorg!!', $max_langorg, $ptab[7]);
$ptab[7] = str_replace('!!languesorg_repetables!!', $langorg_repetables, $ptab[7]);
$form_notice = str_replace('!!tab7!!', $ptab[7], $form_notice);
// mise a jour de l'onglet 8
global $pmb_curl_timeout;
$ptab[8] = str_replace('!!lien!!', htmlentities($this->lien ,ENT_QUOTES, $charset) , $ptab[8]);
$ptab[8] = str_replace('!!eformat!!', htmlentities($this->eformat ,ENT_QUOTES, $charset) , $ptab[8]);
$ptab[8] = str_replace('!!pmb_curl_timeout!!', $pmb_curl_timeout , $ptab[8]);
$form_notice = str_replace('!!tab8!!', thumbnail::get_js_function_chklnk_tpl().$ptab[8], $form_notice);
//Mise a jour de l'onglet 9
$p_perso=new parametres_perso("notices");
if (!$p_perso->no_special_fields) {
// si on duplique, construire le formulaire avec les donnees de la notice d'origine
if ($this->duplicate_from_id) $perso_=$p_perso->show_editable_fields($this->duplicate_from_id);
else $perso_=$p_perso->show_editable_fields($this->id);
$perso="";
for ($i=0; $i
".$p["COMMENT_DISPLAY"]."
".$p["AFF"]."
";
}
}
}
}
}
}
}
$perso.=$perso_["CHECK_SCRIPTS"];
$ptab[9]=str_replace("!!champs_perso!!",$perso,$ptab[9]);
} else
$ptab[9]="\n\n";
$form_notice = str_replace('!!tab9!!', $ptab[9], $form_notice);
//------------------------------------------
//Mise a jour de l'onglet 9
$p_perso1=new parametres_perso("notices");
if (!$p_perso1->no_special_fields) {
// si on duplique, construire le formulaire avec les donnees de la notice d'origine
if ($this->duplicate_from_id) $perso1_=$p_perso1->show_editable_fields($this->duplicate_from_id);
else $perso1_=$p_perso1->show_editable_fields($this->id);
$perso1="";
for ($i=0; $i
".$p["COMMENT_DISPLAY"]."
".$p["AFF"]."
";
}else{
if (strncmp($p["NAME"], $c2,6)== 0) {
$perso1.="
".$p["COMMENT_DISPLAY"]."
".$p["AFF"]."
";
}else {
if (strncmp($p["NAME"], $c3,6)== 0) {
$perso1.="
".$p["COMMENT_DISPLAY"]."
".$p["AFF"]."
";
}else{
if (strncmp($p["NAME"], $c4,6)== 0) {
$perso1.="
".$p["COMMENT_DISPLAY"]."
".$p["AFF"]."
";
}else{
if (strncmp($p["NAME"], $c5,6)== 0) {
$perso1.="
".$p["COMMENT_DISPLAY"]."
".$p["AFF"]."
";
}else{
if (strncmp($p["NAME"], $c6,6)== 0) {
$perso1.="