public function get_datas()
 {
     global $opac_url_base;
     global $opac_show_book_pics;
     global $opac_book_pics_url;
     $datas = parent::get_datas();
     $notices = $datas['records'];
     $query = "select notice_id,tit1,thumbnail_url,code from notices where notice_id in(" . implode(",", $notices) . ")";
     $result = pmb_mysql_query($query);
     $notices = array();
     if (pmb_mysql_num_rows($result)) {
         while ($row = pmb_mysql_fetch_object($result)) {
             if ($opac_show_book_pics == '1' && ($opac_book_pics_url || $row->thumbnail_url)) {
                 $code_chiffre = pmb_preg_replace('/-|\\.| /', '', $row->code);
                 $url_image = $opac_book_pics_url;
                 $url_image = $opac_url_base . "getimage.php?url_image=" . urlencode($url_image) . "&noticecode=!!noticecode!!&vigurl=" . urlencode($row->thumbnail_url);
                 if ($row->thumbnail_url) {
                     $url_vign = $row->thumbnail_url;
                 } else {
                     if ($code_chiffre) {
                         $url_vign = str_replace("!!noticecode!!", $code_chiffre, $url_image);
                     } else {
                         $url_vign = $opac_url_base . "images/vide.png";
                     }
                 }
             }
             $notices[] = array('title' => $row->tit1, 'link' => $opac_url_base . "?lvl=notice_display&id=" . $row->notice_id, 'vign' => $url_vign);
         }
     }
     return array('records' => $notices);
 }
 public function get_datas()
 {
     global $opac_show_book_pics;
     global $opac_book_pics_url;
     global $opac_url_base;
     //on commence par récupérer l'identifiant retourné par le sélecteur...
     if ($this->parameters['selector'] != "") {
         for ($i = 0; $i < count($this->selectors); $i++) {
             if ($this->selectors[$i]['name'] == $this->parameters['selector']) {
                 $selector = new $this->parameters['selector']($this->selectors[$i]['id']);
                 break;
             }
         }
         $notice = $selector->get_value();
         if (is_array($notice)) {
             $notice = $notice[0];
         }
         if ($notice) {
             $group_metadatas = parent::get_group_metadatas();
             $datas = array();
             $notice_class = new notice($notice);
             if ($opac_show_book_pics == '1' && ($opac_book_pics_url || $notice_class->thumbnail_url)) {
                 $code_chiffre = pmb_preg_replace('/-|\\.| /', '', $notice_class->code);
                 $url_image = $opac_book_pics_url;
                 $url_image = $opac_url_base . "getimage.php?url_image=" . urlencode($url_image) . "&noticecode=!!noticecode!!&vigurl=" . urlencode($notice_class->thumbnail_url);
                 if ($notice_class->thumbnail_url) {
                     $url_vign = $notice_class->thumbnail_url;
                 } else {
                     if ($code_chiffre) {
                         $url_vign = str_replace("!!noticecode!!", $code_chiffre, $url_image);
                     } else {
                         $url_vign = $opac_url_base . "images/vide.png";
                     }
                 }
             }
             $datas = array('id' => $notice_class->id, 'title' => $notice_class->tit1, 'link' => $this->get_constructed_link("notice", $notice_class->id), 'logo_url' => $url_vign, 'header' => $notice_class->notice_header, 'resume' => $notice_class->n_resume, 'content' => $content, 'type' => 'notice');
             $datas["details"] = $datas;
             $datas = array_merge($datas, parent::get_datas());
             $datas['link'] = $this->get_constructed_link("notice", $notice_class->id);
             foreach ($group_metadatas as $i => $metadatas) {
                 if (is_array($metadatas["metadatas"])) {
                     foreach ($metadatas["metadatas"] as $key => $value) {
                         try {
                             $group_metadatas[$i]["metadatas"][$key] = H2o::parseString($value)->render($datas);
                         } catch (Exception $e) {
                         }
                     }
                 }
             }
             return $group_metadatas;
         }
     }
     return false;
 }
 public function render($datas)
 {
     global $opac_notice_affichage_class;
     global $opac_show_book_pics;
     global $opac_book_pics_url;
     global $opac_book_pics_msg;
     if (!$opac_notice_affichage_class) {
         $opac_notice_affichage_class = "notice_affichage";
     }
     //on rajoute nos éléments...
     //le titre
     $render_datas = array();
     $render_datas['title'] = $datas["title"];
     $render_datas['records'] = array();
     if (is_array($datas["records"])) {
         foreach ($datas["records"] as $notice) {
             //on calcule les templates pour chaque notices...
             $notice_class = new $opac_notice_affichage_class($notice);
             $notice_class->do_header();
             if ($notice_class->notice->niveau_biblio != "b") {
                 $notice_id = $notice_class->notice_id;
                 $is_bulletin = false;
             } else {
                 $notice_id = $notice_class->bulletin_id;
                 $is_bulletin = true;
             }
             if ($opac_show_book_pics == '1' && ($opac_book_pics_url || $notice_class->notice->thumbnail_url)) {
                 $code_chiffre = pmb_preg_replace('/-|\\.| /', '', $notice_class->notice->code);
                 $url_image = $opac_book_pics_url;
                 $url_image = $opac_url_base . "getimage.php?url_image=" . urlencode($url_image) . "&noticecode=!!noticecode!!&vigurl=" . urlencode($notice_class->notice->thumbnail_url);
                 if ($notice_class->notice->thumbnail_url) {
                     $url_vign = $notice_class->notice->thumbnail_url;
                 } else {
                     if ($code_chiffre) {
                         $url_vign = str_replace("!!noticecode!!", $code_chiffre, $url_image);
                     } else {
                         $url_vign = $opac_url_base . "images/vide.png";
                     }
                 }
             }
             $infos = array('id' => $notice_id, 'title' => $notice_class->notice->tit1, 'vign' => $url_vign, 'header' => $notice_class->notice_header, 'link' => $this->get_constructed_link("notice", $notice_id, $is_bulletin));
             if ($this->parameters['used_template']) {
                 $tpl = new notice_tpl_gen($this->parameters['used_template']);
                 $infos['content'] = $tpl->build_notice($notice);
             } else {
                 $notice_class->do_isbd();
                 $infos['content'] = $notice_class->notice_isbd;
             }
             $render_datas['records'][] = $infos;
         }
     }
     //on rappelle le tout...
     return parent::render($render_datas);
 }
 public function render($records)
 {
     $datas = array();
     global $opac_url_base;
     global $opac_show_book_pics;
     global $opac_book_pics_url;
     global $opac_notice_affichage_class;
     if (!$opac_notice_affichage_class) {
         $opac_notice_affichage_class = "notice_affichage";
     }
     if (is_array($records['records']) && count($records['records'])) {
         $query = "select notice_id,tit1,thumbnail_url,code from notices where notice_id in (" . implode(",", $records['records']) . ") order by field( notice_id, " . implode(",", $records['records']) . ")";
         $result = pmb_mysql_query($query);
         if ($result && pmb_mysql_num_rows($result)) {
             while ($row = pmb_mysql_fetch_object($result)) {
                 if ($opac_show_book_pics == '1' && ($opac_book_pics_url || $row->thumbnail_url)) {
                     $code_chiffre = pmb_preg_replace('/-|\\.| /', '', $row->code);
                     $url_image = $opac_book_pics_url;
                     $url_image = $opac_url_base . "getimage.php?url_image=" . urlencode($url_image) . "&noticecode=!!noticecode!!&vigurl=" . urlencode($row->thumbnail_url);
                     if ($row->thumbnail_url) {
                         $url_vign = $row->thumbnail_url;
                     } else {
                         if ($code_chiffre) {
                             $url_vign = str_replace("!!noticecode!!", $code_chiffre, $url_image);
                         } else {
                             $url_vign = get_url_icon("vide.png", 1);
                         }
                     }
                 }
                 $notice_class = new $opac_notice_affichage_class($row->notice_id, "");
                 $notice_class->do_header();
                 if ($this->parameters['used_template']) {
                     $tpl = new notice_tpl_gen($this->parameters['used_template']);
                     $content = $tpl->build_notice($row->notice_id);
                 } else {
                     $notice_class->do_isbd();
                     $content = $notice_class->notice_isbd;
                 }
                 $datas[] = array('id' => $row->notice_id, 'title' => $row->tit1, 'link' => $this->get_constructed_link("notice", $row->notice_id), 'vign' => $url_vign, 'header' => $notice_class->notice_header, 'content' => $content);
             }
         }
     }
     $datas = array('title' => $records['title'], 'records' => $datas);
     return parent::render($datas);
 }
 /**
  * Génération de la structure de données representant les items de type notice
  * @return array
  */
 protected function get_items_datas($items)
 {
     global $pmb_opac_url, $pmb_keyword_sep;
     global $opac_show_book_pics, $opac_book_pics_url;
     $records = array();
     if (count($items)) {
         foreach ($items as $item) {
             $notice = new notice($item);
             $record = array();
             $record["num_notice"] = $notice->id;
             $record["title"] = $notice->tit1;
             $record["summary"] = $notice->n_resume;
             $record["content"] = $notice->n_resume;
             $record["url"] = $pmb_opac_url . "index.php?lvl=notice_display&id=" . $notice->id;
             if ($notice->code || $notice->thumbnail_url) {
                 if ($opac_show_book_pics == '1' && ($opac_book_pics_url || $notice->thumbnail_url)) {
                     $code_chiffre = pmb_preg_replace('/-|\\.| /', '', $notice->code);
                     $url_image = $opac_book_pics_url;
                     $url_image = $pmb_opac_url . "getimage.php?url_image=" . urlencode($url_image) . "&amp;noticecode=!!noticecode!!&amp;vigurl=" . urlencode($notice->thumbnail_url);
                     if ($notice->thumbnail_url) {
                         $logo_url = $notice->thumbnail_url;
                     } else {
                         $logo_url = str_replace("!!noticecode!!", $code_chiffre, $url_image);
                     }
                 } else {
                     $logo_url = "";
                 }
             }
             $record["logo_url"] = $logo_url;
             $record["publication_date"] = $notice->date_parution;
             $record["descriptors"] = $notice->categories;
             $record["tags"] = $notice->index_l ? explode($pmb_keyword_sep, $notice->index_l) : "";
             $records[] = $record;
         }
     }
     return $records;
 }
Example #6
0
function window_title($title = 'PMB')
{
    $title = pmb_preg_replace('/\\"/m', "'", $title);
    return "<script type='text/javascript'>document.title=\"{$title}\";window.status=\"{$title}\";</script>";
}
Example #7
0
 /**
  * Retourne l'URL calculée de l'image
  * @return string
  */
 public function get_picture_url()
 {
     if (!$this->picture_url && ($this->get_code() || $this->get_thumbnail_url())) {
         global $opac_show_book_pics, $opac_book_pics_url;
         global $opac_url_base;
         if ($opac_show_book_pics == '1' && ($opac_book_pics_url || $this->get_thumbnail_url())) {
             if ($this->get_thumbnail_url()) {
                 $this->picture_url = $this->get_thumbnail_url();
             } else {
                 $code_chiffre = pmb_preg_replace('/-|\\.| /', '', $this->get_code());
                 $url_image = $opac_book_pics_url;
                 $url_image = $opac_url_base . "getimage.php?url_image=" . urlencode($url_image) . "&noticecode=!!noticecode!!&vigurl=" . urlencode($this->get_thumbnail_url());
                 $this->picture_url = str_replace("!!noticecode!!", $code_chiffre, $url_image);
             }
         }
     }
     if (!$this->picture_url) {
         $this->picture_url = get_url_icon("no_image.jpg");
     }
     return $this->picture_url;
 }
