function show_select_languages()
{
    global $common_tpl_lang_select, $msg, $opac_show_languages, $include_path, $lang;
    $show_languages = substr($opac_show_languages, 0, 1);
    if ($show_languages == 1) {
        $languages = explode(",", substr($opac_show_languages, 2));
        $langues = new XMLlist("{$include_path}/messages/languages.xml");
        $langues->analyser();
        $clang = $langues->table;
        for ($i = 0; $i < sizeof($languages); $i++) {
            $lang_combo[$languages[$i]] = $clang[$languages[$i]];
        }
        $common_tpl_lang_select = str_replace("!!msg_lang_select!!", $msg["common_tpl_lang_select"], $common_tpl_lang_select);
        $combo = "<form method=\"post\" action=\"index.php\" >";
        $combo .= "<select name=\"lang_sel\" onchange=\"this.form.submit();\">";
        while (list($cle, $value) = each($lang_combo)) {
            if (strcmp($cle, $lang) != 0) {
                $combo .= "<option value='{$cle}'>{$value}</option>";
            } else {
                $combo .= "<option value='{$cle}' selected>{$value} </option>";
            }
        }
        $combo .= "</select></form>";
        $common_tpl_lang_select = str_replace("!!lang_select!!", $combo, $common_tpl_lang_select);
        // end combo box
        return $common_tpl_lang_select;
    } else {
        return "";
    }
}
Exemple #2
0
function make_empr_lang_combo($lang = '')
{
    // retourne le combo des langues avec la langue $lang selectionn?e
    // n?cessite l'inclusion de XMLlist.class.php (normalement c'est d?j? le cas partout
    global $include_path;
    global $msg;
    global $charset;
    // langue par defaut
    if (!$lang) {
        $lang = "fr_FR";
    }
    $langues = new XMLlist("{$include_path}/messages/languages.xml");
    $langues->analyser();
    $clang = $langues->table;
    $combo = "<select name='form_empr_lang' id='empr_lang'>";
    while (list($cle, $value) = each($clang)) {
        // arabe seulement si on est en utf-8
        if ($charset != 'utf-8' and $cle != 'ar' or $charset == 'utf-8') {
            if (strcmp($cle, $lang) != 0) {
                $combo .= "<option value='{$cle}'>{$value} ({$cle})</option>";
            } else {
                $combo .= "<option value='{$cle}' selected>{$value} ({$cle})</option>";
            }
        }
    }
    $combo .= "</select>";
    return $combo;
}
Exemple #3
0
 function set_language($lang)
 {
     global $msg;
     global $base_path;
     $messages = new XMLlist($base_path . "/includes/messages/{$lang}.xml", 0);
     $messages->analyser();
     $msg = $messages->table;
 }
 function get_messages($connector_path)
 {
     global $lang;
     if (file_exists($connector_path . "/messages/" . $lang . ".xml")) {
         $file_name = $connector_path . "/messages/" . $lang . ".xml";
     } else {
         if (file_exists($connector_path . "/messages/fr_FR.xml")) {
             $file_name = $connector_path . "/messages/fr_FR.xml";
         }
     }
     if ($file_name) {
         $xmllist = new XMLlist($file_name);
         $xmllist->analyser();
         $this->msg = $xmllist->table;
     }
 }
 function get_messages($lang_path)
 {
     global $lang;
     global $base_path;
     if (file_exists($base_path . $lang_path . "/messages/" . $lang . ".xml")) {
         $file_name = $base_path . $lang_path . "/messages/" . $lang . ".xml";
     } else {
         if (file_exists($base_path . $lang_path . "/messages/fr_FR.xml")) {
             $file_name = $base_path . $lang_path . "/messages/fr_FR.xml";
         }
     }
     if ($file_name) {
         $xmllist = new XMLlist($file_name);
         $xmllist->analyser();
         return $xmllist->table;
     }
 }
Exemple #6
0
function convert_diacrit($string)
{
    global $tdiac;
    global $charset;
    global $include_path;
    if (!$string) {
        return;
    }
    if (!$tdiac) {
        $tdiac = new XMLlist("{$include_path}/messages/diacritique{$charset}.xml");
        $tdiac->analyser();
    }
    foreach ($tdiac->table as $wreplace => $wdiacritique) {
        if (pmb_preg_match("/{$wdiacritique}/", $string)) {
            $string = pmb_preg_replace("/{$wdiacritique}/", $wreplace, $string);
        }
    }
    return $string;
}
 function process($source_id, $pmb_user_id, $json_input)
 {
     global $charset;
     global $wsdl;
     global $class_path;
     $the_source = $this->connector_object->instantiate_source_class($source_id);
     if (!isset($the_source->config["exported_functions"])) {
         $this->return_error("Source wasn't configured");
     }
     $allowed_methods = array();
     foreach ($the_source->config["exported_functions"] as $aallowed_method) {
         $allowed_methods[] = $aallowed_method['group'] . '_' . $aallowed_method['name'];
     }
     $json_operation = '';
     $request = $json_input;
     if ($request) {
         $json_operation = $request["method"];
     }
     //Instantions la classe qui contient les fonctions
     $ess = new external_services(true);
     if ($json_operation && $ess->operation_need_messages($json_operation)) {
         //Allons chercher les messages
         global $class_path;
         global $include_path;
         global $lang;
         require_once "{$class_path}/XMLlist.class.php";
         $messages = new XMLlist("{$include_path}/messages/{$lang}.xml", 0);
         $messages->analyser();
         global $msg;
         $msg = $messages->table;
     }
     if ($json_operation) {
         $proxy = $ess->get_proxy($pmb_user_id, array($json_operation));
     } else {
         $proxy = $ess->get_proxy($pmb_user_id);
     }
     $proxy->input_charset = 'utf-8';
     jsonRPCServer::handle($proxy, $allowed_methods, $json_input) or print 'No request';
 }
