function get_form_select($id, $base_url) { global $msg, $charset, $authperso_form_select; global $user_query, $user_input, $page, $nbr_lignes; global $pmb_type_audit; global $thesaurus_concepts_active; $p_perso = new custom_parametres_perso("authperso", "authperso", $this->id, "./autorites.php?categ=authperso&sub=update&id_authperso=" . $this->id, $option_navigation, $option_visibilite); $authperso_fields = $p_perso->show_editable_fields($id); $authperso_field_tpl = "\t\n\t\t<div class='row'>\n\t\t\t<label class='etiquette'>!!titre!! </label>!!comment!!\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t!!aff!!\n\t\t</div>"; foreach ($authperso_fields['FIELDS'] as $field) { //printr($field); $field_tpl = $authperso_field_tpl; $field_tpl = str_replace("!!titre!!", $field['TITRE'], $field_tpl); $field_tpl = str_replace("!!aff!!", $field['AFF'], $field_tpl); $field_tpl = str_replace("!!comment!!", $field['COMMENT_DISPLAY'], $field_tpl); $tpl .= $field_tpl; } $button_remplace = "<input type='button' class='bouton' value='{$msg['158']}' onclick='unload_off();document.location=\"./autorites.php?categ=authperso&sub=replace&id_authperso=" . $this->id . "&id={$id}\"'>"; $button_voir = "<input type='button' class='bouton' value='{$msg['voir_notices_assoc']}' onclick='unload_off();document.location=\"./catalog.php?categ=search&mode=" . ($this->id + 1000) . "&etat=aut_search&aut_type=authperso&aut_id={$id}\"'>"; if ($pmb_type_audit && $id) { $bouton_audit = " <input class='bouton' type='button' onClick=\"openPopUp('./audit.php?type_obj=" . ($this->id + 1000) . "&object_id=" . $id . "', 'audit_popup', 700, 500, -2, -2, 'scrollbars=yes, toolbar=no, dependent=yes, resizable=yes')\" title=\"" . $msg['audit_button'] . "\" value=\"" . $msg['audit_button'] . "\" /> "; } $aut_link = new aut_link($this->id + 1000, $id); $authperso_form_select = str_replace('<!-- aut_link -->', $aut_link->get_form('saisie_authperso'), $authperso_form_select); // Indexation concept if ($thesaurus_concepts_active == 1) { $index_concept = new index_concept($id, TYPE_AUTHPERSO); $authperso_form_select = str_replace('<!-- index_concept_form -->', $index_concept->get_form('saisie_authperso'), $authperso_form_select); } $authperso_form_select = str_replace("!!libelle!!", $msg['authperso_form_titre_new'], $authperso_form_select); $authperso_form_select = str_replace("!!list_field!!", $tpl, $authperso_form_select); $authperso_form_select = str_replace("!!retour!!", "{$base_url}&action=", $authperso_form_select); $authperso_form_select = str_replace("!!action!!", "{$base_url}&action=update", $authperso_form_select); $authperso_form_select = str_replace("!!id_authperso!!", $this->id, $authperso_form_select); $authperso_form_select = str_replace("!!id!!", $id, $authperso_form_select); return $authperso_form_select; }
function show_form() { global $msg; global $charset; global $indexint_form; global $exact; global $pmb_type_audit; global $thesaurus_concepts_active; if ($this->indexint_id) { $action = "./autorites.php?categ=indexint&sub=update&id=" . $this->indexint_id . "&id_pclass=" . $this->id_pclass; $libelle = $msg[indexint_update]; $button_remplace = "<input type='button' class='bouton' value='{$msg['158']}' "; $button_remplace .= "onclick='unload_off();document.location=\"./autorites.php?categ=indexint&sub=replace&id=" . $this->indexint_id . "&id_pclass=" . $this->id_pclass . "\"'>"; $button_voir = "<input type='button' class='bouton' value='{$msg['voir_notices_assoc']}' "; $button_voir .= "onclick='unload_off();document.location=\"./catalog.php?categ=search&mode=1&etat=aut_search&aut_type=indexint&aut_id=" . $this->indexint_id . "\"'>"; $button_delete = "<input type='button' class='bouton' value='{$msg['63']}' "; $button_delete .= "onClick=\"confirm_delete();\">"; } else { $action = './autorites.php?categ=indexint&sub=update&id=&id_pclass=' . $this->id_pclass; $libelle = $msg[indexint_create]; $button_remplace = ''; $button_delete = ''; } $aut_link = new aut_link(AUT_TABLE_INDEXINT, $this->indexint_id); $indexint_form = str_replace('<!-- aut_link -->', $aut_link->get_form('saisie_indexint'), $indexint_form); $aut_pperso = new aut_pperso("indexint", $this->indexint_id); $indexint_form = str_replace('!!aut_pperso!!', $aut_pperso->get_form(), $indexint_form); $indexint_form = str_replace('!!id_pclass!!', $this->id_pclass, $indexint_form); $indexint_form = str_replace('!!id!!', $this->indexint_id, $indexint_form); $indexint_form = str_replace('!!libelle!!', $libelle, $indexint_form); $indexint_form = str_replace('!!action!!', $action, $indexint_form); $indexint_form = str_replace('!!id!!', $this->s_id, $indexint_form); $indexint_form = str_replace('!!indexint_nom!!', htmlentities($this->name, ENT_QUOTES, $charset), $indexint_form); $indexint_form = str_replace('!!indexint_comment!!', htmlentities($this->comment, ENT_QUOTES, $charset), $indexint_form); $indexint_form = str_replace('!!remplace!!', $button_remplace, $indexint_form); $indexint_form = str_replace('!!voir_notices!!', $button_voir, $indexint_form); $indexint_form = str_replace('!!delete!!', $button_delete, $indexint_form); // pour retour à la bonne page en gestion d'autorités // &user_input=".rawurlencode(stripslashes($user_input))."&nbr_lignes=$nbr_lignes&page=$page global $user_input, $nbr_lignes, $page, $axact; $indexint_form = str_replace('!!user_input_url!!', rawurlencode(stripslashes($user_input)), $indexint_form); $indexint_form = str_replace('!!user_input!!', htmlentities($user_input, ENT_QUOTES, $charset), $indexint_form); $indexint_form = str_replace('!!exact!!', htmlentities($exact, ENT_QUOTES, $charset), $indexint_form); $indexint_form = str_replace('!!nbr_lignes!!', $nbr_lignes, $indexint_form); $indexint_form = str_replace('!!page!!', $page, $indexint_form); if ($thesaurus_concepts_active == 1) { $index_concept = new index_concept($this->indexint_id, TYPE_INDEXINT); $indexint_form = str_replace('!!concept_form!!', $index_concept->get_form('saisie_indexint'), $indexint_form); } else { $indexint_form = str_replace('!!concept_form!!', "", $indexint_form); } if ($pmb_type_audit && $this->indexint_id) { $bouton_audit = " <input class='bouton' type='button' onClick=\"openPopUp('./audit.php?type_obj=" . AUDIT_INDEXINT . "&object_id=" . $this->indexint_id . "', 'audit_popup', 700, 500, -2, -2, 'scrollbars=yes, toolbar=no, dependent=yes, resizable=yes')\" title=\"" . $msg['audit_button'] . "\" value=\"" . $msg['audit_button'] . "\" /> "; } $indexint_form = str_replace('!!audit_bt!!', $bouton_audit, $indexint_form); print $indexint_form; }
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> " . $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> " . $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();\"> "; $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=¶m1=f_bull_new_date¶m2=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; }
function show_form($duplicate = false) { global $msg; global $collection_form; global $charset; global $pmb_type_audit; global $thesaurus_concepts_active; if ($this->id && !$duplicate) { $action = "./autorites.php?categ=collections&sub=update&id={$this->id}"; $libelle = $msg[168]; $button_remplace = "<input type='button' class='bouton' value='{$msg['158']}' "; $button_remplace .= "onclick='unload_off();document.location=\"./autorites.php?categ=collections&sub=replace&id={$this->id}\"'>"; $button_voir = "<input type='button' class='bouton' value='{$msg['voir_notices_assoc']}' "; $button_voir .= "onclick='unload_off();document.location=\"./catalog.php?categ=search&mode=2&etat=aut_search&aut_type=collection&aut_id={$this->id}\"'>"; $button_delete = "<input type='button' class='bouton' value='{$msg['63']}' "; $button_delete .= "onClick=\"confirm_delete();\">"; } else { $action = './autorites.php?categ=collections&sub=update&id='; $libelle = $msg[167]; $button_remplace = ''; $button_delete = ''; } $aut_link = new aut_link(AUT_TABLE_COLLECTIONS, $this->id); $collection_form = str_replace('<!-- aut_link -->', $aut_link->get_form('saisie_collection'), $collection_form); $aut_pperso = new aut_pperso("collection", $this->id); $collection_form = str_replace('!!aut_pperso!!', $aut_pperso->get_form(), $collection_form); $collection_form = str_replace('!!id!!', $this->id, $collection_form); $collection_form = str_replace('!!libelle!!', $libelle, $collection_form); $collection_form = str_replace('!!action!!', $action, $collection_form); $collection_form = str_replace('!!collection_nom!!', htmlentities($this->name, ENT_QUOTES, $charset), $collection_form); $collection_form = str_replace('!!ed_libelle!!', htmlentities($this->editeur, ENT_QUOTES, $charset), $collection_form); $collection_form = str_replace('!!ed_id!!', $this->parent, $collection_form); $collection_form = str_replace('!!issn!!', $this->issn, $collection_form); $collection_form = str_replace('!!delete!!', $button_delete, $collection_form); $collection_form = str_replace('!!remplace!!', $button_remplace, $collection_form); $collection_form = str_replace('!!voir_notices!!', $button_voir, $collection_form); $collection_form = str_replace('!!collection_web!!', htmlentities($this->collection_web, ENT_QUOTES, $charset), $collection_form); $collection_form = str_replace('!!comment!!', htmlentities($this->comment, ENT_QUOTES, $charset), $collection_form); /** * Gestion du selecteur de statut d'autorité */ $collection_form = str_replace('!!auth_statut_selector!!', authorities_statuts::get_form_for(AUT_TABLE_COLLECTIONS, $this->num_statut), $collection_form); // pour retour à la bonne page en gestion d'autorités // &user_input=".rawurlencode(stripslashes($user_input))."&nbr_lignes=$nbr_lignes&page=$page global $user_input, $nbr_lignes, $page; $collection_form = str_replace('!!user_input_url!!', rawurlencode(stripslashes($user_input)), $collection_form); $collection_form = str_replace('!!user_input!!', htmlentities($user_input, ENT_QUOTES, $charset), $collection_form); $collection_form = str_replace('!!nbr_lignes!!', $nbr_lignes, $collection_form); $collection_form = str_replace('!!page!!', $page, $collection_form); if ($thesaurus_concepts_active == 1) { $index_concept = new index_concept($this->id, TYPE_COLLECTION); $collection_form = str_replace('!!concept_form!!', $index_concept->get_form('saisie_collection'), $collection_form); } else { $collection_form = str_replace('!!concept_form!!', "", $collection_form); } if ($pmb_type_audit && $this->id && !$duplicate) { $bouton_audit = " <input class='bouton' type='button' onClick=\"openPopUp('./audit.php?type_obj=" . AUDIT_COLLECTION . "&object_id=" . $this->id . "', 'audit_popup', 700, 500, -2, -2, 'scrollbars=yes, toolbar=no, dependent=yes, resizable=yes')\" title=\"" . $msg['audit_button'] . "\" value=\"" . $msg['audit_button'] . "\" /> "; } $collection_form = str_replace('!!audit_bt!!', $bouton_audit, $collection_form); print $collection_form; }
function fill_form(&$form, $action) { global $charset; global $msg; global $pmb_antivol; global $option_num_auto; global $dbh; global $pmb_expl_show_dates; global $thesaurus_concepts_active; if (isset($option_num_auto)) { $requete = "DELETE from exemplaires_temp where sess not in (select SESSID from sessions)"; pmb_mysql_query($requete, $dbh); //Appel à la fonction de génération automatique de cb $code_exemplaire = init_gen_code_exemplaire($this->id_notice, $this->id_bulletin); do { $code_exemplaire = gen_code_exemplaire($this->id_notice, $this->id_bulletin, $code_exemplaire); $requete = "select expl_cb from exemplaires WHERE expl_cb='{$code_exemplaire}'"; $res0 = pmb_mysql_query($requete, $dbh); $requete = "select cb from exemplaires_temp WHERE cb='{$code_exemplaire}' AND sess <>'" . SESSid . "'"; $res1 = pmb_mysql_query($requete, $dbh); } while (pmb_mysql_num_rows($res0) || pmb_mysql_num_rows($res1)); //Memorise dans temps le cb et la session pour le cas de multi utilisateur session $this->cb = $code_exemplaire; $requete = "INSERT INTO exemplaires_temp (cb ,sess) VALUES ('{$this->cb}','" . SESSid . "')"; pmb_mysql_query($requete, $dbh); } $form = str_replace('!!action!!', $action, $form); if ($this->id_notice) { $form = str_replace('!!id!!', $this->id_notice, $form); } else { $form = str_replace('!!id!!', $this->id_bulletin, $form); } $form = str_replace('!!cb!!', htmlentities($this->cb, ENT_QUOTES, $charset), $form); $form = str_replace('!!nbparts!!', htmlentities($this->nbparts, ENT_QUOTES, $charset), $form); $form = str_replace('!!note!!', htmlentities($this->note, ENT_QUOTES, $charset), $form); $form = str_replace('!!comment!!', htmlentities($this->expl_comment, ENT_QUOTES, $charset), $form); if ($this->id_notice) { $form = str_replace('!!cote!!', htmlentities(prefill_cote($this->id_notice, $this->cote), ENT_QUOTES, $charset), $form); } else { $form = str_replace('!!cote!!', htmlentities(prefill_cote($this->id_bulletin_notice, $this->cote), ENT_QUOTES, $charset), $form); } $form = str_replace('!!prix!!', htmlentities($this->prix, ENT_QUOTES, $charset), $form); // select "type document" $form = str_replace('!!type_doc!!', do_selector('docs_type', 'f_ex_typdoc', $this->typdoc_id), $form); // select "section" $form = str_replace('!!section!!', $this->do_selector(), $form); // select "statut" $form = str_replace('!!statut!!', do_selector('docs_statut', 'f_ex_statut', $this->statut_id), $form); // select "localisation" //visibilité des exemplaires global $explr_visible_mod, $pmb_droits_explr_localises; if ($pmb_droits_explr_localises) { $where_clause_explr = "idlocation in (" . $explr_visible_mod . ") and"; } $form = str_replace('!!localisation!!', gen_liste("select distinct idlocation, location_libelle from docs_location, docsloc_section where {$where_clause_explr} num_location=idlocation order by 2 ", "idlocation", "location_libelle", 'f_ex_location', "calcule_section(this);", $this->location_id, "", "", "", "", 0), $form); // select "code statistique" $form = str_replace('!!codestat!!', do_selector('docs_codestat', 'f_ex_cstat', $this->codestat_id), $form); if ($pmb_antivol) { global $value_deflt_antivol; if ($this->type_antivol == "") { $this->type_antivol = $value_deflt_antivol; } // select "type_antivol" $selector = "<select name='type_antivol' id='type_antivol'>"; $selector .= "<option value='0'"; if ($this->type_antivol == 0) { $selector .= ' selected="selected"'; } $selector .= '>'; $selector .= $msg["type_antivol_aucun"] . '</option>'; $selector .= "<option value='1'"; if ($this->type_antivol == 1) { $selector .= ' selected="selected"'; } $selector .= '>'; $selector .= $msg["type_antivol_magnetique"] . '</option>'; $selector .= "<option value='2'"; if ($this->type_antivol == 2) { $selector .= ' selected="selected"'; } $selector .= '>'; $selector .= $msg["type_antivol_autre"] . '</option>'; $selector .= '</select>'; } else { $selector = ""; } $form = str_replace('!!type_antivol!!', $selector, $form); // select "owner" $form = str_replace('!!owner!!', do_selector('lenders', 'f_ex_owner', $this->owner_id), $form); //dates creation / modification if ($this->expl_id && ($pmb_expl_show_dates == '1' || $pmb_expl_show_dates == '3')) { $form = str_replace('<!-- msg_exp_cre_date -->', "<label class='etiquette' >" . htmlentities($msg['exp_cre_date'], ENT_QUOTES, $charset) . "</label>", $form); $form = str_replace('<!-- exp_cre_date -->', format_date($this->create_date), $form); $form = str_replace('<!-- msg_exp_upd_date -->', "<label class='etiquette' >" . htmlentities($msg['exp_upd_date'], ENT_QUOTES, $charset) . "</label>", $form); $form = str_replace('<!-- exp_upd_date -->', format_date($this->update_date), $form); } //dates dépôt / retour if ($this->expl_id && ($pmb_expl_show_dates == '2' || $pmb_expl_show_dates == '3')) { $form = str_replace('<!-- msg_exp_filing_date -->', "<label class='etiquette' >" . htmlentities($msg['filing_date'], ENT_QUOTES, $charset) . "</label>", $form); $form = str_replace('<!-- exp_filing_date -->', format_date($this->date_depot), $form); $form = str_replace('<!-- msg_exp_return_date -->', "<label class='etiquette' >" . htmlentities($msg['return_date'], ENT_QUOTES, $charset) . "</label>", $form); $form = str_replace('<!-- exp_return_date -->', format_date($this->date_retour), $form); } // Indexation concept if ($thesaurus_concepts_active == 1) { $index_concept = new index_concept($this->expl_id, TYPE_EXPL); $form = str_replace('<!-- index_concept_form -->', $index_concept->get_form("expl"), $form); } $p_perso = new parametres_perso("expl"); if (!$p_perso->no_special_fields) { $c = 0; $perso = "<hr />"; $perso_ = $p_perso->show_editable_fields($this->expl_id); for ($i = 0; $i < count($perso_["FIELDS"]); $i++) { $p = $perso_["FIELDS"][$i]; if ($c == 0) { $perso .= "<div class='row'>\n"; } $perso .= "<div class='colonne2'><label for='" . $p["NAME"] . "' class='etiquette'>" . $p["TITRE"] . "</label><div class='row'>" . $p["AFF"] . "</div></div>\n"; $c++; if ($c == 2) { $perso .= "</div>\n"; $c = 0; } } if ($c == 1) { $perso .= "<div class='colonne2'> </div>\n</div>\n"; } $perso = $perso_["CHECK_SCRIPTS"] . "\n" . $perso; } else { $perso = "\n<script>function check_form() { return true; }</script>\n"; } $form = str_replace("!!champs_perso!!", $perso, $form); //Remplissage ajax de la cote global $pmb_prefill_cote_ajax, $pmb_antivol; if ($pmb_prefill_cote_ajax) { $expl_ajax_cote = " completion='expl_cote' listfield='" . $this->ajax_cote_fields . ",f_ex_cb,f_ex_typdoc,f_ex_location,f_ex_owner,f_ex_statut,f_ex_cstat" . ($pmb_antivol > 0 ? ",type_antivol" : "") . "' "; } else { $expl_ajax_cote = ""; } $form = str_replace("!!expl_ajax_cote!!", $expl_ajax_cote, $form); }
function show_form($duplicate = false) { global $msg; global $titre_uniforme_form; global $charset; global $user_input, $nbr_lignes, $page; global $pmb_type_audit; global $thesaurus_concepts_active; global $value_deflt_fonction; global $tu_authors_tpl, $tu_authors_all_tpl; global $pmb_authors_qualification; $fonction = new marc_list('function'); $music_key = new marc_list('music_key'); $music_form = new marc_list('music_form'); if ($this->id && !$duplicate) { $action = "./autorites.php?categ=titres_uniformes&sub=update&id={$this->id}"; $libelle = $msg["aut_titre_uniforme_modifier"]; $button_remplace = "<input type='button' class='bouton' value='{$msg['158']}' "; $button_remplace .= "onclick='unload_off();document.location=\"./autorites.php?categ=titres_uniformes&sub=replace&id={$this->id}\"'>"; $button_voir = "<input type='button' class='bouton' value='{$msg['voir_notices_assoc']}' "; $button_voir .= "onclick='unload_off();document.location=\"./catalog.php?categ=search&mode=9&etat=aut_search&aut_type=titre_uniforme&aut_id={$this->id}\"'>"; $button_delete = "<input type='button' class='bouton' value='{$msg['63']}' "; $button_delete .= "onClick=\"confirm_delete();\">"; } else { $action = './autorites.php?categ=titres_uniformes&sub=update&id='; $libelle = $msg["aut_titre_uniforme_ajouter"]; $button_remplace = ''; $button_delete = ''; } if ($this->import_denied == 1) { $import_denied_checked = "checked='checked'"; } else { $import_denied_checked = ""; } // Auteurs $as = array_keys($this->responsabilites["responsabilites"], "0"); $max_aut0 = count($as); $tu_auteurs = ""; if ($max_aut0 == 0) { $max_aut0 = 1; } for ($i = 0; $i < $max_aut0; $i++) { $indice = $as[$i]; $auteur_0 = $this->responsabilites["auteurs"][$indice]; $auteur = new auteur($auteur_0["id"]); if ($value_deflt_fonction && $auteur_0["id"] == 0 && $i == 0) { $auteur_0["fonction"] = $value_deflt_fonction; } $ptab_aut_tu = $tu_authors_tpl; $ptab_aut_tu = str_replace('!!n!!', 0, $ptab_aut_tu); $ptab_aut_tu = str_replace('!!iaut!!', $i, $ptab_aut_tu); $ptab_aut_tu = str_replace('!!title!!', $msg["tu_authors_list"], $ptab_aut_tu); $ptab_aut_tu = str_replace('!!vedettetype!!', 'role', $ptab_aut_tu); if ($i) { $ptab_aut_tu = str_replace('!!title_display!!', 'display:none', $ptab_aut_tu); $ptab_aut_tu = str_replace('!!bouton_add_display!!', 'display:none', $ptab_aut_tu); } else { $ptab_aut_tu = str_replace('!!title_display!!', 'display:block', $ptab_aut_tu); $ptab_aut_tu = str_replace('!!bouton_add_display!!', '', $ptab_aut_tu); } $ptab_aut_tu = str_replace('!!aut0_id!!', $auteur_0["id"], $ptab_aut_tu); $ptab_aut_tu = str_replace('!!aut0!!', htmlentities($auteur->isbd_entry, ENT_QUOTES, $charset), $ptab_aut_tu); $ptab_aut_tu = str_replace('!!f0_code!!', $auteur_0["fonction"], $ptab_aut_tu); $ptab_aut_tu = str_replace('!!f0!!', $fonction->table[$auteur_0["fonction"]], $ptab_aut_tu); if ($pmb_authors_qualification) { $vedette_ui = new vedette_ui(new vedette_composee(vedette_composee::get_vedette_id_from_object($auteur_0["id_responsability_tu"], TYPE_TU_RESPONSABILITY), 'tu_authors')); $ptab_aut_tu = str_replace('!!vedette_author!!', $vedette_ui->get_form('role', $i, 'saisie_titre_uniforme'), $ptab_aut_tu); } else { $ptab_aut_tu = str_replace('!!vedette_author!!', "", $ptab_aut_tu); } $tu_auteurs .= $ptab_aut_tu; } $tu_authors_all_tpl = str_replace('!!max_aut0!!', $max_aut0, $tu_authors_all_tpl); $tu_authors_all_tpl = str_replace('!!authors_list0!!', $tu_auteurs, $tu_authors_all_tpl); // Interpretes $as = array_keys($this->responsabilites["responsabilites"], "1"); $max_aut1 = count($as); $tu_auteurs = ""; if ($max_aut1 == 0) { $max_aut1 = 1; } for ($i = 0; $i < $max_aut1; $i++) { $indice = $as[$i]; $auteur_1 = $this->responsabilites["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_tu = $tu_authors_tpl; $ptab_aut_tu = str_replace('!!n!!', 1, $ptab_aut_tu); $ptab_aut_tu = str_replace('!!iaut!!', $i, $ptab_aut_tu); $ptab_aut_tu = str_replace('!!title!!', $msg["tu_interpreter_list"], $ptab_aut_tu); $ptab_aut_tu = str_replace('!!vedettetype!!', 'role_autre', $ptab_aut_tu); if ($i) { $ptab_aut_tu = str_replace('!!title_display!!', 'display:none', $ptab_aut_tu); $ptab_aut_tu = str_replace('!!bouton_add_display!!', 'display:none', $ptab_aut_tu); } else { $ptab_aut_tu = str_replace('!!title_display!!', 'display:block', $ptab_aut_tu); $ptab_aut_tu = str_replace('!!bouton_add_display!!', '', $ptab_aut_tu); } $ptab_aut_tu = str_replace('!!aut1_id!!', $auteur_1["id"], $ptab_aut_tu); $ptab_aut_tu = str_replace('!!aut1!!', htmlentities($auteur->isbd_entry, ENT_QUOTES, $charset), $ptab_aut_tu); $ptab_aut_tu = str_replace('!!f1_code!!', $auteur_1["fonction"], $ptab_aut_tu); $ptab_aut_tu = str_replace('!!f1!!', $fonction->table[$auteur_1["fonction"]], $ptab_aut_tu); if ($pmb_authors_qualification) { $vedette_ui = new vedette_ui(new vedette_composee(vedette_composee::get_vedette_id_from_object($auteur_1["id_responsability_tu"], TYPE_TU_RESPONSABILITY_INTERPRETER), 'tu_authors')); $ptab_aut_tu = str_replace('!!vedette_author!!', $vedette_ui->get_form('role_autre', $i, 'saisie_titre_uniforme'), $ptab_aut_tu); } else { $ptab_aut_tu = str_replace('!!vedette_author!!', "", $ptab_aut_tu); } $tu_auteurs .= $ptab_aut_tu; } $tu_authors_all_tpl = str_replace('!!max_aut1!!', $max_aut1, $tu_authors_all_tpl); $tu_authors_all_tpl = str_replace('!!authors_list1!!', $tu_auteurs, $tu_authors_all_tpl); $aut_link = new aut_link(AUT_TABLE_TITRES_UNIFORMES, $this->id); $titre_uniforme_form = str_replace('<!-- aut_link -->', $aut_link->get_form('saisie_titre_uniforme'), $titre_uniforme_form); $aut_pperso = new aut_pperso("tu", $this->id); $titre_uniforme_form = str_replace('!!aut_pperso!!', $aut_pperso->get_form(), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!id!!', $this->id, $titre_uniforme_form); $titre_uniforme_form = str_replace('!!action!!', $action, $titre_uniforme_form); $titre_uniforme_form = str_replace('!!libelle!!', $libelle, $titre_uniforme_form); $select_oeuvre_type = new marc_select('oeuvre_type', 'oeuvre_type', $this->oeuvre_type, "", '', '', array(array('name' => 'data-form-name', 'value' => 'oeuvre_type'))); $titre_uniforme_form = str_replace('!!oeuvre_type!!', $select_oeuvre_type->display, $titre_uniforme_form); $select_oeuvre_nature = new marc_select('oeuvre_nature', 'oeuvre_nature', $this->oeuvre_nature, "", '', '', array(array('name' => 'data-form-name', 'value' => 'oeuvre_nature'))); $titre_uniforme_form = str_replace('!!oeuvre_nature!!', $select_oeuvre_nature->display, $titre_uniforme_form); $titre_uniforme_form = str_replace('!!oeuvre_expression!!', $this->gen_oeuvre_expression_form(), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!other_link!!', $this->gen_other_link_form(), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!oeuvre_event!!', $this->gen_oeuvre_event_form(), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!nom!!', htmlentities($this->name, ENT_QUOTES, $charset), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!authors!!', $tu_authors_all_tpl, $titre_uniforme_form); $titre_uniforme_form = str_replace('!!aut_id!!', htmlentities($this->num_author, ENT_QUOTES, $charset), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!form!!', htmlentities($this->form, ENT_QUOTES, $charset), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!music_form_id!!', $this->form_marclist, $titre_uniforme_form); $titre_uniforme_form = str_replace('!!music_form!!', $music_form->table[$this->form_marclist], $titre_uniforme_form); $titre_uniforme_form = str_replace('!!date!!', htmlentities($this->date, ENT_QUOTES, $charset), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!subject!!', htmlentities($this->subject, ENT_QUOTES, $charset), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!place!!', htmlentities($this->place, ENT_QUOTES, $charset), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!history!!', htmlentities($this->history, ENT_QUOTES, $charset), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!intended_audience!!', htmlentities($this->intended_audience, ENT_QUOTES, $charset), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!context!!', htmlentities($this->context, ENT_QUOTES, $charset), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!tonalite!!', htmlentities($this->tonalite, ENT_QUOTES, $charset), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!music_key_id!!', $this->tonalite_marclist, $titre_uniforme_form); $titre_uniforme_form = str_replace('!!music_key!!', $music_key->table[$this->tonalite_marclist], $titre_uniforme_form); $titre_uniforme_form = str_replace('!!coordinates!!', htmlentities($this->coordinates, ENT_QUOTES, $charset), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!equinox!!', htmlentities($this->equinox, ENT_QUOTES, $charset), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!characteristic!!', htmlentities($this->characteristic, ENT_QUOTES, $charset), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!comment!!', htmlentities($this->comment, ENT_QUOTES, $charset), $titre_uniforme_form); /** * Gestion du selecteur de statut d'autorité */ $titre_uniforme_form = str_replace('!!auth_statut_selector!!', authorities_statuts::get_form_for(AUT_TABLE_TITRES_UNIFORMES, $this->num_statut), $titre_uniforme_form); // auteur $tu_auteur_id = $this->num_author; if ($tu_auteur_id) { $tu_auteur = new auteur($tu_auteur_id); } $titre_uniforme_form = str_replace('!!aut_name!!', htmlentities($tu_auteur->display, ENT_QUOTES, $charset), $titre_uniforme_form); // complétude $intended_termination_id = $this->intended_termination; $select_0 = ""; $select_1 = ""; $select_2 = ""; if ($intended_termination_id == 1) { $select_1 = "selected"; } elseif ($intended_termination_id == 2) { $select_2 = "selected"; } else { $select_0 = "selected"; } $titre_uniforme_form = str_replace('!!intended_termination_0!!', htmlentities($select_0, ENT_QUOTES, $charset), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!intended_termination_1!!', htmlentities($select_1, ENT_QUOTES, $charset), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!intended_termination_2!!', htmlentities($select_2, ENT_QUOTES, $charset), $titre_uniforme_form); // distribution $distribution_form = $this->gen_input_selection($msg["aut_titre_uniforme_form_distribution"], "saisie_titre_uniforme", "distrib", $this->distrib, "", "saisie-80em"); $titre_uniforme_form = str_replace("<!--\tDistribution instrumentale et vocale (pour la musique)\t-->", $distribution_form, $titre_uniforme_form); // reference $ref_num_form = $this->gen_input_selection($msg["aut_titre_uniforme_form_ref_numerique"], "saisie_titre_uniforme", "ref", $this->ref, "", "saisie-80em"); $titre_uniforme_form = str_replace("<!--\tRéférence numérique (pour la musique)\t-->", $ref_num_form, $titre_uniforme_form); // subdivision $sub_form = $this->gen_input_selection($msg["aut_titre_uniforme_form_subdivision_forme"], "saisie_titre_uniforme", "subdiv", $this->subdiv, "", "saisie-80em"); $titre_uniforme_form = str_replace('<!-- Subdivision de forme -->', $sub_form, $titre_uniforme_form); $titre_uniforme_form = str_replace('!!remplace!!', $button_remplace, $titre_uniforme_form); $titre_uniforme_form = str_replace('!!voir_notices!!', $button_voir, $titre_uniforme_form); $titre_uniforme_form = str_replace('!!delete!!', $button_delete, $titre_uniforme_form); $titre_uniforme_form = str_replace('!!user_input_url!!', rawurlencode(stripslashes($user_input)), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!user_input!!', htmlentities($user_input, ENT_QUOTES, $charset), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!nbr_lignes!!', $nbr_lignes, $titre_uniforme_form); $titre_uniforme_form = str_replace('!!page!!', $page, $titre_uniforme_form); $titre_uniforme_form = str_replace('!!tu_import_denied!!', $import_denied_checked, $titre_uniforme_form); if ($thesaurus_concepts_active == 1) { $index_concept = new index_concept($this->id, TYPE_TITRE_UNIFORME); $titre_uniforme_form = str_replace('!!concept_form!!', $index_concept->get_form('saisie_titre_uniforme'), $titre_uniforme_form); } else { $titre_uniforme_form = str_replace('!!concept_form!!', "", $titre_uniforme_form); } if ($pmb_type_audit && $this->id && !$duplicate) { $bouton_audit = " <input class='bouton' type='button' onClick=\"openPopUp('./audit.php?type_obj=" . AUDIT_TITRE_UNIFORME . "&object_id=" . $this->id . "', 'audit_popup', 700, 500, -2, -2, 'scrollbars=yes, toolbar=no, dependent=yes, resizable=yes')\" title=\"" . $msg['audit_button'] . "\" value=\"" . $msg['audit_button'] . "\" /> "; } $titre_uniforme_form = str_replace('!!audit_bt!!', $bouton_audit, $titre_uniforme_form); print $titre_uniforme_form; }
function show_form() { global $msg; global $charset; global $lang; global $include_path, $class_path; global $current_module; global $pmb_type_audit, $select_categ_prop, $z3950_accessible; global $value_deflt_fonction, $value_deflt_relation; global $thesaurus_mode_pmb; global $PMBuserid, $pmb_form_editables, $thesaurus_classement_mode_pmb; global $xmlta_indexation_lang; global $thesaurus_concepts_active; global $pmb_map_activate; global $pmb_notices_show_dates; global $thesaurus_categories_affichage_ordre; include "{$include_path}/templates/catal_form.tpl.php"; $fonction = new marc_list('function'); // mise a jour de l'action en fonction de l'id $this->action .= $this->id; // mise a jour de l'en-tete du formulaire if ($this->notice_mere[0]) { $this->libelle_form .= " " . $msg["catalog_notice_fille_lib"] . " " . substr($this->notice_mere[0], 0, 100) . (count($this->notice_mere) > 1 ? ", ..." : ""); } $form_notice = str_replace('!!libelle_form!!', $this->libelle_form, $form_notice); // mise a jour des flags de niveau hierarchique $form_notice = str_replace('!!b_level!!', $this->biblio_level, $form_notice); $form_notice = str_replace('!!h_level!!', $this->hierar_level, $form_notice); // mise a jour de l'onglet 0 $ptab[0] = str_replace('!!tit1!!', htmlentities($this->tit1, ENT_QUOTES, $charset), $ptab[0]); $ptab[0] = str_replace('!!tit2!!', htmlentities($this->tit2, ENT_QUOTES, $charset), $ptab[0]); $ptab[0] = str_replace('!!tit3!!', htmlentities($this->tit3, ENT_QUOTES, $charset), $ptab[0]); $ptab[0] = str_replace('!!tit4!!', htmlentities($this->tit4, ENT_QUOTES, $charset), $ptab[0]); $ptab[0] = str_replace('!!tparent_id!!', $this->tparent_id, $ptab[0]); $ptab[0] = str_replace('!!tparent!!', htmlentities($this->tparent, ENT_QUOTES, $charset), $ptab[0]); $ptab[0] = str_replace('!!tnvol!!', htmlentities($this->tnvol, ENT_QUOTES, $charset), $ptab[0]); $form_notice = str_replace('!!tab0!!', $ptab[0], $form_notice); // mise a jour de l'onglet 1 // constitution de la mention de responsabilite //$this->responsabilites $as = array_search("0", $this->responsabilites["responsabilites"]); if ($as !== FALSE && $as !== NULL) { $auteur_0 = $this->responsabilites["auteurs"][$as]; $auteur = new auteur($auteur_0["id"]); } if ($value_deflt_fonction && $auteur_0["id"] == 0) { $auteur_0["fonction"] = $value_deflt_fonction; } if ($pmb_authors_qualification) { $vedette_ui = new vedette_ui(new vedette_composee(vedette_composee::get_vedette_id_from_object($auteur_0["id_responsability"], TYPE_NOTICE_RESPONSABILITY_PRINCIPAL), 'notice_authors')); $ptab[1] = str_replace('!!vedette_author!!', $vedette_ui->get_form('role', 0, 'notice'), $ptab[1]); } else { $ptab[1] = str_replace('!!vedette_author!!', "", $ptab[1]); } $ptab[1] = str_replace('!!iaut!!', 0, $ptab[1]); $ptab[1] = str_replace('!!aut0_id!!', $auteur_0["id"], $ptab[1]); $ptab[1] = str_replace('!!aut0!!', htmlentities($auteur->isbd_entry, ENT_QUOTES, $charset), $ptab[1]); $ptab[1] = str_replace('!!f0_code!!', $auteur_0["fonction"], $ptab[1]); $ptab[1] = str_replace('!!f0!!', $fonction->table[$auteur_0["fonction"]], $ptab[1]); $as = array_keys($this->responsabilites["responsabilites"], "1"); $max_aut1 = count($as); if ($max_aut1 == 0) { $max_aut1 = 1; } for ($i = 0; $i < $max_aut1; $i++) { $indice = $as[$i]; $auteur_1 = $this->responsabilites["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 = $ptab[11]; $ptab_aut_tu = str_replace('!!iaut!!', $i, $tu_authors_tpl); if ($i) { $ptab_aut_autres = str_replace('!!bouton_add_display!!', 'display:none', $ptab_aut_autres); } else { $ptab_aut_autres = str_replace('!!bouton_add_display!!', '', $ptab_aut_autres); } if ($pmb_authors_qualification) { $vedette_ui = new vedette_ui(new vedette_composee(vedette_composee::get_vedette_id_from_object($auteur_1["id_responsability"], TYPE_NOTICE_RESPONSABILITY_AUTRE), 'notice_authors')); $ptab_aut_autres = str_replace('!!vedette_author!!', $vedette_ui->get_form('role_autre', $i, 'notice', '', 0), $ptab_aut_autres); } else { $ptab_aut_autres = str_replace('!!vedette_author!!', "", $ptab_aut_autres); } $ptab_aut_autres = str_replace('!!iaut!!', $i, $ptab_aut_autres); $ptab_aut_autres = str_replace('!!aut1_id!!', $auteur_1["id"], $ptab_aut_autres); $ptab_aut_autres = str_replace('!!aut1!!', htmlentities($auteur->isbd_entry, 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; } $ptab[1] = str_replace('!!max_aut1!!', $max_aut1, $ptab[1]); $as = array_keys($this->responsabilites["responsabilites"], "2"); $max_aut2 = count($as); if ($max_aut2 == 0) { $max_aut2 = 1; } for ($i = 0; $i < $max_aut2; $i++) { $indice = $as[$i]; $auteur_2 = $this->responsabilites["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 = $ptab[12]; if ($i) { $ptab_aut_autres = str_replace('!!bouton_add_display!!', 'display:none', $ptab_aut_autres); } else { $ptab_aut_autres = str_replace('!!bouton_add_display!!', '', $ptab_aut_autres); } if ($pmb_authors_qualification) { $vedette_ui = new vedette_ui(new vedette_composee(vedette_composee::get_vedette_id_from_object($auteur_2["id_responsability"], TYPE_NOTICE_RESPONSABILITY_SECONDAIRE), 'notice_authors')); $ptab_aut_autres = str_replace('!!vedette_author!!', $vedette_ui->get_form('role_secondaire', $i, 'notice', '', 0), $ptab_aut_autres); } else { $ptab_aut_autres = str_replace('!!vedette_author!!', "", $ptab_aut_autres); } $ptab_aut_autres = str_replace('!!iaut!!', $i, $ptab_aut_autres); $ptab_aut_autres = str_replace('!!aut2_id!!', $auteur_2["id"], $ptab_aut_autres); $ptab_aut_autres = str_replace('!!aut2!!', htmlentities($auteur->isbd_entry, 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; } $ptab[1] = str_replace('!!max_aut2!!', $max_aut2, $ptab[1]); $ptab[1] = str_replace('!!autres_auteurs!!', $autres_auteurs, $ptab[1]); $ptab[1] = str_replace('!!auteurs_secondaires!!', $auteurs_secondaires, $ptab[1]); $form_notice = str_replace('!!tab1!!', $ptab[1], $form_notice); // mise a jour de l'onglet 2 $ptab[2] = str_replace('!!ed1_id!!', $this->ed1_id, $ptab[2]); $ptab[2] = str_replace('!!ed1!!', htmlentities($this->ed1, ENT_QUOTES, $charset), $ptab[2]); $ptab[2] = str_replace('!!coll_id!!', $this->coll_id, $ptab[2]); $ptab[2] = str_replace('!!coll!!', htmlentities($this->coll, ENT_QUOTES, $charset), $ptab[2]); $ptab[2] = str_replace('!!subcoll_id!!', $this->subcoll_id, $ptab[2]); $ptab[2] = str_replace('!!subcoll!!', htmlentities($this->subcoll, ENT_QUOTES, $charset), $ptab[2]); $ptab[2] = str_replace('!!year!!', $this->year, $ptab[2]); $ptab[2] = str_replace('!!nocoll!!', htmlentities($this->nocoll, ENT_QUOTES, $charset), $ptab[2]); $ptab[2] = str_replace('!!mention_edition!!', htmlentities($this->mention_edition, ENT_QUOTES, $charset), $ptab[2]); $ptab[2] = str_replace('!!ed2_id!!', $this->ed2_id, $ptab[2]); $ptab[2] = str_replace('!!ed2!!', htmlentities($this->ed2, ENT_QUOTES, $charset), $ptab[2]); $form_notice = str_replace('!!tab2!!', $ptab[2], $form_notice); // mise a jour de l'onglet 3 $ptab[3] = str_replace('!!cb!!', $this->code, $ptab[3]); $ptab[3] = str_replace('!!notice_id!!', $this->id, $ptab[3]); $form_notice = str_replace('!!tab3!!', $ptab[3], $form_notice); // Gestion des titres uniformes global $pmb_use_uniform_title; if ($pmb_use_uniform_title) { if ($this->duplicate_from_id) { $tu = new tu_notice($this->duplicate_from_id); } else { $tu = new tu_notice($this->id); } $ptab[230] = str_replace("!!titres_uniformes!!", $tu->get_form("notice"), $ptab[230]); $form_notice = str_replace('!!tab230!!', $ptab[230], $form_notice); } // mise a jour de l'onglet 4 $ptab[4] = str_replace('!!npages!!', htmlentities($this->npages, ENT_QUOTES, $charset), $ptab[4]); $ptab[4] = str_replace('!!ill!!', htmlentities($this->ill, ENT_QUOTES, $charset), $ptab[4]); $ptab[4] = str_replace('!!size!!', htmlentities($this->size, ENT_QUOTES, $charset), $ptab[4]); $ptab[4] = str_replace('!!prix!!', htmlentities($this->prix, ENT_QUOTES, $charset), $ptab[4]); $ptab[4] = str_replace('!!accomp!!', htmlentities($this->accomp, ENT_QUOTES, $charset), $ptab[4]); $form_notice = str_replace('!!tab4!!', $ptab[4], $form_notice); // mise a jour de l'onglet 5 $ptab[5] = str_replace('!!n_gen!!', htmlentities($this->n_gen, ENT_QUOTES, $charset), $ptab[5]); $ptab[5] = str_replace('!!n_contenu!!', htmlentities($this->n_contenu, ENT_QUOTES, $charset), $ptab[5]); $ptab[5] = str_replace('!!n_resume!!', htmlentities($this->n_resume, ENT_QUOTES, $charset), $ptab[5]); $form_notice = str_replace('!!tab5!!', $ptab[5], $form_notice); // mise a jour de l'onglet 6 // categories //tri ? if ($thesaurus_categories_affichage_ordre == 0 && count($this->categories)) { $tmp = array(); foreach ($this->categories as $key => $value) { $tmp[$key] = strip_tags($value['categ_libelle']); } $tmp = array_map("convert_diacrit", $tmp); //On enlève les accents $tmp = array_map("strtoupper", $tmp); //On met en majuscule asort($tmp); //Tri sur les valeurs en majuscule sans accent foreach ($tmp as $key => $value) { $tmp[$key] = $this->categories[$key]; //On reprend les bons couples } $this->categories = array_values($tmp); } if (sizeof($this->categories) == 0) { $max_categ = 1; } else { $max_categ = sizeof($this->categories); } $tab_categ_order = ""; for ($i = 0; $i < $max_categ; $i++) { $categ_id = $this->categories[$i]["categ_id"]; $categ = new category($categ_id); if ($i == 0) { $ptab_categ = str_replace('!!icateg!!', $i, $ptab[60]); } else { $ptab_categ = str_replace('!!icateg!!', $i, $ptab[601]); } $ptab_categ = str_replace('!!categ_id!!', $categ_id, $ptab_categ); if (sizeof($this->categories) == 0) { $ptab_categ = str_replace('!!categ_libelle!!', '', $ptab_categ); } else { if ($thesaurus_mode_pmb) { $nom_thesaurus = '[' . $categ->thes->getLibelle() . '] '; } else { $nom_thesaurus = ''; } $ptab_categ = str_replace('!!categ_libelle!!', htmlentities($nom_thesaurus . $categ->catalog_form, ENT_QUOTES, $charset), $ptab_categ); if ($tab_categ_order != "") { $tab_categ_order .= ","; } $tab_categ_order .= $i; } $categ_repetables .= $ptab_categ; } $ptab[6] = str_replace('!!max_categ!!', $max_categ, $ptab[6]); $ptab[6] = str_replace('!!categories_repetables!!', $categ_repetables, $ptab[6]); $ptab[6] = str_replace('!!tab_categ_order!!', $tab_categ_order, $ptab[6]); // indexation interne $ptab[6] = str_replace('!!indexint_id!!', $this->indexint, $ptab[6]); if ($this->indexint) { $indexint = new indexint($this->indexint); if ($indexint->comment) { $disp_indexint = $indexint->name . " - " . $indexint->comment; } else { $disp_indexint = $indexint->name; } if ($thesaurus_classement_mode_pmb) { // plusieurs classements/indexations decimales autorises en parametrage if ($indexint->name_pclass) { $disp_indexint = "[" . $indexint->name_pclass . "] " . $disp_indexint; } } $ptab[6] = str_replace('!!indexint!!', htmlentities($disp_indexint, ENT_QUOTES, $charset), $ptab[6]); $ptab[6] = str_replace('!!num_pclass!!', $indexint->id_pclass, $ptab[6]); } else { $ptab[6] = str_replace('!!indexint!!', '', $ptab[6]); $ptab[6] = str_replace('!!num_pclass!!', '', $ptab[6]); } // indexation libre $ptab[6] = str_replace('!!f_indexation!!', htmlentities($this->index_l, ENT_QUOTES, $charset), $ptab[6]); global $pmb_keyword_sep; //if (!$pmb_keyword_sep) $pmb_keyword_sep=" "; $sep = "'{$pmb_keyword_sep}'"; if (!$pmb_keyword_sep) { $sep = "' '"; } if (ord($pmb_keyword_sep) == 0xa || ord($pmb_keyword_sep) == 0xd) { $sep = $msg['catalogue_saut_de_ligne']; } $ptab[6] = str_replace("!!sep!!", htmlentities($sep, ENT_QUOTES, $charset), $ptab[6]); // Indexation concept if ($thesaurus_concepts_active == 1) { $index_concept = new index_concept($this->id, TYPE_NOTICE); $ptab[6] = str_replace('!!index_concept_form!!', $index_concept->get_form("notice"), $ptab[6]); } else { $ptab[6] = str_replace('!!index_concept_form!!', "", $ptab[6]); } $form_notice = str_replace('!!tab6!!', $ptab[6], $form_notice); // mise a jour de l'onglet 7 : langues // langues repetables if (sizeof($this->langues) == 0) { $max_lang = 1; } else { $max_lang = sizeof($this->langues); } for ($i = 0; $i < $max_lang; $i++) { if ($i) { $ptab_lang = str_replace('!!ilang!!', $i, $ptab[701]); } else { $ptab_lang = str_replace('!!ilang!!', $i, $ptab[70]); } if (sizeof($this->langues) == 0) { $ptab_lang = str_replace('!!lang_code!!', '', $ptab_lang); $ptab_lang = str_replace('!!lang!!', '', $ptab_lang); } else { $ptab_lang = str_replace('!!lang_code!!', $this->langues[$i]["lang_code"], $ptab_lang); $ptab_lang = str_replace('!!lang!!', htmlentities($this->langues[$i]["langue"], ENT_QUOTES, $charset), $ptab_lang); } $lang_repetables .= $ptab_lang; } $ptab[7] = str_replace('!!max_lang!!', $max_lang, $ptab[7]); $ptab[7] = str_replace('!!langues_repetables!!', $lang_repetables, $ptab[7]); // langues originales repetables if (sizeof($this->languesorg) == 0) { $max_langorg = 1; } else { $max_langorg = sizeof($this->languesorg); } for ($i = 0; $i < $max_langorg; $i++) { if ($i) { $ptab_lang = str_replace('!!ilangorg!!', $i, $ptab[711]); } else { $ptab_lang = str_replace('!!ilangorg!!', $i, $ptab[71]); } if (sizeof($this->languesorg) == 0) { $ptab_lang = str_replace('!!langorg_code!!', '', $ptab_lang); $ptab_lang = str_replace('!!langorg!!', '', $ptab_lang); } else { $ptab_lang = str_replace('!!langorg_code!!', $this->languesorg[$i]["lang_code"], $ptab_lang); $ptab_lang = str_replace('!!langorg!!', htmlentities($this->languesorg[$i]["langue"], ENT_QUOTES, $charset), $ptab_lang); } $langorg_repetables .= $ptab_lang; } $ptab[7] = str_replace('!!max_langorg!!', $max_langorg, $ptab[7]); $ptab[7] = str_replace('!!languesorg_repetables!!', $langorg_repetables, $ptab[7]); $form_notice = str_replace('!!tab7!!', $ptab[7], $form_notice); // mise a jour de l'onglet 8 global $pmb_curl_timeout; $ptab[8] = str_replace('!!lien!!', htmlentities($this->lien, ENT_QUOTES, $charset), $ptab[8]); $ptab[8] = str_replace('!!eformat!!', htmlentities($this->eformat, ENT_QUOTES, $charset), $ptab[8]); $ptab[8] = str_replace('!!pmb_curl_timeout!!', $pmb_curl_timeout, $ptab[8]); $form_notice = str_replace('!!tab8!!', $ptab[8], $form_notice); //Mise a jour de l'onglet 9 $p_perso = new parametres_perso("notices"); if (!$p_perso->no_special_fields) { // si on duplique, construire le formulaire avec les donnees de la notice d'origine if ($this->duplicate_from_id) { $perso_ = $p_perso->show_editable_fields($this->duplicate_from_id); } else { $perso_ = $p_perso->show_editable_fields($this->id); } $perso = ""; for ($i = 0; $i < 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\t\t<div class='row'><label for='" . $p["NAME"] . "' class='etiquette'>" . htmlentities($p["TITRE"], ENT_QUOTES, $charset) . "</label>" . $p["COMMENT_DISPLAY"] . "</div>\n\t\t\t\t\t\t\t\t<div class='row'>" . $p["AFF"] . "</div>\n\t\t\t\t\t\t\t </div>"; } $perso .= $perso_["CHECK_SCRIPTS"]; $ptab[9] = str_replace("!!champs_perso!!", $perso, $ptab[9]); } else { $ptab[9] = "\n<script>function check_form() { return true; }</script>\n"; } $form_notice = str_replace('!!tab9!!', $ptab[9], $form_notice); //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 = $ptab[130]; } else { $pattern_rel = $ptab[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 = ''; if ($this->id) { 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>'; } } } else { foreach ($liste_type_relation_up->table as $key => $val) { if ($key . '-up' == $value_deflt_relation) { $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 = ''; if ($this->id) { 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>'; } } } else { foreach ($liste_type_relation_down->table as $key => $val) { if ($key . '-down' == $value_deflt_relation) { $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]); } if ($this->id) { foreach ($liste_type_relation_both['down'] as $key => $val) { $opts .= '<option style="color:#000000" value="' . $key . '-down">' . $val . '</option>'; } } else { foreach ($liste_type_relation_both['down'] as $key => $val) { if ($key . '-down' == $value_deflt_relation) { $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++; } } if (!$n_rel) { $pattern_rel = $ptab[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) { $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) { $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) { $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++; } //Nombre de relations $ptab[13] = str_replace("!!max_rel!!", $n_rel, $ptab[13]); //Liens multiples $ptab[13] = str_replace("!!notice_relations!!", $string_relations, $ptab[13]); $form_notice = str_replace('!!tab11!!', $ptab[13], $form_notice); // 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->statut, "", "", "", "", 0); $ptab[10] = str_replace('!!notice_statut!!', $select_statut, $ptab[10]); if ($this->is_new) { $ptab[10] = str_replace('!!checked_yes!!', "checked", $ptab[10]); $ptab[10] = str_replace('!!checked_no!!', "", $ptab[10]); } else { $ptab[10] = str_replace('!!checked_no!!', "checked", $ptab[10]); $ptab[10] = str_replace('!!checked_yes!!', "", $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]); 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]); if ($this->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<label for='notice_date_crea' class='etiquette'>" . $msg["noti_crea_date"] . "</label> " . $create_date->format('d/m/Y H:i:s') . "\n\t\t\t \t<br>\n\t\t\t \t <label for='notice_date_mod' class='etiquette'>" . $msg["noti_mod_date"] . "</label> " . $update_date->format('d/m/Y H:i:s'); $ptab[10] = str_replace('!!dates_notice!!', $dates_notices, $ptab[10]); } else { $ptab[10] = str_replace('!!dates_notice!!', "", $ptab[10]); } //affichage des formulaires des droits d'acces $rights_form = $this->get_rights_form(); $ptab[10] = str_replace('<!-- rights_form -->', $rights_form, $ptab[10]); // langue de la notice global $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); $form_notice = str_replace('!!tab10!!', $ptab[10], $form_notice); // autorité personnalisées $authperso = new authperso_notice($this->id); $authperso_tpl = $authperso->get_form(); $form_notice = str_replace('!!authperso!!', $authperso_tpl, $form_notice); $form_notice = str_replace('!!tab10!!', $ptab[10], $form_notice); // map if ($pmb_map_activate) { if ($this->duplicate_from_id) { $map_edition = new map_edition_controler(TYPE_RECORD, $this->duplicate_from_id); } else { $map_edition = new map_edition_controler(TYPE_RECORD, $this->id); } $map_form = $map_edition->get_form(); if ($this->duplicate_from_id) { $map_info = new map_info($this->duplicate_from_id); } else { $map_info = new map_info($this->id); } $map_form_info = $map_info->get_form(); $map_notice_form = $ptab[14]; $map_notice_form = str_replace('!!notice_map!!', $map_form . $map_form_info, $map_notice_form); $form_notice = str_replace('!!tab14!!', $map_notice_form, $form_notice); } else { $form_notice = str_replace('!!tab14!!', "", $form_notice); } // Nomenclature if ($pmb_nomenclature_activate) { $nomenclature = new nomenclature_record_ui($this->id); $nomenclature_notice_form = $ptab[15]; $nomenclature_notice_form = str_replace('!!nomenclature_form!!', $nomenclature->get_form(), $nomenclature_notice_form); $form_notice = str_replace('!!tab15!!', $nomenclature_notice_form, $form_notice); } else { $form_notice = str_replace('!!tab15!!', "", $form_notice); } // definition 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->type_doc, "get_pos(); expandAll(); ajax_parse_dom(); if (inedit) move_parse_dom(relative); else initIt();"); $form_notice = str_replace('!!doc_type!!', $select_doc->display, $form_notice); $form_notice = str_replace('!!notice_id_no_replace!!', $this->id, $form_notice); // Ajout des localisations pour edition $select_loc = ""; if ($PMBuserid == 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(); expandAll(); if (inedit) move_parse_dom(relative); else initIt();\">\n"; $select_loc .= "<option value='0'>" . $msg['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"; } } $form_notice = str_replace("!!location!!", $select_loc, $form_notice); // affichage du lien pour suppression et du lien d'annulation if ($this->id) { $link_supp = "\n\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\tfunction confirm_delete() {\n\t\t\t\t\t\tresult = confirm(\"{$msg[confirm_suppr_notice]}\");\n\t\t\t \t\tif(result) {\n\t\t\t \t\t\tunload_off();\n\t\t\t \t\tdocument.location = './catalog.php?categ=delete&id=" . $this->id . "'\n\t\t\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=\"confirm_delete();\" />"; $link_annul = "<input type='button' class='bouton' value=\"{$msg[76]}\" onClick=\"unload_off();history.go(-1);\" />"; $link_remplace = "<input type='button' class='bouton' value='{$msg['158']}' onclick='unload_off();document.location=\"./catalog.php?categ=remplace&id=" . $this->id . "\"' />"; $link_duplicate = "<input type='button' class='bouton' value='{$msg['notice_duplicate_bouton']}' onclick='unload_off();document.location=\"./catalog.php?categ=duplicate&id=" . $this->id . "\"' />"; if ($z3950_accessible) { $link_z3950 = "<input type='button' class='bouton' value='{$msg['notice_z3950_update_bouton']}' onclick='unload_off();document.location=\"./catalog.php?categ=z3950&id_notice=" . $this->id . "&isbn=" . $this->code . "\"' />"; } else { $link_z3950 = ""; } if ($pmb_type_audit) { $link_audit = "<input class='bouton' type='button' onClick=\"openPopUp('./audit.php?type_obj=1&object_id={$this->id}', 'audit_popup', 700, 500, -2, -2, '{$select_categ_prop}')\" title='{$msg['audit_button']}' value='{$msg['audit_button']}' />"; } else { $link_audit = ""; } } else { $link_supp = ""; $link_remplace = ""; $link_duplicate = ""; $link_z3950 = ""; $link_audit = ""; // if ($this->notice_mere_id || $this->duplicate_from_id) $link_annul = "<input type='button' class='bouton' value=\"{$msg[76]}\" onClick=\"unload_off();history.go(-1);\" />"; if ($this->notice_link['up'][0]['id_notice'] || $this->duplicate_from_id) { $link_annul = "<input type='button' class='bouton' value=\"{$msg[76]}\" onClick=\"unload_off();history.go(-1);\" />"; } else { $link_annul = "<input type='button' class='bouton' value=\"{$msg[76]}\" onClick=\"unload_off();document.location='" . $this->link_annul . "';\" />"; } } $form_notice = str_replace('!!link_supp!!', $link_supp, $form_notice); $form_notice = str_replace('!!link_annul!!', $link_annul, $form_notice); $form_notice = str_replace('!!link_remplace!!', $link_remplace, $form_notice); $form_notice = str_replace('!!link_duplicate!!', $link_duplicate, $form_notice); $form_notice = str_replace('!!link_z3950!!', $link_z3950, $form_notice); $form_notice = str_replace('!!link_audit!!', $link_audit, $form_notice); return $form_notice; }
function show_form() { global $msg; global $publisher_form; global $charset; global $pmb_type_audit; global $thesaurus_concepts_active; if ($this->id) { $action = "./autorites.php?categ=editeurs&sub=update&id={$this->id}"; $libelle = $msg[148]; $button_remplace = "<input type='button' class='bouton' value='{$msg['158']}' "; $button_remplace .= "onclick='unload_off();document.location=\"./autorites.php?categ=editeurs&sub=replace&id={$this->id}\"'>"; $button_voir = "<input type='button' class='bouton' value='{$msg['voir_notices_assoc']}' "; $button_voir .= "onclick='unload_off();document.location=\"./catalog.php?categ=search&mode=2&etat=aut_search&aut_type=publisher&aut_id={$this->id}\"'>"; $button_delete = "<input type='button' class='bouton' value='{$msg['63']}' "; $button_delete .= "onClick=\"confirm_delete();\">"; } else { $action = './autorites.php?categ=editeurs&sub=update&id='; $libelle = $msg[145]; $button_remplace = ''; $button_delete = ''; } $aut_link = new aut_link(AUT_TABLE_PUBLISHERS, $this->id); $publisher_form = str_replace('<!-- aut_link -->', $aut_link->get_form('saisie_editeur'), $publisher_form); $aut_pperso = new aut_pperso("publisher", $this->id); $publisher_form = str_replace('!!aut_pperso!!', $aut_pperso->get_form(), $publisher_form); $publisher_form = str_replace('!!libelle!!', $libelle, $publisher_form); $publisher_form = str_replace('!!action!!', $action, $publisher_form); $publisher_form = str_replace('!!id!!', $this->id, $publisher_form); $publisher_form = str_replace('!!ed_nom!!', htmlentities($this->name, ENT_QUOTES, $charset), $publisher_form); $publisher_form = str_replace('!!ed_adr1!!', htmlentities($this->adr1, ENT_QUOTES, $charset), $publisher_form); $publisher_form = str_replace('!!ed_adr2!!', htmlentities($this->adr2, ENT_QUOTES, $charset), $publisher_form); $publisher_form = str_replace('!!ed_cp!!', htmlentities($this->cp, ENT_QUOTES, $charset), $publisher_form); $publisher_form = str_replace('!!ed_ville!!', htmlentities($this->ville, ENT_QUOTES, $charset), $publisher_form); $publisher_form = str_replace('!!ed_pays!!', htmlentities($this->pays, ENT_QUOTES, $charset), $publisher_form); $publisher_form = str_replace('!!ed_web!!', htmlentities($this->web, ENT_QUOTES, $charset), $publisher_form); $publisher_form = str_replace('!!remplace!!', $button_remplace, $publisher_form); $publisher_form = str_replace('!!voir_notices!!', $button_voir, $publisher_form); $publisher_form = str_replace('!!delete!!', $button_delete, $publisher_form); // pour retour a la bonne page en gestion d'autorites // &user_input=".rawurlencode(stripslashes($user_input))."&nbr_lignes=$nbr_lignes&page=$page global $user_input, $nbr_lignes, $page; $publisher_form = str_replace('!!user_input_url!!', rawurlencode(stripslashes($user_input)), $publisher_form); $publisher_form = str_replace('!!user_input!!', htmlentities($user_input, ENT_QUOTES, $charset), $publisher_form); $publisher_form = str_replace('!!nbr_lignes!!', $nbr_lignes, $publisher_form); $publisher_form = str_replace('!!page!!', $page, $publisher_form); $publisher_form = str_replace('!!ed_comment!!', $this->ed_comment, $publisher_form); if ($thesaurus_concepts_active == 1) { $index_concept = new index_concept($this->id, TYPE_PUBLISHER); $publisher_form = str_replace('!!concept_form!!', $index_concept->get_form('saisie_editeur'), $publisher_form); } else { $publisher_form = str_replace('!!concept_form!!', "", $publisher_form); } if ($pmb_type_audit && $this->id) { $bouton_audit = " <input class='bouton' type='button' onClick=\"openPopUp('./audit.php?type_obj=" . AUDIT_PUBLISHER . "&object_id=" . $this->id . "', 'audit_popup', 700, 500, -2, -2, 'scrollbars=yes, toolbar=no, dependent=yes, resizable=yes')\" title=\"" . $msg['audit_button'] . "\" value=\"" . $msg['audit_button'] . "\" /> "; } $publisher_form = str_replace('!!audit_bt!!', $bouton_audit, $publisher_form); print $publisher_form; }
function show_form($type_autorite = 70) { global $msg; global $author_form; global $dbh; global $charset; global $pmb_type_audit; global $thesaurus_concepts_active; $liste_renvoyes = ""; if ($this->id) { $action = "./autorites.php?categ=auteurs&sub=update&id={$this->id}"; $libelle = $msg[199]; $button_remplace = "<input type='button' class='bouton' value='{$msg['158']}' "; $button_remplace .= "onclick='unload_off();document.location=\"./autorites.php?categ=auteurs&sub=replace&id={$this->id}\"'>"; $button_voir = "<input type='button' class='bouton' value='{$msg['voir_notices_assoc']}' "; $button_voir .= "onclick='unload_off();document.location=\"./catalog.php?categ=search&mode=0&etat=aut_search&aut_id={$this->id}\"'>"; $button_delete = "<input type='button' class='bouton' value='{$msg['63']}' "; $button_delete .= "onClick=\"confirm_delete();\">"; $requete = "SELECT * FROM authors WHERE "; $requete .= "author_see = '{$this->id}' "; $requete .= "ORDER BY author_name, author_rejete "; $res = @pmb_mysql_query($requete, $dbh); $nbr_lignes = pmb_mysql_num_rows($res); if ($nbr_lignes) { $liste_renvoyes = "<br /><div class='row'><h3>{$msg['aut_list_renv_titre']}</h3><table>"; $parity = 1; while ($author_renvoyes = pmb_mysql_fetch_object($res)) { $author_renvoyes->author_name = $author_renvoyes->author_name; $author_renvoyes->author_rejete = $author_renvoyes->author_rejete; if ($author_renvoyes->author_rejete) { $author_entry = $author_renvoyes->author_name . ', ' . $author_renvoyes->author_rejete; } else { $author_entry = $author_renvoyes->author_name; } if ($author_renvoyes->author_date) { $author_entry .= " ({$author_renvoyes->author_date})"; } $link_auteur = "./autorites.php?categ=auteurs&sub=author_form&id={$author_renvoyes->author_id}"; if ($parity % 2) { $pair_impair = "even"; } else { $pair_impair = "odd"; } $parity += 1; $tr_javascript = " onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='{$pair_impair}'\" onmousedown=\"document.location='{$link_auteur}';\" "; $liste_renvoyes .= "<tr class='{$pair_impair}' {$tr_javascript} style='cursor: pointer'>\n\t\t\t\t\t\t\t\t\t<td valign='top'>\n\t\t\t\t\t\t\t\t{$author_entry}\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>"; } // fin while $liste_renvoyes .= "</table></div>"; } } else { $action = './autorites.php?categ=auteurs&sub=update&id='; $libelle = $msg[207]; $button_remplace = ''; $button_delete = ''; } // Si on est en modif ou non if (!$this->id) { $this->type = $type_autorite; $author_form = str_replace('!!dupliquer!!', "", $author_form); } // mise à jour de la zone type switch ($this->type) { case 71: $sel_coll = " SELECTED"; // Si on est en modif ou non if ($this->id) { $libelle = $msg["aut_modifier_coll"]; $bouton_dupliquer = "<input type='button' id='dupli_btn' value='" . $msg["aut_duplicate"] . "' class='bouton' onClick='unload_off();document.location=\"./autorites.php?categ=auteurs&sub=duplicate&type_autorite=" . $this->type . "&id=" . $this->id . "\"'/>"; $author_form = str_replace('!!dupliquer!!', $bouton_dupliquer, $author_form); } else { $libelle = $msg["aut_ajout_collectivite"]; } $completion_name = "collectivite_name"; break; case 72: // Si on est en modif ou non if ($this->id) { $libelle = $msg["aut_modifier_congres"]; $bouton_dupliquer = "<input type='button' id='dupli_btn' value='" . $msg["aut_duplicate"] . "' class='bouton' onClick='unload_off();document.location=\"./autorites.php?categ=auteurs&sub=duplicate&type_autorite=" . $this->type . "&id=" . $this->id . "\"'/>"; $author_form = str_replace('!!dupliquer!!', $bouton_dupliquer, $author_form); } else { $libelle = $msg["aut_ajout_congres"]; } $sel_congres = " SELECTED"; $completion_name = "congres_name"; break; default: $author_form = str_replace('!!display!!', "display:none", $author_form); $author_form = str_replace('!!dupliquer!!', "", $author_form); $sel_pp = " SELECTED"; $completion_name = " "; break; } if ($this->import_denied == 1) { $import_denied_checked = "checked='checked'"; } else { $import_denied_checked = ""; } if ($pmb_type_audit && $this->id) { $bouton_audit = " <input class='bouton' type='button' onClick=\"openPopUp('./audit.php?type_obj=" . AUDIT_AUTHOR . "&object_id=" . $this->id . "', 'audit_popup', 700, 500, -2, -2, 'scrollbars=yes, toolbar=no, dependent=yes, resizable=yes')\" title=\"" . $msg['audit_button'] . "\" value=\"" . $msg['audit_button'] . "\" /> "; } $aut_link = new aut_link(AUT_TABLE_AUTHORS, $this->id); $author_form = str_replace('<!-- aut_link -->', $aut_link->get_form('saisie_auteur'), $author_form); $aut_link = new aut_link(AUT_TABLE_AUTHORS, $this->id); $author_form = str_replace('<!-- aut_link -->', $aut_link->get_form('saisie_auteur'), $author_form); $aut_pperso = new aut_pperso("author", $this->id); $author_form = str_replace('!!aut_pperso!!', $aut_pperso->get_form(), $author_form); $author_form = str_replace('!!id!!', $this->id, $author_form); $author_form = str_replace('!!action!!', $action, $author_form); $author_form = str_replace('!!libelle!!', $libelle, $author_form); $author_form = str_replace('!!author_nom!!', htmlentities($this->name, ENT_QUOTES, $charset), $author_form); $author_form = str_replace('!!author_rejete!!', htmlentities($this->rejete, ENT_QUOTES, $charset), $author_form); $author_form = str_replace('!!voir_id!!', $this->see, $author_form); $author_form = str_replace('!!voir_libelle!!', htmlentities($this->see_libelle, ENT_QUOTES, $charset), $author_form); $author_form = str_replace('!!date!!', htmlentities($this->date, ENT_QUOTES, $charset), $author_form); $author_form = str_replace('!!lieu!!', htmlentities($this->lieu, ENT_QUOTES, $charset), $author_form); $author_form = str_replace('!!ville!!', htmlentities($this->ville, ENT_QUOTES, $charset), $author_form); $author_form = str_replace('!!pays!!', htmlentities($this->pays, ENT_QUOTES, $charset), $author_form); $author_form = str_replace('!!subdivision!!', htmlentities($this->subdivision, ENT_QUOTES, $charset), $author_form); $author_form = str_replace('!!numero!!', htmlentities($this->numero, ENT_QUOTES, $charset), $author_form); $author_form = str_replace('!!author_web!!', htmlentities($this->author_web, ENT_QUOTES, $charset), $author_form); $author_form = str_replace('!!sel_pp!!', $sel_pp, $author_form); $author_form = str_replace('!!sel_coll!!', $sel_coll, $author_form); $author_form = str_replace('!!sel_congres!!', $sel_congres, $author_form); $author_form = str_replace('!!remplace!!', $button_remplace, $author_form); $author_form = str_replace('!!voir_notices!!', $button_voir, $author_form); $author_form = str_replace('!!delete!!', $button_delete, $author_form); $author_form = str_replace('!!liste_des_renvoyes_vers!!', $liste_renvoyes, $author_form); $author_form = str_replace('!!completion_name!!', $completion_name, $author_form); $author_form = str_replace('!!type_autorite!!', $this->type, $author_form); // pour retour à la bonne page en gestion d'autorités // &user_input=".rawurlencode(stripslashes($user_input))."&nbr_lignes=$nbr_lignes&page=$page global $user_input, $nbr_lignes, $page; $author_form = str_replace('!!user_input_url!!', rawurlencode(stripslashes($user_input)), $author_form); $author_form = str_replace('!!user_input!!', htmlentities($user_input, ENT_QUOTES, $charset), $author_form); $author_form = str_replace('!!nbr_lignes!!', "", $author_form); $author_form = str_replace('!!page!!', $page, $author_form); $author_form = str_replace('!!author_comment!!', $this->author_comment, $author_form); $author_form = str_replace('!!author_import_denied!!', $import_denied_checked, $author_form); $author_form = str_replace('!!aut_pperso!!', $aut_pperso->get_form(), $author_form); $author_form = str_replace('!!audit_bt!!', $bouton_audit, $author_form); if ($thesaurus_concepts_active == 1) { $index_concept = new index_concept($this->id, TYPE_AUTHOR); $author_form = str_replace('!!concept_form!!', $index_concept->get_form('saisie_auteur'), $author_form); } else { $author_form = str_replace('!!concept_form!!', "", $author_form); } print $author_form; }
function bul_do_form($obj, $bul_id = 0) { // $obj = objet contenant les propriétés de l'exemplaire associé global $bul_expl_form; global $msg; // pour texte du bouton supprimer global $dbh; global $pmb_type_audit, $select_categ_prop; global $pmb_antivol; global $option_num_auto; global $pmb_rfid_activate, $pmb_rfid_serveur_url, $charset; global $pmb_expl_show_dates, $pmb_expl_show_lastempr; global $thesaurus_concepts_active; if (isset($option_num_auto)) { $requete = "DELETE from exemplaires_temp where sess not in (select SESSID from sessions)"; $res = pmb_mysql_query($requete, $dbh); //Appel à la fonction de génération automatique de cb $code_exemplaire = init_gen_code_exemplaire(0, $obj->expl_bulletin); do { $code_exemplaire = gen_code_exemplaire(0, $obj->expl_bulletin, $code_exemplaire); $requete = "select expl_cb from exemplaires WHERE expl_cb='{$code_exemplaire}'"; $res0 = pmb_mysql_query($requete, $dbh); $requete = "select cb from exemplaires_temp WHERE cb='{$code_exemplaire}' AND sess <>'" . SESSid . "'"; $res1 = pmb_mysql_query($requete, $dbh); } while (pmb_mysql_num_rows($res0) || pmb_mysql_num_rows($res1)); //Memorise dans temps le cb et la session pour le cas de multi utilisateur session $obj->expl_cb = $code_exemplaire; $requete = "INSERT INTO exemplaires_temp (cb ,sess) VALUES ('{$obj->expl_cb}','" . SESSid . "')"; $res = pmb_mysql_query($requete, $dbh); } //on compte le nombre de prets pour cet exemplaire $req = "select count(arc_expl_id) as nb_prets from pret_archive where arc_expl_id = " . $obj->expl_id; $res = pmb_mysql_query($req); if (pmb_mysql_num_rows($res)) { $arch_pret = pmb_mysql_fetch_object($res); $nb_prets = $arch_pret->nb_prets; } else { $nb_prets = 0; } if ($nb_prets) { //dernière date de pret pour cet exemplaire $req = "select date_format(last_loan_date, '" . $msg["format_date"] . "') as date_last from exemplaires where expl_id = " . $obj->expl_id; $res = pmb_mysql_query($req); if (pmb_mysql_num_rows($res)) { $expl_pret = pmb_mysql_fetch_object($res); $date_last = $expl_pret->date_last; $info_nb_prets = str_replace("!!nb_prets!!", $nb_prets, $msg['expl_nbprets']); $query = "select count(pret_idexpl) "; $query .= "from pret, empr where pret_idexpl='" . $obj->expl_id . "' and pret_idempr=id_empr "; $result = pmb_mysql_query($query, $dbh); if ($result && pmb_mysql_result($result, 0, 0)) { $info_date_last = str_replace("!!date_last!!", $date_last, $msg['expl_lastpret_encours']); } else { $info_date_last = str_replace("!!date_last!!", $date_last, $msg['expl_lastpret_retour']); } print $info_nb_prets . " " . $info_date_last; } } // l'annulation du form renvoit à : $annuler = "./catalog.php?categ=serials&sub=bulletinage&action=view&bul_id=" . $obj->expl_bulletin; $action = "./catalog.php?categ=serials&sub=bulletinage&action=expl_update"; $expl_nbparts = $obj->expl_cb; if (!$obj->expl_nbparts) { $expl_nbparts = 1; } else { $expl_nbparts = $obj->expl_nbparts; } // mise à jour des champs de gestion $bul_expl_form = str_replace('!!bul_id!!', $obj->expl_bulletin, $bul_expl_form); $bul_expl_form = str_replace('!!id_form!!', md5(microtime()), $bul_expl_form); $bul_expl_form = str_replace('!!org_cb!!', htmlentities($obj->expl_cb, ENT_QUOTES, $charset), $bul_expl_form); $bul_expl_form = str_replace('!!expl_id!!', $obj->expl_id, $bul_expl_form); $bul_expl_form = str_replace('!!action!!', $action, $bul_expl_form); $bul_expl_form = str_replace('!!id!!', $obj->expl_notice, $bul_expl_form); $bul_expl_form = str_replace('!!cb!!', htmlentities($obj->expl_cb, ENT_QUOTES, $charset), $bul_expl_form); $bul_expl_form = str_replace('!!nbparts!!', htmlentities($expl_nbparts, ENT_QUOTES, $charset), $bul_expl_form); $bul_expl_form = str_replace('!!note!!', $obj->expl_note, $bul_expl_form); $bul_expl_form = str_replace('!!comment!!', $obj->expl_comment, $bul_expl_form); $bul_expl_form = str_replace('!!cote!!', $obj->expl_cote, $bul_expl_form); $bul_expl_form = str_replace('!!prix!!', $obj->expl_prix, $bul_expl_form); // select "type document" $bul_expl_form = str_replace('!!type_doc!!', do_selector('docs_type', 'expl_typdoc', $obj->expl_typdoc), $bul_expl_form); // select "section" $bul_expl_form = str_replace('!!section!!', do_selector_bul_section($obj->expl_section, $obj->expl_location), $bul_expl_form); // select "statut" $bul_expl_form = str_replace('!!statut!!', do_selector('docs_statut', 'expl_statut', $obj->expl_statut), $bul_expl_form); // select "localisation" //visibilité des exemplaires global $explr_visible_mod, $pmb_droits_explr_localises; if ($pmb_droits_explr_localises) { $where_clause_explr = "idlocation in (" . $explr_visible_mod . ") and"; } else { $where_clause_explr = ""; } $bul_expl_form = str_replace('!!localisation!!', gen_liste("select distinct idlocation, location_libelle from docs_location, docsloc_section where {$where_clause_explr} num_location=idlocation order by 2", "idlocation", "location_libelle", 'expl_location', "calcule_section(this);", $obj->expl_location, "", "", "", "", 0), $bul_expl_form); // select "code statistique" $bul_expl_form = str_replace('!!codestat!!', do_selector('docs_codestat', 'expl_codestat', $obj->expl_codestat), $bul_expl_form); // select "owner" $bul_expl_form = str_replace('!!owner!!', do_selector('lenders', 'expl_owner', $obj->expl_owner), $bul_expl_form); //dates creation / modification if ($obj->expl_id && ($pmb_expl_show_dates == '1' || $pmb_expl_show_dates == '3')) { $bul_expl_form = str_replace('<!-- msg_exp_cre_date -->', "<label class='etiquette' >" . htmlentities($msg['exp_cre_date'], ENT_QUOTES, $charset) . "</label>", $bul_expl_form); $bul_expl_form = str_replace('<!-- exp_cre_date -->', format_date($obj->create_date), $bul_expl_form); $bul_expl_form = str_replace('<!-- msg_exp_upd_date -->', "<label class='etiquette' >" . htmlentities($msg['exp_upd_date'], ENT_QUOTES, $charset) . "</label>", $bul_expl_form); $bul_expl_form = str_replace('<!-- exp_upd_date -->', format_date($obj->update_date), $bul_expl_form); } //dates dépôt / retour if ($obj->expl_id && ($pmb_expl_show_dates == '2' || $pmb_expl_show_dates == '3')) { $bul_expl_form = str_replace('<!-- msg_exp_filing_date -->', "<label class='etiquette' >" . htmlentities($msg['filing_date'], ENT_QUOTES, $charset) . "</label>", $bul_expl_form); $bul_expl_form = str_replace('<!-- exp_filing_date -->', format_date($obj->expl_date_depot), $bul_expl_form); $bul_expl_form = str_replace('<!-- msg_exp_return_date -->', "<label class='etiquette' >" . htmlentities($msg['return_date'], ENT_QUOTES, $charset) . "</label>", $bul_expl_form); $bul_expl_form = str_replace('<!-- exp_return_date -->', format_date($obj->expl_date_retour), $bul_expl_form); } // Indexation concept if ($thesaurus_concepts_active == 1) { $index_concept = new index_concept($obj->expl_id, TYPE_EXPL); $bul_expl_form = str_replace('<!-- index_concept_form -->', $index_concept->get_form("expl"), $bul_expl_form); } // select "type_antivol" $selector = ""; if ($pmb_antivol > 0) { global $value_deflt_antivol; if ($obj->type_antivol == "") { $obj->type_antivol = $value_deflt_antivol; } // select "type_antivol" $selector = "\n\t\t<div class='colonne3'>\n\t\t<!-- code stat -->\n\t\t<label class='etiquette' for='type_antivol'>{$msg['type_antivol']}</label>\n\t\t<div class='row'>\n\t\t<select name='type_antivol' id='type_antivol'>"; $selector .= "<option value='0'"; if ($obj->type_antivol == 0) { $selector .= ' SELECTED'; } $selector .= '>'; $selector .= $msg["type_antivol_aucun"] . '</option>'; $selector .= "<option value='1'"; if ($obj->type_antivol == 1) { $selector .= ' SELECTED'; } $selector .= '>'; $selector .= $msg["type_antivol_magnetique"] . '</option>'; $selector .= "<option value='2'"; if ($obj->type_antivol == 2) { $selector .= ' SELECTED'; } $selector .= '>'; $selector .= $msg["type_antivol_autre"] . '</option>'; $selector .= '</select></div></div>'; } $bul_expl_form = str_replace('!!type_antivol!!', $selector, $bul_expl_form); $p_perso = new parametres_perso("expl"); if (!$p_perso->no_special_fields) { $c = 0; $perso = "<hr />"; global $expl_id_from; if ($expl_id_from && !$obj->expl_id) { $perso_id_expl = $expl_id_from; } elseif ($obj->expl_id) { $perso_id_expl = $obj->expl_id; } else { $perso_id_expl = 0; } $perso_ = $p_perso->show_editable_fields($perso_id_expl); for ($i = 0; $i < count($perso_["FIELDS"]); $i++) { $p = $perso_["FIELDS"][$i]; if ($c == 0) { $perso .= "<div class='row'>\n"; } $perso .= "<div class='colonne2'><label for='" . $p["NAME"] . "' class='etiquette'>" . $p["TITRE"] . " </label>" . $p["COMMENT_DISPLAY"] . "<div class='row'>" . $p["AFF"] . "</div></div>\n"; $c++; if ($c == 2) { $perso .= "</div>\n"; $c = 0; } } if ($c == 1) { $perso .= "<div class='colonne2'> </div>\n</div>\n"; } $perso = $perso_["CHECK_SCRIPTS"] . "\n" . $perso; $perso = "<div class='row'>" . $perso . "</div>"; } else { $perso = ""; } $bul_expl_form = str_replace("!!champs_perso!!", $perso, $bul_expl_form); // circulation des périodique $perio_circ_tpl = ""; $in_circ = 0; if ($obj->expl_id) { $req = "select * from serialcirc_expl where num_serialcirc_expl_id=" . $obj->expl_id; $res_in_circ = pmb_mysql_query($req); if (pmb_mysql_num_rows($res_in_circ)) { $in_circ = 1; $perio_circ_tpl = "<label class='etiquette'>" . $msg['serialcirc_expl_in_circ'] . "</label>"; } } if (!$in_circ) { $req = "select * from abts_abts, bulletins, serialcirc where abts_abts.num_notice =bulletin_notice and bulletin_id=" . $obj->expl_bulletin . " and num_serialcirc_abt=abt_id\n\t\torder by abt_name"; $res_circ = pmb_mysql_query($req); if ($nb = pmb_mysql_num_rows($res_circ)) { $perio_circ_tpl = "<input type='checkbox' name='serial_circ_add' value='1'> " . $msg['serialcirc_add_expl']; if ($nb > 1) { $perio_circ_tpl .= "<select name='abt_id'>"; } while ($circ = pmb_mysql_fetch_object($res_circ)) { if ($nb == 1) { $perio_circ_tpl .= "<input type='hidden' name='abt_id' value='" . $circ->abt_id . "' >"; break; } $perio_circ_tpl .= "<option value='" . $circ->abt_id . "'> " . htmlentities($circ->abt_name, ENT_QUOTES, $charset) . "</option>"; } if ($nb > 1) { $perio_circ_tpl .= "</select>"; } } } $bul_expl_form = str_replace("!!perio_circ_tpl!!", $perio_circ_tpl, $bul_expl_form); // bouton supprimer si modification if ($obj->expl_id) { $del_button = "<input type='button' class='bouton' value=' {$msg['63']} ' onClick=\"confirm_expl_delete();\">"; $bt_dupliquer = "<input type='button' class='bouton' value=\"" . $msg['dupl_expl_bt'] . "\" name='dupl_ex' id='dupl_ex' onClick=\"unload_off();document.location='./catalog.php?categ=serials&sub=bulletinage&action=dupl_expl&bul_id=" . $obj->expl_bulletin . "&expl_id=" . $obj->expl_id . "' ; \" />"; if ($pmb_type_audit) { $link_audit = "<input class='bouton' type='button' onClick=\"openPopUp('./audit.php?type_obj=2&object_id={$obj->expl_id}', 'audit_popup', 700, 500, -2, -2, '{$select_categ_prop}')\" title='{$msg['audit_button']}' value='{$msg['audit_button']}' />"; } else { $link_audit = ""; } } else { $del_button = ""; $link_audit = ""; $bt_dupliquer = ""; } //boutons selon droits $nex = new exemplaire($obj->cb, $obj->expl_id, $obj->notice, $obj->bulletin); if ($nex->explr_acces_autorise == "MODIF") { $bt_modifier = "<input type='submit' class='bouton' value=' {$msg['77']} ' onClick=\"return test_form(this.form)\" />"; } else { $bt_modifier = ""; $del_button = ""; $bt_dupliquer = ""; } if ($pmb_rfid_activate == 1 && $pmb_rfid_serveur_url) { $script_rfid_encode = "if(script_rfid_encode()==false) return false;"; $bul_expl_form = str_replace('!!questionrfid!!', $script_rfid_encode, $bul_expl_form); } else { $bul_expl_form = str_replace('!!questionrfid!!', '', $bul_expl_form); } $bul_expl_form = str_replace('!!del!!', $del_button, $bul_expl_form); $bul_expl_form = str_replace('!!link_audit!!', $link_audit, $bul_expl_form); $bul_expl_form = str_replace('!!bt_dupliquer!!', $bt_dupliquer, $bul_expl_form); $bul_expl_form = str_replace('!!bt_modifier!!', $bt_modifier, $bul_expl_form); $bul_expl_form = str_replace('!!bul_id!!', $bul_id, $bul_expl_form); $bul_expl_form = str_replace('!!expl_id!!', $obj->expl_id, $bul_expl_form); // action du bouton annuler $bul_expl_form = str_replace('!!annuler_action!!', $annuler, $bul_expl_form); // rafraichissement de la liste des sections par rapport à la localisation sélectionnée // $bul_expl_form .= "<script> calcule_section(document.forms['expl'].expl_location.options[document.forms['expl'].expl_location.selectedIndex].value); </script>"; // zone du dernier emrunteur $last_pret = ""; if ($pmb_expl_show_lastempr && $obj->expl_lastempr) { $lastempr = new emprunteur($obj->expl_lastempr, '', FALSE, 0); $last_pret = "<hr /><div class='row'><b>{$msg['expl_lastempr']} </b>"; $link = "<a href='./circ.php?categ=pret&form_cb=" . rawurlencode($lastempr->cb) . "'>"; $last_pret .= $link . $lastempr->prenom . ' ' . $lastempr->nom . ' (' . $lastempr->cb . ')</a>'; $last_pret .= "</div>"; } // zone de l'emprunteur $query = "select empr_cb, empr_nom, empr_prenom, "; $query .= " date_format(pret_date, '" . $msg["format_date"] . "') as aff_pret_date, "; $query .= " date_format(pret_retour, '" . $msg["format_date"] . "') as aff_pret_retour, "; $query .= " IF(pret_retour>sysdate(),0,1) as retard "; $query .= " from pret, empr where pret_idexpl='" . $obj->expl_id . "' and pret_idempr=id_empr "; $result = pmb_mysql_query($query, $dbh); if (pmb_mysql_num_rows($result)) { $pret = pmb_mysql_fetch_object($result); $last_pret .= "<hr /><div class='row'><b>{$msg['380']}</b> "; $link = "<a href='./circ.php?categ=pret&form_cb=" . rawurlencode($pret->empr_cb) . "'>"; $last_pret .= $link . $pret->empr_prenom . ' ' . $pret->empr_nom . ' (' . $pret->empr_cb . ')</a>'; $last_pret .= " {$msg[381]} " . $pret->aff_pret_date; $last_pret .= ". {$msg[358]} " . $pret->aff_pret_retour . "."; $last_pret .= "</div>"; } return $bul_expl_form . $last_pret; }
function fill_form(&$form, $action, $suppr = '') { global $charset; global $msg, $lang; global $pmb_scan_pmbws_client_url, $pmb_scan_pmbws_url; global $pmb_indexation_docnum, $dbh, $pmb_explnum_statut; global $b_mimetype; global $pmb_docnum_in_directory_allow, $pmb_docnum_in_database_allow; global $explnum_id; global $pmb_diarization_docnum; global $base_path; global $thesaurus_concepts_active; $form = str_replace('!!action!!', $action, $form); $form = str_replace('!!explnum_id!!', $this->explnum_id, $form); $form = str_replace('!!bulletin!!', $this->explnum_bulletin, $form); $form = str_replace('!!notice!!', $this->explnum_notice, $form); $form = str_replace('!!nom!!', htmlentities($this->explnum_nom, ENT_QUOTES, $charset), $form); $form = str_replace('!!url!!', htmlentities($this->explnum_url, ENT_QUOTES, $charset), $form); //Gestion de l'interface d'indexation if ($pmb_indexation_docnum) { $checkbox = "<div class='row'>\n\t\t\t\t \t\t<input type='checkbox' id='ck_index' value='1' name='ck_index' {$this->explnum_index} /><label for='ck_index'>{$msg['docnum_a_indexer']}</label>\t\n\t\t\t\t \t</div>\n\t\t\t\t "; if ($this->explnum_index_sew != '' && $this->explnum_index_wew != '') { $fct = "\n\t\t\t\t \t<script> function suppr_index(form){\n\t\t\t\t \t\t if(!form.ck_index.checked) {\n\t\t\t\t \t\t \tconf = confirm(\"" . $msg['docnum_suppr_index'] . "\");\n\t\t\t\t \t\t\treturn conf;\n\t\t\t\t \t\t } \n\t\t\t\t \t\t return true;\n\t\t\t\t \t}</script>\n\t\t\t\t \t"; $form = str_replace("!!submit_action!!", 'return suppr_index(this)', $form); } else { $fct = ""; $form = str_replace("!!submit_action!!", "return testing_file(" . $this->explnum_id . ");", $form); } $form = str_replace('!!ck_indexation!!', $checkbox . $fct, $form); } else { $form = str_replace("!!ck_indexation!!", "", $form); $form = str_replace("!!submit_action!!", "return testing_file(" . $this->explnum_id . ");", $form); } //Gestion de l'interface de segmentation if ($pmb_diarization_docnum) { $checkbox = "<div class='row'>\n\t\t\t\t \t\t<input type='checkbox' id='ck_diarization' value='1' name='ck_diarization' /><label for='ck_diarization'>" . $msg['diarize_explnum'] . "</label>\t\n\t\t\t\t \t</div>\n\t\t\t\t "; $form = str_replace('!!ck_diarization!!', $checkbox, $form); } else { $form = str_replace("!!ck_diarization!!", "", $form); } //Gestion du scanner if ($pmb_scan_pmbws_client_url && $pmb_scan_pmbws_url) { $scan_addon = "\n\t\t\t\t<script>function afterscan(format) {\n\t\t\t\t\tif (document.explnum.f_fichier) {\n\t\t\t\t\t\tsitxt=document.createElement('span');\n\t\t\t\t\t\tsitxt.setAttribute('id','scanned_image_txt');\n\t\t\t\t\t\tsitxt.className='erreur';\n\t\t\t\t\t\tdocument.explnum.f_fichier.parentNode.replaceChild(sitxt,document.explnum.f_fichier);\n\t\t\t\t\t}\n\t\t\t\t\tdocument.getElementById('scanned_image_txt').innerHTML='" . $msg["scan_image_recorded"] . "';\n\t\t\t\t\tdocument.getElementById('scanned_image_ext').value=format;\n\t\t\t\t}</script>\n\t\t\t\t<input type='button' value='" . $msg["scan_button"] . "' onClick='openPopUp(\"" . $pmb_scan_pmbws_client_url . "?scanfield=scanned_image&urlbase=" . rawurlencode($pmb_scan_pmbws_url) . "&scanform=explnum&callbackimage=afterscan&lang={$lang}&charset={$charset}\",\"scanWindow\",900,700,0,0,\"scrollbars=yes, resizable=yes\")' class='bouton'/>\n\t\t\t\t<input type='hidden' name='scanned_image_ext' id='scanned_image_ext' value=''/>\n\t\t\t\t<input type='hidden' name='scanned_image' value=''/>\n\t\t\t\t<input type='hidden' id='scanned_texte' name='scanned_texte' value=''/>"; $form = str_replace('<!-- !!scan_button!! -->', $scan_addon, $form); } // Ajout du bouton d'association s'il y a des segments en base $associer = ""; $fct = ""; if ($this->explnum_id) { $nb = 0; $query = "select count(*) as nb from explnum_segments where explnum_segment_explnum_num = " . $this->explnum_id; $result = pmb_mysql_query($query); if ($result && pmb_mysql_num_rows($result)) { $nb = pmb_mysql_fetch_object($result)->nb; } if ($nb > 0) { $associer = "<input type='button' class='bouton' value=\"" . $msg['associate_speakers'] . "\" name='associate_speakers' id='associate_speakers' onClick=\"document.location = '" . $base_path . "/catalog.php?categ=explnum_associate&explnum_id=" . $this->explnum_id . "';\" />"; if ($pmb_diarization_docnum) { // On ajoute une confirmation pour une deuxième segmentation => perte des associations $fct = "<script type='text/javascript'>\r\n\t\t\t\t\t\t\tfunction conf_diarize_again() {\r\n\t\t\t\t\t\t\t\tif (document.getElementById('ck_diarization').checked) {\r\n\t\t\t\t\t\t\t\t\tconf = confirm('" . addslashes($msg['explnum_associate_conf_diarize_again']) . "');\r\n\t\t\t\t\t\t\t\t\tif (!conf) {\n\t\t\t\t\t\t\t\t\t\tdocument.getElementById('ck_diarization').checked = false;\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdocument.getElementById('ck_diarization').addEventListener('change', conf_diarize_again, false);\r\n\t\t\t\t\t\t</script>"; } } } $form = str_replace("!!associate_speakers!!", $associer, $form); $form = str_replace("!!fct_conf_diarize_again!!", $fct, $form); $form = str_replace("!!rights_form!!", $this->get_rights_form(), $form); // Ajout du bouton supprimer si modification if ($this->explnum_id && $suppr) { $supprimer = "\n\t\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t function confirm_delete() {\n\t\t \t\t\tresult = confirm(\"{$msg["confirmdelete_explnum"]} ?\");\n\t\t \t\t\tif(result)\n\t\t \t\t\tdocument.location = \"{$suppr}\";\n\t\t \t\t\t}\n\t\t\t\t\t</script>\n\t\t\t\t\t<input type='button' class='bouton' value=\"{$msg['63']}\" name='del_ex' id='del_ex' onClick=\"confirm_delete();\" />\n\t\t\t\t\t"; } $form = str_replace('!!supprimer!!', $supprimer, $form); //Gestion du statut de notice if ($pmb_explnum_statut == '1') { $explnum_statut_form = " <input type='checkbox' id='f_statut_chk' name='f_statut_chk' value='1' "; if ($this->explnum_statut == '1') { $explnum_statut_form .= "checked='checked' "; } $explnum_statut_form .= "/> <label class='etiquette' for='f_statut_chk'>" . htmlentities($msg['explnum_statut_msg'], ENT_QUOTES, $charset) . "</label>"; $form = str_replace('<!-- explnum_statut -->', $explnum_statut_form, $form); } //Conserver la vignette if ($this->explnum_vignette) { $form = str_replace('!!vignette_existante!!', " <input type='checkbox' checked='checked' name='conservervignette' id='conservervignette' value='1'> <label for='conservervignette'>" . $msg[explnum_conservervignette] . "</label>", $form); } else { $form = str_replace('!!vignette_existante!!', '', $form); } global $_mimetypes_bymimetype_; create_tableau_mimetype(); $selector_mimetype = "<label class='etiquette'>" . htmlentities($msg['explnum_mime_label'], ENT_QUOTES, $charset) . "</label> <select id='mime_vign' name='mime_vign' >\n\t\t\t<option value=''>" . htmlentities($msg['explnum_no_mimetype'], ENT_QUOTES, $charset) . "</option>\n\t\t\t"; foreach ($_mimetypes_bymimetype_ as $key => $val) { //$selected=""; //if($this->explnum_mimetype == $key) //$selected = "selected"; $selector_mimetype .= "<option value='" . $key . "' {$selected} >" . htmlentities($key, ENT_QUOTES, $charset) . "</option>"; } $selector_mimetype .= "</select>"; $form = str_replace('!!mimetype_list!!', $selector_mimetype, $form); //Intégration de la gestion de l'interface de l'upload if ($pmb_docnum_in_directory_allow) { $div_up = "<div class='row'>"; if ($pmb_docnum_in_database_allow) { $div_up .= "<input type='radio' name='up_place' id='base' value='0' !!check_base!!/> <label for='base'>{$msg['upload_repertoire_sql']}</label>"; } $div_up .= "\t<input type='radio' name='up_place' id='upload' value='1' !!check_up!! />\n\t\t\t\t\t\t\t\t<label for='upload'>{$msg['upload_repertoire_server']}\n\t\t\t\t\t\t\t\t\t<input type='text' name='path' id='path' class='saisie-50emr' value='!!path!!' /><input type='button' class='bouton' name='upload_path' id='upload_path' value='...' onclick='upload_openFrame(event)'/>\n\t\t\t\t\t\t\t\t</label> \n\t\t\t\t\t\t\t\t<input type='hidden' name='id_rep' id='id_rep' value='!!id_rep!!' /> \n\t\t\t\t\t\t\t</div>"; $form = str_replace('!!div_upload!!', $div_up, $form); $up = new upload_folder($this->explnum_repertoire); //$nom_chemin = ($up->isHashing() ? $this->explnum_rep_nom : $this->explnum_rep_nom.$this->explnum_path); $nom_chemin = $this->explnum_rep_nom; if ($up->isHashing()) { $nom_chemin .= "/"; } else { $nom_chemin .= $this->explnum_path === '' ? "/" : $this->explnum_path; } $form = str_replace('!!path!!', htmlentities($nom_chemin, ENT_QUOTES, $charset), $form); $form = str_replace('!!id_rep!!', htmlentities($this->explnum_repertoire, ENT_QUOTES, $charset), $form); if ($this->explnum_rep_nom || $this->isEnUpload()) { $form = str_replace('!!check_base!!', '', $form); $form = str_replace('!!check_up!!', 'checked', $form); } else { $form = str_replace('!!check_base!!', '', $form); $form = str_replace('!!check_up!!', 'checked', $form); } } else { $form = str_replace('!!div_upload!!', '', $form); } //Ajout du selecteur de localisation if ($explnum_id) { if (!$this->explnum_location) { $requete = "select idlocation from docs_location"; $res = pmb_mysql_query($requete); $i = 0; while ($row = pmb_mysql_fetch_array($res)) { $liste_id[$i] = $row["idlocation"]; $i++; } } else { $liste_id = $this->explnum_location; } } else { global $deflt_docs_location; $liste_id[0] = $deflt_docs_location; } $docloc = new docs_location(); $selector_location = $docloc->gen_multiple_combo($liste_id); $form = str_replace('!!location_explnum!!', "<div class='row'><label class='etiquette'>" . htmlentities($msg['empr_location'], ENT_QUOTES, $charset) . "</label></div>" . $selector_location, $form); // statut $select_statut = gen_liste_multiple("select id_explnum_statut, gestion_libelle from explnum_statut order by 2", "id_explnum_statut", "gestion_libelle", "id_explnum_statut", "f_explnum_statut", "", $this->explnum_docnum_statut, "", "", "", "", 0); $form = str_replace('!!statut_list!!', $select_statut, $form); // Indexation concept if ($thesaurus_concepts_active == 1) { $index_concept = new index_concept($this->explnum_id, TYPE_EXPLNUM); $form = str_replace('!!index_concept_form!!', $index_concept->get_form('explnum'), $form); } else { $form = str_replace('!!index_concept_form!!', "", $form); } }
$category_form = str_replace("<!-- liaison -->", $liaison_tpl, $category_form); } else { $category_form = str_replace("<!-- liaison -->", "", $category_form); } //Numéro d'autorité $form_num_aut = str_replace("!!num_aut!!", $num_aut, $form_num_aut); $category_form = str_replace("<!-- numero_autorite -->", $form_num_aut, $category_form); // Indexation concepts if ($id) { $id_categ = $id; } else { $id_categ = 0; } if ($thesaurus_concepts_active == 1) { $index_concept = new index_concept($id, TYPE_CATEGORY); $category_form = str_replace('!!concept_form!!', $index_concept->get_form('categ_form'), $category_form); } else { $category_form = str_replace('!!concept_form!!', "", $category_form); } if ($id) { // Impression de la branche du thésaurus $lien_impression_thesaurus = "<a href='#' onClick=\"openPopUp('./print_thesaurus.php?current_print=2&action=print_prepare&aff_num_thesaurus=" . $id_thes . "&id_noeud_origine={$id}','print', 500, 600, -2, -2, 'scrollbars=yes,menubar=0,resizable=yes'); return false;\">" . $msg[print_branche] . "</a>"; $category_form = str_replace("<!-- imprimer_thesaurus -->", $lien_impression_thesaurus, $category_form); } //Remplacement $button_remplace = "<input type='button' class='bouton' value='{$msg['158']}' "; $button_remplace .= "onclick='unload_off();document.location=\"./autorites.php?categ=categories&sub=categ_replace&id={$id}&parent={$parent}\"'/>"; $category_form = str_replace("<!-- remplace_categ -->", $button_remplace, $category_form); //Suppression $category_form = str_replace('<!-- delete_button -->', $delete_button, $category_form); } else {
function show_form() { global $msg; global $titre_uniforme_form; global $charset; global $user_input, $nbr_lignes, $page; global $pmb_type_audit; global $thesaurus_concepts_active; global $value_deflt_fonction; global $tu_authors_tpl, $tu_authors_all_tpl; $fonction = new marc_list('function'); $aut_key_list = new marc_select("music_key", "form_tonalite_selector", $this->tonalite_marclist, '', "0", " "); $aut_form_list = new marc_select("music_form", "form_form_selector", $this->form_marclist, '', "0", " "); if ($this->id) { $action = "./autorites.php?categ=titres_uniformes&sub=update&id={$this->id}"; $libelle = $msg["aut_titre_uniforme_modifier"]; $button_remplace = "<input type='button' class='bouton' value='{$msg['158']}' "; $button_remplace .= "onclick='unload_off();document.location=\"./autorites.php?categ=titres_uniformes&sub=replace&id={$this->id}\"'>"; $button_voir = "<input type='button' class='bouton' value='{$msg['voir_notices_assoc']}' "; $button_voir .= "onclick='unload_off();document.location=\"./catalog.php?categ=search&mode=9&etat=aut_search&aut_type=titre_uniforme&aut_id={$this->id}\"'>"; $button_delete = "<input type='button' class='bouton' value='{$msg['63']}' "; $button_delete .= "onClick=\"confirm_delete();\">"; } else { $action = './autorites.php?categ=titres_uniformes&sub=update&id='; $libelle = $msg["aut_titre_uniforme_ajouter"]; $button_remplace = ''; $button_delete = ''; } if ($this->import_denied == 1) { $import_denied_checked = "checked='checked'"; } else { $import_denied_checked = ""; } // remplacement de tous les champs du formulaire par les données $as = array_keys($this->responsabilites["responsabilites"], "0"); $max_aut0 = count($as); if ($max_aut0 == 0) { $max_aut0 = 1; } for ($i = 0; $i < $max_aut0; $i++) { $indice = $as[$i]; $auteur_0 = $this->responsabilites["auteurs"][$indice]; $auteur = new auteur($auteur_0["id"]); if ($value_deflt_fonction && $auteur_0["id"] == 0 && $i == 0) { $auteur_0["fonction"] = $value_deflt_fonction; } $ptab_aut_tu = str_replace('!!iaut!!', $i, $tu_authors_tpl); $ptab_aut_tu = str_replace('!!aut0_id!!', $auteur_0["id"], $ptab_aut_tu); $ptab_aut_tu = str_replace('!!aut0!!', htmlentities($auteur->isbd_entry, ENT_QUOTES, $charset), $ptab_aut_tu); $ptab_aut_tu = str_replace('!!f0_code!!', $auteur_0["fonction"], $ptab_aut_tu); $ptab_aut_tu = str_replace('!!f0!!', $fonction->table[$auteur_0["fonction"]], $ptab_aut_tu); $tu_auteurs .= $ptab_aut_tu; } $tu_authors_all_tpl = str_replace('!!max_aut0!!', $max_aut0, $tu_authors_all_tpl); $tu_authors_all_tpl = str_replace('!!authors_list!!', $tu_auteurs, $tu_authors_all_tpl); $aut_link = new aut_link(AUT_TABLE_TITRES_UNIFORMES, $this->id); $titre_uniforme_form = str_replace('<!-- aut_link -->', $aut_link->get_form('saisie_titre_uniforme'), $titre_uniforme_form); $aut_pperso = new aut_pperso("tu", $this->id); $titre_uniforme_form = str_replace('!!aut_pperso!!', $aut_pperso->get_form(), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!id!!', $this->id, $titre_uniforme_form); $titre_uniforme_form = str_replace('!!action!!', $action, $titre_uniforme_form); $titre_uniforme_form = str_replace('!!libelle!!', $libelle, $titre_uniforme_form); $titre_uniforme_form = str_replace('!!nom!!', htmlentities($this->name, ENT_QUOTES, $charset), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!authors!!', $tu_authors_all_tpl, $titre_uniforme_form); $titre_uniforme_form = str_replace('!!aut_id!!', htmlentities($this->num_author, ENT_QUOTES, $charset), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!form!!', htmlentities($this->form, ENT_QUOTES, $charset), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!form_selector!!', $aut_form_list->display, $titre_uniforme_form); $titre_uniforme_form = str_replace('!!date!!', htmlentities($this->date, ENT_QUOTES, $charset), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!subject!!', htmlentities($this->subject, ENT_QUOTES, $charset), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!place!!', htmlentities($this->place, ENT_QUOTES, $charset), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!history!!', htmlentities($this->history, ENT_QUOTES, $charset), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!intended_audience!!', htmlentities($this->intended_audience, ENT_QUOTES, $charset), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!context!!', htmlentities($this->context, ENT_QUOTES, $charset), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!tonalite!!', htmlentities($this->tonalite, ENT_QUOTES, $charset), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!tonalite_selector!!', $aut_key_list->display, $titre_uniforme_form); $titre_uniforme_form = str_replace('!!coordinates!!', htmlentities($this->coordinates, ENT_QUOTES, $charset), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!equinox!!', htmlentities($this->equinox, ENT_QUOTES, $charset), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!characteristic!!', htmlentities($this->characteristic, ENT_QUOTES, $charset), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!comment!!', htmlentities($this->comment, ENT_QUOTES, $charset), $titre_uniforme_form); // auteur $tu_auteur_id = $this->num_author; if ($tu_auteur_id) { $tu_auteur = new auteur($tu_auteur_id); } $titre_uniforme_form = str_replace('!!aut_name!!', htmlentities($tu_auteur->display, ENT_QUOTES, $charset), $titre_uniforme_form); // complétude $intended_termination_id = $this->intended_termination; $select_0 = ""; $select_1 = ""; $select_2 = ""; if ($intended_termination_id == 1) { $select_1 = "selected"; } elseif ($intended_termination_id == 2) { $select_2 = "selected"; } else { $select_0 = "selected"; } $titre_uniforme_form = str_replace('!!intended_termination_0!!', htmlentities($select_0, ENT_QUOTES, $charset), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!intended_termination_1!!', htmlentities($select_1, ENT_QUOTES, $charset), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!intended_termination_2!!', htmlentities($select_2, ENT_QUOTES, $charset), $titre_uniforme_form); // distribution $distribution_form = $this->gen_input_selection($msg["aut_titre_uniforme_form_distribution"], "saisie_titre_uniforme", "distrib", $this->distrib, "", "saisie-80em"); $titre_uniforme_form = str_replace("<!--\tDistribution instrumentale et vocale (pour la musique)\t-->", $distribution_form, $titre_uniforme_form); // reference $ref_num_form = $this->gen_input_selection($msg["aut_titre_uniforme_form_ref_numerique"], "saisie_titre_uniforme", "ref", $this->ref, "", "saisie-80em"); $titre_uniforme_form = str_replace("<!--\tRéférence numérique (pour la musique)\t-->", $ref_num_form, $titre_uniforme_form); // subdivision $sub_form = $this->gen_input_selection($msg["aut_titre_uniforme_form_subdivision_forme"], "saisie_titre_uniforme", "subdiv", $this->subdiv, "", "saisie-80em"); $titre_uniforme_form = str_replace('<!-- Subdivision de forme -->', $sub_form, $titre_uniforme_form); $titre_uniforme_form = str_replace('!!remplace!!', $button_remplace, $titre_uniforme_form); $titre_uniforme_form = str_replace('!!voir_notices!!', $button_voir, $titre_uniforme_form); $titre_uniforme_form = str_replace('!!delete!!', $button_delete, $titre_uniforme_form); $titre_uniforme_form = str_replace('!!user_input_url!!', rawurlencode(stripslashes($user_input)), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!user_input!!', htmlentities($user_input, ENT_QUOTES, $charset), $titre_uniforme_form); $titre_uniforme_form = str_replace('!!nbr_lignes!!', $nbr_lignes, $titre_uniforme_form); $titre_uniforme_form = str_replace('!!page!!', $page, $titre_uniforme_form); $titre_uniforme_form = str_replace('!!tu_import_denied!!', $import_denied_checked, $titre_uniforme_form); if ($thesaurus_concepts_active == 1) { $index_concept = new index_concept($this->id, TYPE_TITRE_UNIFORME); $titre_uniforme_form = str_replace('!!concept_form!!', $index_concept->get_form('saisie_titre_uniforme'), $titre_uniforme_form); } else { $titre_uniforme_form = str_replace('!!concept_form!!', "", $titre_uniforme_form); } if ($pmb_type_audit && $this->id) { $bouton_audit = " <input class='bouton' type='button' onClick=\"openPopUp('./audit.php?type_obj=" . AUDIT_TITRE_UNIFORME . "&object_id=" . $this->id . "', 'audit_popup', 700, 500, -2, -2, 'scrollbars=yes, toolbar=no, dependent=yes, resizable=yes')\" title=\"" . $msg['audit_button'] . "\" value=\"" . $msg['audit_button'] . "\" /> "; } $titre_uniforme_form = str_replace('!!audit_bt!!', $bouton_audit, $titre_uniforme_form); print $titre_uniforme_form; }