function test_other_query($n_res = 0, $n_gen = 0, $n_tit = 0, $n_mat = 0, $query, $operator = TRUE, $force_regexp = FALSE)
{
    // fonction d'analyse d'une recherche sur titre
    // la fonction retourne un tableau :
    $query_result = array('type' => 0, 'restr' => '', 'order' => '', 'display', 'nbr_rows' => 0);
    // $query_result['type'] = type de la requête :
    // 0 : rien (problème)
    // 1: match/against
    // 2: regexp
    // 3: regexp pure sans traitement
    // $query_result['restr'] = critères de restriction
    // $query_result['order'] = critères de tri
    // $query_result['nbr_rows'] = nombre de lignes qui matchent
    // $query_result['display'] = affichage en clair de la requête utilisateur
    // si operator TRUE La recherche est booléenne AND
    // si operator FALSE La recherche est booléenne OR
    // si force_regexp : la recherche est forcée en mode regexp
    $stopwords = FALSE;
    global $dbh;
    // initialisation opérateur
    $operator ? $dopt = 'AND' : ($dopt = 'OR');
    $query = pmb_strtolower($query);
    // espaces en début et fin
    $query = pmb_preg_replace('/^\\s+|\\s+$/', '', $query);
    // espaces en double
    $query = pmb_preg_replace('/\\s+/', ' ', $query);
    // contrôle de la requete
    if (!$query) {
        return $query_result;
    }
    // déterminer si la requête est une regexp
    // si c'est le cas, on utilise la saisie utilisateur sans modification
    // (on part du principe qu'il sait ce qu'il fait)
    if (pmb_preg_match('/\\^|\\$|\\[|\\]|\\.|\\*|\\{|\\}|\\|/', $query)) {
        // regexp pure : pas de modif de la saisie utilisateur
        $query_result['type'] = 3;
        if ($n_res) {
            $query_result['restr'] = "n_resume REGEXP '{$query}' OR n_contenu REGEXP '{$query}' ";
        } else {
            $query_result['restr'] = "";
        }
        if ($n_gen) {
            if ($query_result['restr']) {
                $query_result['restr'] .= " OR ";
            }
            $query_result['restr'] .= " n_gen REGEXP '{$query}'";
        }
        if ($n_tit) {
            if ($query_result['restr']) {
                $query_result['restr'] .= " OR ";
            }
            $query_result['restr'] .= " tit1 REGEXP '{$query}' OR tit2 REGEXP '{$query}' OR tit3 REGEXP '{$query}' OR tit4 REGEXP '{$query}' OR index_serie REGEXP '{$query}' ";
        }
        if ($n_mat) {
            if ($query_result['restr']) {
                $query_result['restr'] .= " OR ";
            }
            $query_result['restr'] .= " index_l REGEXP '{$query}' ";
        }
        $query_result['order'] = "index_serie ASC, tnvol ASC, index_sew ASC";
        $query_result['display'] = $query;
    } else {
        // nettoyage de la chaîne
        $query = pmb_preg_replace("/[\\(\\)\\,\\;\\'\\!\\-\\+]/", ' ', $query);
        // on supprime les mots vides
        $query = strip_empty_words($query);
        // contrôle de la requete
        if (!$query) {
            return $query_result;
        }
        // la saisie est splitée en un tableau
        $tab = pmb_split('/\\s+/', $query);
        // on cherche à détecter les mots de moins de 4 caractères (stop words)
        // si il y des mots remplissant cette condition, c'est la méthode regexp qui sera employée
        foreach ($tab as $dummykey => $word) {
            if (pmb_strlen($word) < 4) {
                $stopwords = TRUE;
                break;
            }
        }
        if ($stopwords || $force_regexp) {
            // méthode REGEXP
            $query_result['type'] = 2;
            // constitution du membre restricteur
            // premier mot
            if ($n_res) {
                $query_result['restr'] = "( n_resume REGEXP '{$tab[0]}' OR n_contenu REGEXP '{$tab[0]}' ";
            } else {
                $query_result['restr'] = "";
            }
            if ($n_gen) {
                if ($query_result['restr']) {
                    $query_result['restr'] .= " OR  n_gen REGEXP '{$tab[0]}'";
                } else {
                    $query_result['restr'] = "( n_gen REGEXP '{$tab[0]}'";
                }
            }
            if ($n_tit) {
                if ($query_result['restr']) {
                    $query_result['restr'] .= " OR tit1 REGEXP '{$tab[0]}' OR tit2 REGEXP '{$tab[0]}' OR tit3 REGEXP '{$tab[0]}' OR tit4 REGEXP '{$tab[0]}' OR index_serie REGEXP '{$tab[0]}'";
                } else {
                    $query_result['restr'] = "( tit1 REGEXP '{$tab[0]}' OR tit2 REGEXP '{$tab[0]}' OR tit3 REGEXP '{$tab[0]}' OR tit4 REGEXP '{$tab[0]}' OR index_serie REGEXP '{$tab[0]}' ";
                }
            }
            if ($n_mat) {
                if ($query_result['restr']) {
                    $query_result['restr'] .= " OR index_l REGEXP '{$tab[0]}' ";
                } else {
                    $query_result['restr'] = "( index_l REGEXP '{$tab[0]}' ";
                }
            }
            $query_result['restr'] .= ") ";
            //$query_result['restr'] = "(n_resume REGEXP '${tab[0]}'";
            //$query_result['restr'] .= " OR n_contenu REGEXP '$tab[0]')";
            $query_result['display'] = $tab[0];
            for ($i = 1; $i < sizeof($tab); $i++) {
                $query_suite = "";
                if ($n_res) {
                    $query_suite = " ( n_resume REGEXP '{$tab[$i]}' OR n_contenu REGEXP '{$tab[$i]}' ";
                }
                if ($n_gen) {
                    if ($query_suite) {
                        $query_suite .= " OR  n_gen REGEXP '{$tab[$i]}'";
                    } else {
                        $query_suite = "( n_gen REGEXP '{$tab[$i]}'";
                    }
                }
                if ($n_tit) {
                    if ($query_suite) {
                        $query_suite .= " OR tit1 REGEXP '{$tab[$i]}' OR tit2 REGEXP '{$tab[$i]}' OR tit3 REGEXP '{$tab[$i]}' OR tit4 REGEXP '{$tab[$i]}' OR index_serie REGEXP '{$tab[$i]}'";
                    } else {
                        $query_suite = "( tit1 REGEXP '{$tab[$i]}' OR tit2 REGEXP '{$tab[$i]}' OR tit3 REGEXP '{$tab[$i]}' OR tit4 REGEXP '{$tab[$i]}' OR index_serie REGEXP '{$tab[$i]}' ";
                    }
                }
                if ($n_mat) {
                    if ($query_suite) {
                        $query_suite .= " OR index_l REGEXP '{$tab[$i]}' ";
                    } else {
                        $query_suite = "( index_l REGEXP '{$tab[$i]}' ";
                    }
                }
                if ($query_suite) {
                    $query_suite .= " ) ";
                    $query_result['restr'] .= " {$dopt} " . $query_suite;
                }
                //$query_result['restr'] .= " $dopt (n_resume REGEXP '${tab[$i]}'";
                //$query_result['restr'] .= " OR n_contenu REGEXP '${tab[$i]}')";
                $query_result['display'] .= " {$dopt} {$tab[$i]}";
            }
            //echo "<br /><br /><br />".$query_result['restr']."<br /><br /><br />";
            // contitution de la clause de tri
            $query_result['order'] = "index_serie ASC, tnvol ASC, index_sew ASC";
        } else {
            // méthode FULLTEXT
            $query_result['type'] = 1;
            // membre restricteur
            if ($n_res) {
                $query_result['restr'] = "( MATCH (n_resume, n_contenu) AGAINST ('{$tab[0]}') ";
            } else {
                $query_result['restr'] = "";
            }
            if ($n_gen) {
                if ($query_result['restr']) {
                    $query_result['restr'] .= " OR MATCH (n_gen) AGAINST ('{$tab[0]}') ";
                } else {
                    $query_result['restr'] = "( MATCH (n_gen) AGAINST ('{$tab[0]}') ";
                }
            }
            if ($n_tit) {
                if ($query_result['restr']) {
                    $query_result['restr'] .= " OR MATCH (index_wew) AGAINST ('{$tab[0]}') ";
                } else {
                    $query_result['restr'] = "( MATCH (index_wew) AGAINST ('{$tab[0]}')  ";
                }
            }
            if ($n_mat) {
                if ($query_result['restr']) {
                    $query_result['restr'] .= " OR MATCH (index_matieres) AGAINST ('{$tab[0]}') ";
                } else {
                    $query_result['restr'] = "( MATCH (index_matieres) AGAINST ('{$tab[0]}') ";
                }
            }
            $query_result['restr'] .= ") ";
            //$query_result['restr'] = "MATCH (n_resume, n_contenu) AGAINST ('${tab[0]}')";
            $query_result['display'] = $tab[0];
            for ($i = 1; $i < sizeof($tab); $i++) {
                $query_suite = "";
                if ($n_res) {
                    $query_suite = " ( MATCH (n_resume, n_contenu) AGAINST ('{$tab[$i]}') ";
                }
                if ($n_gen) {
                    if ($query_suite) {
                        $query_suite .= " OR MATCH (n_gen) AGAINST ('{$tab[$i]}') ";
                    } else {
                        $query_suite = "( MATCH (n_gen) AGAINST ('{$tab[$i]}')";
                    }
                }
                if ($n_tit) {
                    if ($query_suite) {
                        $query_suite .= " OR MATCH (index_wew) AGAINST ('{$tab[$i]}') ";
                    } else {
                        $query_suite = "( MATCH (index_wew) AGAINST ('{$tab[$i]}') ";
                    }
                }
                if ($n_mat) {
                    if ($query_suite) {
                        $query_suite .= " OR MATCH (index_matieres) AGAINST ('{$tab[$i]}') ";
                    } else {
                        $query_suite = "( MATCH (index_matieres) AGAINST ('{$tab[$i]}') ";
                    }
                }
                if ($query_suite) {
                    $query_suite .= " ) ";
                    $query_result['restr'] .= " {$dopt} " . $query_suite;
                }
                //$query_result['restr'] .= " $dopt MATCH";
                //$query_result['restr'] .= " (n_resume, n_contenu)";
                //$query_result['restr'] .= " AGAINST ('${tab[$i]}')";
                $query_result['display'] .= " {$dopt} {$tab[$i]}";
            }
            // membre de tri
            $query_result['order'] = "index_serie ASC, tnvol ASC, index_sew ASC";
        }
    }
    // récupération du nombre de lignes
    $rws = "SELECT count(1) FROM notices WHERE {$query_result['restr']}";
    $result = @pmb_mysql_query($rws, $dbh);
    $query_result['nbr_rows'] = pmb_mysql_result($result, 0, 0);
    return $query_result;
}
 /**
  * Getter
  *
  * @return string
  * @access public
  */
 public function get_abbreviation()
 {
     return pmb_preg_replace('/\\s+/', '', $this->abbreviation);
 }
 public function get_datas()
 {
     global $opac_url_base;
     global $opac_show_book_pics;
     global $opac_book_pics_url;
     global $dbh;
     //on commence par récupérer le type et le sous-type de page...
     $type_page_opac = cms_module_common_datasource_typepage_opac::get_type_page();
     $subtype_page_opac = cms_module_common_datasource_typepage_opac::get_subtype_page();
     if ($type_page_opac && $subtype_page_opac) {
         $group_metadatas = parent::get_group_metadatas();
         $datas = array();
         $query = $this->get_query();
         if ($query) {
             $post = $_POST;
             $get = $_GET;
             if ($post['lvl']) {
                 $niveau = $post['lvl'];
             } elseif ($get['lvl']) {
                 $niveau = $get['lvl'];
             } else {
                 $niveau = '';
             }
             $result = pmb_mysql_query($query, $dbh);
             while ($row = pmb_mysql_fetch_object($result)) {
                 $datas["id"] = $row->id;
                 $datas["title"] = $row->title;
                 $datas["resume"] = $row->resume;
                 if ($opac_show_book_pics == '1' && ($opac_book_pics_url || $row->logo_url)) {
                     $code_chiffre = pmb_preg_replace('/-|\\.| /', '', $row->code);
                     $url_image = $opac_book_pics_url;
                     $url_image = $opac_url_base . "getimage.php?url_image=" . urlencode($url_image) . "&noticecode=!!noticecode!!&vigurl=" . urlencode($row->logo_url);
                     if ($row->logo_url) {
                         $url_vign = $row->logo_url;
                     } else {
                         if ($code_chiffre) {
                             $url_vign = str_replace("!!noticecode!!", $code_chiffre, $url_image);
                         } else {
                             $url_vign = $opac_url_base . "images/vide.png";
                         }
                     }
                 }
                 $datas["logo_url"] = $url_vign;
                 $datas["link"] = $opac_url_base . "index.php?lvl=" . $niveau . "&id=" . $row->id;
                 $datas["type"] = $row->type;
             }
         }
         $datas["details"] = array('type_page' => cms_module_common_datasource_typepage_opac::get_label($type_page_opac), 'subtype_page' => cms_module_common_datasource_typepage_opac::get_label($subtype_page_opac));
         $datas = array_merge($datas, parent::get_datas());
         foreach ($group_metadatas as $i => $metadatas) {
             if (is_array($metadatas["metadatas"])) {
                 foreach ($metadatas["metadatas"] as $key => $value) {
                     try {
                         $group_metadatas[$i]["metadatas"][$key] = H2o::parseString($value)->render($datas);
                     } catch (Exception $e) {
                     }
                 }
             }
         }
         return $group_metadatas;
     }
     return false;
 }
Example #11
0
function strip_empty_chars_thesaurus($string)
{
    // traitement des diacritiques
    $string = convert_diacrit($string);
    // Mis en commentaire : qu'en est-il des caractères non latins ???
    // SUPPRIME DU COMMENTAIRE : ER : 12/05/2004 : ça fait tout merder...
    // RECH_14 : Attention : ici suppression des éventuels "
    //          les " ne sont plus supprimés
    $string = stripslashes($string);
    $string = pmb_alphabetic('^a-z0-9\\s', ' ', pmb_strtolower($string));
    // espaces en début et fin
    $string = pmb_preg_replace('/^\\s+|\\s+$/', '', $string);
    return $string;
}
 function do_image(&$entree, $depliable)
 {
     global $charset;
     global $opac_show_book_pics;
     global $opac_book_pics_url;
     global $opac_book_pics_msg;
     global $opac_url_base;
     global $msg;
     if ($this->notice->code || $this->notice->thumbnail_url) {
         if ($opac_show_book_pics == '1' && ($opac_book_pics_url || $this->notice->thumbnail_url)) {
             $code_chiffre = pmb_preg_replace('/-|\\.| /', '', $this->notice->code);
             $url_image = $opac_book_pics_url;
             $url_image = $opac_url_base . "getimage.php?url_image=" . urlencode($url_image) . "&noticecode=!!noticecode!!&vigurl=" . urlencode($this->notice->thumbnail_url);
             $hauteur_vig = "";
             if (strpos($this->notice->thumbnail_url, "AFFICHES_VIGNETTES") !== false) {
                 $hauteur_vig = "";
             } else {
                 $hauteur_vig = " height=\"150px\" ";
             }
             if ($depliable) {
                 $image = "<img src='" . $opac_url_base . "images/vide.png' hspace='4' vspace='2' {$hauteur_vig} isbn='" . $code_chiffre . "' url_image='" . $url_image . "' border='1px solid #ccccff' vigurl=\"" . $this->notice->thumbnail_url . "\"  alt='" . $msg["opac_notice_vignette_alt"] . "'/>";
             } else {
                 if ($this->notice->thumbnail_url) {
                     $url_image_ok = $this->notice->thumbnail_url;
                     $title_image_ok = "";
                 } else {
                     $url_image_ok = str_replace("!!noticecode!!", $code_chiffre, $url_image);
                     $title_image_ok = htmlentities($opac_book_pics_msg, ENT_QUOTES, $charset);
                 }
                 if (!trim($title_image_ok)) {
                     $title_image_ok = htmlentities($this->notice->tit1, ENT_QUOTES, $charset);
                 }
                 $image = "<img src='" . $url_image_ok . "' title=\"" . $title_image_ok . "\" {$hauteur_vig} align='right' hspace='4' vspace='2'  alt='" . $msg["opac_notice_vignette_alt"] . "'/>";
             }
         } else {
             $image = "";
         }
         if ($image) {
             $entree = "<table width='100%'><tr><td>{$image}</td></tr><tr><td>{$entree}</td></tr></table>";
         } else {
             $entree = "<table width='100%'><tr><td>{$entree}</td></tr></table>";
         }
     } else {
         $entree = "<table width='100%'><tr><td>{$entree}</td></tr></table>";
     }
 }