Exemple #8
0
function zattr_form($zbib_id = "", $zattr_libelle = "", $zattr_attr = "")
{
    global $msg;
    global $admin_zattr_form;
    global $include_path;
    global $lang;
    global $charset;
    // loading the localized attributes labels
    $la = new XMLlist($include_path . "/marc_tables/z3950attributes.xml", 0);
    $la->analyser();
    $codici = $la->table;
    if (!$zattr_libelle) {
        $admin_zattr_form = str_replace('!!form_title!!', $msg["zattr_ajouter_attr"], $admin_zattr_form);
        $admin_zattr_form = str_replace('!!bib_id!!', "", $admin_zattr_form);
        // here the combo box must be enabled because the user is adding a new attr.
        $select = "<div class='row'>\n\t\t\t\t<div class='colonne4' align='right'>\n\t\t\t\t\t<label class='etiquette'>{$msg['zattr_libelle']} &nbsp;</label>\n\t\t\t\t</div>\n\t\t\t\t<div class='colonne_suite'> ";
        $select .= "<select name='form_attr_libelle'>\t";
        while (list($codeattr, $libelle) = each($codici)) {
            if ($zattr_libelle == $codeattr) {
                $select .= "<option value='" . htmlentities($codeattr, ENT_QUOTES, $charset) . "' SELECTED>" . htmlentities($msg["z3950_" . $libelle], ENT_QUOTES, $charset) . "</option>";
            } else {
                $select .= "<option value='" . htmlentities($codeattr, ENT_QUOTES, $charset) . "'>" . htmlentities($msg["z3950_" . $libelle], ENT_QUOTES, $charset) . "</option>";
            }
        }
        $select .= "</select></div></div>";
    } else {
        $admin_zattr_form = str_replace('!!form_title!!', $msg["zattr_modifier_attr"] . " : " . $msg["z3950_" . $codici[$zattr_libelle]], $admin_zattr_form);
        $admin_zattr_form = str_replace('!!bib_id!!', $zbib_id, $admin_zattr_form);
        // here the combo box doesn't appear because the user can't change the attr. label
        $select = "<input type=hidden name=form_attr_libelle value='{$zattr_libelle}'>";
    }
    $admin_zattr_form = str_replace('!!code!!', $select, $admin_zattr_form);
    $admin_zattr_form = str_replace('!!attr_bib_id!!', $zbib_id, $admin_zattr_form);
    $admin_zattr_form = str_replace('!!attr_libelle!!', $zattr_libelle, $admin_zattr_form);
    $admin_zattr_form = str_replace('!!attr_attr!!', $zattr_attr, $admin_zattr_form);
    $admin_zattr_form = str_replace('!!local_attr_libelle!!', $msg["z3950_" . $codici[$zattr_libelle]], $admin_zattr_form);
    print confirmation_delete("./admin.php?categ=z3950&sub=zattr&action=del&");
    print $admin_zattr_form;
}
require_once "{$include_path}/mysql_connect.inc.php";
$dbh = connection_mysql();
//require_once("$include_path/sessions.inc.php");
require_once "{$include_path}/misc.inc.php";
//require_once("$javascript_path/misc.inc.php");
//require_once("$include_path/user_error.inc.php");
// classe de gestion de l'audit des objets
//require_once("$class_path/audit.class.php");
include "{$include_path}/start.inc.php";
$lang = "fr_FR";
$helpdir = $lang;
// localisation (fichier XML)
$messages = new XMLlist("{$include_path}/messages/{$lang}.xml", 0);
$messages->analyser();
$msg = $messages->table;
$descriptions = new XMLlist("affiche_contenu_params.xml", 0);
$descriptions->analyser();
$desc = $descriptions->table;
require "{$include_path}/templates/common.tpl.php";
require_once $include_path . "/parser.inc.php";
function param_form($id_param = 0, $type_param = "", $sstype_param = "", $valeur_param = "", $comment_param = "")
{
    global $msg;
    global $admin_param_form;
    $title = $msg[1606];
    // modification
    $admin_param_form = str_replace('!!form_title!!', $title, $admin_param_form);
    $admin_param_form = str_replace('!!id_param!!', $id_param, $admin_param_form);
    $admin_param_form = str_replace('!!type_param!!', $type_param, $admin_param_form);
    $admin_param_form = str_replace('!!sstype_param!!', $sstype_param, $admin_param_form);
    $admin_param_form = str_replace('!!valeur_param!!', $valeur_param, $admin_param_form);
function update_authors_num_opsys($aut_, $responsability_type)
{
    global $notice_id;
    global $table_responsability_function;
    global $lang, $include_path;
    global $xml_changement;
    if (!is_array($table_responsability_function)) {
        //$table_responsability_function=unserialize_file("table_responsability_function.tmp");
        $parser = new XMLlist("{$include_path}/marc_tables/{$lang}/function.xml");
        $parser->analyser();
        $table = $parser->table;
        $table_responsability_function = $parser->tablefav;
        if ($table_responsability_function) {
            foreach ($table_responsability_function as $key => $val) {
                $table_responsability_function[$key] = $table[$key];
            }
        }
    }
    //print"<pre>";print_r($aut_);print"</pre>";
    for ($i = 0; $i < count($aut_); $i++) {
        if ($aut_[$i][3] != "") {
            $aut_i_4 = str_replace('&', "", $aut_[$i]['4']);
            $aut_i_p = str_replace('&', "", $aut_[$i]['p']);
            $requete = "select author_id from authors, responsability where author_name='" . addslashes($aut_[$i][a]) . "' and author_rejete='" . addslashes($aut_[$i][b]) . "' \n\t\t\t\tand responsability_notice='{$notice_id}' and responsability_author = author_id";
            $result = pmb_mysql_query($requete);
            if ($row = pmb_mysql_fetch_row($result)) {
                $author_id = $row[0];
                $requete = "update authors set author_comment='" . addslashes($aut_[$i][3]) . "' where author_id='{$author_id}' ";
                pmb_mysql_query($requete);
                if ($aut_i_4 >= 900) {
                    $index = '';
                    if ($table_responsability_function) {
                        foreach ($table_responsability_function as $key => $val) {
                            if ($table_responsability_function[$key] == $aut_i_4) {
                                $index = $key;
                                break;
                            }
                        }
                    }
                    if (!$index) {
                        // creer
                        $index = count($table_responsability_function) + 900;
                        $table_responsability_function[$index] = $aut_i_4;
                        $xml_changement = 1;
                    }
                    $requete = "update responsability SET responsability_fonction='{$index}' where responsability_notice='{$notice_id}'\n\t\t\t\t\tand responsability_author = {$author_id} and responsability_fonction=" . $aut_i_4;
                    $result = pmb_mysql_query($requete);
                }
                if ($aut_i_p != "") {
                    $requete = "delete from responsability where responsability_fonction='' and responsability_author = {$author_id} and responsability_type={$responsability_type} and  responsability_notice='{$notice_id}'";
                    $result = pmb_mysql_query($requete);
                    $index = '';
                    if ($table_responsability_function) {
                        foreach ($table_responsability_function as $key => $val) {
                            if ($table_responsability_function[$key] == $aut_i_p) {
                                $index = $key;
                                break;
                            }
                        }
                    }
                    if (!$index) {
                        // creer
                        $index = count($table_responsability_function) + 900;
                        $table_responsability_function[$index] = $aut_i_p;
                        $xml_changement = 1;
                    }
                    //$requete="update responsability SET responsability_fonction='$index' where responsability_notice='$notice_id' and responsability_author = $author_id";
                    $requete = "insert into responsability SET responsability_fonction='{$index}' , responsability_notice='{$notice_id}' , responsability_author = {$author_id}, responsability_type={$responsability_type}";
                    $result = pmb_mysql_query($requete);
                }
            }
        }
    }
}
 function get_label($type)
 {
     global $lang, $include_path;
     global $dbh;
     global $type_page_opac;
     if (!count($type_page_opac)) {
         if (file_exists($include_path . "/interpreter/statopac/{$lang}.xml")) {
             $liste_libelle = new XMLlist($include_path . "/interpreter/statopac/{$lang}.xml");
         } else {
             $liste_libelle = new XMLlist($include_path . "/interpreter/statopac/fr_FR.xml");
         }
         $liste_libelle->analyser();
         $type_page_opac = $liste_libelle->table;
         $query = "select id_page, page_name from cms_pages";
         $result = pmb_mysql_query($query, $dbh);
         if (pmb_mysql_num_rows($result)) {
             while ($row = pmb_mysql_fetch_object($result)) {
                 $type_page_opac["25" . str_pad($row->id_page, 2, "0", STR_PAD_LEFT)] = $row->page_name;
             }
         }
     }
     return $type_page_opac[$type];
 }
 function get_form($action, $id_notice = 0, $retour = 'link', $article = false)
 {
     // construit le formulaire de catalogage pré-rempli
     global $msg, $dbh, $charset, $current_module;
     global $include_path;
     global $base_path;
     global $znotices_id;
     global $item;
     $fonction = new marc_list('function');
     $this->action = $action;
     include "{$include_path}/templates/z3950_form.tpl.php";
     global $bt_undo;
     // mise à jour de l'entête du formulaire
     $form_notice = str_replace('!!libelle_form!!', $this->libelle_form, $form_notice);
     // mise à jour des flags de niveau hiérarchique
     $form_notice = str_replace('!!b_level!!', $this->bibliographic_level, $form_notice);
     $form_notice = str_replace('!!h_level!!', $this->hierarchic_level, $form_notice);
     for ($i = 0; $i < 4; $i++) {
         z3950_notice::substitute("title_{$i}", $this->titles[$i], $ptab[0]);
     }
     z3950_notice::substitute("serie", $this->serie, $ptab[0]);
     z3950_notice::substitute("nbr_in_serie", $this->nbr_in_serie, $ptab[0]);
     $form_notice = str_replace('!!tab0!!', $ptab[0], $form_notice);
     // mise à jour de l'onglet 1
     // constitution de la mention de responsabilité
     $nb_autres_auteurs = 0;
     $nb_auteurs_secondaires = 0;
     //print "<pre>";print_r($this->aut_array);print "</pre>";
     for ($as = 0; $as < sizeof($this->aut_array); $as++) {
         if ($this->aut_array[$as]["responsabilite"] === 0) {
             $numrows = 0;
             if ($this->aut_array[$as]["date"]) {
                 $sql_author_find = "SELECT author_id, author_name, author_rejete, author_date FROM authors WHERE author_name = '" . addslashes($this->aut_array[$as]["entree"]) . "' AND author_rejete = '" . addslashes($this->aut_array[$as]["rejete"]) . "' AND author_type = '" . $this->aut_array[$as]["type_auteur"] . "' AND author_date ='" . addslashes($this->aut_array[$as]["date"]) . "'";
                 $res = pmb_mysql_query($sql_author_find);
                 $numrows = pmb_mysql_num_rows($res);
             }
             if (!$numrows) {
                 $sql_author_find = "SELECT author_id, author_name, author_rejete, author_date FROM authors WHERE author_name = '" . addslashes($this->aut_array[$as]["entree"]) . "' AND author_rejete = '" . addslashes($this->aut_array[$as]["rejete"]) . "' AND author_type = '" . $this->aut_array[$as]["type_auteur"] . "'";
                 $res = pmb_mysql_query($sql_author_find);
                 $numrows = pmb_mysql_num_rows($res);
             }
             if ($numrows == 1) {
                 $existing_author = pmb_mysql_fetch_array($res);
                 $existing_author_id = $existing_author["author_id"];
             } else {
                 $existing_author_id = 0;
             }
             z3950_notice::substitute("author0_type_use_existing", $existing_author_id ? "checked" : "", $ptab[1]);
             z3950_notice::substitute("author0_type_insert_new", $existing_author_id ? "" : "checked", $ptab[1]);
             if ($existing_author_id) {
                 z3950_notice::substitute("f_author_name_0_existing", $existing_author["author_name"] . ", " . $existing_author["author_rejete"] . ($existing_author["author_date"] ? " (" . $existing_author["author_date"] . ")" : ""), $ptab[1]);
                 z3950_notice::substitute("f_aut0_existing_id", $existing_author_id, $ptab[1]);
             } else {
                 z3950_notice::substitute("f_author_name_0_existing", '', $ptab[1]);
                 z3950_notice::substitute("f_aut0_existing_id", 0, $ptab[1]);
             }
             z3950_notice::substitute("author_name_0", $this->aut_array[$as]["entree"], $ptab[1]);
             z3950_notice::substitute("author_rejete_0", $this->aut_array[$as]["rejete"], $ptab[1]);
             z3950_notice::substitute("author_date_0", $this->aut_array[$as]["date"], $ptab[1]);
             z3950_notice::substitute("author_function_0", $this->aut_array[$as]["fonction"], $ptab[1]);
             z3950_notice::substitute("author_function_label_0", $fonction->table[$this->aut_array[$as]["fonction"]], $ptab[1]);
             z3950_notice::substitute("author_lieu_0", $this->aut_array[$as]["lieu"], $ptab[1]);
             z3950_notice::substitute("author_pays_0", $this->aut_array[$as]["pays"], $ptab[1]);
             z3950_notice::substitute("author_comment_0", $this->aut_array[$as]["author_comment"], $ptab[1]);
             z3950_notice::substitute("author_ville_0", $this->aut_array[$as]["ville"], $ptab[1]);
             z3950_notice::substitute("author_subdivision_0", $this->aut_array[$as]["subdivision"], $ptab[1]);
             z3950_notice::substitute("author_numero_0", $this->aut_array[$as]["numero"], $ptab[1]);
             z3950_notice::substitute("author_web_0", $this->aut_array[$as]["web"], $ptab[1]);
             z3950_notice::substitute("authority_number_0", $this->aut_array[$as]["authority_number"], $ptab[1]);
             for ($type = 70; $type <= 72; $type++) {
                 if ($this->aut_array[$as]["type_auteur"] == $type) {
                     $sel = " selected";
                 } else {
                     $sel = "";
                 }
                 z3950_notice::substitute("author_type_" . $type . "_0", $sel, $ptab[1]);
                 if ($this->aut_array[$as]["type_auteur"] == '70') {
                     z3950_notice::substitute('display_0', 'none', $ptab[1]);
                 } else {
                     z3950_notice::substitute('display_0', '', $ptab[1]);
                 }
             }
         }
         if ($this->aut_array[$as]["responsabilite"] == 1) {
             if ($this->aut_array[$as]["entree"] == "") {
                 continue;
             }
             $ptab_aut_autres = str_replace('!!iaut!!', $nb_autres_auteurs, $ptab[11]);
             $numrows = 0;
             if ($this->aut_array[$as]["date"]) {
                 $sql_author_find = "SELECT author_id, author_name, author_rejete, author_date FROM authors WHERE author_name = '" . addslashes($this->aut_array[$as]["entree"]) . "' AND author_rejete = '" . addslashes($this->aut_array[$as]["rejete"]) . "' AND author_type = '" . $this->aut_array[$as]["type_auteur"] . "' AND author_date ='" . addslashes($this->aut_array[$as]["date"]) . "'";
                 $res = pmb_mysql_query($sql_author_find);
                 $numrows = pmb_mysql_num_rows($res);
             }
             if (!$numrows) {
                 $sql_author_find = "SELECT author_id, author_name, author_rejete, author_date FROM authors WHERE author_name = '" . addslashes($this->aut_array[$as]["entree"]) . "' AND author_rejete = '" . addslashes($this->aut_array[$as]["rejete"]) . "' AND author_type = '" . $this->aut_array[$as]["type_auteur"] . "'";
                 $res = pmb_mysql_query($sql_author_find);
                 $numrows = pmb_mysql_num_rows($res);
             }
             if ($numrows == 1) {
                 $existing_author = pmb_mysql_fetch_array($res);
                 $existing_author_id = $existing_author["author_id"];
             } else {
                 $existing_author_id = 0;
             }
             z3950_notice::substitute("author1_type_use_existing_", $existing_author_id ? "checked" : "", $ptab_aut_autres);
             z3950_notice::substitute("author1_type_insert_new_", $existing_author_id ? "" : "checked", $ptab_aut_autres);
             if ($existing_author_id) {
                 z3950_notice::substitute("f_aut1", $existing_author["author_name"] . ", " . $existing_author["author_rejete"] . ($existing_author["author_date"] ? " (" . $existing_author["author_date"] . ")" : ""), $ptab_aut_autres);
                 z3950_notice::substitute("f_aut1_id", $existing_author_id, $ptab_aut_autres);
             } else {
                 z3950_notice::substitute("f_aut1", '', $ptab_aut_autres);
                 z3950_notice::substitute("f_aut1_id", '', $ptab_aut_autres);
             }
             z3950_notice::substitute("author_name_1", $this->aut_array[$as]["entree"], $ptab_aut_autres);
             z3950_notice::substitute("author_rejete_1", $this->aut_array[$as]["rejete"], $ptab_aut_autres);
             z3950_notice::substitute("author_date_1", $this->aut_array[$as]["date"], $ptab_aut_autres);
             z3950_notice::substitute("author_function_1", $this->aut_array[$as]["fonction"], $ptab_aut_autres);
             z3950_notice::substitute("author_function_label_1", $fonction->table[$this->aut_array[$as]["fonction"]], $ptab_aut_autres);
             z3950_notice::substitute("author_lieu_1", $this->aut_array[$as]["lieu"], $ptab_aut_autres);
             z3950_notice::substitute("author_pays_1", $this->aut_array[$as]["pays"], $ptab_aut_autres);
             z3950_notice::substitute("author_comment_1", $this->aut_array[$as]["author_comment"], $ptab_aut_autres);
             z3950_notice::substitute("author_ville_1", $this->aut_array[$as]["ville"], $ptab_aut_autres);
             z3950_notice::substitute("author_subdivision_1", $this->aut_array[$as]["subdivision"], $ptab_aut_autres);
             z3950_notice::substitute("author_numero_1", $this->aut_array[$as]["numero"], $ptab_aut_autres);
             z3950_notice::substitute("author_web_1", $this->aut_array[$as]["web"], $ptab_aut_autres);
             z3950_notice::substitute("authority_number_1", $this->aut_array[$as]["authority_number"], $ptab_aut_autres);
             for ($type = 70; $type <= 72; $type++) {
                 if ($this->aut_array[$as]["type_auteur"] == $type) {
                     $sel = " selected";
                 } else {
                     $sel = "";
                 }
                 z3950_notice::substitute("author_type_" . $type . "_1", $sel, $ptab_aut_autres);
                 if ($this->aut_array[$as]["type_auteur"] == '70') {
                     z3950_notice::substitute('display_1' . $nb_autres_auteurs, 'none', $ptab_aut_autres);
                 } else {
                     z3950_notice::substitute('display_1' . $nb_autres_auteurs, '', $ptab_aut_autres);
                 }
             }
             $autres_auteurs .= $ptab_aut_autres;
             $nb_autres_auteurs++;
         }
         if ($this->aut_array[$as]["responsabilite"] == 2) {
             if ($this->aut_array[$as]["entree"] == "") {
                 continue;
             }
             $ptab_aut_autres = str_replace('!!iaut!!', $nb_auteurs_secondaires, $ptab[12]);
             $numrows = 0;
             if ($this->aut_array[$as]["date"]) {
                 $sql_author_find = "SELECT author_id, author_name, author_rejete, author_date FROM authors WHERE author_name = '" . addslashes($this->aut_array[$as]["entree"]) . "' AND author_rejete = '" . addslashes($this->aut_array[$as]["rejete"]) . "' AND author_type = '" . $this->aut_array[$as]["type_auteur"] . "' AND author_date ='" . addslashes($this->aut_array[$as]["date"]) . "'";
                 $res = pmb_mysql_query($sql_author_find);
                 $numrows = pmb_mysql_num_rows($res);
             }
             if (!$numrows) {
                 $sql_author_find = "SELECT author_id, author_name, author_rejete, author_date FROM authors WHERE author_name = '" . addslashes($this->aut_array[$as]["entree"]) . "' AND author_rejete = '" . addslashes($this->aut_array[$as]["rejete"]) . "' AND author_type = '" . $this->aut_array[$as]["type_auteur"] . "'";
                 $res = pmb_mysql_query($sql_author_find);
                 $numrows = pmb_mysql_num_rows($res);
             }
             if ($numrows == 1) {
                 $existing_author = pmb_mysql_fetch_array($res);
                 $existing_author_id = $existing_author["author_id"];
             } else {
                 $existing_author_id = 0;
             }
             z3950_notice::substitute("author2_type_use_existing_", $existing_author_id ? "checked" : "", $ptab_aut_autres);
             z3950_notice::substitute("author2_type_insert_new_", $existing_author_id ? "" : "checked", $ptab_aut_autres);
             if ($existing_author_id) {
                 z3950_notice::substitute("f_aut2", $existing_author["author_name"] . ", " . $existing_author["author_rejete"] . ($existing_author["author_date"] ? " (" . $existing_author["author_date"] . ")" : ""), $ptab_aut_autres);
                 z3950_notice::substitute("f_aut2_id", $existing_author_id, $ptab_aut_autres);
             } else {
                 z3950_notice::substitute("f_aut2", '', $ptab_aut_autres);
                 z3950_notice::substitute("f_aut2_id", 0, $ptab_aut_autres);
             }
             z3950_notice::substitute("author_name_2", $this->aut_array[$as]["entree"], $ptab_aut_autres);
             z3950_notice::substitute("author_rejete_2", $this->aut_array[$as]["rejete"], $ptab_aut_autres);
             z3950_notice::substitute("author_date_2", $this->aut_array[$as]["date"], $ptab_aut_autres);
             z3950_notice::substitute("author_function_2", $this->aut_array[$as]["fonction"], $ptab_aut_autres);
             z3950_notice::substitute("author_function_label_2", $fonction->table[$this->aut_array[$as]["fonction"]], $ptab_aut_autres);
             z3950_notice::substitute("author_lieu_2", $this->aut_array[$as]["lieu"], $ptab_aut_autres);
             z3950_notice::substitute("author_pays_2", $this->aut_array[$as]["pays"], $ptab_aut_autres);
             z3950_notice::substitute("author_comment_2", $this->aut_array[$as]["author_comment"], $ptab_aut_autres);
             z3950_notice::substitute("author_ville_2", $this->aut_array[$as]["ville"], $ptab_aut_autres);
             z3950_notice::substitute("author_subdivision_2", $this->aut_array[$as]["subdivision"], $ptab_aut_autres);
             z3950_notice::substitute("author_numero_2", $this->aut_array[$as]["numero"], $ptab_aut_autres);
             z3950_notice::substitute("author_web_2", $this->aut_array[$as]["web"], $ptab_aut_autres);
             z3950_notice::substitute("authority_number_2", $this->aut_array[$as]["authority_number"], $ptab_aut_autres);
             for ($type = 70; $type <= 72; $type++) {
                 if ($this->aut_array[$as]["type_auteur"] == $type) {
                     $sel = " selected";
                 } else {
                     $sel = "";
                 }
                 z3950_notice::substitute("author_type_" . $type . "_2", $sel, $ptab_aut_autres);
                 if ($this->aut_array[$as]["type_auteur"] == '70') {
                     z3950_notice::substitute('display_2' . $nb_auteurs_secondaires, 'none', $ptab_aut_autres);
                 } else {
                     z3950_notice::substitute('display_2' . $nb_auteurs_secondaires, '', $ptab_aut_autres);
                 }
             }
             $auteurs_secondaires .= $ptab_aut_autres;
             $nb_auteurs_secondaires++;
         }
     }
     // au cas ou pas d'auteur principal : on fait le ménage dans le formulaire
     z3950_notice::substitute("author_name_0", "", $ptab[1]);
     z3950_notice::substitute("author_rejete_0", "", $ptab[1]);
     z3950_notice::substitute("author_date_0", "", $ptab[1]);
     z3950_notice::substitute("author_function_0", "", $ptab[1]);
     z3950_notice::substitute("author_function_label_0", "", $ptab[1]);
     z3950_notice::substitute("f_author_name_0_existing", "", $ptab[1]);
     z3950_notice::substitute("f_aut0_existing_id", "", $ptab[1]);
     z3950_notice::substitute("author0_type_use_existing", "", $ptab[1]);
     z3950_notice::substitute("author0_type_insert_new", "checked", $ptab[1]);
     z3950_notice::substitute("author_lieu_0", "", $ptab[1]);
     z3950_notice::substitute("author_pays_0", "", $ptab[1]);
     z3950_notice::substitute("author_comment_0", "", $ptab[1]);
     z3950_notice::substitute("author_ville_0", "", $ptab[1]);
     z3950_notice::substitute("author_subdivision_0", "", $ptab[1]);
     z3950_notice::substitute("author_numero_0", "", $ptab[1]);
     z3950_notice::substitute("author_web_0", "", $ptab[1]);
     z3950_notice::substitute("authority_number_0", "", $ptab[1]);
     z3950_notice::substitute('display_0', 'none', $ptab[1]);
     $ptab[1] = str_replace('!!max_aut1!!', $nb_autres_auteurs + 1, $ptab[1]);
     $ptab[1] = str_replace('!!iaut_added1!!', $nb_autres_auteurs, $ptab[1]);
     $ptab[1] = str_replace('!!max_aut2!!', $nb_auteurs_secondaires + 1, $ptab[1]);
     $ptab[1] = str_replace('!!iaut_added2!!', $nb_auteurs_secondaires, $ptab[1]);
     $ptab[1] = str_replace('!!autres_auteurs!!', $autres_auteurs, $ptab[1]);
     $ptab[1] = str_replace('!!auteurs_secondaires!!', $auteurs_secondaires, $ptab[1]);
     $form_notice = str_replace('!!tab1!!', $ptab[1], $form_notice);
     //Editeur 1
     //On tente avec toutes les infos
     if ($this->editors[0]['name'] && $this->editors[0]['ville']) {
         $sql_find_publisher = "SELECT ed_id,ed_ville,ed_name FROM publishers WHERE ed_name = '" . addslashes($this->editors[0]['name']) . "' AND ed_ville = '" . addslashes($this->editors[0]['ville']) . "'";
         $res = pmb_mysql_query($sql_find_publisher);
         if (pmb_mysql_num_rows($res) == 1) {
             $existing_publisher = pmb_mysql_fetch_array($res);
             $existing_publisher_id = $existing_publisher["ed_id"];
         }
     }
     //Non? Le nom sans ville peut être alors?
     if (!$existing_publisher_id && $this->editors[0]['name']) {
         $sql_find_publisher = "SELECT ed_id,ed_ville,ed_name FROM publishers WHERE ed_name = '" . addslashes($this->editors[0]['name']) . "' AND ed_ville = ''";
         $res = pmb_mysql_query($sql_find_publisher);
         if (pmb_mysql_num_rows($res) == 1) {
             $existing_publisher = pmb_mysql_fetch_array($res);
             $existing_publisher_id = $existing_publisher["ed_id"];
         }
     }
     //Juste le nom alors?
     if (!$existing_publisher_id && $this->editors[0]['name'] && !$this->editors[0]['ville']) {
         $sql_find_publisher = "SELECT ed_id,ed_ville,ed_name FROM publishers WHERE ed_name = '" . addslashes($this->editors[0]['name']) . "'";
         $res = pmb_mysql_query($sql_find_publisher);
         if (pmb_mysql_num_rows($res) == 1) {
             $existing_publisher = pmb_mysql_fetch_array($res);
             $existing_publisher_id = $existing_publisher["ed_id"];
         }
     }
     if (!$existing_publisher_id) {
         $existing_publisher_id = 0;
     }
     z3950_notice::substitute("editor_type_use_existing", $existing_publisher_id ? 'checked' : '', $ptab[2]);
     z3950_notice::substitute("editor_type_insert_new", $existing_publisher_id ? '' : 'checked', $ptab[2]);
     if ($existing_publisher_id) {
         $editor = new editeur($existing_publisher_id);
         $editor_display = $editor->display;
         if (!$editor_display) {
             $info_ville = $existing_publisher["ed_ville"] ? ' (' . $existing_publisher["ed_ville"] . ')' : "";
             $editor_display = $existing_publisher["ed_name"] . $info_ville;
         }
         z3950_notice::substitute("f_ed1", $editor_display, $ptab[2]);
         z3950_notice::substitute("f_ed1_id", $existing_publisher_id, $ptab[2]);
     } else {
         z3950_notice::substitute("f_ed1", '', $ptab[2]);
         z3950_notice::substitute("f_ed1_id", '', $ptab[2]);
     }
     z3950_notice::substitute("editor_name_0", $this->editors[0]['name'], $ptab[2]);
     z3950_notice::substitute("editor_ville_0", $this->editors[0]['ville'], $ptab[2]);
     //Editeur 2
     //On tente avec toutes les infos
     if ($this->editors[1]['name'] && $this->editors[1]['ville']) {
         $sql_find_publisher2 = "SELECT ed_id,ed_ville,ed_name FROM publishers WHERE ed_name = '" . addslashes($this->editors[1]['name']) . "' AND ed_ville = '" . addslashes($this->editors[1]['ville']) . "'";
         $res = pmb_mysql_query($sql_find_publisher2);
         if (pmb_mysql_num_rows($res) == 1) {
             $existing_publisher2 = pmb_mysql_fetch_array($res);
             $existing_publisher_id2 = $existing_publisher2["ed_id"];
         }
     }
     //Non? Le nom sans ville peut être alors?
     if (!$existing_publisher_id2 && $this->editors[1]['name']) {
         $sql_find_publisher2 = "SELECT ed_id,ed_ville,ed_name FROM publishers WHERE ed_name = '" . addslashes($this->editors[1]['name']) . "' AND ed_ville = ''";
         $res = pmb_mysql_query($sql_find_publisher2);
         if (pmb_mysql_num_rows($res) == 1) {
             $existing_publisher2 = pmb_mysql_fetch_array($res);
             $existing_publisher_id2 = $existing_publisher2["ed_id"];
         }
     }
     //Juste le nom alors?
     if (!$existing_publisher_id2 && $this->editors[1]['name'] && !$this->editors[1]['ville']) {
         $sql_find_publisher2 = "SELECT ed_id,ed_ville,ed_name FROM publishers WHERE ed_name = '" . addslashes($this->editors[1]['name']) . "'";
         $res = pmb_mysql_query($sql_find_publisher2);
         if (pmb_mysql_num_rows($res) == 1) {
             $existing_publisher2 = pmb_mysql_fetch_array($res);
             $existing_publisher_id2 = $existing_publisher2["ed_id"];
         }
     }
     if (!$existing_publisher_id2) {
         $existing_publisher_id2 = 0;
     }
     z3950_notice::substitute("editor1_type_use_existing", $existing_publisher_id2 ? 'checked' : '', $ptab[2]);
     z3950_notice::substitute("editor1_type_insert_new", $existing_publisher_id2 ? '' : 'checked', $ptab[2]);
     if ($existing_publisher_id2) {
         $editor = new editeur($existing_publisher_id2);
         $editor_display = $editor->display;
         if (!$editor_display) {
             $info_ville = $existing_publisher2["ed_ville"] ? ' (' . $existing_publisher2["ed_ville"] . ')' : "";
             $editor_display = $existing_publisher2["ed_name"] . $info_ville;
         }
         z3950_notice::substitute("f_ed11", $editor_display, $ptab[2]);
         z3950_notice::substitute("f_ed11_id", $existing_publisher_id2, $ptab[2]);
     } else {
         z3950_notice::substitute("f_ed11", '', $ptab[2]);
         z3950_notice::substitute("f_ed11_id", '', $ptab[2]);
     }
     z3950_notice::substitute("editor_name_1", $this->editors[1]['name'], $ptab[2]);
     z3950_notice::substitute("editor_ville_1", $this->editors[1]['ville'], $ptab[2]);
     //Collection
     if ($existing_publisher_id && $this->collection['name']) {
         $sql_collection_find = "SELECT collection_id, collection_name FROM collections WHERE collection_name = '" . addslashes($this->collection['name']) . "' AND collection_parent = '" . $existing_publisher_id . "'";
         $res = pmb_mysql_query($sql_collection_find);
         if (pmb_mysql_num_rows($res) == 1) {
             $existing_collection = pmb_mysql_fetch_array($res);
             $existing_collection_id = $existing_collection["collection_id"];
         } else {
             $existing_collection_id = 0;
         }
     } else {
         $existing_collection_id = 0;
     }
     z3950_notice::substitute("collection_type_use_existing", $existing_collection_id ? 'checked' : '', $ptab[2]);
     z3950_notice::substitute("collection_type_insert_new", $existing_collection_id ? '' : 'checked', $ptab[2]);
     if ($existing_collection_id) {
         z3950_notice::substitute("f_coll_existing", $existing_collection["collection_name"], $ptab[2]);
         z3950_notice::substitute("f_coll_existing_id", $existing_collection_id, $ptab[2]);
     } else {
         z3950_notice::substitute("f_coll_existing", '', $ptab[2]);
         z3950_notice::substitute("f_coll_existing_id", '0', $ptab[2]);
     }
     z3950_notice::substitute("collection_name", $this->collection['name'], $ptab[2]);
     z3950_notice::substitute("collection_issn", $this->collection['issn'], $ptab[2]);
     //Sous Collection
     if ($existing_collection_id && $this->subcollection['name']) {
         $sql_subcollection_find = "SELECT sub_coll_id, sub_coll_name FROM sub_collections WHERE sub_coll_name = '" . addslashes($this->subcollection['name']) . "' AND sub_coll_parent = '" . $existing_collection_id . "'";
         $res = pmb_mysql_query($sql_subcollection_find) or die(pmb_mysql_error() . "<br />{$sql_subcollection_find}");
         if (pmb_mysql_num_rows($res) == 1) {
             $existing_subcollection = pmb_mysql_fetch_array($res);
             $existing_subcollection_id = $existing_subcollection["sub_coll_id"];
         } else {
             $existing_subcollection_id = 0;
         }
     } else {
         $existing_subcollection_id = 0;
     }
     z3950_notice::substitute("subcollection_type_use_existing", $existing_subcollection_id ? 'checked' : '', $ptab[2]);
     z3950_notice::substitute("subcollection_type_insert_new", $existing_subcollection_id ? '' : 'checked', $ptab[2]);
     if ($existing_subcollection_id) {
         z3950_notice::substitute("f_subcoll_existing", $existing_subcollection["sub_coll_name"], $ptab[2]);
         z3950_notice::substitute("f_subcoll_existing_id", $existing_subcollection_id, $ptab[2]);
     } else {
         z3950_notice::substitute("f_subcoll_existing", '', $ptab[2]);
         z3950_notice::substitute("f_subcoll_existing_id", '0', $ptab[2]);
     }
     z3950_notice::substitute("subcollection_name", $this->subcollection['name'], $ptab[2]);
     z3950_notice::substitute("subcollection_issn", $this->subcollection['issn'], $ptab[2]);
     z3950_notice::substitute("nbr_in_collection", $this->nbr_in_collection, $ptab[2]);
     z3950_notice::substitute("year", $this->year, $ptab[2]);
     z3950_notice::substitute("mention_edition", $this->mention_edition, $ptab[2]);
     $form_notice = str_replace('!!tab2!!', $ptab[2], $form_notice);
     z3950_notice::substitute("isbn", $this->isbn, $ptab[3]);
     $form_notice = str_replace('!!tab3!!', $ptab[3], $form_notice);
     z3950_notice::substitute("page_nbr", $this->page_nbr, $ptab[4]);
     z3950_notice::substitute("illustration", $this->illustration, $ptab[4]);
     z3950_notice::substitute("prix", $this->prix, $ptab[4]);
     z3950_notice::substitute("accompagnement", $this->accompagnement, $ptab[4]);
     z3950_notice::substitute("size", $this->size, $ptab[4]);
     $form_notice = str_replace('!!tab4!!', $ptab[4], $form_notice);
     z3950_notice::substitute("general_note", $this->general_note, $ptab[5]);
     z3950_notice::substitute("content_note", $this->content_note, $ptab[5]);
     z3950_notice::substitute("abstract_note", $this->abstract_note, $ptab[5]);
     $form_notice = str_replace('!!tab5!!', $ptab[5], $form_notice);
     // indexation interne
     $pclassement_sql = "SELECT * FROM pclassement";
     $res = pmb_mysql_query($pclassement_sql);
     $pclassement_count = pmb_mysql_num_rows($res);
     if (!$pclassement_count) {
         $pclassement_count = 1;
     }
     if ($pclassement_count > 1) {
         $pclassements = array();
         while ($row = pmb_mysql_fetch_assoc($res)) {
             $pclassements[] = array("id" => $row["id_pclass"], "name" => $row["name_pclass"]);
         }
         $pclassement_combobox = '<select name="f_indexint_new_pclass">';
         foreach ($pclassements as $pclassement) {
             $pclassement_combobox .= '<option value="' . $pclassement["id"] . '">' . $pclassement["name"] . '</option>';
         }
         $pclassement_combobox .= '</select>';
     } else {
         $pclassement_combobox = "";
     }
     $ptab[6] = str_replace("!!multiple_pclass_combo_box!!", $pclassement_combobox, $ptab[6]);
     $index_int_sql = "SELECT indexint_name, indexint_comment, indexint_id, name_pclass FROM indexint LEFT JOIN pclassement ON (pclassement.id_pclass = indexint.num_pclass) WHERE indexint_name = '" . addslashes($this->dewey[0]) . "'";
     $res = pmb_mysql_query($index_int_sql, $dbh);
     $num_rows = pmb_mysql_num_rows($res);
     if ($num_rows == 1) {
         $the_row = pmb_mysql_fetch_assoc($res);
         z3950_notice::substitute("indexint", $the_row["indexint_name"] . ': ' . $the_row["indexint_comment"], $ptab[6]);
         z3950_notice::substitute("indexint_id", $the_row["indexint_id"], $ptab[6]);
         z3950_notice::substitute("indexint_type_use_existing", 'checked', $ptab[6]);
         z3950_notice::substitute("indexint_type_insert_new", '', $ptab[6]);
         z3950_notice::substitute("multiple_index_int_propositions", '', $ptab[6]);
     } else {
         if ($num_rows > 1) {
             $index_ints = array();
             while ($row = pmb_mysql_fetch_assoc($res)) {
                 $index_ints[] = array("id" => $row["indexint_id"], "name" => $row["indexint_name"], "comment" => $row["indexint_comment"], "pclass" => $row["name_pclass"]);
             }
             $form_indexint_proposition = "<ul>";
             foreach ($index_ints as $index_int) {
                 $form_indexint_proposition .= "<li><b>[" . $index_int["pclass"] . "]</b> " . $index_int["name"] . ": " . $index_int["comment"] . '&nbsp;';
                 $jsaction = "document.getElementById('indexint_type_use_existing').checked=1; document.getElementById('f_indexint').value='" . addslashes($index_int["name"] . ' - ' . $index_int["comment"]) . "'; document.getElementById('f_indexint_id').value='" . addslashes($index_int["id"]) . "'";
                 $form_indexint_proposition .= '<input type="button" class="bouton" value="' . $msg["notice_integre_indexint_use"] . '" onclick="' . $jsaction . '">';
                 $form_indexint_proposition .= '</li>';
             }
             $form_indexint_proposition .= "</ul>";
             $ptab[6] = str_replace("!!multiple_index_int_propositions!!", $form_indexint_proposition, $ptab[6]);
             z3950_notice::substitute("indexint", "", $ptab[6]);
             z3950_notice::substitute("indexint_id", "", $ptab[6]);
             z3950_notice::substitute("indexint_type_use_existing", 'checked', $ptab[6]);
             z3950_notice::substitute("indexint_type_insert_new", '', $ptab[6]);
         } else {
             z3950_notice::substitute("indexint", "", $ptab[6]);
             z3950_notice::substitute("indexint_id", "", $ptab[6]);
             z3950_notice::substitute("indexint_type_use_existing", '', $ptab[6]);
             z3950_notice::substitute("indexint_type_insert_new", 'checked', $ptab[6]);
             z3950_notice::substitute("multiple_index_int_propositions", '', $ptab[6]);
         }
     }
     z3950_notice::substitute("indexint_new_name", $this->dewey[0], $ptab[6]);
     z3950_notice::substitute("indexint_new_comment", "", $ptab[6]);
     // indexation libre
     z3950_notice::substitute("f_free_index", $this->free_index, $ptab[6]);
     global $pmb_keyword_sep;
     $sep = "'{$pmb_keyword_sep}'";
     if (!$pmb_keyword_sep) {
         $sep = "' '";
     }
     if (ord($pmb_keyword_sep) == 0xa || ord($pmb_keyword_sep) == 0xd) {
         $sep = $msg['catalogue_saut_de_ligne'];
     }
     $ptab[6] = str_replace("!!sep!!", htmlentities($sep, ENT_QUOTES, $charset), $ptab[6]);
     $form_notice = str_replace('!!tab6!!', $ptab[6], $form_notice);
     // Gestion des titres uniformes
     $nb_tu = sizeof($this->tu_500);
     for ($i = 0; $i < $nb_tu; $i++) {
         $value_tu[$i]['name'] = $this->tu_500[$i]['a'];
         $ntu_data[$i]->tu->name = $this->tu_500[$i]['a'];
         $value_tu[$i]['tonalite'] = $this->tu_500[$i]['u'];
         for ($j = 0; $j < count($this->tu_500_r[$i]); $j++) {
             $value_tu[$i]['distrib'][$j] = $this->tu_500_r[$i][$j];
         }
         for ($j = 0; $j < count($this->tu_500_s[$i]); $j++) {
             $value_tu[$i]['ref'][$j] = $this->tu_500_s[$i][$j];
         }
         if ($tu_id = titre_uniforme::import_tu_exist($value_tu, 1)) {
             // 	le titre uniforme est déjà existant
             $ntu_data[$i]->num_tu = $tu_id;
         } else {
             // le titre uniforme n'est pas existant
             for ($j = 0; $j < count($this->tu_500_n[$i]); $j++) {
                 $value_tu[$i]['comment'] .= $this->tu_500_r[$i][$j];
                 if ($j + 1 < count($this->tu_500_n[$i])) {
                     $value_tu[$i]['comment'] .= "\n";
                 }
             }
             for ($j = 0; $j < count($this->tu_500_j[$i]); $j++) {
                 $value_tu[$i]['subdiv'][$j] = $this->tu_500_j[$i][$j];
             }
         }
         // memorisation du niveau biblio de ce titre uniforme
         for ($j = 0; $j < count($this->tu_500_i[$i]); $j++) {
             $ntu_data[$i]->titre .= $this->tu_500_i[$i][$j];
             if ($j + 1 < count($this->tu_500_i[$i])) {
                 $ntu_data[$i]->titre .= "; ";
             }
         }
         $ntu_data[$i]->date = $this->tu_500[$i]['k'];
         for ($j = 0; $j < count($this->tu_500_l[$i]); $j++) {
             $ntu_data[$i]->sous_vedette .= $this->tu_500_l[$i][$j];
             if ($j + 1 < count($this->tu_500_l[$i])) {
                 $ntu_data[$i]->sous_vedette .= "; ";
             }
         }
         $ntu_data[$i]->langue = $this->tu_500[$i]['m'];
         $ntu_data[$i]->version = $this->tu_500[$i]['q'];
         $ntu_data[$i]->mention = $this->tu_500[$i]['w'];
     }
     // serialisation des champs de l'autorité titre uniforme
     global $pmb_use_uniform_title;
     if ($pmb_use_uniform_title) {
         $memo_value_tu = "<input type='hidden' name='memo_value_tu' value=\"" . rawurlencode(serialize($value_tu)) . "\">";
         $ptab[230] = str_replace("!!titres_uniformes!!", $memo_value_tu . tu_notice::get_form_import("notice", $ntu_data), $ptab[230]);
         $form_notice = str_replace('!!tab230!!', $ptab[230], $form_notice);
     }
     // mise à jour de l'onglet 7 : langues
     // langues répétables
     $lang = new marc_list('lang');
     if (sizeof($this->language_code) == 0) {
         $max_lang = 1;
     } else {
         $max_lang = sizeof($this->language_code);
     }
     for ($i = 0; $i < $max_lang; $i++) {
         if ($i) {
             $ptab_lang = str_replace('!!ilang!!', $i, $ptab[701]);
         } else {
             $ptab_lang = str_replace('!!ilang!!', $i, $ptab[70]);
         }
         if (sizeof($this->language_code) == 0) {
             $ptab_lang = str_replace('!!lang_code!!', '', $ptab_lang);
             $ptab_lang = str_replace('!!lang!!', '', $ptab_lang);
         } else {
             $ptab_lang = str_replace('!!lang_code!!', $this->language_code[$i], $ptab_lang);
             $ptab_lang = str_replace('!!lang!!', htmlentities($lang->table[$this->language_code[$i]], ENT_QUOTES, $charset), $ptab_lang);
         }
         $lang_repetables .= $ptab_lang;
     }
     $ptab[7] = str_replace('!!max_lang!!', $max_lang, $ptab[7]);
     $ptab[7] = str_replace('!!langues_repetables!!', $lang_repetables, $ptab[7]);
     // langues originales répétables
     if (sizeof($this->original_language_code) == 0) {
         $max_langorg = 1;
     } else {
         $max_langorg = sizeof($this->original_language_code);
     }
     for ($i = 0; $i < $max_langorg; $i++) {
         if ($i) {
             $ptab_lang = str_replace('!!ilangorg!!', $i, $ptab[711]);
         } else {
             $ptab_lang = str_replace('!!ilangorg!!', $i, $ptab[71]);
         }
         if (sizeof($this->original_language_code) == 0) {
             $ptab_lang = str_replace('!!langorg_code!!', '', $ptab_lang);
             $ptab_lang = str_replace('!!langorg!!', '', $ptab_lang);
         } else {
             $ptab_lang = str_replace('!!langorg_code!!', $this->original_language_code[$i], $ptab_lang);
             $ptab_lang = str_replace('!!langorg!!', htmlentities($lang->table[$this->original_language_code[$i]], ENT_QUOTES, $charset), $ptab_lang);
         }
         $langorg_repetables .= $ptab_lang;
     }
     $ptab[7] = str_replace('!!max_langorg!!', $max_langorg, $ptab[7]);
     $ptab[7] = str_replace('!!languesorg_repetables!!', $langorg_repetables, $ptab[7]);
     $form_notice = str_replace('!!tab7!!', $ptab[7], $form_notice);
     z3950_notice::substitute("link_url", $this->link_url, $ptab[8]);
     z3950_notice::substitute("link_format", $this->link_format, $ptab[8]);
     $form_notice = str_replace('!!tab8!!', $ptab[8], $form_notice);
     // définition de la page cible du form
     $form_notice = str_replace('!!action!!', $this->action, $form_notice);
     // ajout des selecteurs
     $select_doc = new marc_select('doctype', 'typdoc', $this->document_type);
     $form_notice = str_replace('!!document_type!!', $select_doc->display, $form_notice);
     if ($article) {
         $form_notice = str_replace('!!checked_mono!!', "", $form_notice);
         $form_notice = str_replace('!!checked_perio!!', "", $form_notice);
         $form_notice = str_replace('!!checked_art!!', "selected=\"selected\"", $form_notice);
     } else {
         if ($this->bibliographic_level == 's') {
             $form_notice = str_replace('!!checked_mono!!', "", $form_notice);
             $form_notice = str_replace('!!checked_perio!!', "selected=\"selected\"", $form_notice);
             $form_notice = str_replace('!!checked_art!!', "", $form_notice);
         } else {
             $form_notice = str_replace('!!checked_mono!!', "selected=\"selected\"", $form_notice);
             $form_notice = str_replace('!!checked_perio!!', "", $form_notice);
             $form_notice = str_replace('!!checked_art!!', "", $form_notice);
         }
     }
     //Zone des perios et des bulletins pour les articles
     $zone_article_form = str_replace("!!perio_titre!!", $this->perio_titre[0], $zone_article_form);
     $zone_article_form = str_replace("!!perio_issn!!", $this->perio_issn[0], $zone_article_form);
     $zone_article_form = str_replace("!!bull_date!!", $this->bull_mention[0], $zone_article_form);
     $zone_article_form = str_replace("!!bull_titre!!", $this->bull_titre[0], $zone_article_form);
     $zone_article_form = str_replace("!!bull_num!!", $this->bull_num[0], $zone_article_form);
     if ($this->bull_date[0]) {
         $date_date_formatee = formatdate_input($this->bull_date[0]);
         $date_date_hid = $this->bull_date[0];
     } else {
         $date_date_formatee = '';
         $date_date_hid = '';
     }
     $date_clic = "onClick=\"openPopUp('./select.php?what=calendrier&caller=notice&date_caller=&param1=f_bull_new_date&param2=date_date_lib&auto_submit=NO&date_anterieure=YES', 'date_date', 250, 300, -2, -2, 'toolbar=no, dependent=yes, resizable=yes')\"  ";
     $date_date = "<input type='hidden' id='f_bull_new_date' name='f_bull_new_date' value='{$date_date_hid}' />\n\t\t\t<input class='saisie-10em' type='text' name='date_date_lib' value='" . $date_date_formatee . "' placeholder='" . $msg["format_date_input_placeholder"] . "' />\n\t\t\t<input class='bouton' type='button' name='date_date_lib_bouton' value='" . $msg["bouton_calendrier"] . "' " . $date_clic . " />";
     $zone_article_form = str_replace("!!date_date!!", $date_date, $zone_article_form);
     //On cherche si le perio existe
     if ($this->perio_titre[0] && $this->perio_issn[0]) {
         $req = "select notice_id, tit1 from notices where niveau_biblio='s' and niveau_hierar='1' \n\t\t\t\t\tand tit1='" . addslashes($this->perio_titre[0]) . "'\n\t\t\t\t\tand code='" . addslashes($this->perio_issn[0]) . "' limit 1";
         $res_perio = pmb_mysql_query($req, $dbh);
         $num_rows_perio = pmb_mysql_num_rows($res_perio);
     }
     if (!$num_rows_perio) {
         if ($this->perio_titre[0]) {
             $req = "select notice_id, tit1 from notices where niveau_biblio='s' and niveau_hierar='1' \n\t\t\t\t\tand tit1='" . addslashes($this->perio_titre[0]) . "'\n\t\t\t\t\tlimit 1";
             $res_perio = pmb_mysql_query($req, $dbh);
             $num_rows_perio = pmb_mysql_num_rows($res_perio);
         }
     }
     if (!$num_rows_perio) {
         if ($this->perio_issn[0]) {
             $req = "select notice_id, tit1 from notices where niveau_biblio='s' and niveau_hierar='1' \n\t\t\t\t\t\tand code='" . addslashes($this->perio_issn[0]) . "' limit 1";
             $res_perio = pmb_mysql_query($req, $dbh);
             $num_rows_perio = pmb_mysql_num_rows($res_perio);
         }
     }
     if ($num_rows_perio == 1) {
         $perio_found = pmb_mysql_fetch_object($res_perio);
         $idperio = $perio_found->notice_id;
         $zone_article_form = str_replace("!!f_perio_existing!!", htmlentities($perio_found->tit1, ENT_QUOTES, $charset), $zone_article_form);
         $zone_article_form = str_replace("!!f_perio_existing_id!!", $perio_found->notice_id, $zone_article_form);
         $zone_article_form = str_replace("!!perio_type_new!!", "", $zone_article_form);
         $zone_article_form = str_replace("!!perio_type_use_existing!!", "checked", $zone_article_form);
     } else {
         $idperio = 0;
         $zone_article_form = str_replace("!!f_perio_existing!!", "", $zone_article_form);
         $zone_article_form = str_replace("!!f_perio_existing_id!!", "", $zone_article_form);
         $zone_article_form = str_replace("!!perio_type_new!!", "checked", $zone_article_form);
         $zone_article_form = str_replace("!!perio_type_use_existing!!", "", $zone_article_form);
     }
     //On cherche si le bulletin existe
     $num_rows_bull = 0;
     if ($this->bull_num[0] && $idperio) {
         $req = "select bulletin_id, bulletin_numero,date_date,mention_date from bulletins where bulletin_notice='" . $idperio . "' and  bulletin_numero like '%" . addslashes($this->bull_num[0]) . "%' ";
         $res_bull = pmb_mysql_query($req, $dbh);
         $num_rows_bull = pmb_mysql_num_rows($res_bull);
     }
     if (!$num_rows_bull && $this->bull_date[0] && $idperio) {
         $req = "select bulletin_id, bulletin_numero,date_date,mention_date from bulletins where bulletin_notice='" . $idperio . "' and date_date='" . addslashes($this->bull_date[0]) . "' ";
         $res_bull = pmb_mysql_query($req, $dbh);
         $num_rows_bull = pmb_mysql_num_rows($res_bull);
     } elseif ($num_rows_bull > 1 && $this->bull_date[0] && $idperio) {
         $req = "select bulletin_id, bulletin_numero,date_date,mention_date from bulletins where bulletin_notice='" . $idperio . "' and date_date='" . addslashes($this->bull_date[0]) . "' and  bulletin_numero like '%" . addslashes($this->bull_num[0]) . "%' ";
         $res_bull = pmb_mysql_query($req, $dbh);
         $num_rows_bull = pmb_mysql_num_rows($res_bull);
     }
     if (!$num_rows_bull && $this->bull_mention[0] && $idperio) {
         $req = "select bulletin_id, bulletin_numero,date_date,mention_date from bulletins where bulletin_notice='" . $idperio . "' and mention_date='" . addslashes($this->bull_mention[0]) . "' ";
         $res_bull = pmb_mysql_query($req, $dbh);
         $num_rows_bull = pmb_mysql_num_rows($res_bull);
     } elseif ($num_rows_bull > 1 && $this->bull_mention[0] && $idperio) {
         if ($this->bull_date[0]) {
             $req = "select bulletin_id, bulletin_numero,date_date,mention_date from bulletins where bulletin_notice='" . $idperio . "' and date_date='" . addslashes($this->bull_date[0]) . "' and mention_date='" . addslashes($this->bull_mention[0]) . "' ";
         } else {
             $req = "select bulletin_id, bulletin_numero,date_date,mention_date from bulletins where bulletin_notice='" . $idperio . "' and mention_date='" . addslashes($this->bull_mention[0]) . "' and  bulletin_numero like '%" . addslashes($this->bull_num[0]) . "%' ";
         }
         $res_bull = pmb_mysql_query($req, $dbh);
         $num_rows_bull = pmb_mysql_num_rows($res_bull);
     }
     if ($num_rows_bull) {
         $bull_found = pmb_mysql_fetch_object($res_bull);
         $f_bull_existing = trim($bull_found->bulletin_numero);
         if (!$f_bull_existing && trim($bull_found->date_date)) {
             $f_bull_existing = "[" . trim($bull_found->date_date) . "]";
         } elseif (!$f_bull_existing && trim($bull_found->mention_date)) {
             $f_bull_existing = "(" . trim($bull_found->mention_date) . ")";
         }
         $zone_article_form = str_replace("!!f_bull_existing!!", htmlentities($f_bull_existing, ENT_QUOTES, $charset), $zone_article_form);
         $zone_article_form = str_replace("!!f_bull_existing_id!!", $bull_found->bulletin_id, $zone_article_form);
         $zone_article_form = str_replace("!!bull_type_new!!", $num_rows_bull ? '' : "checked='checked'", $zone_article_form);
         $zone_article_form = str_replace("!!bull_type_use_existing!!", $num_rows_bull ? "checked='checked'" : '', $zone_article_form);
     } else {
         $zone_article_form = str_replace("!!f_bull_existing!!", "", $zone_article_form);
         $zone_article_form = str_replace("!!f_bull_existing_id!!", "", $zone_article_form);
         $zone_article_form = str_replace("!!bull_type_new!!", "checked='checked'", $zone_article_form);
         $zone_article_form = str_replace("!!bull_type_use_existing!!", "", $zone_article_form);
     }
     $form_notice = str_replace("!!zone_article!!", $zone_article_form, $form_notice);
     if ($article) {
         $form_notice = str_replace("!!display_zone_article!!", "", $form_notice);
     } else {
         $form_notice = str_replace("!!display_zone_article!!", "none", $form_notice);
     }
     if ($item) {
         $form_notice = str_replace('!!notice_entrepot!!', "<input type='hidden' name='item' value='{$item}' />", $form_notice);
     } else {
         $form_notice = str_replace('!!notice_entrepot!!', "", $form_notice);
     }
     $form_notice = str_replace('!!orinot_nom!!', $this->origine_notice[nom], $form_notice);
     $form_notice = str_replace('!!orinot_pays!!', $this->origine_notice[pays], $form_notice);
     //Traitement du 503 "titre de forme" pour le Musée des beaux arts de Nantes
     global $tableau_503;
     $tableau_503 = array("info_503" => $this->info_503, "info_503_d" => $this->info_503_d, "info_503_j" => $this->info_503_j);
     // traitement des catégories : affichage dans le formulaire
     $tableau_600 = array("info_600_3" => $this->info_600_3, "info_600_a" => $this->info_600_a, "info_600_b" => $this->info_600_b, "info_600_c" => $this->info_600_c, "info_600_d" => $this->info_600_d, "info_600_f" => $this->info_600_f, "info_600_g" => $this->info_600_g, "info_600_j" => $this->info_600_j, "info_600_p" => $this->info_600_p, "info_600_t" => $this->info_600_t, "info_600_x" => $this->info_600_x, "info_600_y" => $this->info_600_y, "info_600_z" => $this->info_600_z);
     $tableau_601 = array("info_601_3" => $this->info_601_3, "info_601_a" => $this->info_601_a, "info_601_b" => $this->info_601_b, "info_601_c" => $this->info_601_c, "info_601_d" => $this->info_601_d, "info_601_e" => $this->info_601_e, "info_601_f" => $this->info_601_f, "info_601_g" => $this->info_601_g, "info_601_h" => $this->info_601_h, "info_601_j" => $this->info_601_j, "info_601_t" => $this->info_601_t, "info_601_x" => $this->info_601_x, "info_601_y" => $this->info_601_y, "info_601_z" => $this->info_601_z);
     $tableau_602 = array("info_602_3" => $this->info_602_3, "info_602_a" => $this->info_602_a, "info_602_f" => $this->info_602_f, "info_602_j" => $this->info_602_j, "info_602_t" => $this->info_602_t, "info_602_x" => $this->info_602_x, "info_602_y" => $this->info_602_y, "info_602_z" => $this->info_602_z);
     $tableau_604 = array("info_604_3" => $this->info_604_3, "info_604_a" => $this->info_604_a, "info_604_h" => $this->info_604_h, "info_604_i" => $this->info_604_i, "info_604_j" => $this->info_604_j, "info_604_k" => $this->info_604_k, "info_604_l" => $this->info_604_l, "info_604_x" => $this->info_604_x, "info_604_y" => $this->info_604_y, "info_604_z" => $this->info_604_z);
     $tableau_605 = array("info_605_3" => $this->info_605_3, "info_605_a" => $this->info_605_a, "info_605_h" => $this->info_605_h, "info_605_i" => $this->info_605_i, "info_605_k" => $this->info_605_k, "info_605_l" => $this->info_605_l, "info_605_m" => $this->info_605_m, "info_605_n" => $this->info_605_n, "info_605_q" => $this->info_605_q, "info_605_r" => $this->info_605_r, "info_605_s" => $this->info_605_s, "info_605_u" => $this->info_605_u, "info_605_w" => $this->info_605_w, "info_605_j" => $this->info_605_j, "info_605_x" => $this->info_605_x, "info_605_y" => $this->info_605_y, "info_605_z" => $this->info_605_z);
     $tableau_606 = array("info_606_3" => $this->info_606_3, "info_606_a" => $this->info_606_a, "info_606_j" => $this->info_606_j, "info_606_x" => $this->info_606_x, "info_606_y" => $this->info_606_y, "info_606_z" => $this->info_606_z);
     $tableau_607 = array("info_607_3" => $this->info_607_3, "info_607_a" => $this->info_607_a, "info_607_j" => $this->info_607_j, "info_607_x" => $this->info_607_x, "info_607_y" => $this->info_607_y, "info_607_z" => $this->info_607_z);
     $tableau_608 = array("info_608_3" => $this->info_608_3, "info_608_a" => $this->info_608_a, "info_608_j" => $this->info_608_j, "info_608_x" => $this->info_608_x, "info_608_y" => $this->info_608_y, "info_608_z" => $this->info_608_z);
     // catégories
     $max_categ = 1;
     $ptab_categ = str_replace('!!icateg!!', 0, $ptab[60]);
     $ptab_categ = str_replace('!!categ_id!!', 0, $ptab_categ);
     $ptab_categ = str_replace('!!categ_libelle!!', '', $ptab_categ);
     $ptab[6] = str_replace("!!categories_repetables!!", $ptab_categ, $ptab[6]);
     $ptab[6] = str_replace('!!tab_categ_order!!', "", $ptab[6]);
     $traitement_rameau = traite_categories_for_form($tableau_600, $tableau_601, $tableau_602, $tableau_605, $tableau_606, $tableau_607, $tableau_608);
     if (!is_array($traitement_rameau)) {
         $traitement_rameau = array("form" => $traitement_rameau, "message" => "");
     }
     $form_notice = str_replace('!!message_rameau!!', $traitement_rameau["message"], $form_notice);
     $form_notice = str_replace('!!traitement_rameau!!', $traitement_rameau["form"], $form_notice);
     $manual_categorisation_form = get_manual_categorisation_form($tableau_600, $tableau_601, $tableau_602, $tableau_604, $tableau_605, $tableau_606, $tableau_607, $tableau_608);
     $form_notice = str_replace('!!manual_categorisation!!', $manual_categorisation_form, $form_notice);
     //Mise à jour de l'onglet 9
     $p_perso = new parametres_perso("notices");
     if (function_exists("param_perso_form")) {
         param_perso_form($p_perso);
     }
     //pour Pubmed et DOI, on regarde si on peut remplir un champ résolveur...
     if (count($this->others_ids) > 0) {
         foreach ($p_perso->t_fields as $key => $t_field) {
             if ($t_field['TYPE'] == "resolve") {
                 $field_options = _parser_text_no_function_("<?xml version='1.0' encoding='" . $charset . "'?>\n" . $t_field['OPTIONS'], "OPTIONS");
                 foreach ($field_options['RESOLVE'] as $resolve) {
                     //pubmed = 1 | DOI = 2
                     foreach ($this->others_ids as $other_id) {
                         if ($other_id['b'] == "PMID" && $resolve['ID'] == "1") {
                             //on a le champ perso résolveur PubMed
                             $p_perso->values[$key][] = $other_id['a'] . "|1";
                         } else {
                             if ($other_id['b'] == "DOI" && $resolve['ID'] == "2") {
                                 //on a le champ perso résolveur DOI
                                 $p_perso->values[$key][] = $other_id['a'] . "|2";
                             }
                         }
                     }
                 }
             }
         }
     }
     if (!$p_perso->no_special_fields) {
         $perso_ = $p_perso->show_editable_fields($id_notice, true);
         $perso = "";
         for ($i = 0; $i < count($perso_["FIELDS"]); $i++) {
             $p = $perso_["FIELDS"][$i];
             $perso .= "<div class='row'>\n\t\t\t\t\t<label for='" . $p["NAME"] . "' class='etiquette'>" . $p["TITRE"] . " </label>" . $p["COMMENT_DISPLAY"] . "\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class='row'>\n\t\t\t\t\t" . $p["AFF"] . "\n\t\t\t\t\t</div>\n\t\t\t\t\t";
         }
         $perso .= $perso_["CHECK_SCRIPTS"];
         $ptab[9] = str_replace("!!champs_perso!!", $perso, $ptab[9]);
     } else {
         $ptab[9] = "\n<script type='text/javascript' >function check_form() { return true; }</script>\n";
     }
     $form_notice = str_replace('!!tab9!!', $ptab[9], $form_notice);
     // champs de gestion
     global $pmb_notice_img_folder_id;
     $message_folder = "";
     if ($pmb_notice_img_folder_id) {
         $req = "select repertoire_path from upload_repertoire where repertoire_id ='" . $pmb_notice_img_folder_id . "'";
         $res = pmb_mysql_query($req);
         if (pmb_mysql_num_rows($res)) {
             $rep = pmb_mysql_fetch_object($res);
             if (!is_dir($rep->repertoire_path)) {
                 $notice_img_folder_error = 1;
             }
         } else {
             $notice_img_folder_error = 1;
         }
         if ($notice_img_folder_error) {
             if (SESSrights & ADMINISTRATION_AUTH) {
                 $requete = "select * from parametres where gestion=0 and type_param='pmb' and sstype_param='notice_img_folder_id' ";
                 $res = pmb_mysql_query($requete);
                 $i = 0;
                 if ($param = pmb_mysql_fetch_object($res)) {
                     $message_folder = " <a class='erreur' href='./admin.php?categ=param&action=modif&id_param=" . $param->id_param . "' >" . $msg['notice_img_folder_admin_no_access'] . "</a> ";
                 }
             } else {
                 $message_folder = $msg['notice_img_folder_no_access'];
             }
         }
     }
     $ptab[10] = str_replace('!!message_folder!!', $message_folder, $ptab[10]);
     // langue de la notice
     global $lang, $xmlta_indexation_lang;
     $user_lang = $this->indexation_lang;
     if (!$user_lang) {
         $user_lang = $xmlta_indexation_lang;
     }
     //	if(!$user_lang) $user_lang="fr_FR";
     $langues = new XMLlist("{$include_path}/messages/languages.xml");
     $langues->analyser();
     $clang = $langues->table;
     $combo = "<select name='indexation_lang' id='indexation_lang' class='saisie-20em' >";
     if (!$user_lang) {
         $combo .= "<option value='' selected>--</option>";
     } else {
         $combo .= "<option value='' >--</option>";
     }
     while (list($cle, $value) = each($clang)) {
         // arabe seulement si on est en utf-8
         if ($charset != 'utf-8' and $user_lang != 'ar' or $charset == 'utf-8') {
             if (strcmp($cle, $user_lang) != 0) {
                 $combo .= "<option value='{$cle}'>{$value} ({$cle})</option>";
             } else {
                 $combo .= "<option value='{$cle}' selected>{$value} ({$cle})</option>";
             }
         }
     }
     $combo .= "</select>";
     $ptab[10] = str_replace('!!indexation_lang!!', $combo, $ptab[10]);
     $form_notice = str_replace('!!indexation_lang_sel!!', $user_lang, $form_notice);
     global $deflt_integration_notice_statut;
     if ($id_notice) {
         $rqt_statut = "select statut from notices where notice_id='{$id_notice}' ";
         $res_statut = pmb_mysql_query($rqt_statut);
         $stat = pmb_mysql_fetch_object($res_statut);
         $select_statut = gen_liste_multiple("select id_notice_statut, gestion_libelle from notice_statut order by 2", "id_notice_statut", "gestion_libelle", "id_notice_statut", "form_notice_statut", "", $stat->statut, "", "", "", "", 0);
     } else {
         $select_statut = gen_liste_multiple("select id_notice_statut, gestion_libelle from notice_statut order by 2", "id_notice_statut", "gestion_libelle", "id_notice_statut", "form_notice_statut", "", $deflt_integration_notice_statut, "", "", "", "", 0);
     }
     $ptab[10] = str_replace('!!notice_statut!!', $select_statut, $ptab[10]);
     $ptab[10] = str_replace('!!commentaire_gestion!!', htmlentities($this->commentaire_gestion, ENT_QUOTES, $charset), $ptab[10]);
     $ptab[10] = str_replace('!!thumbnail_url!!', htmlentities($this->thumbnail_url, ENT_QUOTES, $charset), $ptab[10]);
     $form_notice = str_replace('!!tab10!!', $ptab[10], $form_notice);
     // Documents Numériques
     $docnum_infos = "";
     $count = 0;
     $upload_doc_num = "";
     if ($this->source_id) {
         $requete = "select * from connectors_sources where source_id=" . $this->source_id . "";
         $resultat = pmb_mysql_query($requete);
         if (pmb_mysql_num_rows($resultat)) {
             $r = pmb_mysql_fetch_object($resultat);
             if (!$r->upload_doc_num) {
                 $upload_doc_num = "checked";
             }
         }
     }
     if (count($this->doc_nums)) {
         global $deflt_explnum_statut;
         $statutlist = gen_liste_multiple("select id_explnum_statut, gestion_libelle from explnum_statut order by 2", "id_explnum_statut", "gestion_libelle", "id_explnum_statut", "doc_num_statut!!docnumid!!", "", $deflt_explnum_statut, "", "", "", "", 0);
         foreach ($this->doc_nums as $doc_num) {
             $docnum_info = $ptab[1111];
             // 				$alink = '<a target="_blank" href="'.htmlspecialchars($doc_num["a"]).'">'.htmlspecialchars($doc_num["a"]).'</a>';
             $docnum_info = str_replace('!!docnum_url!!', htmlspecialchars($doc_num["a"], ENT_QUOTES, $charset), $docnum_info);
             $docnum_info = str_replace('!!docnum_caption!!', htmlspecialchars($doc_num["b"], ENT_QUOTES, $charset), $docnum_info);
             $docnum_info = str_replace('!!docnum_filename!!', htmlspecialchars($doc_num["f"], ENT_QUOTES, $charset), $docnum_info);
             $docnum_info = str_replace('!!docnum_statutlist!!', $statutlist, $docnum_info);
             $docnum_info = str_replace('!!docnumid!!', $count, $docnum_info);
             $docnum_info = str_replace('!!upload_doc_num!!', $upload_doc_num, $docnum_info);
             $docnum_infos .= $docnum_info;
             $count++;
         }
     }
     if (!$docnum_infos) {
         $docnum_infos = $msg["noticeintegre_nodocnum"];
     }
     $ptab[1110] = str_replace('!!docnum_count!!', $count, $ptab[1110]);
     $ptab[1110] = str_replace('!!docnums!!', $docnum_infos, $ptab[1110]);
     $form_notice = str_replace('!!tab11!!', $ptab[1110], $form_notice);
     $aac = explode('&', $action);
     $retact = '&' . $aac[2] . '&' . $aac[5] . '&' . $aac[6];
     global $force;
     $retares = '';
     switch ($retour) {
         case 'button':
             if ($this->message_retour) {
                 $retares = "<input type='button' class='bouton' onclick='history.go(-1);' value='" . $this->message_retour . "' />";
             } else {
                 if ($force == 1) {
                     $retares = "<a href='javascript:history.go(-2);'>" . $msg['z3950_retour_a_resultats'] . "</a>";
                 } else {
                     $retares = "<a href='javascript:history.go(-1);'>" . $msg['z3950_retour_a_resultats'] . "</a>";
                 }
             }
             break;
         case 'link':
             $retares = "<a href='./catalog.php?categ=z3950&action=display" . $retact . "'>" . $msg['z3950_retour_a_resultats'] . "</a>";
             break;
         default:
             break;
     }
     $form_notice = str_replace('!!retour_a_resultats!!', $retares, $form_notice);
     if (!$this->bt_integr_value) {
         if (!$id_notice) {
             $form_notice = str_replace('!!bouton_integration!!', $msg['z3950_integr_not_seule'], $form_notice);
         } else {
             $form_notice = str_replace('!!bouton_integration!!', $msg['notice_z3950_remplace_catal'], $form_notice);
         }
     } else {
         $form_notice = str_replace('!!bouton_integration!!', $this->bt_integr_value, $form_notice);
     }
     if ($this->bt_undo_value && $this->bt_undo_action) {
         $bt_undo = str_replace('!!value!!', $this->bt_undo_value, $bt_undo);
         $bt_undo = str_replace('!!action!!', $this->bt_undo_action, $bt_undo);
         $form_notice = str_replace('<!-- bt_undo -->', $bt_undo, $form_notice);
     }
     $form_notice = str_replace('!!id_notice!!', $id_notice, $form_notice);
     $form_notice = str_replace('!!notice!!', $znotices_id, $form_notice);
     $form_notice = str_replace('!!notice_type!!', $this->notice_type, $form_notice);
     return $form_notice;
 }
Exemple #13
0
            break;
    }
    $i++;
}
$requete_nom = "SELECT nom, prenom, user_email, userid, username, user_lang  FROM users WHERE username='******' ";
$res_nom = pmb_mysql_query($requete_nom, $dbh);
@($param_nom = pmb_mysql_fetch_object($res_nom));
$lang = $param_nom->user_lang;
$PMBusernom = $param_nom->nom;
$PMBuserprenom = $param_nom->prenom;
$PMBuseremail = $param_nom->user_email;
// pour que l'id user soit dispo partout
define('SESSuserid', $param_nom->userid);
$PMBuserid = $param_nom->userid;
$PMBusername = $param_nom->username;
$messages = new XMLlist("{$include_path}/messages/{$lang}.xml", 0);
$messages->analyser();
$msg = $messages->table;
include_once "{$class_path}/bannette.class.php";
include_once "{$class_path}/equation.class.php";
include_once "{$class_path}/classements.class.php";
require_once "{$class_path}/docs_location.class.php";
include_once "{$class_path}/rss_flux.class.php";
require_once "./dsi/func_abo.inc.php";
require_once "./dsi/func_pro.inc.php";
require_once "./dsi/func_common.inc.php";
require_once "./dsi/func_clas.inc.php";
require_once "./dsi/func_equ.inc.php";
require_once "./dsi/func_diff.inc.php";
require_once "./dsi/func_rss.inc.php";
$action_diff_aff = "<h1>" . $msg[dsi_dif_auto_titre] . "</h1>";
Exemple #14
0
header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Content-Disposition: inline; filename="toto.csv"');
//header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
include '../../../classes/XMLlist.class.php';
// on définit les langues existantes
$languages = new XMLlist("languages_csv.xml", 0);
$languages->analyser();
$avail_lang = $languages->table;
$nb_lang = 0;
$messages_list = array();
while (list($cle, $valeur) = each($avail_lang)) {
    // Dans un tableau des codages, la valeur de codage est stockée
    $codage[$nb_lang] = $valeur;
    $lang_name[$nb_lang] = $cle;
    $obj_lang = new XMLlist("../{$cle}.xml", 0);
    $obj_lang->analyser();
    $lang = $obj_lang->table;
    while (list($key, $val) = each($lang)) {
        $messages_list[$key][$nb_lang] = $val;
    }
    $nb_lang++;
}
while (list($cle, $valeur) = each($messages_list)) {
    echo $cle . ";";
    // La première langue est supposée en utf-8 alors que la suivante est en iso
    //$valeur[0]=utf8_encode($valeur[0]);
    for ($i = 0; $i < $nb_lang; $i++) {
        // Si le codage de la langue n'est pas en utf-8 alors on encode
        if ($codage[$i] != "utf-8") {
            $valeur[$i] = utf8_encode($valeur[$i]);
Exemple #15
0
 function marc_list($type)
 {
     global $lang;
     global $charset;
     global $include_path;
     switch ($type) {
         case 'country':
             $parser = new XMLlist("{$include_path}/marc_tables/{$lang}/country.xml");
             $parser->analyser();
             $this->table = $parser->table;
             break;
         case 'icondoc':
             $parser = new XMLlist("{$include_path}/marc_tables/icondoc.xml");
             $parser->analyser();
             $this->table = $parser->table;
             break;
         case 'icondoc_big':
             $parser = new XMLlist("{$include_path}/marc_tables/icondoc_big.xml");
             $parser->analyser();
             $this->table = $parser->table;
             break;
         case 'lang':
             $parser = new XMLlist("{$include_path}/marc_tables/{$lang}/lang.xml");
             $parser->analyser();
             $this->table = $parser->table;
             break;
         case 'doctype':
             $parser = new XMLlist("{$include_path}/marc_tables/{$lang}/doctype.xml", 0);
             $parser->analyser();
             $this->table = $parser->table;
             break;
         case 'recordtype':
             $parser = new XMLlist("{$include_path}/marc_tables/{$lang}/recordtype.xml");
             $parser->analyser();
             $this->table = $parser->table;
             break;
         case 'function':
             $parser = new XMLlist("{$include_path}/marc_tables/{$lang}/function.xml");
             $parser->analyser();
             $this->table = $parser->table;
             break;
         case 'literal_function':
             $parser = new XMLlist("{$include_path}/marc_tables/{$lang}/literal_function.xml");
             $parser->analyser();
             $this->table = $parser->table;
             break;
         case 'section_995':
             $parser = new XMLlist("{$include_path}/marc_tables/{$lang}/section_995.xml");
             $parser->analyser();
             $this->table = $parser->table;
             break;
         case 'typdoc_995':
             $parser = new XMLlist("{$include_path}/marc_tables/{$lang}/typdoc_995.xml");
             $parser->analyser();
             $this->table = $parser->table;
             break;
         case 'codstatdoc_995':
             $parser = new XMLlist("{$include_path}/marc_tables/{$lang}/codstat_995.xml");
             $parser->analyser();
             $this->table = $parser->table;
             break;
         case 'diacritique':
             // Armelle : a priori plus utile
             $parser = new XMLlist("{$include_path}/marc_tables/diacritique.xml");
             $parser->analyser();
             $this->table = $parser->table;
             break;
         case 'nivbiblio':
             $parser = new XMLlist("{$include_path}/marc_tables/{$lang}/nivbiblio.xml");
             $parser->analyser();
             $this->table = $parser->table;
             break;
         case 'relationtypeup':
             $parser = new XMLlist("{$include_path}/marc_tables/{$lang}/relationtypeup.xml");
             $parser->analyser();
             $this->table = $parser->table;
             break;
         case 'relationtypedown':
             $parser = new XMLlist("{$include_path}/marc_tables/{$lang}/relationtypedown.xml");
             $parser->analyser();
             $this->table = $parser->table;
             break;
         case "etat_demandes":
             $parser = new XMLlist("{$include_path}/marc_tables/{$lang}/etat_demandes.xml");
             $parser->analyser();
             $this->table = $parser->table;
             break;
         case "type_actions":
             $parser = new XMLlist("{$include_path}/marc_tables/{$lang}/type_actions_demandes.xml");
             $parser->analyser();
             $this->table = $parser->table;
             break;
         case 'relationtype_aut':
             $parser = new XMLlist("{$include_path}/marc_tables/{$lang}/relationtype_aut.xml");
             $parser->analyser();
             $this->table = $parser->table;
             break;
         case 'relationtype_autup':
             $parser = new XMLlist("{$include_path}/marc_tables/{$lang}/relationtype_autup.xml");
             $parser->analyser();
             $this->table = $parser->table;
             break;
         default:
             $this->table = array();
             break;
     }
 }
 function get_messages()
 {
     global $lang;
     global $base_path;
     $path = $this->path;
     if (file_exists($base_path . "/admin/connecteurs/out/{$path}/messages/" . $lang . ".xml")) {
         $file_name = $base_path . "/admin/connecteurs/out/{$path}/messages/" . $lang . ".xml";
     } else {
         if (file_exists($base_path . "/admin/connecteurs/out/{$path}/messages/fr_FR.xml")) {
             $file_name = $base_path . "/admin/connecteurs/out/{$path}/messages/fr_FR.xml";
         }
     }
     if ($file_name) {
         $xmllist = new XMLlist($file_name);
         $xmllist->analyser();
         $this->msg = $xmllist->table;
     }
 }
Exemple #17
0
function user_form($login = "", $nom = "", $prenom = "", $flag = 3, $id = 0, $lang = "", $nb_per_page_search = 10, $nb_per_page_select = 10, $nb_per_page_gestion = 10, $form_param_default = "", $form_user_email = "", $form_user_alert_resamail = "0", $form_user_alert_demandesmail = "0", $form_user_alert_subscribemail = "0", $form_user_alert_suggmail = "0", $usr_grp = FALSE)
{
    global $msg;
    global $admin_user_form;
    global $charset;
    global $password_field;
    global $include_path;
    global $demandes_active;
    global $opac_websubscribe_show, $acquisition_active;
    $user_encours = $_COOKIE["PhpMyBibli-LOGIN"];
    if ($id == 1 || $login == $user_encours || $id == 0) {
        // $id est admin ou $login est l'utilisateur en cours
        $admin_user_form = str_replace('!!bouton_suppression!!', "", $admin_user_form);
    } else {
        $admin_user_form = str_replace('!!bouton_suppression!!', " <input class='bouton' type='button' value=' {$msg['63']} ' onClick=\"javascript:confirmation_delete(!!id!!,'{$login}')\" /> ", $admin_user_form);
    }
    if (!$id) {
        $title = $msg[85];
    } else {
        $title = $msg[90];
    }
    // modification
    $admin_user_form = str_replace('!!id!!', $id, $admin_user_form);
    $admin_user_form = str_replace('!!title!!', $title, $admin_user_form);
    $admin_user_form = str_replace('!!login!!', $login, $admin_user_form);
    $admin_user_form = str_replace('!!nom!!', $nom, $admin_user_form);
    $admin_user_form = str_replace('!!prenom!!', $prenom, $admin_user_form);
    $admin_user_form = str_replace('!!nb_per_page_search!!', $nb_per_page_search, $admin_user_form);
    $admin_user_form = str_replace('!!nb_per_page_select!!', $nb_per_page_select, $admin_user_form);
    $admin_user_form = str_replace('!!nb_per_page_gestion!!', $nb_per_page_gestion, $admin_user_form);
    if (!$id) {
        $admin_user_form = str_replace('!!password_field!!', $password_field, $admin_user_form);
    } else {
        $admin_user_form = str_replace('!!password_field!!', '', $admin_user_form);
    }
    $flag & ADMINISTRATION_AUTH ? $admin_flg_form = "checked " : ($admin_flg_form = "");
    $flag & CIRCULATION_AUTH ? $circ_flg_form = "checked " : ($circ_flg_form = "");
    $flag & CATALOGAGE_AUTH ? $catal_flg_form = "checked " : ($catal_flg_form = "");
    $flag & AUTORITES_AUTH ? $auth_flg_form = "checked " : ($auth_flg_form = "");
    $flag & EDIT_AUTH ? $edit_flg_form = "checked " : ($edit_flg_form = "");
    $flag & EDIT_FORCING_AUTH ? $edit_forcing_flg_form = "checked " : ($edit_forcing_flg_form = "");
    $flag & SAUV_AUTH ? $sauv_flg_form = "checked " : ($sauv_flg_form = "");
    $flag & DSI_AUTH ? $dsi_flg_form = "checked " : ($dsi_flg_form = "");
    $flag & PREF_AUTH ? $pref_flg_form = "checked " : ($pref_flg_form = "");
    $flag & ACQUISITION_AUTH ? $acquisition_flg_form = "checked " : ($acquisition_flg_form = "");
    $flag & RESTRICTCIRC_AUTH ? $restrictcirc_flg_form = "checked " : ($restrictcirc_flg_form = "");
    $flag & THESAURUS_AUTH ? $thesaurus_flg_form = "checked " : ($thesaurus_flg_form = "");
    $flag & TRANSFERTS_AUTH ? $transferts_flg_form = "checked " : ($transferts_flg_form = "");
    $flag & EXTENSIONS_AUTH ? $extensions_flg_form = "checked " : ($extensions_flg_form = "");
    $flag & DEMANDES_AUTH ? $demandes_flg_form = "checked " : ($extensions_flg_form = "");
    $flag & CMS_AUTH ? $cms_flg_form = "checked " : ($cms_flg_form = "");
    $flag & FICHES_AUTH ? $fiches_flg_form = "checked " : ($fiches_flg_form = "");
    $admin_user_form = str_replace('!!admin_flg!!', $admin_flg_form, $admin_user_form);
    $admin_user_form = str_replace('!!catal_flg!!', $catal_flg_form, $admin_user_form);
    $admin_user_form = str_replace('!!circ_flg!!', $circ_flg_form, $admin_user_form);
    $admin_user_form = str_replace('!!auth_flg!!', $auth_flg_form, $admin_user_form);
    $admin_user_form = str_replace('!!edit_flg!!', $edit_flg_form, $admin_user_form);
    $admin_user_form = str_replace('!!edit_forcing_flg!!', $edit_forcing_flg_form, $admin_user_form);
    $admin_user_form = str_replace('!!sauv_flg!!', $sauv_flg_form, $admin_user_form);
    $admin_user_form = str_replace('!!dsi_flg!!', $dsi_flg_form, $admin_user_form);
    $admin_user_form = str_replace('!!pref_flg!!', $pref_flg_form, $admin_user_form);
    $admin_user_form = str_replace('!!acquisition_flg!!', $acquisition_flg_form, $admin_user_form);
    $admin_user_form = str_replace('!!restrictcirc_flg!!', $restrictcirc_flg_form, $admin_user_form);
    $admin_user_form = str_replace('!!thesaurus_flg!!', $thesaurus_flg_form, $admin_user_form);
    $admin_user_form = str_replace('!!transferts_flg!!', $transferts_flg_form, $admin_user_form);
    $admin_user_form = str_replace('!!extensions_flg!!', $extensions_flg_form, $admin_user_form);
    $admin_user_form = str_replace('!!demandes_flg!!', $demandes_flg_form, $admin_user_form);
    $admin_user_form = str_replace('!!cms_flg!!', $cms_flg_form, $admin_user_form);
    $admin_user_form = str_replace('!!fiches_flg!!', $fiches_flg_form, $admin_user_form);
    if ($form_user_alert_resamail == 1) {
        $alert_resa_mail = " checked";
    } else {
        $alert_resa_mail = "";
    }
    $admin_user_form = str_replace('!!alter_resa_mail!!', $alert_resa_mail, $admin_user_form);
    if ($demandes_active) {
        if ($form_user_alert_demandesmail == 1) {
            $alert_demandes_mail = " checked";
        } else {
            $alert_demandes_mail = "";
        }
        $admin_user_form = str_replace('!!alert_demandes_mail!!', $alert_demandes_mail, $admin_user_form);
    }
    if ($opac_websubscribe_show) {
        if ($form_user_alert_subscribemail == 1) {
            $alert_subscribe_mail = " checked";
        } else {
            $alert_subscribe_mail = "";
        }
        $admin_user_form = str_replace('!!alert_subscribe_mail!!', $alert_subscribe_mail, $admin_user_form);
    }
    if ($acquisition_active) {
        if ($form_user_alert_suggmail == 1) {
            $alert_sugg_mail = " checked";
        } else {
            $alert_sugg_mail = "";
        }
        $admin_user_form = str_replace('!!alert_sugg_mail!!', $alert_sugg_mail, $admin_user_form);
    }
    $admin_user_form = str_replace('!!user_email!!', $form_user_email, $admin_user_form);
    if (!$id) {
        $form_type = '1';
    } else {
        $form_type = '0';
    }
    // récupération des codes langues
    $la = new XMLlist("{$include_path}/messages/languages.xml", 0);
    $la->analyser();
    $languages = $la->table;
    // constitution du sélecteur
    $selector = "<select name='user_lang'>\t";
    while (list($codelang, $libelle) = each($languages)) {
        // arabe seulement si on est en utf-8
        if ($charset != 'utf-8' and $codelang != 'ar' or $charset == 'utf-8') {
            if ($lang == $codelang) {
                $selector .= "<option value='" . htmlentities($codelang, ENT_QUOTES, $charset) . "' SELECTED>" . htmlentities($libelle, ENT_QUOTES, $charset) . "</option>";
            } else {
                $selector .= "<option value='" . htmlentities($codelang, ENT_QUOTES, $charset) . "'>" . htmlentities($libelle, ENT_QUOTES, $charset) . "</option>";
            }
        }
    }
    $selector .= '</select>';
    $admin_user_form = str_replace('!!select_lang!!', $selector, $admin_user_form);
    $admin_user_form = str_replace('!!form_type!!', $form_type, $admin_user_form);
    $admin_user_form = str_replace('!!form_param_default!!', $form_param_default, $admin_user_form);
    //groupes
    if ($usr_grp !== FALSE) {
        $q = "select * from users_groups order by grp_name ";
        $sel_group = gen_liste($q, 'grp_id', 'grp_name', 'sel_group', '', $usr_grp, '0', $msg[128], '0', $msg[128]);
        $sel_group = "<label class='etiquette'>" . htmlentities($msg['admin_usr_grp_aff'], ENT_QUOTES, $charset) . '</label><br />' . $sel_group;
        $admin_user_form = str_replace('<!-- sel_group -->', $sel_group, $admin_user_form);
    }
    print confirmation_delete("./admin.php?categ=users&sub=users&action=del&id=");
    print $admin_user_form;
}
/**
 * Retourne le type d'url externe cliquée
 */
function aff_url_externe_type($param, $parser)
{
    global $lang, $include_path;
    global $liste_libelle_types;
    if (!count($liste_libelle_types)) {
        if (file_exists($include_path . "/interpreter/statopac/{$lang}.xml")) {
            $liste_libelle = new XMLlist($include_path . "/interpreter/statopac/{$lang}.xml");
        } else {
            $liste_libelle = new XMLlist($include_path . "/interpreter/statopac/fr_FR.xml");
        }
        $liste_libelle->analyser();
        $liste_libelle_types = $liste_libelle->table;
    }
    $tab = get_var_get($param, $parser);
    if (!isset($tab['type_url'])) {
        $tab = get_var_post($param, $parser);
        if (!isset($tab['type_url'])) {
            return '';
        }
    }
    return $liste_libelle_types[$tab['type_url']];
}
Exemple #19
0
function get_functions_authors()
{
    global $include_path;
    global $lang;
    if (file_exists($include_path . "/marc_tables/" . $lang . "/function.xml")) {
        $file_name = $include_path . "/marc_tables/" . $lang . "/function.xml";
    } else {
        if (file_exists($include_path . "/marc_tables/fr_FR/function.xml")) {
            $file_name = $include_path . "/marc_tables/fr_FR/function.xml";
        }
    }
    if ($file_name) {
        $xmllist = new XMLlist($file_name);
        $xmllist->analyser();
        $codes_auteurs = $xmllist->table;
        return $codes_auteurs;
    } else {
        return array();
    }
}
 function checkTasks()
 {
     global $dbh, $base_path, $include_path, $class_path, $javascript_path, $lang;
     global $charset;
     global $PMBusernom, $PMBuserprenom, $PMBuseremail;
     //Récupération de l'OS pour la vérification des processus
     $os = $this->getOS();
     $sql = "SELECT id_tache, start_at, id_process FROM taches WHERE id_process <> 0";
     $res = pmb_mysql_query($sql, $dbh);
     if ($res && pmb_mysql_num_rows($res)) {
         while ($row = pmb_mysql_fetch_assoc($res)) {
             if ($os == "Linux") {
                 $command = 'ps -p ' . $row['id_process'];
             } else {
                 if ($os == "Windows") {
                     $command = 'tasklist /FI "PID eq ' . $row['id_process'] . '" ';
                 } else {
                     if ($os == "Mac") {
                         $command = 'ps -p ' . $row['id_process'];
                     } else {
                         $command = 'ps -p ' . $row['id_process'];
                     }
                 }
             }
             $output = array();
             exec($command, $output);
             if (!isset($output[1])) {
                 // 5 = STOPPED
                 $sql_stop_task = "update taches set status=5, ";
                 if ($row['start_at'] == '0000-00-00 00:00:00') {
                     $sql_stop_task .= "start_at=CURRENT_TIMESTAMP, ";
                 }
                 $sql_stop_task .= "end_at=CURRENT_TIMESTAMP, id_process=0, commande=0 where id_tache=" . $row["id_tache"];
                 pmb_mysql_query($sql_stop_task);
                 //En fonction du paramétrage de la tâche...
                 //Replanifier / Envoi de mail
                 $query = "select num_type_tache, libelle_tache, param, num_planificateur, indicat_progress from planificateur join taches on id_planificateur=num_planificateur where id_tache=" . $row["id_tache"];
                 $result = pmb_mysql_query($query);
                 if ($result && pmb_mysql_num_rows($result)) {
                     $task_info = pmb_mysql_fetch_object($result);
                     $params = unserialize($task_info->param);
                     if ($params["alert_mail_on_failure"] != "") {
                         $params_alert_mail = explode(",", $params["alert_mail_on_failure"]);
                         if ($params_alert_mail[0]) {
                             $mails = explode(";", $params_alert_mail[1]);
                             if (preg_match("#.*@.*#", $PMBuseremail)) {
                                 if (count($mails)) {
                                     //Allons chercher les messages
                                     if (file_exists("{$include_path}/messages/" . $lang . ".xml")) {
                                         //Allons chercher les messages
                                         require_once "{$class_path}/XMLlist.class.php";
                                         $messages = new XMLlist("{$include_path}/messages/" . $lang . ".xml", 0);
                                         $messages->analyser();
                                         $msg = $messages->table;
                                         $objet = $msg["task_alert_user_mail_obj"];
                                         $corps = str_replace("!!task_name!!", $task_info->libelle_tache, $msg["task_alert_user_mail_corps"]);
                                         $corps = str_replace("!!percent!!", $task_info->indicat_progress, $corps);
                                         foreach ($mails as $mail) {
                                             if (preg_match("#.*@.*#", $mail)) {
                                                 @mailpmb("", $mail, $objet, $corps, $PMBusernom . " " . $PMBuserprenom, $PMBuseremail, "Content-Type: text/plain; charset=\"{$charset}\"", '', '', 0, '');
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                     if ($params["restart_on_failure"]) {
                         $this->createNewTask($row["id_tache"], $task_info->num_type_tache, $task_info->num_planificateur);
                     }
                 }
             }
         }
     }
 }
Exemple #21
0
                 $liste_values = mysql_fetch_row($resultat_liste);
                 $deflt_user .= "<option value=\"" . $liste_values[0] . "\" ";
                 if ($field_values[$i] == $liste_values[0]) {
                     $deflt_user .= "selected";
                 }
                 $deflt_user .= ">" . $liste_values[1] . "</option>\n";
                 $j++;
             }
             $deflt_user .= "</select></div></div>\n";
         }
     }
     break;
 case "xmlta_":
     switch ($field) {
         case "xmlta_indexation_lang":
             $langues = new XMLlist("{$include_path}/messages/languages.xml");
             $langues->analyser();
             $clang = $langues->table;
             $combo = "<select name='form_" . $field . "' id='form_" . $field . "' class='saisie-20em' >";
             if (!$field_values[$i]) {
                 $combo .= "<option value='' selected>--</option>";
             } else {
                 $combo .= "<option value='' >--</option>";
             }
             while (list($cle, $value) = each($clang)) {
                 // arabe seulement si on est en utf-8
                 if ($charset != 'utf-8' and $user_lang != 'ar' or $charset == 'utf-8') {
                     if (strcmp($cle, $field_values[$i]) != 0) {
                         $combo .= "<option value='{$cle}'>{$value} ({$cle})</option>";
                     } else {
                         $combo .= "<option value='{$cle}' selected>{$value} ({$cle})</option>";
Exemple #22
0
function aff_libelle_sous_type_page($param, $parser)
{
    global $lang, $include_path;
    global $liste_libelle_sous_type_page;
    global $cms_active, $class_path;
    if (!count($liste_libelle_sous_type_page)) {
        if (file_exists($include_path . "/interpreter/statopac/{$lang}.xml")) {
            $liste_libelle = new XMLlist($include_path . "/interpreter/statopac/{$lang}.xml");
        } else {
            $liste_libelle = new XMLlist($include_path . "/interpreter/statopac/fr_FR.xml");
        }
        $liste_libelle->analyser();
        $liste_libelle_sous_type_page = $liste_libelle->table;
        //Libellés des pages du portail
        if ($cms_active) {
            require_once $class_path . "/cms/cms_pages.class.php";
            $cms_pages = new cms_pages();
            if (count($cms_pages->data)) {
                foreach ($cms_pages->data as $page) {
                    $liste_libelle_sous_type_page["25" . str_pad($page["id"], 2, "0", STR_PAD_LEFT)] = $page["name"];
                }
            }
        }
    }
    $value_page = aff_sous_type_page($param, $parser);
    return $liste_libelle_sous_type_page[$value_page];
}
Exemple #23
0
 function analysis_form($notice_type = false)
 {
     global $style;
     global $msg;
     global $pdeptab;
     global $analysis_top_form;
     global $fonction_auteur;
     global $charset;
     global $include_path, $class_path;
     global $pmb_type_audit, $select_categ_prop;
     global $value_deflt_fonction;
     global $value_deflt_lang, $value_deflt_relation_analysis;
     global $thesaurus_mode_pmb, $thesaurus_classement_mode_pmb;
     global $thesaurus_concepts_active;
     global $pmb_notices_show_dates;
     require_once "{$class_path}/author.class.php";
     require_once $class_path . "/index_concept.class.php";
     $fonction = new marc_list('function');
     // inclusion de la feuille de style des expandables
     print $style;
     // mise à jour des flags de niveau hiérarchique
     $select_doc = new marc_select('doctype', 'typdoc', $this->analysis_typdoc, "get_pos(); initIt(); ajax_parse_dom();");
     $analysis_top_form = str_replace('!!doc_type!!', $select_doc->display, $analysis_top_form);
     //$analysis_top_form = str_replace('!!doc_type!!', $this->analysis_typdoc, $analysis_top_form);
     $analysis_top_form = str_replace('!!b_level!!', $this->analysis_biblio_level, $analysis_top_form);
     $analysis_top_form = str_replace('!!h_level!!', $this->analysis_hierar_level, $analysis_top_form);
     $analysis_top_form = str_replace('!!id!!', $this->serial_id, $analysis_top_form);
     // mise à jour de l'onglet 0
     $pdeptab[0] = str_replace('!!tit1!!', htmlentities($this->analysis_tit1, ENT_QUOTES, $charset), $pdeptab[0]);
     $pdeptab[0] = str_replace('!!tit2!!', htmlentities($this->analysis_tit2, ENT_QUOTES, $charset), $pdeptab[0]);
     $pdeptab[0] = str_replace('!!tit3!!', htmlentities($this->analysis_tit3, ENT_QUOTES, $charset), $pdeptab[0]);
     $pdeptab[0] = str_replace('!!tit4!!', htmlentities($this->analysis_tit4, ENT_QUOTES, $charset), $pdeptab[0]);
     $analysis_top_form = str_replace('!!tab0!!', $pdeptab[0], $analysis_top_form);
     // initialisation avec les paramètres du user :
     if (!$this->analysis_langues) {
         global $value_deflt_lang;
         if ($value_deflt_lang) {
             $lang = new marc_list('lang');
             $this->analysis_langues[] = array('lang_code' => $value_deflt_lang, 'langue' => $lang->table[$value_deflt_lang]);
         }
     }
     // mise à jour de l'onglet 1
     // constitution de la mention de responsabilité
     //$this->responsabilites
     $as = array_search("0", $this->responsabilites_dep["responsabilites"]);
     if ($as !== FALSE && $as !== NULL) {
         $auteur_0 = $this->responsabilites_dep["auteurs"][$as];
         $auteur = new auteur($auteur_0["id"]);
     }
     if ($value_deflt_fonction && $auteur_0["id"] == 0) {
         $auteur_0["fonction"] = $value_deflt_fonction;
     }
     $pdeptab[1] = str_replace('!!aut0_id!!', $auteur_0["id"], $pdeptab[1]);
     $pdeptab[1] = str_replace('!!aut0!!', htmlentities($auteur->display, ENT_QUOTES, $charset), $pdeptab[1]);
     $pdeptab[1] = str_replace('!!f0_code!!', $auteur_0["fonction"], $pdeptab[1]);
     $pdeptab[1] = str_replace('!!f0!!', $fonction->table[$auteur_0["fonction"]], $pdeptab[1]);
     $as = array_keys($this->responsabilites_dep["responsabilites"], "1");
     $max_aut1 = count($as);
     if ($max_aut1 == 0) {
         $max_aut1 = 1;
     }
     for ($i = 0; $i < $max_aut1; $i++) {
         $indice = $as[$i];
         $auteur_1 = $this->responsabilites_dep["auteurs"][$indice];
         $auteur = new auteur($auteur_1["id"]);
         if ($value_deflt_fonction && $auteur_1["id"] == 0 && $i == 0) {
             $auteur_1["fonction"] = $value_deflt_fonction;
         }
         $ptab_aut_autres = str_replace('!!iaut!!', $i, $pdeptab[11]);
         $ptab_aut_autres = str_replace('!!aut1_id!!', $auteur_1["id"], $ptab_aut_autres);
         $ptab_aut_autres = str_replace('!!aut1!!', htmlentities($auteur->display, ENT_QUOTES, $charset), $ptab_aut_autres);
         $ptab_aut_autres = str_replace('!!f1_code!!', $auteur_1["fonction"], $ptab_aut_autres);
         $ptab_aut_autres = str_replace('!!f1!!', $fonction->table[$auteur_1["fonction"]], $ptab_aut_autres);
         $autres_auteurs .= $ptab_aut_autres;
     }
     $pdeptab[1] = str_replace('!!max_aut1!!', $max_aut1, $pdeptab[1]);
     $as = array_keys($this->responsabilites_dep["responsabilites"], "2");
     $max_aut2 = count($as);
     if ($max_aut2 == 0) {
         $max_aut2 = 1;
     }
     for ($i = 0; $i < $max_aut2; $i++) {
         $indice = $as[$i];
         $auteur_2 = $this->responsabilites_dep["auteurs"][$indice];
         $auteur = new auteur($auteur_2["id"]);
         if ($value_deflt_fonction && $auteur_2["id"] == 0 && $i == 0) {
             $auteur_2["fonction"] = $value_deflt_fonction;
         }
         $ptab_aut_autres = str_replace('!!iaut!!', $i, $pdeptab[12]);
         $ptab_aut_autres = str_replace('!!aut2_id!!', $auteur_2["id"], $ptab_aut_autres);
         $ptab_aut_autres = str_replace('!!aut2!!', htmlentities($auteur->display, ENT_QUOTES, $charset), $ptab_aut_autres);
         $ptab_aut_autres = str_replace('!!f2_code!!', $auteur_2["fonction"], $ptab_aut_autres);
         $ptab_aut_autres = str_replace('!!f2!!', $fonction->table[$auteur_2["fonction"]], $ptab_aut_autres);
         $auteurs_secondaires .= $ptab_aut_autres;
     }
     $pdeptab[1] = str_replace('!!max_aut2!!', $max_aut2, $pdeptab[1]);
     $pdeptab[1] = str_replace('!!autres_auteurs!!', $autres_auteurs, $pdeptab[1]);
     $pdeptab[1] = str_replace('!!auteurs_secondaires!!', $auteurs_secondaires, $pdeptab[1]);
     $analysis_top_form = str_replace('!!tab1!!', $pdeptab[1], $analysis_top_form);
     // mise à jour de l'onglet 2
     $pdeptab[2] = str_replace('!!pages!!', htmlentities($this->analysis_pages, ENT_QUOTES, $charset), $pdeptab[2]);
     $analysis_top_form = str_replace('!!tab2!!', $pdeptab[2], $analysis_top_form);
     // mise à jour de l'onglet 3 (notes)
     $pdeptab[3] = str_replace('!!n_gen!!', htmlentities($this->analysis_n_gen, ENT_QUOTES, $charset), $pdeptab[3]);
     $pdeptab[3] = str_replace('!!n_contenu!!', htmlentities($this->analysis_n_contenu, ENT_QUOTES, $charset), $pdeptab[3]);
     $pdeptab[3] = str_replace('!!n_resume!!', htmlentities($this->analysis_n_resume, ENT_QUOTES, $charset), $pdeptab[3]);
     $analysis_top_form = str_replace('!!tab3!!', $pdeptab[3], $analysis_top_form);
     // mise à jour de l'onglet 4
     // catégories
     if (sizeof($this->analysis_categories) == 0) {
         $max_categ = 1;
     } else {
         $max_categ = sizeof($this->analysis_categories);
     }
     $tab_categ_order = "";
     for ($i = 0; $i < $max_categ; $i++) {
         $categ_id = $this->analysis_categories[$i]["categ_id"];
         $categ = new category($categ_id);
         if ($i == 0) {
             $ptab_categ = str_replace('!!icateg!!', $i, $pdeptab[40]);
         } else {
             $ptab_categ = str_replace('!!icateg!!', $i, $pdeptab[401]);
         }
         if ($thesaurus_mode_pmb && $categ_id) {
             $nom_thesaurus = '[' . thesaurus::getLibelle($categ->thes->id_thesaurus) . '] ';
         } else {
             $nom_thesaurus = '';
         }
         $ptab_categ = str_replace('!!categ_id!!', $categ_id, $ptab_categ);
         $ptab_categ = str_replace('!!categ_libelle!!', htmlentities($nom_thesaurus . $categ->catalog_form, ENT_QUOTES, $charset), $ptab_categ);
         $categ_repetables .= $ptab_categ;
         if (sizeof($this->analysis_categories) > 0) {
             if ($tab_categ_order != "") {
                 $tab_categ_order .= ",";
             }
             $tab_categ_order .= $i;
         }
     }
     $pdeptab[4] = str_replace('!!max_categ!!', $max_categ, $pdeptab[4]);
     $pdeptab[4] = str_replace('!!categories_repetables!!', $categ_repetables, $pdeptab[4]);
     $pdeptab[4] = str_replace('!!tab_categ_order!!', $tab_categ_order, $pdeptab[4]);
     // Concepts
     if ($thesaurus_concepts_active == 1) {
         $index_concept = new index_concept($this->analysis_id, TYPE_NOTICE);
         $pdeptab[4] = str_replace('!!concept_form!!', $index_concept->get_form('notice'), $pdeptab[4]);
     } else {
         $pdeptab[4] = str_replace('!!concept_form!!', "", $pdeptab[4]);
     }
     // indexation interne
     $pdeptab[4] = str_replace('!!indexint_id!!', $this->analysis_indexint, $pdeptab[4]);
     $pdeptab[4] = str_replace('!!indexint!!', htmlentities($this->analysis_indexint_lib, ENT_QUOTES, $charset), $pdeptab[4]);
     if ($this->indexint) {
         $indexint = new indexint($this->indexint);
         if ($indexint->comment) {
             $disp_indexint = $indexint->name . " - " . $indexint->comment;
         } else {
             $disp_indexint = $indexint->name;
         }
         if ($thesaurus_classement_mode_pmb) {
             // plusieurs classements/indexations décimales autorisés en parametrage
             if ($indexint->name_pclass) {
                 $disp_indexint = "[" . $indexint->name_pclass . "] " . $disp_indexint;
             }
         }
         $pdeptab[4] = str_replace('!!indexint!!', htmlentities($disp_indexint, ENT_QUOTES, $charset), $pdeptab[4]);
         $pdeptab[4] = str_replace('!!num_pclass!!', $indexint->id_pclass, $pdeptab[4]);
     } else {
         $pdeptab[4] = str_replace('!!indexint!!', '', $pdeptab[4]);
         $pdeptab[4] = str_replace('!!num_pclass!!', '', $pdeptab[4]);
     }
     // indexation libre
     $pdeptab[4] = str_replace('!!f_indexation!!', htmlentities($this->analysis_index_l, ENT_QUOTES, $charset), $pdeptab[4]);
     global $pmb_keyword_sep;
     $sep = "'{$pmb_keyword_sep}'";
     if (!$pmb_keyword_sep) {
         $sep = "' '";
     }
     if (ord($pmb_keyword_sep) == 0xa || ord($pmb_keyword_sep) == 0xd) {
         $sep = $msg['catalogue_saut_de_ligne'];
     }
     $pdeptab[4] = str_replace("!!sep!!", htmlentities($sep, ENT_QUOTES, $charset), $pdeptab[4]);
     $analysis_top_form = str_replace('!!tab4!!', $pdeptab[4], $analysis_top_form);
     // mise à jour de l'onglet 5 : Langues
     // langues répétables
     if (sizeof($this->analysis_langues) == 0) {
         $max_lang = 1;
     } else {
         $max_lang = sizeof($this->analysis_langues);
     }
     for ($i = 0; $i < $max_lang; $i++) {
         if ($i) {
             $ptab_lang = str_replace('!!ilang!!', $i, $pdeptab[501]);
         } else {
             $ptab_lang = str_replace('!!ilang!!', $i, $pdeptab[50]);
         }
         if (sizeof($this->analysis_langues) == 0) {
             $ptab_lang = str_replace('!!lang_code!!', '', $ptab_lang);
             $ptab_lang = str_replace('!!lang!!', '', $ptab_lang);
         } else {
             $ptab_lang = str_replace('!!lang_code!!', $this->analysis_langues[$i]["lang_code"], $ptab_lang);
             $ptab_lang = str_replace('!!lang!!', htmlentities($this->analysis_langues[$i]["langue"], ENT_QUOTES, $charset), $ptab_lang);
         }
         $lang_repetables .= $ptab_lang;
     }
     $pdeptab[5] = str_replace('!!max_lang!!', $max_lang, $pdeptab[5]);
     $pdeptab[5] = str_replace('!!langues_repetables!!', $lang_repetables, $pdeptab[5]);
     // langues originales répétables
     if (sizeof($this->analysis_languesorg) == 0) {
         $max_langorg = 1;
     } else {
         $max_langorg = sizeof($this->analysis_languesorg);
     }
     for ($i = 0; $i < $max_langorg; $i++) {
         if ($i) {
             $ptab_lang = str_replace('!!ilangorg!!', $i, $pdeptab[511]);
         } else {
             $ptab_lang = str_replace('!!ilangorg!!', $i, $pdeptab[51]);
         }
         if (sizeof($this->analysis_languesorg) == 0) {
             $ptab_lang = str_replace('!!langorg_code!!', '', $ptab_lang);
             $ptab_lang = str_replace('!!langorg!!', '', $ptab_lang);
         } else {
             $ptab_lang = str_replace('!!langorg_code!!', $this->analysis_languesorg[$i]["lang_code"], $ptab_lang);
             $ptab_lang = str_replace('!!langorg!!', htmlentities($this->analysis_languesorg[$i]["langue"], ENT_QUOTES, $charset), $ptab_lang);
         }
         $langorg_repetables .= $ptab_lang;
     }
     $pdeptab[5] = str_replace('!!max_langorg!!', $max_langorg, $pdeptab[5]);
     $pdeptab[5] = str_replace('!!languesorg_repetables!!', $langorg_repetables, $pdeptab[5]);
     $analysis_top_form = str_replace('!!tab5!!', $pdeptab[5], $analysis_top_form);
     // mise à jour de l'onglet 6
     global $pmb_curl_timeout;
     $pdeptab[6] = str_replace('!!lien!!', htmlentities($this->analysis_lien, ENT_QUOTES, $charset), $pdeptab[6]);
     $pdeptab[6] = str_replace('!!eformat!!', htmlentities($this->analysis_eformat, ENT_QUOTES, $charset), $pdeptab[6]);
     $pdeptab[6] = str_replace('!!pmb_curl_timeout!!', $pmb_curl_timeout, $pdeptab[6]);
     $analysis_top_form = str_replace('!!tab6!!', $pdeptab[6], $analysis_top_form);
     //Mise à jour de l'onglet 7
     $p_perso = new parametres_perso("notices");
     if (!$p_perso->no_special_fields) {
         // si on duplique, construire le formulaire avec les donnees de la notice d'origine
         if ($this->duplicate_from_id) {
             $perso_ = $p_perso->show_editable_fields($this->duplicate_from_id);
         } else {
             $perso_ = $p_perso->show_editable_fields($this->analysis_id);
         }
         $perso = "";
         for ($i = 0; $i < count($perso_["FIELDS"]); $i++) {
             $p = $perso_["FIELDS"][$i];
             $perso .= "<div id='move_" . $p["NAME"] . "' movable='yes' title=\"" . htmlentities($p["TITRE"], ENT_QUOTES, $charset) . "\">\n\t\t\t\t\t\t<div class='row'><label for='" . $p["NAME"] . "' class='etiquette'>" . $p["TITRE"] . "</label></div>\n\t\t\t\t\t\t<div class='row'>" . $p["AFF"] . "</div>\n\t\t\t\t\t\t</div>";
         }
         $perso .= $perso_["CHECK_SCRIPTS"];
         $pdeptab[7] = str_replace("!!champs_perso!!", $perso, $pdeptab[7]);
     } else {
         $pdeptab[7] = "\n<script>function check_form() { return true; }</script>\n";
     }
     $analysis_top_form = str_replace('!!tab7!!', $pdeptab[7], $analysis_top_form);
     //Liens vers d'autres notices
     $string_relations = "";
     $n_rel = 0;
     foreach ($this->notice_link as $direction => $relations) {
         foreach ($relations as $relation) {
             //Selection du template
             if ($n_rel == 0) {
                 $pattern_rel = $pdeptab[130];
             } else {
                 $pattern_rel = $pdeptab[131];
             }
             //Construction du textbox
             $pattern_rel = str_replace("!!notice_relations_id!!", $relation['id_notice'], $pattern_rel);
             $pattern_rel = str_replace("!!notice_relations_libelle!!", htmlentities($relation['title_notice'], ENT_QUOTES, $charset), $pattern_rel);
             $pattern_rel = str_replace("!!notice_relations_rank!!", $relation['rank'], $pattern_rel);
             $pattern_rel = str_replace("!!n_rel!!", $n_rel, $pattern_rel);
             //Construction du combobox de type de lien
             $pattern_rel = str_replace("!!f_notice_type_relations_name!!", "f_rel_type_{$n_rel}", $pattern_rel);
             //Recuperation des types de relation
             $liste_type_relation_up = new marc_list("relationtypeup");
             $liste_type_relation_down = new marc_list("relationtypedown");
             $liste_type_relation_both = array();
             $corresp_relation_up_down = array();
             foreach ($liste_type_relation_up->table as $key_up => $val_up) {
                 foreach ($liste_type_relation_down->table as $key_down => $val_down) {
                     if ($val_up == $val_down) {
                         $liste_type_relation_both['down'][$key_down] = $val_down;
                         $liste_type_relation_both['up'][$key_up] = $val_up;
                         $corresp_relation_up_down[$key_up] = $key_down;
                         unset($liste_type_relation_down->table[$key_down]);
                         unset($liste_type_relation_up->table[$key_up]);
                     }
                 }
             }
             $opts = '';
             foreach ($liste_type_relation_up->table as $key => $val) {
                 if (preg_match('/^' . $key . '/', $relation['relation_type']) && $direction == 'up') {
                     $opts .= '<option  style="color:#000000" value="' . $key . '-up" selected="selected" >' . $val . '</option>';
                 } else {
                     $opts .= '<option  style="color:#000000" value="' . $key . '-up">' . $val . '</option>';
                 }
             }
             $pattern_rel = str_replace("!!f_notice_type_relations_up!!", $opts, $pattern_rel);
             $opts = '';
             foreach ($liste_type_relation_down->table as $key => $val) {
                 if (preg_match('/^' . $key . '/', $relation['relation_type']) && $direction == 'down') {
                     $opts .= '<option  style="color:#000000" value="' . $key . '-down" selected="selected" >' . $val . '</option>';
                 } else {
                     $opts .= '<option  style="color:#000000" value="' . $key . '-down">' . $val . '</option>';
                 }
             }
             $pattern_rel = str_replace("!!f_notice_type_relations_down!!", $opts, $pattern_rel);
             $opts = '';
             if (array_key_exists($relation['relation_type'], $liste_type_relation_both['up']) || array_key_exists($relation['relation_type'], $liste_type_relation_both['down'])) {
                 $opts .= '<option  style="color:#000000" value="' . $relation['relation_type'] . '-' . $direction . '" selected="selected" >' . $liste_type_relation_both[$direction][$relation['relation_type']] . '</option>';
                 if ($direction == "up") {
                     $notDirection = "down";
                 } else {
                     $notDirection = "up";
                     $corresp_relation_up_down = array_flip($corresp_relation_up_down);
                 }
                 $notRelationType = $corresp_relation_up_down[$relation['relation_type']];
                 unset($liste_type_relation_both[$direction][$relation['relation_type']]);
                 unset($liste_type_relation_both[$notDirection][$notRelationType]);
             }
             foreach ($liste_type_relation_both['down'] as $key => $val) {
                 $opts .= '<option  style="color:#000000" value="' . $key . '-down">' . $val . '</option>';
             }
             $pattern_rel = str_replace("!!f_notice_type_relations_both!!", $opts, $pattern_rel);
             $string_relations .= $pattern_rel;
             $n_rel++;
         }
     }
     if (!$n_rel) {
         $pattern_rel = $pdeptab[130];
         $pattern_rel = str_replace("!!notice_relations_id!!", "", $pattern_rel);
         $pattern_rel = str_replace("!!notice_relations_libelle!!", "", $pattern_rel);
         $pattern_rel = str_replace("!!notice_relations_rank!!", "0", $pattern_rel);
         $pattern_rel = str_replace("!!n_rel!!", $n_rel, $pattern_rel);
         $pattern_rel = str_replace("!!f_notice_type_relations_name!!", "f_rel_type_0", $pattern_rel);
         //Recuperation des types de relation
         $liste_type_relation_up = new marc_list("relationtypeup");
         $liste_type_relation_down = new marc_list("relationtypedown");
         $liste_type_relation_both = array();
         foreach ($liste_type_relation_up->table as $key_up => $val_up) {
             foreach ($liste_type_relation_down->table as $key_down => $val_down) {
                 if ($val_up == $val_down) {
                     $liste_type_relation_both[$key_down] = $val_down;
                     unset($liste_type_relation_down->table[$key_down]);
                     unset($liste_type_relation_up->table[$key_up]);
                 }
             }
         }
         $opts = '';
         foreach ($liste_type_relation_up->table as $key => $val) {
             if ($key . '-up' == $value_deflt_relation_analysis) {
                 $opts .= '<option  style="color:#000000" value="' . $key . '-up" selected="selected" >' . $val . '</option>';
             } else {
                 $opts .= '<option  style="color:#000000" value="' . $key . '-up">' . $val . '</option>';
             }
         }
         $pattern_rel = str_replace("!!f_notice_type_relations_up!!", $opts, $pattern_rel);
         $opts = '';
         foreach ($liste_type_relation_down->table as $key => $val) {
             if ($key . '-down' == $value_deflt_relation_analysis) {
                 $opts .= '<option  style="color:#000000" value="' . $key . '-down" selected="selected" >' . $val . '</option>';
             } else {
                 $opts .= '<option  style="color:#000000" value="' . $key . '-down">' . $val . '</option>';
             }
         }
         $pattern_rel = str_replace("!!f_notice_type_relations_down!!", $opts, $pattern_rel);
         $opts = '';
         foreach ($liste_type_relation_both as $key => $val) {
             if ($key . '-down' == $value_deflt_relation_analysis) {
                 $opts .= '<option  style="color:#000000" value="' . $key . '-down" selected="selected" >' . $val . '</option>';
             } else {
                 $opts .= '<option  style="color:#000000" value="' . $key . '-down">' . $val . '</option>';
             }
         }
         $pattern_rel = str_replace("!!f_notice_type_relations_both!!", $opts, $pattern_rel);
         $string_relations .= $pattern_rel;
         $n_rel++;
     }
     //Type de relation par défaut
     $pdeptab[13] = str_replace("!!value_deflt_relation!!", $value_deflt_relation_analysis, $pdeptab[13]);
     //Nombre de relations
     $pdeptab[13] = str_replace("!!max_rel!!", $n_rel, $pdeptab[13]);
     //Liens multiples
     $pdeptab[13] = str_replace("!!notice_relations!!", $string_relations, $pdeptab[13]);
     $analysis_top_form = str_replace('!!tab13!!', $pdeptab[13], $analysis_top_form);
     // champs de gestion
     $select_statut = gen_liste_multiple("select id_notice_statut, gestion_libelle from notice_statut order by 2", "id_notice_statut", "gestion_libelle", "id_notice_statut", "form_notice_statut", "", $this->analysis_statut, "", "", "", "", 0);
     $pdeptab[8] = str_replace('!!notice_statut!!', $select_statut, $pdeptab[8]);
     $pdeptab[8] = str_replace('!!commentaire_gestion!!', htmlentities($this->analysis_commentaire_gestion, ENT_QUOTES, $charset), $pdeptab[8]);
     $pdeptab[8] = str_replace('!!thumbnail_url!!', htmlentities($this->analysis_thumbnail_url, ENT_QUOTES, $charset), $pdeptab[8]);
     if ($this->analysis_is_new) {
         $pdeptab[8] = str_replace('!!checked_yes!!', "checked", $pdeptab[8]);
         $pdeptab[8] = str_replace('!!checked_no!!', "", $pdeptab[8]);
     } else {
         $pdeptab[8] = str_replace('!!checked_no!!', "checked", $pdeptab[8]);
         $pdeptab[8] = str_replace('!!checked_yes!!', "", $pdeptab[8]);
     }
     global $pmb_notice_img_folder_id;
     $message_folder = "";
     if ($pmb_notice_img_folder_id) {
         $req = "select repertoire_path from upload_repertoire where repertoire_id ='" . $pmb_notice_img_folder_id . "'";
         $res = pmb_mysql_query($req);
         if (pmb_mysql_num_rows($res)) {
             $rep = pmb_mysql_fetch_object($res);
             if (!is_dir($rep->repertoire_path)) {
                 $notice_img_folder_error = 1;
             }
         } else {
             $notice_img_folder_error = 1;
         }
         if ($notice_img_folder_error) {
             if (SESSrights & ADMINISTRATION_AUTH) {
                 $requete = "select * from parametres where gestion=0 and type_param='pmb' and sstype_param='notice_img_folder_id' ";
                 $res = pmb_mysql_query($requete);
                 $i = 0;
                 if ($param = pmb_mysql_fetch_object($res)) {
                     $message_folder = " <a class='erreur' href='./admin.php?categ=param&action=modif&id_param=" . $param->id_param . "' >" . $msg['notice_img_folder_admin_no_access'] . "</a> ";
                 }
             } else {
                 $message_folder = $msg['notice_img_folder_no_access'];
             }
         }
     }
     $pdeptab[8] = str_replace('!!message_folder!!', $message_folder, $pdeptab[8]);
     if ($this->analysis_id && $pmb_notices_show_dates) {
         $create_date = new DateTime($this->create_date);
         $update_date = new DateTime($this->update_date);
         $dates_notices = "<br>\n\t\t\t\t\t\t<label for='notice_date_crea' class='etiquette'>" . $msg["noti_crea_date"] . "</label>&nbsp;" . $create_date->format('d/m/Y H:i:s') . "\n\t\t\t    \t\t<br>\n\t\t\t    \t\t<label for='notice_date_mod' class='etiquette'>" . $msg["noti_mod_date"] . "</label>&nbsp;" . $update_date->format('d/m/Y H:i:s');
         $pdeptab[8] = str_replace('!!dates_notice!!', $dates_notices, $pdeptab[8]);
     } else {
         $pdeptab[8] = str_replace('!!dates_notice!!', "", $pdeptab[8]);
     }
     //affichage des formulaires des droits d'acces
     $rights_form = $this->get_rights_form();
     $pdeptab[8] = str_replace('<!-- rights_form -->', $rights_form, $pdeptab[8]);
     global $lang, $xmlta_indexation_lang;
     $user_lang = $this->analysis_indexation_lang;
     if (!$user_lang) {
         $user_lang = $xmlta_indexation_lang;
     }
     $langues = new XMLlist("{$include_path}/messages/languages.xml");
     $langues->analyser();
     $clang = $langues->table;
     $combo = "<select name='indexation_lang' id='indexation_lang' class='saisie-20em' >";
     if (!$user_lang) {
         $combo .= "<option value='' selected>--</option>";
     } else {
         $combo .= "<option value='' >--</option>";
     }
     while (list($cle, $value) = each($clang)) {
         // arabe seulement si on est en utf-8
         if ($charset != 'utf-8' and $user_lang != 'ar' or $charset == 'utf-8') {
             if (strcmp($cle, $user_lang) != 0) {
                 $combo .= "<option value='{$cle}'>{$value} ({$cle})</option>";
             } else {
                 $combo .= "<option value='{$cle}' selected>{$value} ({$cle})</option>";
             }
         }
     }
     $combo .= "</select>";
     $pdeptab[8] = str_replace('!!indexation_lang!!', $combo, $pdeptab[8]);
     $analysis_top_form = str_replace('!!tab8!!', $pdeptab[8], $analysis_top_form);
     // autorité personnalisées
     $authperso = new authperso_notice($this->analysis_id);
     $authperso_tpl = $authperso->get_form();
     $analysis_top_form = str_replace('!!authperso!!', $authperso_tpl, $analysis_top_form);
     // map
     global $pmb_map_activate;
     if ($pmb_map_activate) {
         $map_edition = new map_edition_controler(TYPE_RECORD, $this->analysis_id);
         $map_form = $map_edition->get_form();
         $map_info = new map_info($this->analysis_id);
         $map_form_info = $map_info->get_form();
         $map_notice_form = $pdeptab[14];
         $map_notice_form = str_replace('!!notice_map!!', $map_form . $map_form_info, $map_notice_form);
         $analysis_top_form = str_replace('!!tab14!!', $map_notice_form, $analysis_top_form);
     } else {
         $analysis_top_form = str_replace('!!tab14!!', "", $analysis_top_form);
     }
     // définition de la page cible du form
     $analysis_top_form = str_replace('!!action!!', $this->action, $analysis_top_form);
     // mise à jour du type de document
     $analysis_top_form = str_replace('!!doc_type!!', $this->analysis_typdoc, $analysis_top_form);
     // Ajout des localisations pour édition
     $select_loc = "";
     global $PMBuserid, $pmb_form_editables;
     if ($PMBuserid == 1 && $pmb_form_editables == 1) {
         $req_loc = "select idlocation,location_libelle from docs_location";
         $res_loc = pmb_mysql_query($req_loc);
         if (pmb_mysql_num_rows($res_loc) > 1) {
             $select_loc = "<select name='grille_location' id='grille_location' style='display:none' onChange=\"get_pos();initIt(); if (inedit) move_parse_dom(relative);\">\n";
             $select_loc .= "<option value='0'>" . $msg['notice_grille_all_location'] . "</option>\n";
             while ($r = pmb_mysql_fetch_object($res_loc)) {
                 $select_loc .= "<option value='" . $r->idlocation . "'>" . $r->location_libelle . "</option>\n";
             }
             $select_loc .= "</select>\n";
         }
     }
     $analysis_top_form = str_replace("!!location!!", $select_loc, $analysis_top_form);
     // affichage du lien pour suppression
     if ($this->analysis_id) {
         $link_supp = "\n\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t<!--\n\t\t\t\t\tfunction confirmation_delete() {\n\t\t\t\t\tresult = confirm(\"{$msg['confirm_suppr']} ?\");\n\t\t\t\t\tif(result) {\n\t\t\t\t\t\tunload_off();\n\t\t\t\t\t\tdocument.location = './catalog.php?categ=serials&sub=analysis&action=delete&bul_id=!!bul_id!!&analysis_id=!!analysis_id!!';\t\t\t\t\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\t\t-->\n\t\t\t\t</script>\n\t\t\t\t<input type='button' class='bouton' value=\"{$msg[63]}\" onClick=\"confirmation_delete();\">&nbsp;";
         $form_titre = $msg[4023];
         if ($pmb_type_audit) {
             $link_audit = "<input class='bouton' type='button' onClick=\"openPopUp('./audit.php?type_obj=1&object_id={$this->analysis_id}', 'audit_popup', 700, 500, -2, -2, '{$select_categ_prop}')\" title='{$msg['audit_button']}' value='{$msg['audit_button']}' />";
         } else {
             $link_audit = "";
         }
         $link_duplicate = "<input type='button' class='bouton' value='" . $msg["analysis_duplicate_bouton"] . "' onclick='document.location=\"./catalog.php?categ=serials&sub=analysis&action=analysis_duplicate&bul_id={$this->id_bulletinage}&analysis_id={$this->analysis_id}\"' />";
         $link_move = "<input type='button' class='bouton' value='" . $msg["analysis_move_bouton"] . "' onclick='document.location=\"./catalog.php?categ=serials&sub=analysis&action=analysis_move&bul_id={$this->id_bulletinage}&analysis_id=" . $this->analysis_id . "\"' />";
     } else {
         $link_supp = "";
         $form_titre = $msg[4022];
         $link_audit = "";
         $link_duplicate = "";
         $link_move = "";
     }
     $analysis_top_form = str_replace('!!link_supp!!', $link_supp, $analysis_top_form);
     $analysis_top_form = str_replace('!!form_title!!', $form_titre, $analysis_top_form);
     // mise à jour des infos du dépouillement
     $analysis_top_form = str_replace('!!bul_id!!', $this->id_bulletinage, $analysis_top_form);
     $analysis_top_form = str_replace('!!analysis_id!!', $this->analysis_id, $analysis_top_form);
     $analysis_top_form = str_replace('!!link_audit!!', $link_audit, $analysis_top_form);
     $analysis_top_form = str_replace('!!link_duplicate!!', $link_duplicate, $analysis_top_form);
     $analysis_top_form = str_replace('!!link_move!!', $link_move, $analysis_top_form);
     $analysis_top_form = str_replace('!!notice_id_no_replace!!', $this->analysis_id, $analysis_top_form);
     if ($notice_type) {
         global $analysis_type_form;
         $date_clic = "onClick=\"openPopUp('./select.php?what=calendrier&caller=notice&date_caller=&param1=f_bull_new_date&param2=date_date_lib&auto_submit=NO&date_anterieure=YES', 'date_date', 250, 300, -2, -2, 'toolbar=no, dependent=yes, resizable=yes')\"  ";
         $date_date = "<input type='hidden' id='f_bull_new_date' name='f_bull_new_date' value='' />\n\t\t\t\t<input class='saisie-10em' type='text' name='date_date_lib' value='' />\n\t\t\t\t<input class='bouton' type='button' name='date_date_lib_bouton' value='" . $msg["bouton_calendrier"] . "' " . $date_clic . " />";
         $analysis_type_form = str_replace("!!date_date!!", $date_date, $analysis_type_form);
         $analysis_type_form = str_replace("!!perio_type_new!!", "checked", $analysis_type_form);
         $analysis_type_form = str_replace("!!bull_type_new!!", "checked", $analysis_type_form);
         $analysis_type_form = str_replace("!!perio_type_use_existing!!", "", $analysis_type_form);
         $analysis_type_form = str_replace("!!bull_type_use_existing!!", "", $analysis_type_form);
         $analysis_top_form = str_replace("!!type_catal!!", $analysis_type_form, $analysis_top_form);
         return $analysis_top_form;
     } else {
         $analysis_top_form = str_replace("!!type_catal!!", "", $analysis_top_form);
     }
     return $analysis_top_form;
 }
Exemple #24
0
 function lang_list()
 {
     global $include_path;
     global $msg;
     global $charset;
     $la = new XMLlist("{$include_path}/messages/languages.xml", 0);
     $la->analyser();
     $languages = $la->table;
     $i = 0;
     foreach ($languages as $codelang => $libelle) {
         $infos[$i]["codelang"] = $codelang;
         $infos[$i]["libelle"] = $libelle;
         $i++;
     }
     return $this->build_ok($infos);
 }
Exemple #25
0
require_once "{$class_path}/audit.class.php";
if (noeuds::isRacine($id)) {
    error_form_message($msg['categ_forb']);
    exit;
}
//recuperation du thesaurus session
if (!$id_thes) {
    $id_thes = thesaurus::getSessionThesaurusId();
}
if ($id_thes == '-1') {
    $id_thes = $thesaurus_defaut;
}
thesaurus::setSessionThesaurusId($id_thes);
$thes = new thesaurus($id_thes);
//Récuperation de la liste des langues définies pour l'interface
$langages = new XMLlist("{$include_path}/messages/languages.xml", 1);
$langages->analyser();
$lg = $langages->table;
//Récuperation de la liste des langues définies pour les thésaurus
//autre que la langue par defaut du thesaurus
$thes_liste_trad = thesaurus::getTranslationsList();
$lg1 = array();
foreach ($thes_liste_trad as $dummykey => $item) {
    if ($item != $thes->langue_defaut && $lg[$item] != '') {
        $lg1[$item] = $lg[$item];
    }
}
// dessin du form
$see_also = array();
if ($id) {
    $title = $msg[318];
 function external_services_searchcache($search_realm, $search_unique_id = '', $PMBUserId = -1, $OPACEmprId = -1, $cache_duration = false, $id_prefix = "", $newsearch = false)
 {
     global $dbh, $pmb_external_service_search_cache, $search;
     $opac_realm = false;
     $full_path = '';
     if (substr($search_realm, 0, 5) == 'opac|') {
         $search_realm = substr($search_realm, 5);
         global $base_path;
         $full_path = $base_path . "/includes/search_queries/";
         $opac_realm = true;
     }
     if ($opac_realm) {
         global $lang;
         if (file_exists("{$base_path}/includes/messages/{$lang}.xml")) {
             //Allons chercher les messages
             global $class_path;
             include_once "{$class_path}/XMLlist.class.php";
             $messages = new XMLlist("{$base_path}/includes/messages/{$lang}.xml", 0);
             $messages->analyser();
             global $msg;
             $msg = $messages->table;
         }
     }
     $this->source_ids = array();
     if (preg_match('/\\|sources\\([0-9]+(,[0-9]+)*\\)$/', $search_realm)) {
         preg_match_all('/(\\d+)(?=,|\\))/', $search_realm, $m);
         if (isset($m[1])) {
             $this->source_ids = array_values($m[1]);
         }
         $search_realm = substr($search_realm, 0, strpos($search_realm, '|'));
     }
     array_walk($this->source_ids, create_function('&$a', '$a+=0;'));
     $this->source_ids = array_unique($this->source_ids);
     if ($this->source_ids) {
         $this->external_search = true;
         //Il n'y a pas de droits sur les notices externes
         $PMBUserId = -1;
         $OPACEmprId = -1;
         //On décale tout
         global $search;
         for ($i = count($search) - 1; $i >= 0; $i--) {
             $search[$i + 1] = $search[$i];
             $this->decale("field_" . $i . "_" . $search[$i], "field_" . ($i + 1) . "_" . $search[$i]);
             $this->decale("op_" . $i . "_" . $search[$i], "op_" . ($i + 1) . "_" . $search[$i]);
             $this->decale("inter_" . $i . "_" . $search[$i], "inter_" . ($i + 1) . "_" . $search[$i]);
             $this->decale("fieldvar_" . $i . "_" . $search[$i], "fieldvar_" . ($i + 1) . "_" . $search[$i]);
         }
         $search[0] = "s_2";
         global $op_0_s_2;
         $op_0_s_2 = "EQ";
         global $field_0_s_2;
         $field_0_s_2 = $this->source_ids;
         $inter = "inter_1_" . $search[1];
         global ${$inter};
         ${$inter} = "and";
     }
     $this->search = new search(false, $search_realm, $full_path);
     if (!isset($search) || !$search) {
         $current_search_uniqueid = "";
     } else {
         $current_search_uniqueid = md5($this->search->serialize_search());
     }
     $this->search_realm = $search_realm;
     $this->PMBUserId = $PMBUserId + 0;
     $this->OPACEmprId = $OPACEmprId + 0;
     $this->id_prefix = $id_prefix;
     $found = false;
     $pmb_external_service_search_cache += 0;
     if ($cache_duration === false) {
         if ($pmb_external_service_search_cache === "") {
             $this->cache_duration = 3600;
         } else {
             $this->cache_duration = $pmb_external_service_search_cache;
         }
     } else {
         if (!$cache_duration) {
             $this->cache_duration = '0';
         } else {
             $this->cache_duration = $cache_duration;
         }
     }
     $this->cache = new external_services_cache('es_cache_blob', $this->cache_duration);
     $this->cache->delete_objectref_list_multiple_using_query(CACHE_TYPE_NOTICE, "SELECT es_searchcache_searchid FROM es_searchcache WHERE es_searchcache_date + INTERVAL 1 WEEK < NOW()", 'pmbesSearch');
     $sql2 = "DELETE FROM es_searchcache WHERE es_searchcache_date + INTERVAL " . $this->cache_duration . " SECOND < NOW()";
     pmb_mysql_query($sql2, $dbh);
     //Cherchons avec le paramètre
     if ($search_unique_id) {
         $sql = "SELECT es_searchcache.*, (es_searchcache_date + INTERVAL " . $this->cache_duration . " SECOND <= NOW()) AS outdated FROM es_searchcache WHERE es_searchcache_searchid = '" . addslashes($this->search_realm) . "_" . $search_unique_id . "'";
         $res = pmb_mysql_query($sql, $dbh);
         if (!pmb_mysql_num_rows($res)) {
             $search_unique_id = "";
         } else {
             $row = pmb_mysql_fetch_assoc($res);
             $this->serialized_search = $row["es_searchcache_serializedsearch"];
             $this->cache_date = $row["es_searchcache_date"];
             $this->outdated = $row["outdated"];
             $found = true;
             $ids = array("'" . $row["es_searchcache_searchid"] . "'");
             if ($this->OPACEmprId != -1) {
                 $ids[] = "'" . $row["es_searchcache_searchid"] . "_E" . $this->OPACEmprId . "'";
             }
             if ($this->PMBUserId != -1) {
                 $ids[] = "'" . $row["es_searchcache_searchid"] . "_" . $this->PMBUserId . "'";
             }
             $sql = "UPDATE es_searchcache SET es_searchcache_date = NOW() WHERE es_searchcache_searchid IN (" . implode(',', $ids) . ")";
             //pmb_mysql_query($sql, $dbh); Si on repousse la date il faudrai aussi le faire pour ce qui est dans la table es_cache_blob sinon cela pose problème
         }
     }
     //Pas trouvé? Cherchons avec la recherche nue sans filtrage
     if (!$newsearch && !$found && !$search_unique_id && $current_search_uniqueid && $this->PMBUserId == -1) {
         $sql = "SELECT es_searchcache.*, (es_searchcache_date + INTERVAL " . $this->cache_duration . " SECOND <= NOW()) AS outdated FROM es_searchcache WHERE es_searchcache_searchid = '" . addslashes($this->search_realm) . "_" . $id_prefix . $current_search_uniqueid . "'";
         $res = pmb_mysql_query($sql, $dbh);
         if (!pmb_mysql_num_rows($res)) {
             $search_unique_id = "";
         } else {
             $row = pmb_mysql_fetch_assoc($res);
             $this->serialized_search = $row["es_searchcache_serializedsearch"];
             $this->cache_date = $row["es_searchcache_date"];
             $this->outdated = $row["outdated"];
             $ids = array("'" . $row["es_searchcache_searchid"] . "'");
             if ($this->OPACEmprId != -1) {
                 $ids[] = "'" . $row["es_searchcache_searchid"] . "_E" . $this->OPACEmprId . "'";
             }
             if ($this->PMBUserId != -1) {
                 $ids[] = "'" . $row["es_searchcache_searchid"] . "_" . $this->PMBUserId . "'";
             }
             $sql = "UPDATE es_searchcache SET es_searchcache_date = NOW() WHERE es_searchcache_searchid es_searchcache_searchid IN (" . implode(',', $ids) . ")";
             //pmb_mysql_query($sql, $dbh); Comme la requete est mauvaise ça ne sert à rien de la faire
         }
     }
     if ($newsearch) {
         $this->search_unique_id = '';
     } else {
         if ($search_unique_id) {
             $this->search->unserialize_search($this->serialized_search);
             $this->search_unique_id = $search_unique_id;
         } else {
             $this->serialized_search = $this->search->serialize_search();
             $this->search_unique_id = $id_prefix . md5($this->serialized_search);
         }
     }
 }
function load_lang($lang)
{
    // localisation (fichier XML)
    global $include_path;
    global $msg_lang;
    //Permet de charger le fichier de lange 1 seule fois
    if (!$msg_lang[$lang]) {
        $messages = new XMLlist("{$include_path}/messages/{$lang}.xml", 0);
        $messages->analyser();
        $msg_lang[$lang] = $messages->table;
    }
    return $msg_lang[$lang];
}
 function update()
 {
     global $base_path;
     global $dbh;
     global $lang;
     global $class_path;
     global $include_path;
     global $pmb_version_database_as_it_should_be;
     global $pmb_subversion_database_as_it_shouldbe;
     //Allons chercher les messages
     include_once "{$class_path}/XMLlist.class.php";
     $messages = new XMLlist("{$include_path}/messages/{$lang}.xml", 0);
     $messages->analyser();
     $msg = $messages->table;
     //les globales PMB !
     include $include_path . "/start.inc.php";
     $result = array();
     $result['result'] = true;
     $result['informations'] = "";
     $check = $this->need_update();
     if ($check['need']) {
         ob_start();
         if ($this->get_current_version() != $pmb_version_database_as_it_should_be) {
             $action = "lancement";
             $version_pmb_bdd = $pmb_bdd_version;
             switch (substr($pmb_bdd_version, 0, 2)) {
                 case "v1":
                     include $base_path . "/admin/misc/alter_v1.inc.php";
                     break;
                 case "v2":
                     include $base_path . "/admin/misc/alter_v2.inc.php";
                     break;
                 case "v3":
                     include $base_path . "/admin/misc/alter_v3.inc.php";
                     break;
                 case "v4":
                     if (substr($pmb_version_database_as_it_should_be, 0, 2) == "v5" && ($pmb_bdd_version == "v4.97" || $pmb_bdd_version == "v4.96" || $pmb_bdd_version == "v4.95" || $pmb_bdd_version == "v4.94")) {
                         include $base_path . "/admin/misc/alter_v5.inc.php";
                     } else {
                         include $base_path . "/admin/misc/alter_v4.inc.php";
                     }
                     break;
                 case "v5":
                     include $base_path . "/admin/misc/alter_v5.inc.php";
                     break;
             }
             ob_get_contents();
             ob_end_clean();
             ob_start();
             $action = $maj_a_faire;
             switch (substr($pmb_bdd_version, 0, 2)) {
                 case "v1":
                     include $base_path . "/admin/misc/alter_v1.inc.php";
                     break;
                 case "v2":
                     include $base_path . "/admin/misc/alter_v2.inc.php";
                     break;
                 case "v3":
                     include $base_path . "/admin/misc/alter_v3.inc.php";
                     break;
                 case "v4":
                     if (substr($pmb_version_database_as_it_should_be, 0, 2) == "v5" && ($pmb_bdd_version == "v4.97" || $pmb_bdd_version == "v4.96" || $pmb_bdd_version == "v4.95" || $pmb_bdd_version == "v4.94")) {
                         include $base_path . "/admin/misc/alter_v5.inc.php";
                     } else {
                         include $base_path . "/admin/misc/alter_v4.inc.php";
                     }
                     break;
                 case "v5":
                     include $base_path . "/admin/misc/alter_v5.inc.php";
                     break;
             }
             $result['informations'] = ob_get_contents();
         } else {
             $addon = file_get_contents($base_path . "/admin/misc/addon.inc.php");
             $addon = preg_replace("#function traite_rqt\\(.*?AJOUTER ICI LES MODIFICATIONS#si", "/******************** AJOUTER ICI LES MODIFICATIONS", $addon);
             file_put_contents($base_path . "/temp/addon.inc.php", $addon);
             include $base_path . "/temp/addon.inc.php";
             unlink($base_path . "/temp/addon.inc.php");
         }
         ob_end_clean();
     } else {
         $result['informations'] = $this->msg['update_msg_database_already_updated'];
     }
     return $result;
 }
Exemple #29
0
 function get_next_notice($lender = "", $td = array(), $sd = array(), $keep_expl = false, $params = array())
 {
     global $is_expl_caddie;
     global $include_path, $lang;
     global $opac_show_book_pics;
     global $dbh, $charset;
     if (!$is_expl_caddie) {
         $requete_panier = "select count(*) from expl_cart_id";
         $res_panier = @pmb_mysql_query($requete_panier);
         if ($res_panier) {
             $is_expl_caddie = 2;
         } else {
             $is_expl_caddie = 1;
         }
     }
     unset($this->xml_array);
     $this->xml_array = array();
     $this->notice = "";
     if ($this->current_notice != -1 && array_search($this->notice_list[$this->current_notice], $this->notice_exporte) !== false) {
         $this->current_notice++;
         if ($this->current_notice >= count($this->notice_list)) {
             $this->current_notice = -1;
         }
         return true;
     }
     if ($this->current_notice != -1) {
         //Recuperation des infos de la notice
         $requete = "select * from notices where notice_id=" . $this->notice_list[$this->current_notice];
         $resultat = pmb_mysql_query($requete);
         $res = pmb_mysql_fetch_object($resultat);
         if (!$res) {
             return false;
         }
         //Remplissage des champs immediats
         //Numero unique de la base
         $this->add_field("001", "", "", $res->notice_id);
         //Champ de traitement
         if ($charset == "utf-8") {
             $encodage = "50  ";
         } else {
             $encodage = "0103";
         }
         $c100 = substr($res->create_date, 0, 4) . substr($res->create_date, 5, 2) . substr($res->create_date, 8, 2) . "u        u  u0frey" . $encodage . "    ba";
         $this->add_field("100", "  ", array("a" => $c100), "");
         //Titre
         $titre[c] = "200";
         $titre[ind] = "1 ";
         $labels = array("a", "c", "d", "e");
         $subfields = array();
         for ($i = 1; $i < 5; $i++) {
             $v = "";
             eval("\$v=\$res->tit{$i};");
             $subfields[$labels[$i - 1]] = $v;
         }
         if ($res->niveau_biblio == 'b' && $res->niveau_hierar == '2') {
             $req_bulletin = "SELECT bulletin_id, bulletin_numero, date_date, mention_date, bulletin_titre, bulletin_numero from bulletins WHERE num_notice=" . $res->notice_id;
             $result_bull = pmb_mysql_query($req_bulletin);
             while ($bull = pmb_mysql_fetch_object($result_bull)) {
                 $subfields["h"] = $bull->bulletin_numero;
                 $subfields["i"] = $bull->bulletin_titre;
                 $subfields["9"] = "id:" . $bull->bulletin_id;
             }
         }
         $this->add_field("200", "1 ", $subfields);
         //Titres Uniformes
         $rqt_tu = "select * from notices_titres_uniformes,titres_uniformes where tu_id =ntu_num_tu and ntu_num_notice = '" . $this->notice_list[$this->current_notice] . "' order by ntu_ordre";
         $result_tu = pmb_mysql_query($rqt_tu);
         if (pmb_mysql_num_rows($result_tu)) {
             while ($row_tu = pmb_mysql_fetch_object($result_tu)) {
                 $subfields = array();
                 $subfields["9"] = "id:" . $row_tu->tu_id;
                 $subfields["a"] = $row_tu->tu_name;
                 $subfields["u"] = $row_tu->tu_tonalite;
                 $subfields["n"] = $row_tu->tu_comment;
                 $subfields["i"] = $row_tu->ntu_titr;
                 $subfields["k"] = $row_tu->ntu_date;
                 $subfields["l"] = $row_tu->ntu_sous_vedette;
                 $subfields["m"] = $row_tu->ntu_langue;
                 $subfields["q"] = $row_tu->ntu_version;
                 $subfields["w"] = $row_tu->ntu_mention;
                 $rqt_tucomp = "SELECT * FROM tu_distrib WHERE distrib_num_tu='" . $row_tu->tu_id . "' ORDER BY distrib_ordre,distrib_name";
                 $result_tucomp = pmb_mysql_query($rqt_tucomp);
                 if (pmb_mysql_num_rows($result_tucomp)) {
                     while ($row_tucomp = pmb_mysql_fetch_object($result_tucomp)) {
                         $subfields["r"][] = $row_tucomp->distrib_name;
                     }
                 }
                 $rqt_tucomp = "SELECT * FROM tu_ref WHERE ref_num_tu='" . $row_tu->tu_id . "' ORDER BY ref_ordre,ref_name";
                 $result_tucomp = pmb_mysql_query($rqt_tucomp);
                 if (pmb_mysql_num_rows($result_tucomp)) {
                     while ($row_tucomp = pmb_mysql_fetch_object($result_tucomp)) {
                         $subfields["s"][] = $row_tucomp->ref_name;
                     }
                 }
                 $rqt_tucomp = "SELECT * FROM tu_subdiv WHERE subdiv_num_tu='" . $row_tu->tu_id . "' ORDER BY subdiv_ordre,subdiv_name";
                 $result_tucomp = pmb_mysql_query($rqt_tucomp);
                 if (pmb_mysql_num_rows($result_tucomp)) {
                     while ($row_tucomp = pmb_mysql_fetch_object($result_tucomp)) {
                         $subfields["j"][] = $row_tucomp->subdiv_name;
                     }
                 }
                 $this->add_field("500", "10", $subfields);
             }
         }
         //Titre du pério pour les notices de bulletin
         $subfields = array();
         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)) {
                 $subfields["a"] = $bull->titre;
             }
         }
         $this->add_field("530", "  ", $subfields);
         //Date en 210 pour les notices de bulletin
         $subfields = array();
         if ($res->niveau_biblio == 'b' && $res->niveau_hierar == '2') {
             $req_bulletin = "SELECT bulletin_id, bulletin_numero, date_date, mention_date, bulletin_titre, bulletin_numero from bulletins WHERE num_notice=" . $res->notice_id;
             $result_bull = pmb_mysql_query($req_bulletin);
             while ($bull = pmb_mysql_fetch_object($result_bull)) {
                 $subfields["h"] = $bull->date_date;
                 $subfields["d"] = $bull->mention_date;
             }
         }
         $this->add_field("210", "  ", $subfields);
         //isbn
         $subfields = array();
         $subfields["a"] = $res->code;
         $subfields["d"] = $res->prix;
         $this->add_field("010", "  ", $subfields);
         // URL
         $subfields = array();
         $subfields["u"] = $res->lien;
         $subfields["q"] = $res->eformat;
         $this->add_field("856", "  ", $subfields);
         //Langage
         $rqttmp_lang = "select type_langue,code_langue from notices_langues where num_notice='{$res->notice_id}' order by ordre_langue ";
         $restmp_lang = pmb_mysql_query($rqttmp_lang);
         $ind = "0 ";
         $subfields_101 = array();
         while ($tmp_lang = pmb_mysql_fetch_object($restmp_lang)) {
             if ($tmp_lang->type_langue) {
                 $ind = "1 ";
                 $subfields_101['c'][] = $tmp_lang->code_langue;
             } else {
                 $subfields_101['a'][] = $tmp_lang->code_langue;
             }
         }
         $this->add_field('101', $ind, $subfields_101);
         //Mention d'edition
         $subfields = array();
         $subfields["a"] = $res->mention_edition;
         $this->add_field("205", "  ", $subfields);
         //Collation
         $subfields = array();
         $subfields["a"] = $res->npages;
         $subfields["c"] = $res->ill;
         $subfields["d"] = $res->size;
         $subfields["e"] = $res->accomp;
         $this->add_field("215", "  ", $subfields);
         //Notes
         $subfields = array();
         $subfields["a"] = $res->n_gen;
         $this->add_field("300", "  ", $subfields);
         $subfields["a"] = $res->n_contenu;
         $this->add_field("327", "  ", $subfields);
         $subfields["a"] = $res->n_resume;
         $this->add_field("330", "  ", $subfields);
         //Auteurs
         //Recherche des auteurs;
         $requete = "select author_id, author_type, author_name, author_rejete, author_date, responsability_fonction, responsability_type \n\t\t\t,author_subdivision, author_lieu,author_ville, author_pays,author_numero,author_web, author_comment\n\t\t\tfrom authors, responsability where responsability_notice=" . $res->notice_id . " and responsability_author=author_id order by responsability_ordre asc";
         $resultat = pmb_mysql_query($requete) or die(pmb_mysql_error() . "<br />" . $requete);
         while ($auth = pmb_mysql_fetch_object($resultat)) {
             //Si c'est un 70 (individuel) alors on l'exporte
             $subfields = array();
             $attrs = array();
             if ($params["include_authorite_ids"]) {
                 $attrs["id"] = $auth->author_id;
             }
             if ($auth->author_type == "70") {
                 // Personne physique
                 //Champ = author_type + responsability_type (70 + 0 pour auteur principal = 700 !)
                 $auth_code = $auth->author_type . $auth->responsability_type;
                 $subfields["a"] = $auth->author_name;
                 $subfields["b"] = $auth->author_rejete;
                 $subfields["c"] = $auth->author_comment;
                 //Fonction
                 $subfields["4"] = $auth->responsability_fonction;
                 //Dates
                 if ($auth->author_date != "") {
                     $subfields["f"] = $auth->author_date;
                 }
                 $subfields["N"] = $auth->author_web;
                 $subfields["9"] = "id:" . $auth->author_id;
                 $this->add_field($auth_code, " 1", $subfields, "", $attrs);
             } elseif ($auth->author_type == "71" || $auth->author_type == "72") {
                 //Collectivité
                 $auth_code = $auth->author_type . $auth->responsability_type;
                 $subfields["a"] = $auth->author_name;
                 $subfields["b"] = $auth->author_subdivision;
                 $subfields["c"] = $auth->author_comment;
                 $subfields["g"] = $auth->author_rejete;
                 $subfields["d"] = $auth->author_numero;
                 //Fonction
                 $subfields["4"] = $auth->responsability_fonction;
                 //Dates
                 if ($auth->author_date != "") {
                     $subfields["f"] = $auth->author_date;
                 }
                 $lieu = $auth->author_lieu;
                 if ($auth->author_ville) {
                     if ($lieu) {
                         $lieu .= "; ";
                     }
                     $lieu .= $auth->author_ville;
                 }
                 if ($auth->author_pays) {
                     if ($lieu) {
                         $lieu .= "; ";
                     }
                     $lieu .= $auth->author_pays;
                 }
                 $subfields["e"] = $lieu;
                 $subfields["K"] = $auth->author_lieu;
                 $subfields["L"] = $auth->author_ville;
                 $subfields["M"] = $auth->author_pays;
                 $subfields["N"] = $auth->author_web;
                 $subfields["9"] = "id:" . $auth->author_id;
                 if ($auth->author_type == "71") {
                     $auth_code = $auth->author_type . $auth->responsability_type;
                     $this->add_field($auth_code, "02", $subfields, "", $attrs);
                 } elseif ($auth->author_type == "72") {
                     $auth_code = "71" . $auth->responsability_type;
                     $this->add_field($auth_code, "12", $subfields, "", $attrs);
                 }
             }
         }
         //Editeurs et date de la notice
         $c102_export = false;
         //Le champ 102 n'est pas répétable
         $requete = "select * from publishers where ed_id =" . $res->ed1_id;
         $resultat = pmb_mysql_query($requete);
         $subfields = array();
         $attrs = array();
         if ($params["include_authorite_ids"]) {
             $attrs["id"] = $res->ed1_id;
         }
         if ($ed1 = pmb_mysql_fetch_object($resultat)) {
             $subfields["a"] = $ed1->ed_ville;
             $subfields["b"] = trim($ed1->ed_adr1 . "\n" . $ed1->ed_adr2 . "\n" . $ed1->ed_cp . "\n" . $ed1->ed_ville . "\n" . $ed1->ed_pays);
             $subfields["c"] = $ed1->ed_name;
             $subfields["d"] = $res->year;
             $subfields["z"] = $ed1->ed_pays;
             if (trim($ed1->ed_pays)) {
                 $parser = new XMLlist("{$include_path}/marc_tables/{$lang}/country.xml");
                 $parser->analyser();
                 if ($tmp = array_search(trim($ed1->ed_pays), $parser->table)) {
                     $subfields_102 = array();
                     $subfields_102["a"] = mb_strtolower($tmp);
                     $this->add_field("102", "  ", $subfields_102);
                     $c102_export = true;
                 }
             }
             $subfields["9"][] = "id:" . $ed1->ed_id;
             if (trim($ed1->ed_web)) {
                 $subfields["9"][] = "web:" . $ed1->ed_web;
             }
             if (trim($ed1->ed_comment)) {
                 $subfields["9"][] = "comment:" . $ed1->ed_comment;
             }
             if (trim($ed1->ed_cp)) {
                 $subfields["9"][] = "cp:" . $ed1->ed_cp;
             }
             if (trim($ed1->ed_adr1)) {
                 $subfields["9"][] = "adr1:" . $ed1->ed_adr1;
             }
             if (trim($ed1->ed_adr2)) {
                 $subfields["9"][] = "adr2:" . $ed1->ed_adr2;
             }
         } elseif ($res->year && $res->niveau_biblio != 'b') {
             $subfields["d"] = $res->year;
         }
         $this->add_field("210", "  ", $subfields, "", $attrs);
         $requete = "select * from publishers where ed_id =" . $res->ed2_id;
         $resultat = pmb_mysql_query($requete);
         $subfields = array();
         $attrs = array();
         if ($params["include_authorite_ids"]) {
             $attrs["id"] = $res->ed2_id;
         }
         if ($ed1 = pmb_mysql_fetch_object($resultat)) {
             $subfields["a"] = $ed1->ed_ville;
             $subfields["b"] = trim($ed1->ed_adr1 . "\n" . $ed1->ed_adr2 . "\n" . $ed1->ed_cp . "\n" . $ed1->ed_ville . "\n" . $ed1->ed_pays);
             $subfields["c"] = $ed1->ed_name;
             $subfields["d"] = $res->year;
             $subfields["z"] = $ed1->ed_pays;
             if (trim($ed1->ed_pays) && !$c102_export) {
                 $parser = new XMLlist("{$include_path}/marc_tables/{$lang}/country.xml");
                 $parser->analyser();
                 if ($tmp = array_search(trim($ed1->ed_pays), $parser->table)) {
                     $subfields_102 = array();
                     $subfields_102["a"] = mb_strtolower($tmp);
                     $this->add_field("102", "  ", $subfields_102);
                 }
             }
             $subfields["9"][] = "id:" . $ed1->ed_id;
             if (trim($ed1->ed_web)) {
                 $subfields["9"][] = "web:" . $ed1->ed_web;
             }
             if (trim($ed1->ed_comment)) {
                 $subfields["9"][] = "comment:" . $ed1->ed_comment;
             }
             if (trim($ed1->ed_cp)) {
                 $subfields["9"][] = "cp:" . $ed1->ed_cp;
             }
             if (trim($ed1->ed_adr1)) {
                 $subfields["9"][] = "adr1:" . $ed1->ed_adr1;
             }
             if (trim($ed1->ed_adr2)) {
                 $subfields["9"][] = "adr2:" . $ed1->ed_adr2;
             }
         }
         $this->add_field("210", "  ", $subfields, "", $attrs);
         //Collections
         $requete = "select * from collections where collection_id=" . $res->coll_id;
         $resultat = pmb_mysql_query($requete);
         $subfields = array();
         $subfields_410 = array();
         $subfields_411 = array();
         $subfields_s = array();
         $attrs = array();
         if ($params["include_authorite_ids"]) {
             $attrs["id"] = $res->coll_id;
         }
         if ($col = pmb_mysql_fetch_object($resultat)) {
             $subfields["a"] = $col->collection_name;
             $subfields_410["t"] = $col->collection_name;
             $subfields["v"] = $res->nocoll;
             $subfields_410["v"] = $res->nocoll;
             $subfields["x"] = $col->collection_issn;
             $subfields_410["x"] = $col->collection_issn;
             $subfields["9"] = "id:" . $res->coll_id;
             $subfields_410["9"] = "id:" . $res->coll_id;
         }
         //Recherche des sous collections
         $requete = "select * from sub_collections where sub_coll_id=" . $res->subcoll_id;
         $resultat = pmb_mysql_query($requete);
         if ($subcol = pmb_mysql_fetch_object($resultat)) {
             $subfields_s["i"] = $subcol->sub_coll_name;
             $subfields_411["t"] = $subcol->sub_coll_name;
             $subfields_s["x"] = $subcol->sub_coll_issn;
             $subfields_411["x"] = $subcol->sub_coll_issn;
             $subfields_s["9"] = "id:" . $res->subcoll_id;
             $subfields_411["9"] = "id:" . $res->subcoll_id;
         }
         $attrs2 = array();
         if ($params["include_authorite_ids"]) {
             $attrs2["id"] = $res->subcoll_id;
         }
         $this->add_field("225", "2 ", $subfields, "", $attrs);
         $this->add_field("410", " 0", $subfields_410, "", $attrs);
         $this->add_field("225", "2 ", $subfields_s, "", $attrs2);
         $this->add_field("411", " 0", $subfields_411, "", $attrs2);
         $requete = "select * from series where serie_id=" . $res->tparent_id;
         $resultat = pmb_mysql_query($requete);
         $subfields = array();
         $attrs = array();
         if ($serie = pmb_mysql_fetch_object($resultat)) {
             $subfields["t"] = $serie->serie_name;
             $subfields["v"] = $res->tnvol;
             if ($params["include_authorite_ids"]) {
                 $attrs["id"] = $serie->serie_id;
             }
         }
         $this->add_field("461", " 0", $subfields, '', $attrs);
         //dewey
         $subfields = array();
         //Recher 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)) {
             $subfields["a"] = $code_dewey->indexint_name;
             $subfields["l"] = $code_dewey->indexint_comment;
             $subfields["9"] = "id:" . $code_dewey->indexint_id;
             $this->add_field("676", "  ", $subfields);
         }
         //Vignette
         if ($opac_show_book_pics) {
             $vignette = get_vignette($this->notice_list[$this->current_notice]);
             if ($vignette) {
                 $this->add_field("896", "  ", array("a" => $vignette));
             }
         }
         if ($keep_expl) {
             if ($res->niveau_biblio == 'b' && $res->niveau_hierar == '2') {
                 //Si c'est une notice de bulletin
                 $requete = "SELECT bulletin_id FROM bulletins WHERE num_notice='" . $res->notice_id . "'";
                 $res_bull = pmb_mysql_query($requete);
                 if (pmb_mysql_num_rows($res_bull)) {
                     $id_bull = pmb_mysql_result($res_bull, 0, 0);
                     if (array_search($id_bull, $this->bulletins_exporte) === false && array_search($id_bull, $this->expl_bulletin_a_exporter) === false) {
                         //Si on exporte les exemplaires on garde l'ID du bulletin pour exporter ses exemplaires
                         $this->expl_bulletin_a_exporter[] = $id_bull;
                     }
                 }
             } else {
                 //Si non
                 //Traitement des exemplaires
                 $this->processing_expl($lender, $td, $sd, $params, $res->notice_id, 0);
             }
         }
         //Mots cles
         $subfields = array();
         $subfields["a"] = $res->index_l;
         $this->add_field("610", "0 ", $subfields);
         //Descripteurs
         $requete = "SELECT libelle_categorie,categories.num_noeud,categories.langue,categories.num_thesaurus 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);
         if (pmb_mysql_num_rows($resultat)) {
             for ($i = 0; $i < pmb_mysql_num_rows($resultat); $i++) {
                 $subfields = array();
                 $subfields["9"][] = "id:" . pmb_mysql_result($resultat, $i, 1);
                 $subfields["9"][] = "lang:" . pmb_mysql_result($resultat, $i, 2);
                 $subfields["9"][] = "idthes:" . pmb_mysql_result($resultat, $i, 3);
                 $subfields["a"] = pmb_mysql_result($resultat, $i, 0);
                 $this->add_field("606", " 1", $subfields);
             }
         }
         //Champs perso de notice traite par la table notice_custom
         $this->processing_cp("notices", $res->notice_id);
         //Notices liées, relations entre notices
         if ($params["genere_lien"]) {
             //On choisit d'exporter les notices mères
             if ($params["mere"]) {
                 $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);
                 while ($notice_fille = pmb_mysql_fetch_object($resultat)) {
                     $requete_mere = "SELECT * FROM notices WHERE notice_id=" . $notice_fille->linked_notice;
                     $resultat_mere = pmb_mysql_query($requete_mere);
                     while ($notice_mere = pmb_mysql_fetch_object($resultat_mere)) {
                         $subfields = array();
                         $list_titre = array();
                         $list_auteurs = array();
                         $list_options = array();
                         //On recopie les informations de la notice fille
                         if ($params["notice_mere"]) {
                             $subfields["0"] = $notice_mere->notice_id;
                         }
                         $list_titre[] = $notice_mere->tit1 ? $notice_mere->tit1 : " ";
                         //auteur
                         $rqt_aut = "select author_name, author_rejete from responsability join authors on author_id = responsability_author and responsability_notice=" . $notice_mere->notice_id . " where responsability_type != 2 order by responsability_type,responsability_ordre";
                         $res_aut = pmb_mysql_query($rqt_aut);
                         $mere_aut = array();
                         while ($mere_aut = pmb_mysql_fetch_object($res_aut)) {
                             $list_auteurs[] = $mere_aut->author_name . ($mere_aut->author_rejete ? ", " . $mere_aut->author_rejete : "");
                         }
                         $list_options[] = "bl:" . $notice_mere->niveau_biblio . $notice_mere->niveau_hierar;
                         $list_options[] = "id:" . $notice_mere->notice_id;
                         if ($notice_fille->rank) {
                             $list_options[] = "rank:" . $notice_fille->rank;
                         }
                         if ($notice_fille->relation_type) {
                             $list_options[] = "type_lnk:" . $notice_fille->relation_type;
                         }
                         $list_options[] = 'lnk:parent';
                         $subfields["9"] = $list_options;
                         //Relation avec mono = ISBN
                         if ($notice_mere->niveau_biblio == 'm' && $notice_mere->niveau_hierar == '0') {
                             if ($notice_mere->code) {
                                 $subfields["y"] = $notice_mere->code;
                             }
                             $subfields["t"] = $list_titre;
                             $subfields["a"] = $list_auteurs;
                         }
                         //Relation avec pério = ISSN
                         if ($notice_mere->niveau_biblio == 's' && $notice_mere->niveau_hierar == '1') {
                             if ($notice_mere->code) {
                                 $subfields["x"] = $notice_mere->code;
                             }
                             $subfields["t"] = $list_titre;
                         }
                         //Relation avec articles
                         if ($notice_mere->niveau_biblio == 'a' && $notice_mere->niveau_hierar == '2') {
                             $req_art = "SELECT bulletin_id, bulletin_numero, date_date, mention_date, bulletin_titre, bulletin_numero, tit1, code from analysis join bulletins on bulletin_id=analysis_bulletin join notices on bulletin_notice=notice_id where analysis_notice=" . $notice_mere->notice_id;
                             $result_art = pmb_mysql_query($req_art);
                             while ($notice_art = pmb_mysql_fetch_object($result_art)) {
                                 $subfields["d"] = $notice_art->date_date;
                                 $subfields["e"] = $notice_art->mention_date;
                                 $subfields["v"] = $notice_art->bulletin_numero;
                                 if ($notice_art->code) {
                                     $subfields["x"] = $notice_art->code;
                                 }
                                 $list_titre[] = $notice_art->bulletin_titre ? $notice_art->bulletin_titre : " ";
                                 $list_titre[] = $notice_art->tit1 ? $notice_art->tit1 : " ";
                                 $subfields["t"] = $list_titre;
                                 if ($keep_expl && array_search($notice_art->bulletin_id, $this->bulletins_exporte) === false && array_search($notice_art->bulletin_id, $this->expl_bulletin_a_exporter) === false) {
                                     //Si on exporte les exemplaires on garde l'ID du bulletin pour exporter ses exemplaires
                                     $this->expl_bulletin_a_exporter[] = $notice_art->bulletin_id;
                                 }
                             }
                         }
                         //Relation avec bulletins
                         if ($notice_mere->niveau_biblio == 'b' && $notice_mere->niveau_hierar == '2') {
                             $req_bull = "SELECT bulletin_id, bulletin_numero, date_date, mention_date, bulletin_titre, bulletin_numero, tit1, code from bulletins join notices on bulletin_notice=notice_id  WHERE num_notice=" . $notice_mere->notice_id;
                             $result_bull = pmb_mysql_query($req_bull);
                             while ($notice_bull = pmb_mysql_fetch_object($result_bull)) {
                                 $subfields["d"] = $notice_bull->date_date;
                                 $subfields["e"] = $notice_bull->mention_date;
                                 $subfields["v"] = $notice_bull->bulletin_numero;
                                 if ($notice_bull->code) {
                                     $subfields["x"] = $notice_bull->code;
                                 }
                                 $list_titre[] = $notice_bull->bulletin_titre ? $notice_bull->bulletin_titre : " ";
                                 $list_titre[] = $notice_bull->tit1 ? $notice_bull->tit1 : " ";
                                 $subfields["t"] = $list_titre;
                                 if ($keep_expl && array_search($notice_bull->bulletin_id, $this->bulletins_exporte) === false && array_search($notice_bull->bulletin_id, $this->expl_bulletin_a_exporter) === false) {
                                     //Si on exporte les exemplaires on garde l'ID du bulletin pour exporter ses exemplaires
                                     $this->expl_bulletin_a_exporter[] = $notice_bull->bulletin_id;
                                 }
                             }
                         }
                         $list_attribut = new XMLlist("{$include_path}/marc_tables/{$lang}/relationtypeup_unimarc.xml");
                         $list_attribut->analyser();
                         $table_attribut = $list_attribut->table;
                         //On teste si la relation est spéciale, de type contient dans une boite
                         if ($notice_fille->relation_type == 'd') {
                             $indicateur = "d0";
                         } else {
                             $indicateur = "  ";
                         }
                         $this->add_field($table_attribut[$notice_fille->relation_type], $indicateur, $subfields);
                         //On exporte les notices mères liées
                         if ($params["notice_mere"] && array_search($notice_mere->notice_id, $this->notice_exporte) === false) {
                             $this->notice_list[] = $notice_mere->notice_id;
                         }
                     }
                 }
             }
             //On choisit d'exporter les notices filles
             if ($params["fille"]) {
                 $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);
                 while ($notice_mere = pmb_mysql_fetch_object($resultat)) {
                     $requete_fille = "SELECT * FROM notices WHERE notice_id=" . $notice_mere->num_notice;
                     $resultat_fille = pmb_mysql_query($requete_fille);
                     while ($notice_fille = pmb_mysql_fetch_object($resultat_fille)) {
                         $subfields = array();
                         $list_titre = array();
                         $list_options = array();
                         //On recopie les informations de la notice fille
                         if ($params["notice_fille"]) {
                             $subfields["0"] = $notice_fille->notice_id;
                         }
                         $list_titre[] = $notice_fille->tit1 ? $notice_fille->tit1 : " ";
                         $list_options[] = "bl:" . $notice_fille->niveau_biblio . $notice_fille->niveau_hierar;
                         $list_options[] = "id:" . $notice_fille->notice_id;
                         if ($notice_mere->rank) {
                             $list_options[] = "rank:" . $notice_mere->rank;
                         }
                         if ($notice_mere->relation_type) {
                             $list_options[] = "type_lnk:" . $notice_mere->relation_type;
                         }
                         $list_options[] = 'lnk:child';
                         $subfields["9"] = $list_options;
                         //Relation avec mono = ISBN
                         if ($notice_fille->niveau_biblio == 'm' && $notice_fille->niveau_hierar == '0') {
                             if ($notice_fille->code) {
                                 $subfields["y"] = $notice_fille->code;
                             }
                             $subfields["t"] = $list_titre;
                         }
                         //Relation avec pério = ISSN
                         if ($notice_fille->niveau_biblio == 's' && $notice_fille->niveau_hierar == '1') {
                             if ($notice_fille->code) {
                                 $subfields["x"] = $notice_fille->code;
                             }
                             $subfields["t"] = $list_titre;
                         }
                         //Relation avec articles
                         if ($notice_fille->niveau_biblio == 'a' && $notice_fille->niveau_hierar == '2') {
                             $req_art = "SELECT bulletin_id, bulletin_numero, date_date, mention_date, bulletin_titre, bulletin_numero, tit1, code from analysis join bulletins on bulletin_id=analysis_bulletin join notices on bulletin_notice=notice_id where analysis_notice=" . $notice_fille->notice_id;
                             $result_art = pmb_mysql_query($req_art);
                             while ($notice_art = pmb_mysql_fetch_object($result_art)) {
                                 $subfields["d"] = $notice_art->date_date;
                                 $subfields["e"] = $notice_art->mention_date;
                                 $subfields["v"] = $notice_art->bulletin_numero;
                                 if ($notice_art->code) {
                                     $subfields["x"] = $notice_art->code;
                                 }
                                 $list_titre[] = $notice_art->bulletin_titre ? $notice_art->bulletin_titre : " ";
                                 $list_titre[] = $notice_art->tit1 ? $notice_art->tit1 : " ";
                                 $subfields["t"] = $list_titre;
                                 if ($keep_expl && array_search($notice_art->bulletin_id, $this->bulletins_exporte) === false && array_search($notice_art->bulletin_id, $this->expl_bulletin_a_exporter) === false) {
                                     //Si on exporte les exemplaires on garde l'ID du bulletin pour exporter ses exemplaires
                                     $this->expl_bulletin_a_exporter[] = $notice_art->bulletin_id;
                                 }
                             }
                         }
                         //Relation avec bulletins
                         if ($notice_fille->niveau_biblio == 'b' && $notice_fille->niveau_hierar == '2') {
                             $req_bull = "SELECT bulletin_id, bulletin_numero, date_date, mention_date, bulletin_titre, bulletin_numero, tit1, code from bulletins join notices on bulletin_notice=notice_id  WHERE num_notice=" . $notice_fille->notice_id;
                             $result_bull = pmb_mysql_query($req_bull);
                             while ($notice_bull = pmb_mysql_fetch_object($result_bull)) {
                                 $subfields["d"] = $notice_bull->date_date;
                                 $subfields["e"] = $notice_bull->mention_date;
                                 $subfields["v"] = $notice_bull->bulletin_numero;
                                 if ($notice_bull->code) {
                                     $subfields["x"] = $notice_bull->code;
                                 }
                                 $list_titre[] = $notice_bull->bulletin_titre ? $notice_bull->bulletin_titre : " ";
                                 $list_titre[] = $notice_bull->tit1 ? $notice_bull->tit1 : " ";
                                 $subfields["t"] = $list_titre;
                                 if ($keep_expl && array_search($notice_bull->bulletin_id, $this->bulletins_exporte) === false && array_search($notice_bull->bulletin_id, $this->expl_bulletin_a_exporter) === false) {
                                     //Si on exporte les exemplaires on garde l'ID du bulletin pour exporter ses exemplaires
                                     $this->expl_bulletin_a_exporter[] = $notice_bull->bulletin_id;
                                 }
                             }
                         }
                         $list_attribut = new XMLlist("{$include_path}/marc_tables/{$lang}/relationtypedown_unimarc.xml");
                         $list_attribut->analyser();
                         $table_attribut = $list_attribut->table;
                         //On teste si la relation est spéciale, de type contient dans une boite
                         if ($notice_fille->relation_type == 'd') {
                             $indicateur = "d0";
                         } else {
                             $indicateur = "  ";
                         }
                         $this->add_field($table_attribut[$notice_mere->relation_type], $indicateur, $subfields);
                         //On exporte les notices filles liées
                         if ($params["notice_fille"] && array_search($notice_fille->notice_id, $this->notice_exporte) === false) {
                             $this->notice_list[] = $notice_fille->notice_id;
                         }
                     }
                 }
             }
             //On choisit d'exporter les liens vers les périodiques pour les notices d'article
             if ($params["perio_link"]) {
                 $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)) {
                     $subfields_461 = array();
                     $list_options = array();
                     if ($params["notice_perio"]) {
                         $subfields_461["0"] = $notice_perio_link->notice_id;
                     }
                     $subfields_461["t"] = $notice_perio_link->tit1 ? $notice_perio_link->tit1 : " ";
                     if ($notice_perio_link->code) {
                         $subfields_461["x"] = $notice_perio_link->code;
                     }
                     $attrs = array("id" => $notice_perio_link->notice_id);
                     $list_options[] = "id:" . $notice_perio_link->notice_id;
                     $list_options[] = 'lnk:perio';
                     $subfields_461["9"] = $list_options;
                     $this->add_field("461", "  ", $subfields_461, '', $attrs);
                     //On exporte les notices de pério liées
                     if ($params["notice_perio"] && array_search($notice_perio_link->notice_id, $this->notice_exporte) === false) {
                         $this->notice_list[] = $notice_perio_link->notice_id;
                     }
                 }
             }
             //On génère le bulletinage pour les notices de pério
             if ($params["bulletinage"]) {
                 $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)) {
                     $subfields_462 = array();
                     $list_options = array();
                     $attrs = array("id" => $notice_bulletinage->bulletin_id);
                     $subfields_462["d"] = $notice_bulletinage->date_date;
                     $subfields_462["e"] = $notice_bulletinage->mention_date;
                     $subfields_462["v"] = $notice_bulletinage->bulletin_numero;
                     $subfields_462["t"] = $notice_bulletinage->bulletin_titre ? $notice_bulletinage->bulletin_titre : " ";
                     $list_options[] = "id:" . $notice_bulletinage->bulletin_id;
                     $list_options[] = 'lnk:bull';
                     $subfields_462["9"] = $list_options;
                     $this->add_field("462", "  ", $subfields_462, '', $attrs);
                     if ($keep_expl && array_search($notice_bulletinage->bulletin_id, $this->bulletins_exporte) === false && array_search($notice_bulletinage->bulletin_id, $this->expl_bulletin_a_exporter) === false) {
                         //Si on exporte les exemplaires on garde l'ID du bulletin pour exporter ses exemplaires
                         $this->expl_bulletin_a_exporter[] = $notice_bulletinage->bulletin_id;
                     }
                 }
             }
             //On choisit d'exporter les liens vers les bulletins pour les notices d'article
             if ($params["bull_link"]) {
                 $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)) {
                     $subfields_463 = array();
                     $list_options = array();
                     $attrs = array("id" => $notice_bull_link->bulletin_id);
                     $subfields_463["d"] = $notice_bull_link->date_date;
                     $subfields_463["e"] = $notice_bull_link->mention_date;
                     $subfields_463["v"] = $notice_bull_link->bulletin_numero;
                     $subfields_463["t"] = $notice_bull_link->bulletin_titre ? $notice_bull_link->bulletin_titre : " ";
                     $list_options[] = "id:" . $notice_bull_link->bulletin_id;
                     $list_options[] = 'lnk:bull';
                     $subfields_463["9"] = $list_options;
                     $this->add_field("463", "  ", $subfields_463, '', $attrs);
                     if ($keep_expl && array_search($notice_bull_link->bulletin_id, $this->bulletins_exporte) === false && array_search($notice_bull_link->bulletin_id, $this->expl_bulletin_a_exporter) === false) {
                         //Si on exporte les exemplaires on garde l'ID du bulletin pour exporter ses exemplaires
                         $this->expl_bulletin_a_exporter[] = $notice_bull_link->bulletin_id;
                     }
                 }
             }
             //On choisit d'exporter les liens vers les articles pour les notices de pério
             if ($params["art_link"]) {
                 $req_art_link = "SELECT bulletin_id, bulletin_numero, date_date, mention_date, bulletin_titre, analysis_notice, a.tit1 as titre, a.npages as page from notices p left join bulletins on bulletin_notice=p.notice_id left join analysis on analysis_bulletin=bulletin_id join notices a on a.notice_id=analysis_notice WHERE p.notice_id=" . $res->notice_id;
                 $result_art_link = pmb_mysql_query($req_art_link);
                 while ($notice_art_link = pmb_mysql_fetch_object($result_art_link)) {
                     $subfields_464 = array();
                     $tab_titre = array();
                     $list_options = array();
                     $attrs = array("id" => $notice_art_link->analysis_notice);
                     $tab_titre[] = $notice_art_link->titre ? $notice_art_link->titre : " ";
                     $tab_titre[] = $notice_art_link->bulletin_titre ? $notice_art_link->bulletin_titre : " ";
                     if ($params["notice_art"]) {
                         $subfields_464["0"] = $notice_art_link->analysis_notice;
                     }
                     $subfields_464["t"] = $tab_titre;
                     $subfields_464["d"] = $notice_art_link->date_date;
                     $subfields_464["e"] = $notice_art_link->mention_date;
                     $subfields_464["v"] = $notice_art_link->bulletin_numero;
                     $list_options[] = "id:" . $notice_art_link->analysis_notice;
                     $list_options[] = "page:" . $notice_art_link->page;
                     $list_options[] = 'lnk:art';
                     $subfields_464["9"] = $list_options;
                     $this->add_field("464", "  ", $subfields_464, '', $attrs);
                     if ($keep_expl && array_search($notice_art_link->bulletin_id, $this->bulletins_exporte) === false && array_search($notice_art_link->bulletin_id, $this->expl_bulletin_a_exporter) === false) {
                         //Si on exporte les exemplaires on garde l'ID du bulletin pour exporter ses exemplaires
                         $this->expl_bulletin_a_exporter[] = $notice_art_link->bulletin_id;
                     }
                     //On exporte les notices d'articles liées
                     if ($params["notice_art"] && array_search($notice_art_link->analysis_notice, $this->notice_exporte) === false) {
                         $this->notice_list[] = $notice_art_link->analysis_notice;
                     }
                 }
             }
         }
         //Etat de collection
         if ($res->niveau_biblio == 's' && $res->niveau_hierar == '1') {
             $req = "SELECT collections_state.*, archempla_libelle, archtype_libelle, archstatut_opac_libelle, archstatut_gestion_libelle, location_libelle FROM collections_state " . "LEFT JOIN arch_emplacement ON archempla_id=collstate_emplacement " . "LEFT JOIN arch_type ON archtype_id=collstate_type " . "LEFT JOIN arch_statut ON archstatut_id=collstate_statut " . "LEFT JOIN docs_location ON idlocation=location_id " . "WHERE id_serial='" . $res->notice_id . "'";
             $res_etat = pmb_mysql_query($req);
             if ($res_etat && pmb_mysql_num_rows($res_etat)) {
                 while ($etat = pmb_mysql_fetch_object($res_etat)) {
                     $subfields = array();
                     $attrs = array();
                     $subfields["9"] = "id:" . $etat->collstate_id;
                     $subfields["a"] = $etat->location_libelle;
                     $subfields["b"] = $etat->state_collections;
                     $subfields["c"] = $etat->archempla_libelle;
                     $subfields["d"] = $etat->archtype_libelle;
                     $subfields["e"] = $etat->collstate_origine;
                     $subfields["f"] = $etat->collstate_cote;
                     $subfields["g"] = $etat->collstate_archive;
                     $subfields["h"] = $etat->archstatut_opac_libelle;
                     $subfields["i"] = $etat->collstate_lacune;
                     $subfields["j"] = $etat->collstate_note;
                     $subfields["k"] = $etat->archstatut_gestion_libelle;
                     $this->add_field("950", "  ", $subfields, "", $attrs);
                     //Export des cp d'etat de collection
                     $this->processing_cp("collstate", $etat->collstate_id, $etat->collstate_id);
                 }
             }
         }
         //Documents numeriques
         if ($params['docnum']) {
             // recuperation des documents numeriques
             $q = "select explnum_id from explnum where explnum_notice='" . $res->notice_id . "' ";
             $q .= "union ";
             $q .= "select explnum_id from explnum, bulletins where bulletin_id = explnum_bulletin and bulletins.num_notice='" . $res->notice_id . "' ";
             $r = pmb_mysql_query($q, $dbh);
             if (pmb_mysql_num_rows($r)) {
                 while ($row = pmb_mysql_fetch_object($r)) {
                     $subfields_897 = array();
                     $dn = new explnum($row->explnum_id);
                     if ($dn->isURL()) {
                         //URL
                         $subfields_897['a'] = $dn->explnum_url;
                         $subfields_897['b'] = $dn->explnum_nom;
                         $subfields_897['f'] = '';
                         $subfields_897['p'] = '';
                     } elseif ($dn->isEnUpload() && $params['docnum_rep']) {
                         //Répertoire
                         $dest_file = $dn->copy_to($params['docnum_rep'], true);
                         if ($dest_file) {
                             $subfields_897['a'] = $dest_file;
                             $subfields_897['b'] = $dn->explnum_nom ? $dn->explnum_nom : $dn->explnum_nomfichier;
                             $subfields_897['f'] = $dn->explnum_nomfichier;
                             $subfields_897['p'] = '';
                         }
                     } elseif ($dn->isEnBase() && $params['docnum_rep']) {
                         //Base
                         $dest_file = $dn->copy_to($params['docnum_rep'], true);
                         if ($dest_file) {
                             $subfields_897['a'] = $dest_file;
                             $subfields_897['b'] = $dn->explnum_nom ? $dn->explnum_nom : $dn->explnum_nomfichier;
                             $subfields_897['f'] = $dn->explnum_nomfichier;
                             $subfields_897['p'] = '';
                         }
                     }
                     if (count($subfields_897)) {
                         $this->add_field('897', '  ', $subfields_897);
                     }
                 }
             }
         }
         //Record field
         $biblio = $res->niveau_biblio;
         $hierar = $res->niveau_hierar;
         if ($biblio == 'b' && $hierar == '2') {
             //si on a un bulletin on modifie b2 en s2
             $biblio = 's';
             $hierar = '2';
         }
         $this->xml_array['rs']['value'] = "n";
         $this->xml_array['dt']['value'] = $res->typdoc;
         $this->xml_array['bl']['value'] = $biblio;
         $this->xml_array['hl']['value'] = $hierar;
         $this->xml_array['el']['value'] = 1;
         $this->xml_array['ru']['value'] = "i";
         if (array_search($res->notice_id, $this->notice_exporte) === false) {
             $this->notice_exporte[] = $res->notice_id;
         }
         $this->toxml();
         $this->current_notice++;
         if ($this->current_notice >= count($this->notice_list)) {
             $this->current_notice = -1;
         }
         return true;
     } else {
         return false;
     }
 }
