function search($rec_history = false, $fichier_xml = "", $full_path = '') { global $launch_search; $this->parse_search_file($fichier_xml, $full_path); $this->strip_slashes(); foreach ($this->dynamicfields as $key => $value) { $this->pp[$key] = new parametres_perso($value["TYPE"]); } $authpersos = new authpersos(); $this->authpersos = $authpersos->get_data(); $this->rec_history = $rec_history; $this->full_path = $full_path; $this->fichier_xml = $fichier_xml; }
function get_form($caller = "categ_form") { global $msg, $add_aut_link, $aut_link0, $aut_link1, $form_aut_link; global $thesaurus_concepts_active, $charset; $form = $add_aut_link; $js_aut_link_table_list = "\n\t\tvar aut_link_table_select=Array();\n\t\taut_link_table_select[" . AUT_TABLE_AUTHORS . "]='./select.php?what=auteur&caller={$caller}&dyn=2¶m1=';\t\t\n\t\taut_link_table_select[" . AUT_TABLE_CATEG . "]='./select.php?what=categorie&caller={$caller}&dyn=2&parent=1&p1=';\n\t\taut_link_table_select[" . AUT_TABLE_PUBLISHERS . "]='./select.php?what=editeur&caller={$caller}&dyn=2&p1=';\n\t\taut_link_table_select[" . AUT_TABLE_COLLECTIONS . "]='./select.php?what=collection&caller={$caller}&dyn=2&p1=';\n\t\taut_link_table_select[" . AUT_TABLE_SUB_COLLECTIONS . "]='./select.php?what=subcollection&caller={$caller}&dyn=2&p1=';\n\t\taut_link_table_select[" . AUT_TABLE_SERIES . "]='./select.php?what=serie&caller={$caller}&dyn=2¶m1=';\n\t\taut_link_table_select[" . AUT_TABLE_TITRES_UNIFORMES . "]='./select.php?what=titre_uniforme&caller={$caller}&dyn=2¶m1=';\n\t\taut_link_table_select[" . AUT_TABLE_INDEXINT . "]='./select.php?what=indexint&caller={$caller}&dyn=2¶m1=';\n\t\taut_link_table_select[" . AUT_TABLE_CONCEPT . "]='./select.php?what=ontology&caller={$caller}&objs={$objs}&element=concept&dyn=2¶m1=';\n\t\t"; if ($thesaurus_concepts_active) { $concept_sel = "<option value='" . AUT_TABLE_CONCEPT . "'>" . $msg["ontology_skos_menu"] . "</option>"; } $aut_table_list = "\n\t\t<select id='f_aut_link_table_list' name='f_aut_link_table_list'>\n\t\t\t<option value='" . AUT_TABLE_AUTHORS . "' selected='selected'>" . $msg[133] . "</option>\n\t\t\t<option value='" . AUT_TABLE_CATEG . "'>" . $msg[134] . "</option>\n\t\t\t<option value='" . AUT_TABLE_PUBLISHERS . "'>" . $msg[135] . "</option>\n\t\t\t<option value='" . AUT_TABLE_COLLECTIONS . "'>" . $msg[136] . "</option>\n\t\t\t<option value='" . AUT_TABLE_SUB_COLLECTIONS . "'>" . $msg[137] . "</option>\n\t\t\t<option value='" . AUT_TABLE_SERIES . "'>" . $msg[333] . "</option>\n\t\t\t<option value='" . AUT_TABLE_TITRES_UNIFORMES . "'>" . $msg["aut_menu_titre_uniforme"] . "</option>\n\t\t\t<option value='" . AUT_TABLE_INDEXINT . "'>" . $msg["indexint_menu"] . "</option>\n\t\t\t{$concept_sel}\n\t\t\t!!autpersos!!\n\t\t</select>"; $authpersos = new authpersos(); $info = $authpersos->get_data(); $tpl_list = ""; foreach ($info as $elt) { $tpl_elt = "<option value='!!id_authperso!!'>!!name!!</option>"; $tpl_elt = str_replace('!!name!!', $elt['name'], $tpl_elt); $tpl_elt = str_replace('!!id_authperso!!', $elt['id'] + 1000, $tpl_elt); $js_aut_link_table_list .= "aut_link_table_select[" . ($elt['id'] + 1000) . "]='./select.php?what=authperso&authperso_id=" . $elt['id'] . "&caller={$caller}&dyn=2¶m1=';"; $tpl_list .= $tpl_elt; } $aut_table_list = str_replace('!!autpersos!!', $tpl_list, $aut_table_list); $i = 0; if (!count($this->aut_list)) { // pas d'enregistrement $form .= $aut_link0; $liste_type_relation = new marc_select("relationtype_aut", "f_aut_link_type{$i}", $aut["type"], "", "", "", array(array('name' => 'data-form-name', 'value' => 'f_aut_link_type'))); $form = str_replace("!!aut_link_type!!", $liste_type_relation->display, $form); $form = str_replace("!!aut_link_reciproc!!", "unchecked='unchecked'", $form); $form = str_replace("!!aut_link!!", $i, $form); $form = str_replace("!!aut_link_libelle!!", "", $form); $form = str_replace("!!aut_link_table!!", "", $form); $form = str_replace("!!aut_link_id!!", "", $form); $form = str_replace("!!aut_link_comment!!", "", $form); $i++; } else { foreach ($this->aut_list as $aut) { // Construction de chaque ligne du formulaire if ($i) { $form_suivant = $aut_link1; } else { $form_suivant = $aut_link0; } if ($aut["flag_reciproc"]) { $liste_type_relation = new marc_select("relationtype_autup", "f_aut_link_type{$i}", $aut["type"], "", "", "", array(array('name' => 'data-form-name', 'value' => 'f_aut_link_type'))); } else { $liste_type_relation = new marc_select("relationtype_aut", "f_aut_link_type{$i}", $aut["type"], "", "", "", array(array('name' => 'data-form-name', 'value' => 'f_aut_link_type'))); } $form_suivant = str_replace("!!aut_link_type!!", $liste_type_relation->display, $form_suivant); if ($aut["reciproc"]) { $check = "checked='checked'"; } else { $check = ""; } $form_suivant = str_replace("!!aut_link_reciproc!!", $check, $form_suivant); $form_suivant = str_replace("!!aut_link!!", $i, $form_suivant); $form_suivant = str_replace("!!aut_link_libelle!!", htmlentities($aut["libelle"], ENT_QUOTES, $charset, false), $form_suivant); $form_suivant = str_replace("!!aut_link_table!!", $aut["to"], $form_suivant); $form_suivant = str_replace("!!aut_link_id!!", $aut["to_num"], $form_suivant); $form_suivant = str_replace("!!aut_link_comment!!", $aut["comment"], $form_suivant); $form .= $form_suivant; $i++; } } $form = str_replace("!!max_aut_link!!", $i, $form); $form = str_replace("!!js_aut_link_table_list!!", $js_aut_link_table_list, $form); $form = str_replace("!!aut_table_list!!", $aut_table_list, $form); $form = str_replace("!!aut_link_contens!!", $form, $form_aut_link); return $form; }
function save_form() { global $dbh; $authpersos = new authpersos(); $infos = $authpersos->get_data(); if (!count($infos)) { return; } $this->delete(); foreach ($infos as $authperso) { $authperso_id = $authperso['id']; $max_authperso = "max_authperso_" . $authperso_id; global ${$max_authperso}; $max_authperso = ${$max_authperso}; $order = 0; $tab_authperso_order = "tab_authperso_order_" . $authperso_id; global ${$tab_authperso_order}; $tab_authperso_order = ${$tab_authperso_order}; // value="authperso_1_2,authperso_1_0,authperso_1_1" .... $tab_order = explode(',', $tab_authperso_order); foreach ($tab_order as $string_order) { $tab_string_order = explode("_", $string_order); $final_ordre[] = $tab_string_order[2]; } if ($final_ordre) { $order = 0; foreach ($final_ordre as $old_order) { $auth_id = "f_authperso_id_" . $authperso_id . "_" . $old_order; global ${$auth_id}; $auth_id = ${$auth_id}; if ($auth_id) { $req = "insert into notices_authperso set notice_authperso_notice_num=" . $this->id . ", notice_authperso_authority_num= {$auth_id}, notice_authperso_order=" . $order; $result = pmb_mysql_query($req, $dbh); $order++; } } } else { $order = 0; for ($i = 0; $i < $max_authperso; $i++) { $auth_id = "f_authperso_id_" . $authperso_id . "_" . $i; global ${$auth_id}; $auth_id = ${$auth_id}; if ($auth_id) { $req = "insert into notices_authperso set notice_authperso_notice_num=" . $this->id . ", notice_authperso_authority_num= {$auth_id}, notice_authperso_order=" . $order; $result = pmb_mysql_query($req, $dbh); $order++; } } } } }
<?php // +-------------------------------------------------+ // © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net) // +-------------------------------------------------+ // $Id: main.inc.php,v 1.13 2014-10-30 16:14:59 dgoron Exp $ if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) { die("no access"); } // page de switch recherche notice // inclusions principales require_once "{$include_path}/templates/notice_search.tpl.php"; require_once "{$class_path}/authperso.class.php"; $authpersos = new authpersos(); $info_authpersos = $authpersos->get_data(); foreach ($info_authpersos as $authperso) { if ($authperso['gestion_search'] != 2) { continue; } // pas de boutton $tpl_elt = $menu_search_tpl; $tpl_elt = str_replace("!!label!!", htmlentities(stripslashes($authperso['name']), ENT_QUOTES, $charset), $tpl_elt); $tpl_elt = str_replace("!!mode!!", $authperso['id'] + 1000, $tpl_elt); $selected = ""; if ($mode == $authperso['id'] + 1000) { $selected = "class=\"selected\""; } $tpl_elt = str_replace("!!selected!!", $selected, $tpl_elt); $tpl_authperso .= $tpl_elt; $authperso_list_name[$authperso['id'] + 1000] = $authperso['name']; }
function search($fichier_xml = "") { global $launch_search; $this->parse_search_file($fichier_xml); $this->strip_slashes(); foreach ($this->dynamicfields as $key => $value) { $this->pp[$key] = new parametres_perso($value["TYPE"]); } $authpersos = new authpersos(); $this->authpersos = $authpersos->get_data(); }
private static function get_authorities_list() { global $msg, $thesaurus_concepts_active, $pmb_use_uniform_title; $authorities = array(AUT_TABLE_AUTHORS => $msg['133'], AUT_TABLE_CATEG => $msg['134'], AUT_TABLE_PUBLISHERS => $msg['135'], AUT_TABLE_COLLECTIONS => $msg['136'], AUT_TABLE_SUB_COLLECTIONS => $msg['137'], AUT_TABLE_SERIES => $msg['333'], AUT_TABLE_INDEXINT => $msg['indexint_menu']); if ($pmb_use_uniform_title) { $authorities[AUT_TABLE_TITRES_UNIFORMES] = $msg['aut_menu_titre_uniforme']; } if ($thesaurus_concepts_active) { $authorities[AUT_TABLE_CONCEPT] = $msg['ontology_skos_menu']; } $authpersos = new authpersos(); $info_authpersos = $authpersos->get_data(); foreach ($info_authpersos as $authperso) { $authorities[$authperso['id'] + 1000] = $authperso['name']; } return $authorities; }