Example #13
0
 function print_resume($level = 2, $css)
 {
     global $fonction_auteur;
     global $base_path;
     // récupération localisation
     require_once $base_path . "/includes/localisation.inc.php";
     global $msg;
     global $css;
     global $opac_show_book_pics;
     global $charset;
     if (!$this->id) {
         return;
     }
     // adaptation par rapport au niveau de détail souhaité
     // niveau par défaut : 2
     // niveau 3 : format public
     switch ($level) {
         case 1:
             global $notice_level1_display;
             global $notice_level1_no_coll_info;
             global $notice_level1_no_author_info;
             global $notice_level1_no_authors_info;
             global $notice_level1_no_publisher_info;
             $notice_display = $notice_level1_display;
             $notice_no_coll_information = $notice_level1_no_coll_info;
             $notice_no_author_information = $notice_level1_no_author_info;
             $notice_no_authors_information = $notice_level1_no_authors_info;
             $notice_no_publisher_information = $notice_level1_no_publisher_info;
             // utilise les bons champs IMPORTANT
             $this->check_fields(N_VALID_TYPDOC | N_VALID_AUTHORS | N_VALID_PARENT_TITLE);
             break;
         case 3:
             // Format Public
             global $notice_level3_display;
             global $notice_level3_no_coll_info;
             global $notice_level3_no_author_info;
             global $notice_level3_no_authors_info;
             global $notice_level3_no_publisher_info;
             $notice_display = $notice_level3_display;
             $notice_no_coll_information = $notice_level3_no_coll_info;
             $notice_no_author_information = $notice_level3_no_author_info;
             $notice_no_authors_information = $notice_level3_no_authors_info;
             $notice_no_publisher_information = $notice_level3_no_publisher_info;
             // utilise les bons champs IMPORTANT
             $this->check_fields(N_VALID_TYPDOC | N_VALID_AUTHORS | N_VALID_PUBLISHERS | N_VALID_COLLECTION | N_VALID_PARENT_TITLE);
             break;
         case 2:
         default:
             global $notice_level2_display;
             global $notice_level2_no_coll_info;
             global $notice_level2_no_author_info;
             global $notice_level2_no_authors_info;
             global $notice_level2_no_publisher_info;
             $notice_display = $notice_level2_display;
             $notice_no_coll_information = $notice_level2_no_coll_info;
             $notice_no_author_information = $notice_level2_no_author_info;
             $notice_no_authors_information = $notice_level2_no_authors_info;
             $notice_no_publisher_information = $notice_level2_no_publisher_info;
             // utilise les bons champs IMPORTANT
             $this->check_fields(N_VALID_TYPDOC | N_VALID_AUTHORS | N_VALID_PUBLISHERS | N_VALID_COLLECTION);
             break;
     }
     $print = $notice_display;
     // remplacement des champs statiques
     // $print = str_replace("!!notice_id!!", $this->id, $print);
     if ($this->id != "") {
         $print = str_replace("!!notice_id!!", "<font size=1>{$msg['notice_id_start']} " . $this->id . " {$msg['notice_id_end']}</font>" . "<br />", $print);
         $print = str_replace("!!notice_id_only!!", $this->id, $print);
     } else {
         $print = str_replace("!!notice_id!!", "", $print);
         $print = str_replace("!!notice_id_only!!", "", $print);
     }
     if ($this->niveau_hierar != "2") {
         $print = str_replace("!!niveau_hierar!!", "<b>" . $msg["hierarchical_level"] . "</b> " . $this->niveau_hierar . "<br />", $print);
     } else {
         $print = str_replace("!!niveau_hierar!!", "", $print);
     }
     if ($this->typdoc != "") {
         if ($this->niveau_hierar != "2") {
             // ce n'est pas un article
             $print = str_replace("!!typdoc!!", $this->typdoc . " " . $msg["article"], $print);
             $print = str_replace("!!typdocpic!!", "<img src=./images/icon_" . $this->typdoc . ".gif> " . $this->niveau_hierar, $print);
         } else {
             // c'est un article
             $print = str_replace("!!typdoc!!", $this->typdoc, $print);
             $print = str_replace("!!typdocpic!!", "<img src=./images/icon_" . $this->typdoc . ".gif>" . $this->niveau_hierar, $print);
         }
     } else {
         $print = str_replace("!!typdoc!!", "", $print);
         $print = str_replace("!!typdocpic!!", "", $print);
     }
     if ($this->tit1 != "") {
         switch ($this->niveau_biblio) {
             case "s":
                 $tit1_ico = "<a href='#' onClick='window.open(\"./includes/messages/fr_FR/icons.html\", \"icones__PMB\", \"scrollbars=yes, toolbar=no, dependent=yes, width=400, height=400, resizable=yes\"); return false' title='" . $msg["serial"] . "'><img src='./images/icon_per.gif' border='0' alt='" . $msg["serial"] . "' align='absmiddle'/>\n\t\t\t\t<img src='./images/icon_" . $this->typdoc . ".gif' border='0' align='absmiddle'/></a>";
                 break;
             case "a":
                 $tit1_ico = "<a href='#' onClick='window.open(\"./includes/messages/fr_FR/icons.html\", \"icones__PMB\", \"scrollbars=yes, toolbar=no, dependent=yes, width=400, height=400, resizable=yes\"); return false' title='" . $msg["article"] . "'><img src='./images/icon_art.gif' border='0' alt='" . $msg["article"] . "' align='absmiddle'/>\n\t\t\t\t<img src='./images/icon_" . $this->typdoc . ".gif' border='0' align='absmiddle'/></a>";
                 break;
             case "m":
             default:
                 $tit1_ico = "<a href='#' onClick='window.open(\"./includes/messages/fr_FR/icons.html\", \"icones__PMB\", \"scrollbars=yes, toolbar=no, dependent=yes, width=400, height=400, resizable=yes\"); return false' title='" . $this->typdocdisplay . "'><img src='./images/icon_" . $this->typdoc . ".gif' border='0' align='absmiddle'/></a>";
                 break;
         }
         $print = str_replace("!!tit1!!", $this->tit1, $print);
         $print = str_replace("!!tit1_ico!!", $tit1_ico, $print);
         $print = str_replace("!!tit1display!!", "<b>{$msg['tit1display_start']}</b>" . $this->tit1 . "{$msg['tit1display_end']}<br />", $print);
     } else {
         $print = str_replace("!!tit1!!", "", $print);
     }
     if ($this->tit2 != "") {
         $print = str_replace("!!tit2!!", "<b>{$msg['tit2_start']}</b>" . $this->tit2 . "<br />", $print);
     } else {
         $print = str_replace("!!tit2!!", "", $print);
     }
     if ($this->tit3 != "") {
         $print = str_replace("!!tit3!!", "<b>{$msg['tit3_start']}</b>" . $this->tit3 . "<br />", $print);
     } else {
         $print = str_replace("!!tit3!!", "", $print);
     }
     if ($this->tit4 != "") {
         $print = str_replace("!!tit4!!", "<b>{$msg['tit4_start']}</b>" . $this->tit4 . "<br />", $print);
     } else {
         $print = str_replace("!!tit4!!", "", $print);
     }
     if ($this->typdocdisplay != "") {
         $print = str_replace("!!typdocdisplay!!", "<b>{$msg['typdocdisplay_start']}</b> " . $this->typdocdisplay . "<br />", $print);
     } else {
         $print = str_replace("!!typdocdisplay!!", $this->typdoc, $print);
     }
     if ($this->tparent != "") {
         if ($this->tnvol) {
             $tparent_libelle = "<b>{$msg['tparent_start']}</b>" . $this->tparent . " [" . $this->tnvol . "]<br />";
         } else {
             $tparent_libelle = "<b>{$msg['tparent_start']}</b>" . $this->tparent . "<br />";
         }
         $print = str_replace("!!tparent!!", $tparent_libelle, $print);
     } else {
         $print = str_replace("!!tparent!!", "", $print);
     }
     if ($this->tnvol != "") {
         $print = str_replace("!!tnvol!!", "<b>{$msg['tnvol_start']}</b>" . $this->tnvol . "<br />", $print);
     } else {
         $print = str_replace("!!tnvol!!", "", $print);
     }
     // constitution de la mention de responsabilité
     //$this->responsabilites
     $as = array_search("0", $this->responsabilites["responsabilites"]);
     if ($as !== FALSE && $as !== NULL) {
         $auteur_0 = $this->responsabilites["auteurs"][$as];
         $auteur = new auteur($auteur_0["id"]);
         if ($auteur_0["fonction"]) {
             $f_auteur = " (" . $fonction_auteur[$auteur_0["fonction"]] . ")";
         } else {
             $f_auteur = "";
         }
         $mention_resp_lib = "<b>" . $msg[auteur_start] . "</b> " . "<a href='index.php?lvl=author_see&id=" . $auteur_0["id"] . "' title='" . $auteur->info_bulle . "'>{$auteur->isbd_entry}</a> " . $f_auteur . "<br />";
         $mention_resp[] = $mention_resp_lib;
     }
     $as = array_keys($this->responsabilites["responsabilites"], "1");
     for ($i = 0; $i < count($as); $i++) {
         $indice = $as[$i];
         $auteur_1 = $this->responsabilites["auteurs"][$indice];
         $auteur = new auteur($auteur_1["id"]);
         if ($auteur_1["fonction"]) {
             $f_auteur = " (" . $fonction_auteur[$auteur_1["fonction"]] . ")";
         } else {
             $f_auteur = "";
         }
         $mention_resp_lib = "<b>" . $msg[auteur_start] . "</b> " . "<a href='index.php?lvl=author_see&id=" . $auteur_1["id"] . "' title='" . $auteur->info_bulle . "'>{$auteur->isbd_entry}</a> " . $f_auteur . "<br />";
         $mention_resp[] = $mention_resp_lib;
     }
     $as = array_keys($this->responsabilites["responsabilites"], "2");
     for ($i = 0; $i < count($as); $i++) {
         $indice = $as[$i];
         $auteur_2 = $this->responsabilites["auteurs"][$indice];
         $auteur = new auteur($auteur_2["id"]);
         if ($auteur_2["fonction"]) {
             $f_auteur = " (" . $fonction_auteur[$auteur_2["fonction"]] . ")";
         } else {
             $f_auteur = "";
         }
         $mention_resp_lib = "<b>" . $msg[auteur_start] . "</b> " . "<a href='index.php?lvl=author_see&id=" . $auteur_2["id"] . "' title='" . $auteur->info_bulle . "'>{$auteur->isbd_entry}</a> " . $f_auteur . "<br />";
         $mention_resp[] = $mention_resp_lib;
     }
     if (!$mention_resp) {
         $mention_resp = array();
     }
     $libelle_mention_resp = implode(" ", $mention_resp);
     // **********************************************
     if ($this->ed1 != "") {
         $print = str_replace("!!ed1!!", "<b>{$msg['ed1_start']}</b>" . $this->ed1 . "<br />", $print);
     } else {
         $print = str_replace("!!ed1!!", "", $print);
     }
     if ($this->ed2 != "") {
         $print = str_replace("!!ed2!!", "<b>{$msg['ed2_start']}</b>" . $this->ed2 . "<br />", $print);
     } else {
         $print = str_replace("!!ed2!!", "", $print);
     }
     if ($this->coll != "") {
         $print = str_replace("!!coll!!", "<b>{$msg['coll_start']}</b>" . $this->coll . "<br />", $print);
     } else {
         $print = str_replace("!!coll!!", "", $print);
     }
     if ($this->subcoll != "") {
         $print = str_replace("!!subcoll!!", "<b>{$msg['subcoll_start']}</b>" . $this->subcoll . "<br />", $print);
     } else {
         $print = str_replace("!!subcoll!!", "", $print);
     }
     if ($this->year != "") {
         $print = str_replace("!!year!!", "<b>{$msg['year_start']}</b>" . $this->year . "<br />", $print);
     } else {
         $print = str_replace("!!year!!", "", $print);
     }
     if ($this->nocoll != "") {
         $print = str_replace("!!nocoll!!", "<b>{$msg['nocoll_start']}</b>" . $this->nocoll . "<br />", $print);
     } else {
         $print = str_replace("!!nocoll!!", "", $print);
     }
     if ($this->code != "") {
         // Si c'est un livre, c'est magique alors on affiche l'image tirée de chez amazon europe.
         if ($this->typdoc == 'a' && $opac_show_book_pics == '1') {
             $code_chiffre = pmb_preg_replace('/-|\\.| /', '', $this->code);
             //if (@fopen("http://images-eu.amazon.com/images/P/".$code_chiffre.".08.MZZZZZZZ.jpg","r"))
             if (isISBN($this->code)) {
                 $print = str_replace("!!image_petit!!", "<img src='http://images-eu.amazon.com/images/P/" . $code_chiffre . ".08.MZZZZZZZ.jpg' align='right' hspace='4' vspace='2'>", $print);
             } else {
                 $print = str_replace("!!image_petit!!", "", $print);
             }
         } else {
             $print = str_replace("!!image_petit!!", "", $print);
         }
         $print = str_replace("!!code!!", "<b>{$msg['code_start']}</b>" . $this->code . "<br />", $print);
     } else {
         $print = str_replace("!!image_petit!!", "", $print);
         $print = str_replace("!!code!!", "", $print);
     }
     if ($this->npages != "") {
         $print = str_replace("!!npages!!", "<b>{$msg['npages_start']}</b>" . $this->npages . "<br />", $print);
     } else {
         $print = str_replace("!!npages!!", "", $print);
     }
     if ($this->ill != "") {
         $print = str_replace("!!ill!!", "<b>{$msg['ill_start']}</b>" . $this->ill . "<br />", $print);
     } else {
         $print = str_replace("!!ill!!", "", $print);
     }
     if ($this->size != "") {
         $print = str_replace("!!size!!", "<b>{$msg['size_start']}</b>" . $this->size . "<br />", $print);
     } else {
         $print = str_replace("!!size!!", "", $print);
     }
     if ($this->accomp != "") {
         $print = str_replace("!!accomp!!", "<b>{$msg['accomp_start']}</b>" . $this->accomp . "<br />", $print);
     } else {
         $print = str_replace("!!accomp!!", "", $print);
     }
     if ($this->n_gen != "") {
         $print = str_replace("!!n_gen!!", "<b>{$msg['n_gen_start']}</b>" . nl2br(htmlentities($this->n_gen, ENT_QUOTES, $charset)) . "<br />", $print);
     } else {
         $print = str_replace("!!n_gen!!", "", $print);
     }
     if ($this->n_contenu != "") {
         $print = str_replace("!!n_contenu!!", "<b>{$msg['n_contenu_start']}</b>" . nl2br(htmlentities($this->n_contenu, ENT_QUOTES, $charset)) . "<br />", $print);
     } else {
         $print = str_replace("!!n_contenu!!", "", $print);
     }
     if ($this->n_resume != "") {
         $print = str_replace("!!n_resume!!", "<b>{$msg['n_resume_start']}</b>" . nl2br(htmlentities($this->n_resume, ENT_QUOTES, $charset)) . "<br />", $print);
     } else {
         $print = str_replace("!!n_resume!!", "", $print);
     }
     if ($this->index_l != "") {
         $print = str_replace("!!index_l!!", "<b>{$msg['index_l_start']}</b>" . nl2br($this->index_l) . "<br />", $print);
     } else {
         $print = str_replace("!!index_l!!", "", $print);
     }
     if ($this->lang != "") {
         $print = str_replace("!!lang!!", $this->lang . "<br />", $print);
     } else {
         $print = str_replace("!!lang!!", "", $print);
     }
     if ($this->org_lang != "") {
         $print = str_replace("!!org_lang!!", $this->org_lang . "<br />", $print);
     } else {
         $print = str_replace("!!org_lang!!", "", $print);
     }
     if ($this->lien != "") {
         $print = str_replace("!!lien!!", "<br /><a href=\"" . $this->lien . "\" title=" . $this->lien . " alt=" . $this->lien . "><img src=./images/docweb.gif border=0> {$this->lien}</a>", $print);
     } else {
         $print = str_replace("!!lien!!", "", $print);
     }
     if ($this->eformat != "") {
         $print = str_replace("!!eformat!!", "[" . $this->eformat . "]<br />" . "<br />", $print);
     } else {
         $print = str_replace("!!eformat!!", "", $print);
     }
     if ($this->prix != "") {
         $print = str_replace("!!prix!!", "<b>{$msg['price_start']}</b> " . $this->prix . " <b>{$msg['price_end']}</b> ", $print);
     } else {
         $print = str_replace("!!prix!!", "", $print);
     }
     // remplacement des champs dynamiques
     if (preg_match("#!!auteur!!#", $print)) {
     }
     if ($libelle_mention_resp) {
         $print = str_replace("!!auteur!!", $libelle_mention_resp, $print);
     } else {
         $print = str_replace("!!auteur!!", $notice_no_authors_information, $print);
     }
     if (preg_match("#!!editeur!!#", $print)) {
         $remplacement = "";
         if ($this->ed1_id) {
             $remplacement = "<b>{$msg['editeur_start']}</b> " . "<a href='index.php?lvl=publisher_see&id={$this->ed1_id}'>{$this->ed1}</a>" . "<br />";
         } elseif ($this->ed2_id) {
             $remplacement = "<b>{$msg['editeur_start']}</b> " . "<a href='index.php?lvl=publisher_see&id={$this->ed2_id}'>{$this->ed2}</a>" . "<br />";
         } else {
             $remplacement = "";
         }
         $print = str_replace("!!editeur!!", $remplacement, $print);
     }
     if (preg_match("#!!collection!!#", $print)) {
         $remplacement = "";
         if ($this->coll_id) {
             $remplacement = "<b>{$msg['coll_start']}</b> <a href='index.php?lvl=coll_see&id={$this->coll_id}'>{$this->coll}</a>";
         }
         if ($this->subcoll_id) {
             $remplacement .= $remplacement ? ", " : "";
             $remplacement .= "(<a href='index.php?lvl=subcoll_see&id={$this->subcoll_id}'>{$this->subcoll}</a>)<br />";
         } else {
             $remplacement .= "<br />";
         }
         if ($remplacement == "") {
             $remplacement = "";
         }
         $print = str_replace("!!collection!!", $remplacement, $print);
     }
     if (preg_match("#!!level1!!#", $print)) {
         if ($this->tparent) {
             if ($this->tnvol) {
                 $titre_affiche = $this->tit1 . " - " . $this->tparent . " [" . $this->tnvol . "]";
             } else {
                 $titre_affiche = $this->tit1 . " - " . $this->tparent;
             }
         } else {
             $titre_affiche = $this->tit1;
         }
         if ($this->tit1) {
             $titre = "<a href='index.php?lvl=notice_display&id=" . $this->id . "'>{$titre_affiche}</a>";
         } elseif ($this->tit2) {
             $titre = "<a href='index.php?lvl=notice_display&id=" . $this->id . "'>{$this->tit2}</a>";
         } elseif ($this->tit3) {
             $titre = "<a href='index.php?lvl=notice_display&id=" . $this->id . "'>{$this->tit3}</a>";
         } elseif ($this->tit4) {
             $titre = "<a href='index.php?lvl=notice_display&id=" . $this->id . "'>{$this->tit4}</a>";
         } else {
             $titre = "";
         }
         // ***
         //$this->responsabilites
         $as = array_search("0", $this->responsabilites["responsabilites"]);
         if ($as !== FALSE && $as !== NULL) {
             $auteur_0 = $this->responsabilites["auteurs"][$as];
             $auteur = new auteur($auteur_0["id"]);
             $auteur = $auteur->isbd_entry;
         } else {
             $as = array_keys($this->responsabilites["responsabilites"], "1");
             for ($i = 0; $i < count($as); $i++) {
                 $indice = $as[$i];
                 $auteur_1 = $this->responsabilites["auteurs"][$indice];
                 $auteur = new auteur($auteur_1["id"]);
                 $aut1_libelle[] = $auteur->isbd_entry;
             }
             if (!$aut1_libelle) {
                 $aut1_libelle = array();
             }
             $auteur = implode(", ", $aut1_libelle);
         }
         // ***
         $remplacement = $titre;
         if ($remplacement != "" && $auteur != "") {
             $remplacement .= " / " . $auteur;
         }
         $print = str_replace("!!level1!!", $remplacement, $print);
     }
     return $print;
 }
