id = $id+0; $this->getData(); } // --------------------------------------------------------------- // getData() : récupération infos collection // --------------------------------------------------------------- public function getData() { global $charset; $this->name = ''; $this->parent = ''; $this->publisher_libelle = ''; $this->publisher_isbd = ''; $this->display = ''; $this->issn = ''; $this->isbd_entry = ''; $this->collection_web = ''; $this->collection_web_link = "" ; $this->comment = "" ; $this->num_statut = 1; if($this->id) { $requete = "SELECT * FROM collections WHERE collection_id='".$this->id."'"; $result = @pmb_mysql_query($requete); if(pmb_mysql_num_rows($result)) { $row = pmb_mysql_fetch_object($result); $this->id = $row->collection_id; $this->name = $row->collection_name; $this->parent = $row->collection_parent; $this->issn = $row->collection_issn; $this->collection_web= $row->collection_web; $this->comment= $row->collection_comment; $this->num_statut = $this->get_authority()->get_num_statut(); if($row->collection_web) $this->collection_web_link = " "; $publisher = authorities_collection::get_authority('publisher', $this->parent); $this->publisher_isbd = $publisher->get_isbd(); $this->publisher_libelle = $publisher->name; $this->isbd_entry = $this->issn ? $this->name.', ISSN '.$this->issn : $this->name; $this->display = $this->name.' ('.$this->publisher_libelle.')'; } } } // --------------------------------------------------------------- // print_resume($level) : affichage d'informations sur la collection // --------------------------------------------------------------- public function print_resume($level = 2,$css='') { global $css; global $msg; if(!$this->id) return; // adaptation par rapport au niveau de détail souhaité switch ($level) { // case x : case 2 : default : global $collection_level2_display; global $collection_level2_no_issn_info; $collection_display = $collection_level2_display; $collection_no_issn_info = $collection_level2_no_issn_info; break; } $print = $collection_display; // remplacement des champs statiques $print = str_replace("!!name!!", $this->name." ".$this->collection_web_link, $print); $print = str_replace("!!issn!!", $this->issn ? $this->issn : $collection_no_issn_info, $print); $print = str_replace("!!publ!!", $this->publisher_libelle, $print); $print = str_replace("!!publ_isbd!!", $this->publisher_isbd, $print); $print = str_replace("!!isbd!!", $this->isbd_entry, $print); $print = str_replace("!!comment!!", nl2br($this->comment), $print); // remplacement des champs dynamiques if (preg_match("#!!publisher!!#", $print)) { $remplacement = "$this->publisher_libelle"; $print = str_replace("!!publisher!!", $remplacement, $print); } if (preg_match("#!!subcolls!!#", $print)) { global $dbh; $query = "select sub_coll_id, sub_coll_name from sub_collections where sub_coll_parent=".$this->id; $result = pmb_mysql_query($query, $dbh); if(pmb_mysql_num_rows($result)) { $remplacement = $msg["subcollection_attached"]."\n