Exemple #30
0
require_once $class_path . "/editor.class.php";
require_once $include_path . "/isbn.inc.php";
require_once $class_path . "/collection.class.php";
require_once $class_path . "/subcollection.class.php";
require_once $class_path . "/serie.class.php";
require_once $include_path . "/explnum.inc.php";
require_once $class_path . "/category.class.php";
require_once $class_path . "/indexint.class.php";
require_once $class_path . "/search.class.php";
require_once $class_path . "/serial_display.class.php";
require_once $include_path . "/mail.inc.php";
require_once $class_path . "/notice_tpl_gen.class.php";
if (file_exists($include_path . '/print/print_options_subst.xml')) {
    $xml_print = new XMLlist($include_path . '/print/print_options_subst.xml');
} else {
    $xml_print = new XMLlist($include_path . '/print/print_options.xml');
}
$xml_print->analyser();
$print_options = $xml_print->table;
if ($action_print == "print_prepare") {
    print $std_header;
    print "<h3>" . $msg["print_options"] . "</h3>\n";
    print "\n\t<script type='text/javascript'>\n\tfunction sel_part_gestion(){\n\t\tif(document.getElementById('outp').checked){\n\t\t\tdocument.getElementById('mail_part').style.display='none';\n\t\t}\n\t\tif(document.getElementById('outt').checked){\n\t\t\tdocument.getElementById('mail_part').style.display='none';\n\t\t}\n\t\tif(document.getElementById('oute').checked){\n\t\t\tdocument.getElementById('mail_part').style.display='block';\n\t\t}\n\t}\n\t</script>";
    print "<form name='print_options' action='print.php?action_print=print' method='post'>\n\t<b>" . $msg["print_size"] . "</b>";
    if (!$notice_id) {
        print "\n\t<blockquote>\n\t\t<input type='radio' name='pager' id='current_page' value='1' " . ($print_options['current_page'] ? ' checked ' : '') . "/><label for='current_page'>&nbsp;" . $msg["print_size_current_page"] . "</label><br />\n\t\t<input type='radio' name='pager' id='all' value='0' " . ($print_options['all'] ? ' checked ' : '') . "/><label for='all'>&nbsp;" . $msg["print_size_all"] . "</label>\n\t</blockquote>";
    }
    $sort_info = $sort_id ? '<input type="hidden" name="sort_id" value="' . $sort_id . '">' : '';
    $onchange = "\n\t\tvar div_sel=document.getElementById('sel_notice_tpl');\n\t\tvar div_sel2=document.getElementById('sel_notice_tpl2');\n\t\tvar notice_tpl=document.getElementById('notice_tpl');\n\t\tvar sel=notice_tpl.options[notice_tpl.selectedIndex].value;\n\t    if(sel>0){\n\t    \tdiv_sel.style.display='none';\n\t    \tdiv_sel2.style.display='none';\n\t    }else { \n\t    \tdiv_sel.style.display='block';\n\t    \tdiv_sel2.style.display='block';\n\t    }\t\t    \n\t";
    $sel_notice_tpl = notice_tpl_gen::gen_tpl_select("notice_tpl", 0, $onchange);
    print "\n\t<b>" . $msg["print_format_title"] . "</b>\n\t<blockquote>\n\t\t{$sel_notice_tpl}\n\t\t<div id='sel_notice_tpl'>\n\t\t\t<input type='radio' name='short' id='s1' value='1' " . ($print_options['s1'] ? ' checked ' : '') . "/><label for='s1'>&nbsp;" . $msg["print_short_format"] . "</label><br />\n\t\t\t<input type='radio' name='short' id='s0' value='6' " . ($print_options['s0'] ? ' checked ' : '') . "/><label for='s0'>&nbsp;" . $msg["print_long_format"] . "</label><br />\n\t\t\t<input type='checkbox' name='header' id='header' value='1' " . ($print_options['header'] ? ' checked ' : '') . "/><label for='header'>&nbsp;" . $msg["print_header"] . "</label><br/>\n\t\t\t<input type='checkbox' name='permalink' id='permalink' value='1' " . ($print_options['permalink'] ? ' checked ' : '') . "/><label for='permalink'>&nbsp;" . $msg["print_permalink"] . "</label><br />\n\t\t\t<input type='checkbox' name='vignette' id='vignette' value='1' " . ($print_options['vignette'] ? ' checked ' : '') . "/><label for='vignette'>&nbsp;" . $msg["print_vignette"] . "</label><br />\n\t\t</div>\t\n\t</blockquote>\n\t<div id='sel_notice_tpl2'>\n\t<b>" . $msg["print_ex_title"] . "</b>\n\t<blockquote>";