Example #14
0
 function getData()
 {
     global $dbh;
     global $msg;
     if ($this->id_expl == 0 && $this->cb_expl == "") {
         // aucun identifiant. on retourne un tableau vide
         $this->id_empr = 0;
         $this->id_expl = 0;
         $this->pret_date = "";
         $this->pret_retour = "";
         $this->cb_expl = "";
         $this->type_doc = "";
         $this->statut_doc = "";
         $this->titre_auteur = "";
         $this->owner = "";
         $this->date_pret_display = "";
         $this->date_retour_display = "";
         $this->etat = 0;
         $this->display = $msg[4052];
     } else {
         $sql_dates = " date_format(pret_date, '" . $msg["format_date"] . "') as aff_pret_date, ";
         $sql_dates .= " date_format(pret_retour, '" . $msg["format_date"] . "') as aff_pret_retour, ";
         $sql_dates .= " IF(pret_retour>sysdate(),0,1) as retard ";
         if ($this->id_expl != 0) {
             $requete = "SELECT pret_idempr, pret_idexpl, pret_date, pret_retour, expl_cb, expl_typdoc, expl_statut, tit1, expl_owner, {$sql_dates} FROM pret, exemplaires, notices WHERE pret_idexpl='" . $this->id_expl . "' and pret_idexpl=expl_id and expl_notice=notice_id LIMIT 1 ";
         } else {
             $requete = "SELECT pret_idempr, pret_idexpl, pret_date, pret_retour, expl_cb, expl_typdoc, tit1, expl_owner, {$sql_dates} FROM pret, exemplaires, notices, authors WHERE expl_cb='" . $this->cb_expl . "' and pret_idexpl=expl_id and expl_notice=notice_id LIMIT 1 ";
         }
         $result = @pmb_mysql_query($requete, $dbh);
         if (pmb_mysql_num_rows($result)) {
             $temp = pmb_mysql_fetch_object($result);
             pmb_mysql_free_result($result);
             $this->id_empr = $temp->pret_idempr;
             $this->id_expl = $temp->pret_idexpl;
             $this->pret_date = $temp->pret_date;
             $this->pret_retour = $temp->pret_retour;
             $this->cb_expl = $temp->expl_cb;
             $requete = "select tdoc_libelle from docs_type where idtyp_doc='" . $temp->expl_typdoc . "' ";
             $result = @pmb_mysql_query($requete, $dbh);
             $typdoc = pmb_mysql_fetch_object($result);
             pmb_mysql_free_result($result);
             $this->type_doc = $typdoc->tdoc_libelle;
             $requete = "select statut_libelle from docs_statut where idstatut='" . $temp->expl_statut . "' ";
             $result = @pmb_mysql_query($requete, $dbh);
             $statdoc = pmb_mysql_fetch_object($result);
             pmb_mysql_free_result($result);
             $this->statut_doc = $statdoc->statut_libelle;
             $this->titre_auteur = $temp->tit1;
             $requete = "select lender_libelle from lenders where idlender='" . $temp->expl_owner . "' ";
             $result = @pmb_mysql_query($requete, $dbh);
             $lender = pmb_mysql_fetch_object($result);
             pmb_mysql_free_result($result);
             $this->owner = $lender->lender_libelle;
             $this->date_pret_display = $temp->aff_pret_date;
             $this->date_retour_display = $temp->aff_pret_retour;
             $this->etat = 1;
             $this->display = "Prêt existant";
         } else {
             // pas de prêt avec cette clé : on va aller chercher le expl_cb avec l'id ou l'inverse
             $long_maxi_cb_expl = pmb_mysql_field_len(pmb_mysql_query("SELECT expl_cb FROM exemplaires limit 1"), 0);
             $this->cb_expl = rtrim(substr(pmb_preg_replace('/\\[|\\]/', '', rtrim(ltrim($this->cb_expl))), 0, $long_maxi_cb_expl));
             if ($this->id_expl == 0) {
                 /* ici la recherche de l'id_expl */
                 $query = "SELECT expl_id, expl_cb FROM exemplaires WHERE expl_cb='{$key_cb_expl}' LIMIT 1 ";
             } else {
                 /* ici la recherche du cb à partir de l'id */
                 $query = "SELECT expl_id, expl_cb FROM exemplaires WHERE expl_id='" . $this->id_expl . "' LIMIT 1 ";
             }
             $result = @pmb_mysql_query($query, $dbh) or die("can't SELECT exemplaires " . $query);
             if (pmb_mysql_num_rows($result) == 0) {
                 /* on n'a trouvé aucun exemplaire */
                 $this->id_empr = 0;
                 $this->id_expl = 0;
                 $this->pret_date = "";
                 $this->pret_retour = "";
                 $this->cb_expl = "";
                 $this->type_doc = "";
                 $this->statut_doc = "";
                 $this->titre_auteur = "";
                 $this->owner = "";
                 $this->date_pret_display = "";
                 $this->date_retour_display = "";
                 $this->etat = 3;
                 $this->display = "Exemplaire introuvable";
             } else {
                 $expl = pmb_mysql_fetch_object($result);
                 $this->id_expl = $expl->expl_id;
                 $this->cb_expl = $expl->expl_cb;
                 $this->pret_retour = "";
                 $this->type_doc = "";
                 $this->statut_doc = "";
                 $this->titre_auteur = "";
                 $this->owner = "";
                 $this->date_pret_display = "";
                 $this->date_retour_display = "";
                 $this->etat = 2;
                 $this->display = "Prêt possible, inexistant avec cette clé";
             }
         }
     }
 }
 function open_restore_stream()
 {
     global $backup_dir;
     $dir = pmb_preg_replace('/\\/\\s$|\\/$/', '', $backup_dir);
     if (!$dir) {
         $dir = '.';
     }
     $in_file = $dir . '/' . $this->filename . $this->extension;
     $this->fptr = @fopen($in_file, 'rb');
     if ($this->fptr) {
         $this->buffer = fread($this->fptr, filesize($in_file));
         fclose($this->fptr);
         return TRUE;
     } else {
         $this->buffer = '';
         return FALSE;
     }
 }
Example #16
0
 function picture_empr($empr_cb)
 {
     global $charset;
     global $empr_pics_url, $empr_pics_max_size;
     if ($empr_pics_url) {
         $code_chiffre = pmb_preg_replace('/ /', '', $empr_cb);
         $url_image = $empr_pics_url;
         $url_image = "./getimage.php?url_image=" . urlencode($url_image) . "&empr_pic=1";
         $url_image_ok = str_replace("%21%21num_carte%21%21", $code_chiffre, $url_image);
         $image = "<img src='" . $url_image_ok . "' {$maxsize} />";
     } else {
         $image = "";
     }
     return $image;
 }
