id = $id+0; $this->getData(); } // --------------------------------------------------------------- // getData() : recuperation infos editeurs // --------------------------------------------------------------- public function getData() { $this->name = ''; $this->adr1 = ''; $this->adr2 = ''; $this->cp = ''; $this->ville = ''; $this->pays = ''; $this->web = ''; $this->link = ''; $this->display = ''; $this->isbd_entry = ''; $this->ed_comment = ''; $this->num_statut = 1; if($this->id) { $requete = "SELECT * FROM publishers WHERE ed_id='".$this->id."'"; $result = pmb_mysql_query($requete); if (pmb_mysql_num_rows($result)) { $row = pmb_mysql_fetch_object($result); $this->id = $row->ed_id; $this->name = $row->ed_name; $this->adr1 = $row->ed_adr1; $this->adr2 = $row->ed_adr2; $this->cp = $row->ed_cp; $this->ville = $row->ed_ville; $this->pays = $row->ed_pays; $this->web = $row->ed_web; $this->ed_comment = $row->ed_comment; $this->num_statut = $this->get_authority()->get_num_statut(); if ($this->web) { $this->link = "$this->web"; } // Détermine le lieu de publication $l = ''; if ($this->adr1) $l = $this->adr1; if ($this->adr2) $l = ($l=='') ? $this->adr2 : $l.', '.$this->adr2; if ($this->cp) $l = ($l=='') ? $this->cp : $l.', '.$this->cp; if ($this->pays) $l = ($l=='') ? $this->pays : $l.', '.$this->pays; if ($this->ville) $l = ($l=='') ? $this->ville : $this->ville.' ('.$l.')'; if ($l=='') $l = '[S.l.]'; // Détermine le nom de l'éditeur if ($this->name) $n = $this->name; else $n = '[S.n.]'; // Constitue l'ISBD pour le coupe lieu/éditeur if ($l == '[S.l.]' AND $n == '[S.n.]') $this->isbd_entry = '[S.l. : s.n.]'; else $this->isbd_entry = $l.' : '.$n; //On fait en sorte que le ne nous embête pas à l'affichage global $charset; $this->isbd_entry = html_entity_decode($this->isbd_entry,ENT_QUOTES, $charset); if ($this->ville) { if ($this->pays) $this->display = "$this->ville [$this->pays] : $this->name"; else $this->display = "$this->ville : $this->name"; } else { $this->display = $this->name; } } } } // --------------------------------------------------------------- // print_resume($level) : affichage d'informations sur la collection // --------------------------------------------------------------- public function print_resume($level = 2,$css='') { global $css,$msg; if(!$this->id) return; // adaptation par rapport au niveau de détail souhaité switch ($level) { // case x : case 2 : default : global $publisher_level2_display; $publisher_display = $publisher_level2_display; break; } $print = $publisher_display; // remplacement des champs statiques $print = str_replace("!!id!!", $this->id, $print); $print = str_replace("!!name!!", $this->name, $print); $print = str_replace("!!adr1!!", $this->adr1, $print); $print = str_replace("!!adr2!!", $this->adr2, $print); $print = str_replace("!!cp!!", $this->cp, $print); $print = str_replace("!!ville!!", $this->ville, $print); $print = str_replace("!!pays!!", $this->pays, $print); if ($this->web) $print = str_replace("!!site_web!!", "", $print); else $print = str_replace("!!site_web!!", "", $print); $print = str_replace("!!isbd!!", $this->isbd_entry, $print); $print = str_replace("!!aut_comment!!", $this->ed_comment, $print); if (preg_match("#!!colls!!#", $print)) { global $dbh; $query = "select collection_id, collection_name from collections where collection_parent='".$this->id."' order by index_coll"; $result = pmb_mysql_query($query, $dbh); if(pmb_mysql_num_rows($result)) { $remplacement = $msg['publishers_collections']."\n