Example #17
0
 function aff_notices_list($notices_list)
 {
     global $dbh, $charset;
     global $opac_show_book_pics, $opac_book_pics_url, $opac_book_pics_msg, $opac_url_base;
     global $opac_notice_affichage_class, $gestion_acces_active, $gestion_acces_empr_notice;
     global $opac_notice_reduit_format_similaire;
     $img_list = "";
     $title_list = "";
     $tabNotice = array();
     if ($gestion_acces_active == 1 && $gestion_acces_empr_notice == 1) {
         $ac = new acces();
         $dom_2 = $ac->setDomain(2);
     }
     foreach ($notices_list as $notice_id) {
         $acces_v = TRUE;
         if ($gestion_acces_active == 1 && $gestion_acces_empr_notice == 1) {
             $acces_v = $dom_2->getRights($_SESSION['id_empr_session'], $notice_id, 4);
         } else {
             $requete = "SELECT notice_visible_opac, expl_visible_opac, notice_visible_opac_abon, expl_visible_opac_abon, explnum_visible_opac, explnum_visible_opac_abon FROM notices, notice_statut WHERE notice_id ='" . $notice_id . "' and id_notice_statut=statut ";
             $myQuery = pmb_mysql_query($requete, $dbh);
             if ($myQuery && pmb_mysql_num_rows($myQuery)) {
                 $statut_temp = pmb_mysql_fetch_object($myQuery);
                 if (!$statut_temp->notice_visible_opac) {
                     $acces_v = FALSE;
                 }
                 if ($statut_temp->notice_visible_opac_abon && !$_SESSION['id_empr_session']) {
                     $acces_v = FALSE;
                 }
             } else {
                 $acces_v = FALSE;
             }
         }
         if (!$acces_v) {
             continue;
         }
         $req = "select * from notices where notice_id={$notice_id}";
         $res = @pmb_mysql_query($req, $dbh);
         if ($r = pmb_mysql_fetch_object($res)) {
             $image = "";
             if (substr($opac_notice_reduit_format_similaire, 0, 1) != "H" && $opac_show_book_pics == '1') {
                 $image = "<a href='" . $opac_url_base . "index.php?lvl=notice_display&id=" . $notice_id . "'>" . "<img class='vignetteimg_simili' src='" . get_url_icon("no_image.jpg") . "' hspace='4' vspace='2'></a>";
                 if ($r->thumbnail_url) {
                     $url_image_ok = $r->thumbnail_url;
                     $title_image_ok = "";
                     $image = "<a href='" . $opac_url_base . "index.php?lvl=notice_display&id=" . $notice_id . "'>" . "<img class='vignetteimg_simili' src='" . $url_image_ok . "' title=\"" . $title_image_ok . "\" hspace='4' vspace='2'>" . "</a>";
                 } elseif ($r->code && $opac_book_pics_url) {
                     $code_chiffre = pmb_preg_replace('/-|\\.| /', '', $r->code);
                     $url_image = $opac_url_base . "getimage.php?url_image=" . urlencode($opac_book_pics_url) . "&noticecode=!!noticecode!!";
                     $url_image_ok = str_replace("!!noticecode!!", $code_chiffre, $url_image);
                     $title_image_ok = htmlentities($opac_book_pics_msg, ENT_QUOTES, $charset);
                     $image = "<a href='" . $opac_url_base . "index.php?lvl=notice_display&id=" . $notice_id . "'>" . "<img class='vignetteimg_simili' src='" . $url_image_ok . "' title=\"" . $title_image_ok . "\" hspace='4' vspace='2'>" . "</a>";
                 }
             }
             $notice = new $opac_notice_affichage_class($notice_id, "", 0, 0, 1);
             $notice->do_header_similaire();
             $notice_header = "<a href='" . $opac_url_base . "index.php?lvl=notice_display&id=" . $notice_id . "'>" . $notice->notice_header . "</a>";
             $i++;
         }
         // affichage du titre et de l'image dans la même cellule
         if ($image != "") {
             $img_list .= "<td align='center'>" . $image . "<br />" . $notice_header . "</td>";
         } else {
             $img_list .= "<td align='center'>" . $notice_header . "</td>";
         }
     }
     if (!$i) {
         return "";
     }
     $display = "<table width='100%' style='table-layout:fixed;'><tr>" . $img_list . "</tr></table>";
     return $display;
 }
 /**
  * Ajoute l'image
  * @param unknown $notice_id Identifiant de la notice
  * @param unknown $entree Contenu avant l'ajout
  * @param unknown $depliable 
  */
 public static function do_image($notice_id, &$entree, $depliable)
 {
     global $charset;
     global $opac_show_book_pics;
     global $opac_book_pics_url;
     global $opac_book_pics_msg;
     global $opac_url_base;
     global $msg;
     $record_datas = static::get_record_datas($notice_id);
     if ($record_datas->get_code() || $record_datas->get_thumbnail_url()) {
         if ($opac_show_book_pics == '1' && ($opac_book_pics_url || $record_datas->get_thumbnail_url())) {
             $code_chiffre = pmb_preg_replace('/-|\\.| /', '', $record_datas->get_code());
             $url_image = $opac_book_pics_url;
             $url_image = $opac_url_base . "getimage.php?url_image=" . urlencode($url_image) . "&noticecode=!!noticecode!!&vigurl=" . urlencode($record_datas->get_thumbnail_url());
             $title_image_ok = "";
             if (!$record_datas->get_thumbnail_url()) {
                 $title_image_ok = htmlentities($opac_book_pics_msg, ENT_QUOTES, $charset);
             }
             if (!trim($title_image_ok)) {
                 $title_image_ok = htmlentities($record_datas->get_tit1(), ENT_QUOTES, $charset);
             }
             if ($depliable) {
                 $image = "<img class='vignetteimg' src='" . $opac_url_base . "images/vide.png' title=\"" . $title_image_ok . "\" align='right' hspace='4' vspace='2' isbn='" . $code_chiffre . "' url_image='" . $url_image . "' vigurl=\"" . $record_datas->get_thumbnail_url() . "\"  alt='" . $msg["opac_notice_vignette_alt"] . "'/>";
             } else {
                 if ($record_datas->get_thumbnail_url()) {
                     $url_image_ok = $record_datas->get_thumbnail_url();
                 } else {
                     $url_image_ok = str_replace("!!noticecode!!", $code_chiffre, $url_image);
                 }
                 $image = "<img class='vignetteimg' src='" . $url_image_ok . "' title=\"" . $title_image_ok . "\" align='right' hspace='4' vspace='2' alt='" . $msg["opac_notice_vignette_alt"] . "' />";
             }
         } else {
             $image = "";
         }
         if ($image) {
             $entree = "<table width='100%'><tr><td valign='top'>{$entree}</td><td valign='top' align='right'>{$image}</td></tr></table>";
         } else {
             $entree = "<table width='100%'><tr><td>{$entree}</td></tr></table>";
         }
     } else {
         $entree = "<table width='100%'><tr><td>{$entree}</td></tr></table>";
     }
 }
Example #19
0
 function fetch_data()
 {
     global $base_path, $charset;
     global $opac_show_book_pics;
     global $opac_book_pics_url;
     global $opac_book_pics_msg;
     global $opac_url_base, $use_opac_url_base;
     global $opac_sur_location_activate;
     global $fonction_auteur, $msg;
     global $tdoc, $icon_doc, $biblio_doc;
     global $pmb_map_activate;
     global $pmb_url_base;
     if (!$this->notice_id) {
         return false;
     }
     //Recuperation des infos de la notice
     $requete = "select * from notices where notice_id=" . $this->notice_id;
     $resultat = pmb_mysql_query($requete);
     $res = pmb_mysql_fetch_object($resultat);
     $this->notice = $res;
     $this->memo_isbn = $this->notice->code;
     $this->memo_typdoc = $tdoc->table[$this->notice->typdoc];
     //Icone type de Document
     $icon = $icon_doc[$this->notice->niveau_biblio . $this->notice->typdoc];
     if ($icon) {
         $info_bulle_icon = $biblio_doc[$this->notice->niveau_biblio] . " : " . $tdoc->table[$this->notice->typdoc];
         if ($use_opac_url_base) {
             $this->memo_icondoc = "<img src=\"" . $opac_url_base . "images/{$icon}\" alt=\"{$info_bulle_icon}\" title=\"{$info_bulle_icon}\" align='top' />";
         } else {
             $this->memo_icondoc = "<img src=\"" . $pmb_url_base . "images/{$icon}\" alt=\"{$info_bulle_icon}\" title=\"{$info_bulle_icon}\" align='top' />";
         }
     }
     if ($use_opac_url_base) {
         if (isset($_SESSION["cart"]) && in_array($this->notice_id, $_SESSION["cart"])) {
             $this->memo_iconcart = "<span id='baskets" . $this->notice_id . "'><a href='#' class=\"img_basket_exist\" title=\"" . $msg['notice_title_basket_exist'] . "\"><img src=\"" . $opac_url_base . "images/basket_exist.gif\" border=\"0\" alt=\"" . $msg['notice_title_basket_exist'] . "\" /></a></span>";
         } else {
             $title = $this->notice_header;
             if (!$title) {
                 $title = $this->notice->tit1;
             }
             $this->memo_iconcart = "<span id='baskets" . $this->notice_id . "'><a href=\"cart_info.php?id=" . $this->notice_id . "&header=" . rawurlencode(strip_tags($title)) . "\" target=\"cart_info\" class=\"img_basket\" title=\"" . $msg['notice_title_basket'] . "\"><img src=\"" . $opac_url_base . "images/basket_small_20x20.gif\" border=\"0\" title=\"" . $msg['notice_title_basket'] . "\" alt=\"" . $msg['notice_title_basket'] . "\" /></a></span>";
         }
     } else {
         $this->memo_iconcart = "<img src=\"" . $pmb_url_base . "images/basket_small_20x20.gif\" align='absmiddle' border='0' title='" . $msg["400"] . "' alt='" . $msg["400"] . "' />";
     }
     $this->niveau_biblio = $this->notice->niveau_biblio;
     $this->niveau_hierar = $this->notice->niveau_hierar;
     //Recherche des infos du périodique
     $this->fetch_analysis_info();
     //Recherche des etats de collection
     $this->fetch_collstate();
     //Titres
     //Titre de serie et composition du titre
     $this->memo_series[] = array();
     if ($res->tparent_id) {
         $requete = "select * from series where serie_id=" . $res->tparent_id;
         $resultat = pmb_mysql_query($requete);
         if ($serie = pmb_mysql_fetch_object($resultat)) {
             $this->memo_series[] = $serie;
             $this->memo_titre = $serie->serie_name;
             $this->memo_titre_serie = $serie->serie_name;
             $this->isbd = $this->serie_name;
             if ($this->notice->tnvol) {
                 $this->memo_titre .= ', ' . $res->tnvol;
                 $this->memo_titre_serie .= ', ' . $res->tnvol;
                 $this->isbd .= ',&nbsp;' . $this->tnvol;
             }
         }
     } elseif ($this->notice->tnvol) {
         $this->memo_titre .= $res->tnvol;
     }
     $this->memo_titre ? $this->memo_titre .= '. ' . $res->tit1 : ($this->memo_titre = $res->tit1);
     $this->isbd ? $this->isbd .= '.&nbsp;' . $this->notice->tit1 : ($this->isbd = $this->notice->tit1);
     $tit2 = $this->notice->tit2;
     $tit3 = $this->notice->tit3;
     $tit4 = $this->notice->tit4;
     if ($tit3) {
         $this->isbd .= "&nbsp;= {$tit3}";
     }
     if ($tit4) {
         $this->isbd .= "&nbsp;: {$tit4}";
     }
     if ($tit2) {
         $this->isbd .= "&nbsp;; {$tit2}";
     }
     $this->isbd .= ' [' . $tdoc->table[$this->notice->typdoc] . ']';
     $this->memo_notice_bulletin = new stdClass();
     $this->memo_bulletin = new stdClass();
     if ($res->niveau_biblio == 'b') {
         $rqt = "select tit1, date_format(date_date, '" . $msg["format_date"] . "') as aff_date_date, bulletin_numero as num_bull,bulletin_notice from bulletins,notices where bulletins.num_notice='" . $this->notice_id . "' and notices.notice_id=bulletins.bulletin_notice";
         $execute_query = pmb_mysql_query($rqt);
         $row = pmb_mysql_fetch_object($execute_query);
         $this->memo_titre .= " " . (!$row->aff_date_date ? sprintf($msg["bul_titre_perio"], $row->tit1) : sprintf($msg["bul_titre_perio"], $row->tit1 . ", " . $row->num_bull . " [" . $row->aff_date_date . "]"));
         // recherche editeur de la notice de perio
         $rqt_perio = "select * from notices where notice_id=" . $row->bulletin_notice;
         $execute_query_perio = pmb_mysql_query($rqt_perio);
         $row_perio = pmb_mysql_fetch_object($execute_query_perio);
         if (!$this->notice->ed1_id) {
             $this->notice->ed1_id = $row_perio->ed1_id;
         }
         //issn pour les notices de bulletin
         if (!$this->notice->code) {
             $this->memo_isbn = $row_perio->code;
         }
     } elseif ($res->niveau_biblio == 'a' && $res->niveau_hierar == 2) {
         $requete = "SELECT b.* ";
         $requete .= "from analysis a, notices b, bulletins c";
         $requete .= " WHERE a.analysis_notice=" . $this->notice_id;
         $requete .= " AND c.bulletin_id=a.analysis_bulletin";
         $requete .= " AND c.bulletin_notice=b.notice_id";
         $requete .= " LIMIT 1";
         $myQuery = pmb_mysql_query($requete);
         if (pmb_mysql_num_rows($myQuery)) {
             $row_perio = pmb_mysql_fetch_object($myQuery);
             if (!$this->notice->ed1_id) {
                 $this->notice->ed1_id = $row_perio->ed1_id;
             }
             //issn pour les notice de dépouillement
             if (!$this->notice->code) {
                 $this->memo_isbn = $row_perio->code;
             }
         }
         //	info du bulletin de ce dépouillement
         $req_bulletin = "SELECT  c.* from analysis a, bulletins c WHERE c.bulletin_id=a.analysis_bulletin AND analysis_notice=" . $res->notice_id;
         $result_bull = pmb_mysql_query($req_bulletin);
         if ($bull = pmb_mysql_fetch_object($result_bull)) {
             $this->memo_bulletin = $bull;
             $this->memo_notice_bulletin = $bull;
             $this->bulletin_mention_date = $bull->mention_date;
             $this->bulletin_date_date = formatdate($bull->date_date);
             $this->bulletin_numero = $bull->bulletin_numero;
         }
     }
     $this->memo_complement_titre = $res->tit4;
     $this->memo_titre_parallele = $res->tit3;
     $this->memo_notice = $res;
     //mention d'édition
     $this->memo_mention_edition = $res->mention_edition;
     //Titre du pério pour les notices de bulletin
     if ($res->niveau_biblio == 'b' && $res->niveau_hierar == '2') {
         $req_bulletin = "SELECT bulletin_id, bulletin_numero, date_date, mention_date, bulletin_titre, bulletin_numero, tit1 as titre from bulletins, notices WHERE bulletin_notice=notice_id AND num_notice=" . $res->notice_id;
         $result_bull = pmb_mysql_query($req_bulletin);
         while ($bull = pmb_mysql_fetch_object($result_bull)) {
             $this->memo_notice_bulletin = $bull;
             $this->memo_bulletin = $bull;
             $this->serial_title = $bull->titre;
             $this->bulletin_mention_date = $bull->mention_date;
             $this->bulletin_date_date = formatdate($bull->date_date);
             $this->bulletin_numero = $bull->bulletin_numero;
             $this->bulletin_id = $bull->bulletin_id;
         }
     }
     //Langage
     $this->memo_lang = get_notice_langues($this->notice_id, 0);
     // langues de la publication
     $this->memo_lang_or = get_notice_langues($this->notice_id, 1);
     // langues originales
     //Auteurs
     $this->authors = array();
     //Recherche des auteurs;
     $this->responsabilites = get_notice_authors($this->notice_id);
     $mention_resp = $mention_resp_1 = $mention_resp_2 = array();
     $isbd_entry_1 = $isbd_entry_2 = array();
     $as = array_search("0", $this->responsabilites["responsabilites"]);
     if ($as !== FALSE && $as !== NULL) {
         $auteur_0 = $this->responsabilites["auteurs"][$as];
         $auteur = new auteur($auteur_0["id"]);
         $auteur->fonction = $fonction_auteur[$auteur_0["fonction"]];
         $this->authors[] = $auteur;
         if ($this->print_mode) {
             $mention_resp_lib = $auteur->isbd_entry;
         } else {
             $mention_resp_lib = $auteur->isbd_entry_lien_gestion;
         }
         if (!$this->print_mode) {
             $mention_resp_lib .= $auteur->author_web_link;
         }
         if ($auteur_0["fonction"]) {
             $mention_resp_lib .= ", " . $fonction_auteur[$auteur_0["fonction"]];
         }
         $mention_resp[] = $mention_resp_lib;
         $this->memo_auteur_principal = $auteur->isbd_entry;
     }
     $as = array_keys($this->responsabilites["responsabilites"], "1");
     for ($i = 0; $i < count($as); $i++) {
         $indice = $as[$i];
         $auteur_1 = $this->responsabilites["auteurs"][$indice];
         $auteur = new auteur($auteur_1["id"]);
         $auteur->fonction = $fonction_auteur[$auteur_1["fonction"]];
         $this->authors[] = $auteur;
         if ($this->print_mode) {
             $mention_resp_lib = $auteur->isbd_entry;
         } else {
             $mention_resp_lib = $auteur->isbd_entry_lien_gestion;
         }
         if (!$this->print_mode) {
             $mention_resp_lib .= $auteur->author_web_link;
         }
         if ($auteur_1["fonction"]) {
             $mention_resp_lib .= ", " . $fonction_auteur[$auteur_1["fonction"]];
         }
         $mention_resp[] = $mention_resp_lib;
         $mention_resp_1[] = $mention_resp_lib;
         $isbd_entry_1[] = $auteur->isbd_entry;
     }
     $this->memo_mention_resp_1 = implode("; ", $mention_resp_1);
     $this->memo_auteur_autre_tab = $isbd_entry_1;
     $this->memo_auteur_autre = implode("; ", $isbd_entry_1);
     $as = array_keys($this->responsabilites["responsabilites"], "2");
     for ($i = 0; $i < count($as); $i++) {
         $indice = $as[$i];
         $auteur_2 = $this->responsabilites["auteurs"][$indice];
         $auteur = new auteur($auteur_2["id"]);
         $auteur->fonction = $fonction_auteur[$auteur_2["fonction"]];
         $this->authors[] = $auteur;
         if ($this->print_mode) {
             $mention_resp_lib = $auteur->isbd_entry;
         } else {
             $mention_resp_lib = $auteur->isbd_entry_lien_gestion;
         }
         if (!$this->print_mode) {
             $mention_resp_lib .= $auteur->author_web_link;
         }
         if ($auteur_2["fonction"]) {
             $mention_resp_lib .= ", " . $fonction_auteur[$auteur_2["fonction"]];
         }
         $mention_resp[] = $mention_resp_lib;
         $mention_resp_2[] = $mention_resp_lib;
         $isbd_entry_2[] = $auteur->isbd_entry;
     }
     $this->memo_mention_resp_2 = implode("; ", $mention_resp_2);
     $this->memo_auteur_secondaire_tab = $isbd_entry_2;
     $this->memo_auteur_secondaire = implode("; ", $isbd_entry_2);
     $this->memo_libelle_mention_resp = implode("; ", $mention_resp);
     if ($this->memo_libelle_mention_resp) {
         $this->isbd .= "&nbsp;/ {$this->memo_libelle_mention_resp}";
     }
     // on récupère la collection au passage, si besoin est
     if ($this->notice->subcoll_id) {
         $collection = new subcollection($this->notice->subcoll_id);
         $info = $this->get_info_editeur($collection->editeur);
         $this->memo_collection = $collection->isbd_entry;
         $this->memo_ed1 = $info["isbd_entry"];
         $this->memo_ed1_name = $info["name"];
         $this->memo_ed1_place = $info["place"];
         $editeurs = $info["isbd_entry"];
     } elseif ($this->notice->coll_id) {
         $collection = new collection($this->notice->coll_id);
         $info = $this->get_info_editeur($collection->parent);
         $this->memo_collection = $collection->isbd_entry;
         $this->memo_ed1 = $info["isbd_entry"];
         $this->memo_ed1_name = $info["name"];
         $this->memo_ed1_place = $info["place"];
         $editeurs = $info["isbd_entry"];
     } elseif ($this->notice->ed1_id) {
         $info = $this->get_info_editeur($this->notice->ed1_id);
         $this->memo_ed1 = $info["isbd_entry"];
         $this->memo_ed1_name = $info["name"];
         $this->memo_ed1_place = $info["place"];
         $editeurs = $info["isbd_entry"];
     }
     if ($this->notice->ed2_id) {
         $info = $this->get_info_editeur($this->notice->ed2_id);
         $this->memo_ed2 = $info["isbd_entry"];
         $this->memo_ed2_name = $info["name"];
         $this->memo_ed2_place = $info["place"];
         $editeurs ? $editeurs .= '&nbsp;; ' . $info["isbd_entry"] : ($editeurs = $info["isbd_entry"]);
     }
     if ($this->notice->year) {
         $editeurs ? $editeurs .= ', ' . $this->notice->year : ($editeurs = $this->notice->year);
     } elseif ($this->notice->niveau_biblio != 'b') {
         $editeurs ? $editeurs .= ', [s.d.]' : ($editeurs = "[s.d.]");
     }
     $this->memo_year = $this->notice->year;
     if ($editeurs) {
         $this->isbd .= ".&nbsp;-&nbsp;{$editeurs}";
     }
     // zone de la collation (ne concerne que a2)
     if ($this->notice->npages) {
         $collation = $this->notice->npages;
     }
     if ($this->notice->ill) {
         $collation .= ': ' . $this->notice->ill;
     }
     if ($this->notice->size) {
         $collation .= '; ' . $this->notice->size;
     }
     if ($this->notice->accomp) {
         $collation .= '+ ' . $this->notice->accomp;
     }
     if ($collation) {
         $this->isbd .= ".&nbsp;-&nbsp;{$collation}";
     }
     $this->memo_collation = $collation;
     // map
     $this->memo_map_isbd = "";
     $this->memo_map_id = 0;
     $this->memo_map_echelle = "";
     $this->memo_map_projection = "";
     $this->memo_map_ref = "";
     $this->memo_map_equinoxe = "";
     $this->memo_map = "";
     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);
         $this->memo_map_isbd = $this->map_info->get_isbd();
         if ($this->memo_map_isbd) {
             $this->isbd .= ".&nbsp;-&nbsp;" . $this->memo_map_isbd;
         }
         $this->memo_map_id = $this->map_info->map['id'];
         $this->memo_map_echelle = $this->map_info->map['echelle'];
         $this->memo_map_projection = $this->map_info->map['projection'];
         $this->memo_map_ref = $this->map_info->map['ref'];
         $this->memo_map_equinoxe = $this->map_info->map['equinoxe'];
         $this->memo_map = $this->map->get_map();
     }
     //Recherche du code dewey
     $requete = "select * from indexint where indexint_id=" . $res->indexint;
     $resultat = pmb_mysql_query($requete);
     if ($code_dewey = pmb_mysql_fetch_object($resultat)) {
         $this->memo_dewey = $code_dewey;
     }
     if ($collections = $this->memo_collection) {
         if ($this->notice->nocoll) {
             $collections .= '; ' . $this->notice->nocoll;
         }
         $this->isbd .= ".&nbsp;-&nbsp;({$collections})" . ' ';
     }
     if (substr(trim($this->isbd), -1) != ".") {
         $this->isbd .= '.';
     }
     //Traitement des exemplaires
     $this->memo_exemplaires = array();
     $requete = "select expl_id, expl_cb, expl_cote, expl_statut,statut_libelle, expl_typdoc, tdoc_libelle, expl_note, expl_comment, expl_section, section_libelle, ";
     $requete .= "expl_owner, lender_libelle, expl_codestat, codestat_libelle, expl_date_retour, expl_date_depot, expl_note, pret_flag, expl_location, location_libelle, expl_prix ";
     if ($opac_sur_location_activate) {
         $requete .= ", ifnull(surloc_id,0) as surloc_id, ifnull(surloc_libelle,'') as surloc_libelle ";
     }
     $requete .= "from exemplaires, docs_statut, docs_type, docs_section, docs_codestat, lenders, docs_location ";
     if ($opac_sur_location_activate) {
         $requete .= "left join sur_location on surloc_num=surloc_id ";
     }
     $requete .= "where expl_notice=" . $res->notice_id . " and expl_statut=idstatut and expl_typdoc=idtyp_doc and expl_section=idsection and expl_owner=idlender and expl_codestat=idcode ";
     $requete .= "and expl_location=idlocation ";
     $requete .= "union ";
     $requete .= "select expl_id, expl_cb, expl_cote, expl_statut,statut_libelle, expl_typdoc, tdoc_libelle, expl_note, expl_comment, expl_section, section_libelle, ";
     $requete .= "expl_owner, lender_libelle, expl_codestat, codestat_libelle, expl_date_retour, expl_date_depot, expl_note, pret_flag, expl_location, location_libelle, expl_prix ";
     if ($opac_sur_location_activate) {
         $requete .= ", ifnull(surloc_id,0) as surloc_id, ifnull(surloc_libelle,'') as surloc_libelle ";
     }
     $requete .= "from exemplaires, bulletins, docs_statut, docs_type, docs_section, docs_codestat, lenders, docs_location ";
     if ($opac_sur_location_activate) {
         $requete .= "left join sur_location on surloc_num=surloc_id ";
     }
     $requete .= "where bulletins.num_notice=" . $res->notice_id . " and expl_bulletin=bulletin_id and expl_statut=idstatut and expl_typdoc=idtyp_doc and expl_section=idsection and expl_owner=idlender and expl_codestat=idcode ";
     $requete .= "and expl_location=idlocation";
     $resultat = pmb_mysql_query($requete);
     while ($ex = pmb_mysql_fetch_object($resultat)) {
         //Champs perso d'exemplaires
         $parametres_perso = array();
         $mes_pp = new parametres_perso("expl");
         if (!$mes_pp->no_special_fields) {
             $mes_pp->get_values($ex->expl_id);
             $values = $mes_pp->values;
             foreach ($values as $field_id => $vals) {
                 $parametres_perso[$mes_pp->t_fields[$field_id]["NAME"]]["TITRE"] = $mes_pp->t_fields[$field_id]["TITRE"];
                 foreach ($vals as $value) {
                     $parametres_perso[$mes_pp->t_fields[$field_id]["NAME"]]["VALUE"][] = $mes_pp->get_formatted_output(array($value), $field_id);
                 }
             }
         }
         $ex->parametres_perso = $parametres_perso;
         $this->memo_exemplaires[] = $ex;
     }
     //Descripteurs
     $requete = "SELECT libelle_categorie FROM categories, notices_categories WHERE notcateg_notice=" . $res->notice_id . " and categories.num_noeud = notices_categories.num_noeud ORDER BY ordre_categorie";
     $resultat = pmb_mysql_query($requete);
     $this->memo_categories = array();
     while ($cat = pmb_mysql_fetch_object($resultat)) {
         $this->memo_categories[] = $cat;
     }
     $authperso = new authperso_notice($this->notice_id);
     $this->memo_authperso_all_isbd .= $authperso->get_notice_display();
     $this->memo_authperso_all_isbd_list = $authperso->get_notice_display_list();
     foreach ($authperso->auth_info as $fields) {
         foreach ($fields["info_fields"] as $field) {
             if (is_array($field["values"]) && count($field["values"])) {
                 $tvalues = array();
                 foreach ($field["values"] as $values) {
                     $tvalues[] = $values["format_value"];
                 }
                 $this->parametres_auth_perso[$field["name"]]["TITRE"][] = $field["label"];
                 $this->parametres_auth_perso[$field["name"]]["VALUE"][] = $tvalues;
             }
         }
     }
     //Champs perso de notice traite par la table notice_custom
     $mes_pp = new parametres_perso("notices");
     $mes_pp->get_values($res->notice_id);
     $values = $mes_pp->values;
     $this->parametres_perso = array();
     foreach ($values as $field_id => $vals) {
         $this->parametres_perso[$mes_pp->t_fields[$field_id]["NAME"]]["TITRE"] = $mes_pp->t_fields[$field_id]["TITRE"];
         foreach ($vals as $value) {
             $this->parametres_perso[$mes_pp->t_fields[$field_id]["NAME"]]["VALUE"][] = $mes_pp->get_formatted_output(array($value), $field_id);
             $this->parametres_perso[$mes_pp->t_fields[$field_id]["NAME"]]["VALUE_IN_DATABASE"][] = $value;
         }
     }
     //Notices liées, relations entre notices
     //les notices mères
     $requete = "SELECT num_notice, linked_notice, relation_type, rank from notices_relations where num_notice=" . $res->notice_id . " order by num_notice, rank asc";
     $resultat = pmb_mysql_query($requete);
     $i = 0;
     while ($notice_fille = pmb_mysql_fetch_object($resultat)) {
         $this->memo_notice_mere[$i] = $notice_fille->linked_notice;
         $this->memo_notice_mere_relation_type[$i] = $notice_fille->relation_type;
         $i++;
     }
     // les notices filles
     $requete = "SELECT num_notice, linked_notice, relation_type, rank from notices_relations where linked_notice=" . $res->notice_id . " order by num_notice, rank asc";
     $resultat = pmb_mysql_query($requete);
     $i = 0;
     while ($notice_mere = pmb_mysql_fetch_object($resultat)) {
         $this->memo_notice_fille[$i] = $notice_mere->num_notice;
         $this->memo_notice_fille_relation_type[$i] = $notice_mere->relation_type;
         $i++;
     }
     // liens vers les périodiques pour les notices d'article
     $req_perio_link = "SELECT notice_id, tit1, code from bulletins,analysis,notices WHERE bulletin_notice=notice_id and bulletin_id=analysis_bulletin and analysis_notice=" . $res->notice_id;
     $result_perio_link = pmb_mysql_query($req_perio_link);
     while ($notice_perio_link = pmb_mysql_fetch_object($result_perio_link)) {
         $this->memo_notice_article[] = $notice_perio_link->notice_id;
     }
     // bulletinage pour les notices de pério
     $req_bulletinage = "SELECT bulletin_id, bulletin_numero, date_date, mention_date, bulletin_titre, bulletin_numero from bulletins, notices WHERE bulletin_notice = notice_id AND notice_id=" . $res->notice_id;
     $result_bulletinage = pmb_mysql_query($req_bulletinage);
     while ($notice_bulletinage = pmb_mysql_fetch_object($result_bulletinage)) {
         $this->memo_bulletinage[] = $notice_bulletinage->bulletin_id;
     }
     // liens vers les bulletins pour les notices d'article
     $req_bull_link = "SELECT bulletin_id, bulletin_numero, date_date, mention_date, bulletin_titre, bulletin_numero from bulletins, analysis WHERE bulletin_id=analysis_bulletin and analysis_notice=" . $res->notice_id;
     $result_bull_link = pmb_mysql_query($req_bull_link);
     while ($notice_bull_link = pmb_mysql_fetch_object($result_bull_link)) {
         $this->memo_article_bulletinage[] = $notice_bull_link->bulletin_id;
     }
     $paramaff["mine_type"] = 1;
     $this->memo_explnum_assoc = show_explnum_per_notice($res->notice_id, 0, "", $paramaff);
     if ($this->notice->code || $this->notice->thumbnail_url) {
         if ($opac_show_book_pics == '1' && ($opac_book_pics_url || $this->notice->thumbnail_url)) {
             $code_chiffre = pmb_preg_replace('/-|\\.| /', '', $this->notice->code);
             $url_image = $opac_book_pics_url;
             $url_image = $opac_url_base . "getimage.php?url_image=" . urlencode($url_image) . "&amp;noticecode=!!noticecode!!&amp;vigurl=" . urlencode($this->notice->thumbnail_url);
             if ($this->notice->thumbnail_url) {
                 $url_image_ok = $this->notice->thumbnail_url;
                 $title_image_ok = "";
             } else {
                 $url_image_ok = str_replace("!!noticecode!!", $code_chiffre, $url_image);
                 $title_image_ok = htmlentities($opac_book_pics_msg, ENT_QUOTES, $charset);
             }
             $this->memo_image = "<img class='vignetteimg' src='" . $url_image_ok . "' title=\"" . $title_image_ok . "\" align='right' hspace='4' vspace='2' style='max-width : 140px; max-height: 200px;' >";
             $this->memo_url_image = $url_image_ok;
         } else {
             $this->memo_image = "";
             $this->memo_url_image = "";
         }
     }
     //calcul du permalink...
     if ($this->notice->niveau_biblio != "b") {
         $this->permalink = $opac_url_base . "index.php?lvl=notice_display&id=" . $this->notice_id;
     } else {
         $this->permalink = $opac_url_base . "index.php?lvl=bulletin_display&id=" . $this->bulletin_id;
     }
     //Traitement des avis
     $this->memo_avis = array();
     $requete = "SELECT id_avis,note,sujet,commentaire,DATE_FORMAT(dateajout,'" . $msg['format_date'] . "') as ladate,empr_login,empr_nom, empr_prenom, valide\n\t\tfrom avis left join empr on id_empr=num_empr where num_notice='" . $res->notice_id . "' and valide=1 order by avis_rank, dateajout desc";
     $resultat = pmb_mysql_query($requete);
     if ($resultat) {
         while ($avis = pmb_mysql_fetch_object($resultat)) {
             $avis->note_textuelle = $msg['avis_detail_note_' . $avis->note];
             if ($charset != "utf-8") {
                 $avis->commentaire = cp1252Toiso88591($avis->commentaire);
             }
             $avis->commentaire = do_bbcode($avis->commentaire);
             $this->memo_avis[] = $avis;
         }
     }
     //Titres uniformes
     $requete = "select * from notices_titres_uniformes where ntu_num_notice=" . $res->notice_id . " order by ntu_ordre";
     $resultat = pmb_mysql_query($requete);
     if (pmb_mysql_num_rows($resultat)) {
         while ($tu = pmb_mysql_fetch_object($resultat)) {
             $tu_memo = new titre_uniforme($tu->ntu_num_tu);
             $tu_memo->parametres_perso = array();
             $mes_pp = new parametres_perso("tu");
             $mes_pp->get_values($tu->ntu_num_tu);
             $values = $mes_pp->values;
             foreach ($values as $field_id => $vals) {
                 $tu_memo->parametres_perso[$mes_pp->t_fields[$field_id]["NAME"]]["TITRE"] = $mes_pp->t_fields[$field_id]["TITRE"];
                 foreach ($vals as $value) {
                     $tu_memo->parametres_perso[$mes_pp->t_fields[$field_id]["NAME"]]["VALUE"][] = $mes_pp->get_formatted_output(array($value), $field_id);
                 }
             }
             $this->memo_tu[] = $tu_memo;
         }
     }
     //statut
     $this->memo_statut['id_notice_statut'] = $res->statut;
     $this->memo_statut['gestion_statut_libelle'] = '';
     $this->memo_statut['opac_statut_libelle'] = '';
     if ($this->memo_statut['id_notice_statut']) {
         $requete = "SELECT * FROM notice_statut WHERE id_notice_statut=" . $this->memo_statut['id_notice_statut'] * 1;
         $resultat = pmb_mysql_query($requete);
         if ($resultat) {
             $statut = pmb_mysql_fetch_object($resultat);
             $this->memo_statut['gestion_statut_libelle'] = $statut->gestion_libelle;
             $this->memo_statut['opac_statut_libelle'] = $statut->opac_libelle;
         }
     }
     return true;
 }
Example #20
0
 function do_image($code, $vigurl = "", $tit1 = "")
 {
     global $charset;
     global $opac_show_book_pics;
     global $opac_book_pics_url;
     global $opac_book_pics_msg;
     global $opac_url_base;
     global $msg;
     if ($code != "" || $vigurl != "") {
         if ($opac_show_book_pics == '1' && ($opac_book_pics_url || $vigurl)) {
             $code_chiffre = pmb_preg_replace('/-|\\.| /', '', $code);
             $url_image = $opac_book_pics_url;
             $url_image = $opac_url_base . "getimage.php?url_image=" . urlencode($url_image) . "&noticecode=!!noticecode!!&vigurl=" . urlencode($vigurl);
             $url_image_ok = str_replace("!!noticecode!!", $code_chiffre, $url_image);
             if ($vigurl) {
                 $title_image_ok = "";
             } else {
                 $title_image_ok = htmlentities($opac_book_pics_msg, ENT_QUOTES, $charset);
             }
             if (!trim($title_image_ok)) {
                 $title_image_ok = htmlentities($tit1, ENT_QUOTES, $charset);
             }
             $image = "<img src='" . $url_image_ok . "' title=\"" . $title_image_ok . "\" align='right' hspace='4' vspace='2'  alt='" . $msg["opac_notice_vignette_alt"] . "'/>";
         } else {
             $image = "";
         }
     } else {
         $image = "";
     }
     return $image;
 }
Example #21
0
function clean_string($string)
{
    // on supprime les caractËres non-imprimables
    $string = pmb_preg_replace("/\\x0|[-]/U", "", $string);
    // suppression des caractËres de ponctuation indesirables
    // $string = pmb_preg_replace('/[\{\}\"]/', '', $string);
    // supression du point et des espaces de fin
    $string = pmb_preg_replace('/\\s+\\.$|\\s+$/', '', $string);
    // nettoyage des espaces autour des parenthËses
    $string = pmb_preg_replace('/\\(\\s+/', '(', $string);
    $string = pmb_preg_replace('/\\s+\\)/', ')', $string);
    // idem pour les crochets
    $string = pmb_preg_replace('/\\[\\s+/', '[', $string);
    $string = pmb_preg_replace('/\\s+\\]/', ']', $string);
    // petit point de detail sur les apostrophes
    //$string = pmb_preg_replace('/\'\s+/', "'", $string);
    // 'trim' par regex
    $string = pmb_preg_replace('/^\\s+|\\s+$/', '', $string);
    // suppression des espaces doubles
    $string = pmb_preg_replace('/\\s+/', ' ', $string);
    return $string;
}
 function do_image(&$entree, $depliable)
 {
     global $charset;
     global $opac_show_book_pics;
     global $opac_book_pics_url;
     global $opac_book_pics_msg;
     global $opac_url_base;
     if ($this->notice->code != "") {
         if ($opac_show_book_pics == '1' && $opac_book_pics_url) {
             $code_chiffre = pmb_preg_replace('/-|\\.| /', '', $this->notice->code);
             $url_image = $opac_book_pics_url;
             $url_image = $opac_url_base . "getimage.php?url_image=" . urlencode($url_image) . "&noticecode=!!noticecode!!";
             if ($depliable) {
                 $image = "<img class='vignetteimg' src='" . $opac_url_base . "images/vide.png' align='right' hspace='4' vspace='2' isbn='" . $code_chiffre . "' url_image='" . $url_image . "'>";
             } else {
                 $url_image_ok = str_replace("!!noticecode!!", $code_chiffre, $url_image);
                 $title_image_ok = htmlentities($opac_book_pics_msg, ENT_QUOTES, $charset);
                 $image = "<img class='vignetteimg' src='" . $url_image_ok . "' title=\"" . $title_image_ok . "\" align='right' hspace='4' vspace='2'>";
             }
         } else {
             $image = "";
         }
         if ($image) {
             $entree = "<table width='100%'><tr><td>{$entree}</td><td valign=top align=right>{$image}</td></tr></table>";
         } else {
             $entree = "<table width='100%'><tr><td>{$entree}</td></tr></table>";
         }
     } else {
         $entree = "<table width='100%'><tr><td>{$entree}</td></tr></table>";
     }
 }
Example #23
0
     $myCart = new caddie($idcaddie);
     $myCart->delete();
     aff_paniers($idcaddie, "NOTI", "./catalog.php?categ=search&mode=3", "add_item", $msg['caddie_select_afficher'], "", 0, 1, 1);
     break;
 case 'del_item':
     $myCart = new caddie($idcaddie);
     $myCart->del_item($item);
     print "<div class=\"row\"><b>Panier&nbsp;: " . $myCart->name . ' (' . $myCart->type . ')</b></div>';
     //aff_cart_notices($myCart->get_cart(), $myCart->type, $idcaddie);
     aff_cart_objects($idcaddie, "./catalog.php?categ=search&mode=3&idcaddie={$idcaddie}", true, 0, true);
     break;
 case 'valid_new_cart':
     $myCart = new caddie(0);
     $myCart->name = pmb_preg_replace('/\\"|\'/', ' ', stripslashes($cart_name));
     $myCart->type = $cart_type;
     $myCart->comment = pmb_preg_replace('/\\"|\'/', ' ', stripslashes($cart_comment));
     if (is_array($cart_autorisations)) {
         $autorisations = implode(" ", $cart_autorisations);
     } else {
         $autorisations = "";
     }
     $myCart->autorisations = $autorisations;
     $myCart->create_cart();
     aff_paniers($idcaddie, "NOTI", "./catalog.php?categ=search&mode=3", "add_item", $msg['caddie_select_afficher'], "", 0, 1, 1);
     break;
 default:
     if ($idcaddie) {
         //Historique
         $myCart = new caddie($idcaddie);
         if ($page == "") {
             $_SESSION["CURRENT"] = count($_SESSION["session_history"]);
 public function render($datas)
 {
     global $dbh;
     global $opac_url_base;
     global $opac_show_book_pics;
     global $opac_book_pics_url;
     global $opac_notice_affichage_class;
     global $opac_bannette_notices_depliables;
     global $opac_bannette_notices_format;
     global $opac_bannette_notices_order;
     global $liens_opac;
     if (!$opac_notice_affichage_class) {
         $opac_notice_affichage_class = "notice_affichage";
     }
     //on gère l'affichage des banettes
     foreach ($datas["bannettes"] as $i => $bannette) {
         $datas['bannettes'][$i]['link'] = $this->get_constructed_link('bannette', $datas['bannettes'][$i]['id']);
         if ($this->parameters['nb_notices']) {
             $limitation = " LIMIT " . $this->parameters['nb_notices'];
         }
         $requete = "select * from bannette_contenu, notices where num_bannette='" . $datas['bannettes'][$i]['id'] . "' \n\t\t\tand notice_id=num_notice";
         if ($opac_bannette_notices_order) {
             $requete .= " order by " . $opac_bannette_notices_order;
         }
         $requete .= " " . $limitation;
         $resultat = pmb_mysql_query($requete, $dbh);
         $cpt_record = 0;
         $datas["bannettes"][$i]['records'] = array();
         while ($r = pmb_mysql_fetch_object($resultat)) {
             $content = "";
             if ($opac_show_book_pics == '1' && ($opac_book_pics_url || $r->thumbnail_url)) {
                 $code_chiffre = pmb_preg_replace('/-|\\.| /', '', $r->code);
                 $url_image = $opac_book_pics_url;
                 $url_image = $opac_url_base . "getimage.php?url_image=" . urlencode($url_image) . "&noticecode=!!noticecode!!&vigurl=" . urlencode($r->thumbnail_url);
                 if ($r->thumbnail_url) {
                     $url_vign = $r->thumbnail_url;
                 } else {
                     if ($code_chiffre) {
                         $url_vign = str_replace("!!noticecode!!", $code_chiffre, $url_image);
                     } else {
                         $url_vign = $opac_url_base . "images/vide.png";
                     }
                 }
             }
             if ($this->parameters['used_template']) {
                 $tpl = new notice_tpl_gen($this->parameters['used_template']);
                 $content = $tpl->build_notice($r->num_notice);
             } else {
                 $notice_class = new $opac_notice_affichage_class($r->num_notice, $liens_opac);
                 $notice_class->do_header();
                 switch ($opac_bannette_notices_format) {
                     case AFF_BAN_NOTICES_REDUIT:
                         $content .= "<div class='etagere-titre-reduit'>" . $notice_class->notice_header_with_link . "</div>";
                         break;
                     case AFF_BAN_NOTICES_ISBD:
                         $notice_class->do_isbd();
                         $notice_class->genere_simple($opac_bannette_notices_depliables, 'ISBD');
                         $content .= $notice_class->result;
                         break;
                     case AFF_BAN_NOTICES_PUBLIC:
                         $notice_class->do_public();
                         $notice_class->genere_simple($opac_bannette_notices_depliables, 'PUBLIC');
                         $content .= $notice_class->result;
                         break;
                     case AFF_BAN_NOTICES_BOTH:
                         $notice_class->do_isbd();
                         $notice_class->do_public();
                         $notice_class->genere_double($opac_bannette_notices_depliables, 'PUBLIC');
                         $content .= $notice_class->result;
                         break;
                     default:
                         $notice_class->do_isbd();
                         $notice_class->do_public();
                         $notice_class->genere_double($opac_bannette_notices_depliables, 'autre');
                         $content .= $notice_class->result;
                         break;
                 }
             }
             $datas["bannettes"][$i]['records'][$cpt_record]['id'] = $r->num_notice;
             $datas["bannettes"][$i]['records'][$cpt_record]['title'] = $r->title;
             $datas["bannettes"][$i]['records'][$cpt_record]['link'] = $this->get_constructed_link("notice", $r->num_notice);
             $datas["bannettes"][$i]['records'][$cpt_record]['url_vign'] = $url_vign;
             $datas["bannettes"][$i]['records'][$cpt_record]['content'] = $content;
             $cpt_record++;
         }
     }
     //on rappelle le tout...
     return parent::render($datas);
 }
Example #25
0
<?php

// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: marguerite_browser.inc.php,v 1.11 2009-05-16 10:52:52 dbellamy Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
$marguerite_img = "<SCRIPT LANGUAGE=\"JavaScript\"><!--\nvar js = 1.0;\n\nVersion = parseInt(navigator.appVersion);\n\nif (navigator.appName == \"Netscape\")\n    js = ((Version >= 4) ? 1.2 : ( (Version == 3) ? 1.1 : 1.0 ));\nelse\n    if (navigator.appVersion.indexOf('MSIE') != -1) \n        js = ((Version >= 4) ? 1.1 : 1.0);\n\nfunction changeImagemap(newImage) {\n    if (js > 1.0) document ['boxImage'].src = eval(newImage + \".src\");\n}\n\nif (js > 1.0) {\n\tmapMarg = new Image();\n\tmapMarg.src = \"images/marg.gif\";\n\n    map0 = new Image();\n    map0.src  = \"images/marg0.gif\";\n\n    map1 = new Image();\n    map1.src  = \"images/marg1.gif\";\n\n    map2 = new Image();\n    map2.src  = \"images/marg2.gif\";\n\n    map3 = new Image();\n    map3.src  = \"images/marg3.gif\";\n\n    map4 = new Image();\n    map4.src  = \"images/marg4.gif\";\n\n    map5 = new Image();\n    map5.src  = \"images/marg5.gif\";\n\n    map6 = new Image();\n    map6.src  = \"images/marg6.gif\";\n\n    map7 = new Image();\n    map7.src  = \"images/marg7.gif\";\n\n    map8 = new Image();\n    map8.src  = \"images/marg8.gif\";\n\n    map9 = new Image();\n    map9.src  = \"images/marg9.gif\";\n\n}\n\n\n\n//-->\n\n\tmapMarg = new Image();\n\tmapMarg.src = \"images/marg.gif\";\n\n    map0 = new Image();\n    map0.src  = \"images/marg0.gif\";\n\n    map1 = new Image();\n    map1.src  = \"images/marg1.gif\";\n\n    map2 = new Image();\n    map2.src  = \"images/marg2.gif\";\n\n    map3 = new Image();\n    map3.src  = \"images/marg3.gif\";\n\n    map4 = new Image();\n    map4.src  = \"images/marg4.gif\";\n\n    map5 = new Image();\n    map5.src  = \"images/marg5.gif\";\n\n    map6 = new Image();\n    map6.src  = \"images/marg6.gif\";\n\n    map7 = new Image();\n    map7.src  = \"images/marg7.gif\";\n\n    map8 = new Image();\n    map8.src  = \"images/marg8.gif\";\n\n    map9 = new Image();\n    map9.src  = \"images/marg9.gif\";\n\n</SCRIPT>\n<map name=\"image-map\">\n  <area shape='poly' coords='176,14,265,43,178,168' HREF='index.php?lvl=indexint_see&id=!!id100!!&main=1'\n   onMouseOver='changeImagemap(\"map1\");self.status=\"" . $msg["put_mouse_over_petals"] . "\";document.getElementById(\"marguerite_petal_text\").innerHTML = \"!!100!!\";return true'\n   onMouseOut='changeImagemap(\"mapMarg\");self.status=\"\";document.getElementById(\"marguerite_petal_text\").innerHTML = \"" . $msg["put_mouse_over_petals"] . "\";return true'>\n  <area shape='poly' coords='265,44,322,119,177,171' HREF='index.php?lvl=indexint_see&id=!!id200!!&main=1'\n   onMouseOver='changeImagemap(\"map2\");self.status=\"" . $msg["put_mouse_over_petals"] . "\";document.getElementById(\"marguerite_petal_text\").innerHTML = \"!!200!!\";return true'\n   onMouseOut='changeImagemap(\"mapMarg\");self.status=\"\";document.getElementById(\"marguerite_petal_text\").innerHTML = \"" . $msg["put_mouse_over_petals"] . "\";return true'>\n  <area shape='poly' coords='177,172,321,121,323,216' HREF='index.php?lvl=indexint_see&id=!!id300!!&main=1'\n   onMouseOver='changeImagemap(\"map3\");self.status=\"" . $msg["put_mouse_over_petals"] . "\";document.getElementById(\"marguerite_petal_text\").innerHTML = \"!!300!!\";return true'\n   onMouseOut='changeImagemap(\"mapMarg\");self.status=\"\";document.getElementById(\"marguerite_petal_text\").innerHTML = \"" . $msg["put_mouse_over_petals"] . "\";return true'>\n  <area shape='poly' coords='176,174,321,218,269,298' HREF='index.php?lvl=indexint_see&id=!!id400!!&main=1'\n   onMouseOver='changeImagemap(\"map4\");self.status=\"" . $msg["put_mouse_over_petals"] . "\";document.getElementById(\"marguerite_petal_text\").innerHTML = \"!!400!!\";return true'\n   onMouseOut='changeImagemap(\"mapMarg\");self.status=\"\";document.getElementById(\"marguerite_petal_text\").innerHTML = \"" . $msg["put_mouse_over_petals"] . "\";return true'>\n  <area shape='poly' coords='267,299,178,330,176,177' HREF='index.php?lvl=indexint_see&id=!!id500!!&main=1'\n   onMouseOver='changeImagemap(\"map5\");self.status=\"" . $msg["put_mouse_over_petals"] . "\";document.getElementById(\"marguerite_petal_text\").innerHTML = \"!!500!!\";return true'\n   onMouseOut='changeImagemap(\"mapMarg\");self.status=\"\";document.getElementById(\"marguerite_petal_text\").innerHTML = \"" . $msg["put_mouse_over_petals"] . "\";return true'>\n  <area shape='poly' coords='172,171,174,326,83,297' HREF='index.php?lvl=indexint_see&id=!!id600!!&main=1'\n   onMouseOver='changeImagemap(\"map6\");self.status=\"" . $msg["put_mouse_over_petals"] . "\";document.getElementById(\"marguerite_petal_text\").innerHTML = \"!!600!!\";return true'\n   onMouseOut='changeImagemap(\"mapMarg\");self.status=\"\";document.getElementById(\"marguerite_petal_text\").innerHTML = \"" . $msg["put_mouse_over_petals"] . "\";return true'>\n  <area shape='poly' coords='172,167,23,217,82,293' HREF='index.php?lvl=indexint_see&id=!!id700!!&main=1'\n   onMouseOver='changeImagemap(\"map7\");self.status=\"" . $msg["put_mouse_over_petals"] . "\";document.getElementById(\"marguerite_petal_text\").innerHTML = \"!!700!!\";return true'\n   onMouseOut='changeImagemap(\"mapMarg\");self.status=\"\";document.getElementById(\"marguerite_petal_text\").innerHTML = \"" . $msg["put_mouse_over_petals"] . "\";return true'>\n  <area shape='poly' coords='23,125,26,218,173,170' HREF='index.php?lvl=indexint_see&id=!!id800!!&main=1'\n   onMouseOver='changeImagemap(\"map8\");self.status=\"" . $msg["put_mouse_over_petals"] . "\";document.getElementById(\"marguerite_petal_text\").innerHTML = \"!!800!!\";return true'\n   onMouseOut='changeImagemap(\"mapMarg\");self.status=\"\";document.getElementById(\"marguerite_petal_text\").innerHTML = \"" . $msg["put_mouse_over_petals"] . "\";return true'>\n  <area shape='poly' coords='173,168,24,122,80,42' HREF='index.php?lvl=indexint_see&id=!!id900!!&main=1'\n   onMouseOver='changeImagemap(\"map9\");self.status=\"" . $msg["put_mouse_over_petals"] . "\";document.getElementById(\"marguerite_petal_text\").innerHTML = \"!!900!!\";return true'\n   onMouseOut='changeImagemap(\"mapMarg\");self.status=\"\";document.getElementById(\"marguerite_petal_text\").innerHTML = \"" . $msg["put_mouse_over_petals"] . "\";return true'>\n  <area shape='poly' coords='171,165,78,39,167,10' HREF='index.php?lvl=indexint_see&id=!!id000!!&main=1'\n   onMouseOver='changeImagemap(\"map0\");self.status=\"" . $msg["put_mouse_over_petals"] . "\";document.getElementById(\"marguerite_petal_text\").innerHTML = \"!!000!!\";return true'\n   onMouseOut='changeImagemap(\"mapMarg\");self.status=\"\";document.getElementById(\"marguerite_petal_text\").innerHTML = \"" . $msg["put_mouse_over_petals"] . "\";return true'>\n</map>\n<img NAME=\"boxImage\" src=\"images/marg.gif\" width=\"348\" height=\"341\" border=\"0\" USEMAP=\"#image-map\">";
$rqt = " select indexint_id, indexint_comment, indexint_name from indexint where indexint_name in ('000','100','200','300','400','500','600','700','800','900') ";
$res = mysql_query($rqt, $dbh);
while ($indexint = mysql_fetch_object($res)) {
    $indexint->indexint_comment = pmb_preg_replace('/\\r/', ' ', $indexint->indexint_comment);
    $indexint->indexint_comment = pmb_preg_replace('/\\n/', ' ', $indexint->indexint_comment);
    $marguerite_img = pmb_preg_replace("/!!" . $indexint->indexint_name . "!!/m", htmlentities($indexint->indexint_comment, ENT_QUOTES, $charset), $marguerite_img);
    $marguerite_img = pmb_preg_replace("/!!id" . $indexint->indexint_name . "!!/", $indexint->indexint_id, $marguerite_img);
}
print preg_replace('/!!indexint_title!!/m', $msg["colors_marguerite"], $decimal_see_header);
print "<center>" . $marguerite_img;
print "<div id=\"marguerite_petal_text\">" . $msg["put_mouse_over_petals"] . "</div></center><br />";
print $decimal_see_footer;
 function do_image(&$entree, $depliable)
 {
     global $empr_pics_url;
     if ($empr_pics_url) {
         $code_chiffre = pmb_preg_replace('/ /', '', $this->empr_cb);
         $url_image = $empr_pics_url;
         $url_image = "./getimage.php?url_image=" . urlencode($url_image) . "&empr_pic=1";
         if ($depliable) {
             $image = "<img src='./images/vide.png' align='right' hspace='4' vspace='2' isbn='" . $code_chiffre . "' url_image='" . $url_image . "'>";
         } else {
             $url_image_ok = str_replace("%21%21num_carte%21%21", $code_chiffre, $url_image);
             $image = "<img src='" . $url_image_ok . "' align='right' hspace='4' vspace='2'>";
         }
     } else {
         $image = "";
     }
     if ($image) {
         $entree = "<table width='100%'><tr><td>{$entree}</td><td valign=top align=right>{$image}</td></tr></table>";
     } else {
         $entree = "<table width='100%'><tr><td>{$entree}</td></tr></table>";
     }
 }
Example #27
0
 /**
  * Creation de l'image vignette associée
  *
  * @param  $entree
  */
 function do_image(&$entree)
 {
     global $charset;
     global $pmb_book_pics_show;
     global $pmb_book_pics_url;
     global $pmb_book_pics_msg;
     // pour url OPAC en diff DSI
     global $prefix_url_image;
     global $depliable;
     if ($this->notice->code || $this->notice->thumbnail_url) {
         if ($pmb_book_pics_show == '1' && ($pmb_book_pics_url || $this->notice->thumbnail_url)) {
             $code_chiffre = pmb_preg_replace('/-|\\.| /', '', $this->notice->code);
             $url_image = $pmb_book_pics_url;
             $url_image = $prefix_url_image . "getimage.php?url_image=" . urlencode($url_image) . "&amp;noticecode=!!noticecode!!&amp;vigurl=" . urlencode($this->notice->thumbnail_url);
             if ($depliable) {
                 $image = "<img class='img_notice' id='PMBimagecover" . $this->notice_id . "' src='" . $prefix_url_image . "images/vide.png' align='right' hspace='4' vspace='2' isbn='" . $code_chiffre . "' url_image='" . $url_image . "' vigurl=\"" . $this->notice->thumbnail_url . "\">";
             } else {
                 if ($this->notice->thumbnail_url) {
                     $url_image_ok = $this->notice->thumbnail_url;
                     $title_image_ok = "";
                 } else {
                     $url_image_ok = str_replace("!!noticecode!!", $code_chiffre, $url_image);
                     $title_image_ok = htmlentities($pmb_book_pics_msg, ENT_QUOTES, $charset);
                 }
                 $image = "<img class='img_notice' id='PMBimagecover" . $this->notice_id . "' src='" . $url_image_ok . "' title=\"" . $title_image_ok . "\" align='right' hspace='4' vspace='2'>";
             }
         } else {
             $image = "";
         }
         if ($image) {
             $entree = "<table width='100%'><tr><td valign=top>{$entree}</td><td valign=top align=right>{$image}</td></tr></table>";
         } else {
             $entree = "<table width='100%'><tr><td valign=top>{$entree}</td></tr></table>";
         }
     } else {
         $entree = "<table width='100%'><tr><td valign=top>{$entree}</td></tr></table>";
     }
 }
Example #28
0
}
$hundred_cases_table .= "\n</tr>";
$i = 1;
while ($i < 10) {
    $j = 0;
    $hundred_cases_table .= "\n<tr height=55>";
    while ($j < 10) {
        if ($j == 0 or $j == 1 or $j == 7 or $j == 8) {
            $color = "#ffffff";
        } else {
            $color = "#000000";
        }
        $hundred_cases_table .= "\n\t<td style=\"filter:blendTrans(Duration=0.7);background:url(images/dewey" . $j . "cell.gif) repeat bottom left;\" onmouseover=\"switchOver(this,'images/dewey" . $j . ".gif')\" onmouseout=\"switchOver(this,'images/dewey" . $j . "cell.gif')\"><a style=\"color:{$color};font-size:smaller;\" href='index.php?lvl=indexint_see&id=!!id" . $j . $i . "0!!&main=1'>!!" . $j . $i . "0!!<br /><div align=right>" . $j . $i . "0</div></a></td>";
        $j++;
    }
    $i++;
    $hundred_cases_table .= "\n</tr>";
    // La valeur affiche est $i avant l'incrémentation (post-incrémentation)
}
$hundred_cases_table .= "\n</table>";
$rqt = " select indexint_id, indexint_comment, indexint_name from indexint where indexint_name REGEXP \"^..0\$\" ";
$res = mysql_query($rqt, $dbh);
while ($indexint = mysql_fetch_object($res)) {
    $indexint->indexint_comment = pmb_preg_replace('/\\r/', ' ', $indexint->indexint_comment);
    $indexint->indexint_comment = pmb_preg_replace('/\\n/', ' ', $indexint->indexint_comment);
    $hundred_cases_table = pmb_preg_replace("/!!" . $indexint->indexint_name . "!!/m", htmlentities($indexint->indexint_comment, ENT_QUOTES, $charset), $hundred_cases_table);
    $hundred_cases_table = pmb_preg_replace("/!!id" . $indexint->indexint_name . "!!/", $indexint->indexint_id, $hundred_cases_table);
}
print pmb_bidi($hundred_cases_table);
print "<br />";
print $decimal_see_footer;