Exemplo n.º 1
0
function aff_choix_quoi_export($action = "", $action_cancel = "", $titre_form = "", $bouton_valider = "")
{
    global $cart_choix_quoi_exporter;
    global $catalog;
    global $base_path;
    $cart_choix_quoi_exporter = str_replace('!!action!!', $action, $cart_choix_quoi_exporter);
    $cart_choix_quoi_exporter = str_replace('!!action_cancel!!', $action_cancel, $cart_choix_quoi_exporter);
    $cart_choix_quoi_exporter = str_replace('!!titre_form!!', $titre_form, $cart_choix_quoi_exporter);
    $cart_choix_quoi_exporter = str_replace('!!bouton_valider!!', $bouton_valider, $cart_choix_quoi_exporter);
    //Lecture des différents exports possibles
    $catalog = array();
    $n_typ_total = 0;
    if (file_exists("{$base_path}/admin/convert/imports/catalog_subst.xml")) {
        $fic_catal = "{$base_path}/admin/convert/imports/catalog_subst.xml";
    } else {
        $fic_catal = "{$base_path}/admin/convert/imports/catalog.xml";
    }
    _parser_($fic_catal, array("ITEM" => "_item_"), "CATALOG");
    //Création de la liste des types d'import
    $export_type = "<select name=\"export_type\" id=\"export_type\">\n";
    for ($i = 0; $i < count($catalog); $i++) {
        $export_type .= "<option value=\"" . $catalog[$i][INDEX] . "\">" . $catalog[$i][NAME] . "</option>\n";
    }
    $export_type .= "</select>";
    $cart_choix_quoi_exporter = str_replace("!!export_type!!", $export_type, $cart_choix_quoi_exporter);
    $param = new export_param(EXP_DEFAULT_GESTION);
    $cart_choix_quoi_exporter = str_replace("!!form_param!!", $param->check_default_param(), $cart_choix_quoi_exporter);
    return $cart_choix_quoi_exporter;
}
 function get_notice_unimarc($notice_id)
 {
     //récupère les param d'exports
     $export_param = new export_param();
     $param = $export_param->get_parametres($export_param->context);
     //petit nettoyage pour un bon fonctionnement...
     foreach ($param as $key => $value) {
         $param[str_replace("export_", "", $key)] = $param[$key];
     }
     //maintenant que c'est en ordre, on peut y aller!
     $export = new export(array($notice_id), array(), array());
     $export->get_next_notice("", array(), array(), false, $param);
     return $export->xml_array;
 }
 function fetch_data()
 {
     //si on a rien, on peut pas travailler...
     if (!$this->notice_id && !$this->notice_externe_id) {
         return false;
     }
     if ($this->notice_id) {
         //pour une notice de la base...
         //récupère les param d'exports
         $export_param = new export_param();
         $param = $export_param->get_parametres($export_param->context);
         //petit nettoyage pour un bon fonctionnement...
         foreach ($param as $key => $value) {
             $param[str_replace("export_", "", $key)] = $param[$key];
         }
         //maintenant que c'est en ordre, on peut y aller!
         $export = new export(array($this->notice_id), array(), array());
         $export->get_next_notice("", array(), array(), false, $param);
         $this->notice_infos = $export->xml_array;
         //on regarde si on veut aussi les infos de la notice contenante...
         if ($this->params['entities']['referring_entity']['allow'] == "yes") {
             //il nous faut déjà l'identifiant du parent, s'il existe...
             $this->parent_id = 0;
             switch ($this->notice_infos['bl']['value'] . $this->notice_infos['hl']['value']) {
                 case "a2":
                 case "s2":
                     $field = "461";
                     break;
                 default:
                     $field = "463";
                     break;
             }
             foreach ($this->notice_infos['f'] as $f) {
                 switch ($f['c']) {
                     case $field:
                         foreach ($f['s'] as $s) {
                             switch ($s['c']) {
                                 case "9":
                                     if (strpos($s['value'], "id:") !== false) {
                                         $this->parent_id = str_replace("id:", "", $s['value']);
                                     }
                                     break;
                             }
                         }
                         break;
                 }
             }
             if ($this->parent_id) {
                 $export_parent = new export(array($this->parent_id), array(), array());
                 $export_parent->get_next_notice("", array(), array(), false, $param);
                 $this->parent_infos = $export_parent->xml_array;
             }
         }
     } else {
         //pour une notice externe
         //TODO : récup notice infos
     }
     //on récup la sérialization pour gérer nos objets
     switch ($this->params['serialization']) {
         case "kev":
         default:
             $this->serialization = "kev_mtx";
             break;
     }
 }
Exemplo n.º 4
0
 function show_form($type = "pro")
 {
     global $msg, $charset;
     global $dsi_bannette_form;
     global $dsi_bannette_form_abo, $dsi_bannette_form_selvars;
     global $nom_prenom_abo;
     global $dsi_bannette_notices_template, $PMBuserid;
     global $form_cb, $id_classement;
     global $page, $nbr_lignes, $nb_per_page;
     if ($type == "abo") {
         $dsi_bannette_form = $dsi_bannette_form_abo;
     }
     if ($this->id_bannette) {
         $link_pagination = "";
         if ($page > 1) {
             $link_pagination .= "&page=" . $page . "&nbr_lignes=" . $nbr_lignes . "&nb_per_page=" . $nb_per_page;
         }
         $action = "./dsi.php?categ=bannettes&sub={$type}&id_bannette={$this->id_bannette}&suite=update&id_classement={$id_classement}&form_cb={$form_cb}{$link_pagination}";
         $link_duplicate = "<input type='button' class='bouton' value='" . $msg['bannette_duplicate_bouton'] . "' onclick='document.location=\"./dsi.php?categ=bannettes&sub={$type}&id_bannette={$this->id_bannette}&suite=duplicate&id_classement={$id_classement}&form_cb={$form_cb}{$link_pagination}\"' />";
         $link_annul = "<input type='button' class='bouton' value='{$msg['76']}' onClick=\"document.location='./dsi.php?categ=bannettes&sub={$type}&id_bannette=&suite=search&id_classement={$id_classement}&form_cb={$form_cb}{$link_pagination}';\" />";
         $button_delete = "<input type='button' class='bouton' value='{$msg['63']}' onClick=\"confirm_delete();\">";
         $libelle = $msg['dsi_ban_form_modif'];
     } else {
         $action = "./dsi.php?categ=bannettes&sub={$type}&id_bannette=0&suite=update";
         $link_duplicate = "";
         $link_annul = "<input type='button' class='bouton' value='{$msg['76']}' onClick=\"history.go(-1);\" />";
         $libelle = $msg['dsi_ban_form_creat'];
         $button_delete = "";
         $this->notice_tpl = $dsi_bannette_notices_template;
     }
     $bannette_tpl_list = bannette_tpl::gen_tpl_select("bannette_tpl_num", $this->bannette_tpl_num);
     $dsi_bannette_form = str_replace('!!libelle!!', $libelle, $dsi_bannette_form);
     $dsi_bannette_form = str_replace('!!type!!', $type, $dsi_bannette_form);
     $dsi_bannette_form = str_replace('!!id_bannette!!', $this->id_bannette, $dsi_bannette_form);
     $dsi_bannette_form = str_replace('!!action!!', $action, $dsi_bannette_form);
     $dsi_bannette_form = str_replace('!!link_duplicate!!', $link_duplicate, $dsi_bannette_form);
     $dsi_bannette_form = str_replace('!!link_annul!!', $link_annul, $dsi_bannette_form);
     $dsi_bannette_form = str_replace('!!nom_bannette!!', htmlentities($this->nom_bannette, ENT_QUOTES, $charset), $dsi_bannette_form);
     if ($type == "pro") {
         $dsi_bannette_form = str_replace('!!num_classement!!', show_classement_utilise('BAN', $this->num_classement, 0), $dsi_bannette_form);
     } else {
         $dsi_bannette_form = str_replace('!!num_classement!!', "<input type=hidden name=num_classement value=0 />", $dsi_bannette_form);
     }
     global $id_empr;
     $dsi_bannette_form = str_replace('!!id_empr!!', $id_empr, $dsi_bannette_form);
     $dsi_bannette_form = str_replace('!!comment_gestion!!', htmlentities($this->comment_gestion, ENT_QUOTES, $charset), $dsi_bannette_form);
     $dsi_bannette_form = str_replace('!!comment_public!!', htmlentities($this->comment_public, ENT_QUOTES, $charset), $dsi_bannette_form);
     $dsi_bannette_form = str_replace('!!bannette_tpl_list!!', $bannette_tpl_list, $dsi_bannette_form);
     $dsi_bannette_form = str_replace('!!entete_mail!!', htmlentities($this->entete_mail, ENT_QUOTES, $charset), $dsi_bannette_form);
     $dsi_bannette_form = str_replace('!!piedpage_mail!!', htmlentities($this->piedpage_mail, ENT_QUOTES, $charset), $dsi_bannette_form);
     $dsi_bannette_form = str_replace('!!date_last_remplissage!!', htmlentities($this->aff_date_last_remplissage, ENT_QUOTES, $charset), $dsi_bannette_form);
     $date_clic = "onClick=\"openPopUp('./select.php?what=calendrier&caller=saisie_bannette&date_caller=" . substr(preg_replace('/-/', '', $this->date_last_envoi), 0, 8) . "&param1=form_date_last_envoi&param2=form_aff_date_last_envoi&auto_submit=NO&date_anterieure=YES', 'date_last_envoi', 250, 300, -2, -2, 'toolbar=no, dependent=yes, resizable=yes')\"  ";
     $date_last_envoi = "\n\t\t\t\t\t<input type='hidden' name='form_date_last_envoi' value='" . str_replace(' ', '', str_replace('-', '', str_replace(':', '', $this->date_last_envoi))) . "' />\n\t\t\t\t\t<input class='bouton' type='button' name='form_aff_date_last_envoi' value='" . $this->aff_date_last_envoi . "' " . $date_clic . " />";
     $dsi_bannette_form = str_replace('!!date_last_envoi!!', $date_last_envoi, $dsi_bannette_form);
     $dsi_bannette_form = str_replace('!!archive_number!!', $this->archive_number, $dsi_bannette_form);
     if ($type == "pro") {
         $dsi_bannette_form = str_replace('!!proprio_bannette!!', htmlentities($msg['dsi_ban_no_proprio'], ENT_QUOTES, $charset), $dsi_bannette_form);
     } else {
         $dsi_bannette_form = str_replace('!!proprio_bannette!!', htmlentities($nom_prenom_abo, ENT_QUOTES, $charset), $dsi_bannette_form);
     }
     if ($this->bannette_auto) {
         $dsi_bannette_form = str_replace('!!bannette_auto!!', "checked", $dsi_bannette_form);
     } else {
         $dsi_bannette_form = str_replace('!!bannette_auto!!', "", $dsi_bannette_form);
     }
     $dsi_bannette_form = str_replace('!!periodicite!!', htmlentities($this->periodicite, ENT_QUOTES, $charset), $dsi_bannette_form);
     if ($this->diffusion_email) {
         $dsi_bannette_form = str_replace('!!diffusion_email!!', "checked='checked'", $dsi_bannette_form);
     } else {
         $dsi_bannette_form = str_replace('!!diffusion_email!!', "", $dsi_bannette_form);
     }
     $dsi_bannette_form = str_replace('!!nb_notices_diff!!', htmlentities($this->nb_notices_diff, ENT_QUOTES, $charset), $dsi_bannette_form);
     $dsi_bannette_form = str_replace('!!notice_tpl!!', notice_tpl_gen::gen_tpl_select("notice_tpl", $this->notice_tpl), $dsi_bannette_form);
     if ($this->statut_not_account) {
         $dsi_bannette_form = str_replace('!!statut_not_account!!', "checked", $dsi_bannette_form);
     } else {
         $dsi_bannette_form = str_replace('!!statut_not_account!!', "", $dsi_bannette_form);
     }
     // group_type, group_pperso, group_facettes
     if ($this->group_type) {
         $dsi_bannette_form = str_replace('!!checked_group_facette!!', " checked='checked' ", $dsi_bannette_form);
         $dsi_bannette_form = str_replace('!!checked_group_pperso!!', "", $dsi_bannette_form);
     } else {
         $dsi_bannette_form = str_replace('!!checked_group_facette!!', "", $dsi_bannette_form);
         $dsi_bannette_form = str_replace('!!checked_group_pperso!!', " checked='checked' ", $dsi_bannette_form);
     }
     $liste_p_perso = $this->p_perso->gen_liste_field("group_pperso", $this->group_pperso, $msg["dsi_ban_form_regroupe_pperso_no"]);
     $dsi_bannette_form = str_replace('!!pperso_group!!', $liste_p_perso, $dsi_bannette_form);
     $dsi_bannette_form = str_replace('!!facette_group!!', $this->gen_facette_selection(), $dsi_bannette_form);
     if ($this->display_notice_in_every_group) {
         $dsi_bannette_form = str_replace("!!display_notice_in_every_group!!", "checked", $dsi_bannette_form);
     } else {
         $dsi_bannette_form = str_replace("!!display_notice_in_every_group!!", "", $dsi_bannette_form);
     }
     if ($type == "pro") {
         $requete = "SELECT id_categ_empr, libelle FROM empr_categ ORDER BY libelle ";
         $onchange = "res=confirm('" . htmlentities($msg['dsi_ban_confirm_modif_categ'], ENT_QUOTES, $charset) . "'); if (res) this.form.majautocateg.value=1; else this.form.majautocateg.value=0;";
         $categ_lect_aff = gen_liste($requete, "id_categ_empr", "libelle", "categorie_lecteurs", $onchange, $this->categorie_lecteurs, 0, $msg['dsi_ban_aucune_categ'], 0, $msg['dsi_ban_aucune_categ'], 0);
         $dsi_bannette_form = str_replace('!!categorie_lecteurs!!', $categ_lect_aff, $dsi_bannette_form);
         $requete = "SELECT id_groupe, libelle_groupe FROM groupe ORDER BY libelle_groupe ";
         $onchange = "res=confirm('" . htmlentities($msg['dsi_ban_confirm_modif_groupe'], ENT_QUOTES, $charset) . "'); if (res) this.form.majautogroupe.value=1; else this.form.majautogroupe.value=0;";
         $groupe_lect_aff = gen_liste($requete, "id_groupe", "libelle_groupe", "groupe_lecteurs", $onchange, $this->groupe_lecteurs, 0, $msg['dsi_ban_aucun_groupe'], 0, $msg['dsi_ban_aucun_groupe'], 0);
         $dsi_bannette_form = str_replace('!!groupe_lecteurs!!', $groupe_lect_aff, $dsi_bannette_form);
     } else {
         $dsi_bannette_form = str_replace('!!categorie_lecteurs!!', "<input type=hidden name=categorie_lecteurs value=0 />", $dsi_bannette_form);
         $dsi_bannette_form = str_replace('!!groupe_lecteurs!!', "<input type=hidden name=groupe_lecteurs value=0 />", $dsi_bannette_form);
     }
     $dsi_bannette_form = str_replace('!!desc_fields!!', $this->build_sel_descriptor(), $dsi_bannette_form);
     $requete = "SELECT idcaddie, name FROM caddie where type='NOTI' ";
     if ($PMBuserid != 1) {
         $requete .= " and (autorisations='{$PMBuserid}' or autorisations like '{$PMBuserid} %' or autorisations like '% {$PMBuserid} %' or autorisations like '% {$PMBuserid}') ";
     }
     $requete .= " ORDER BY name ";
     $panier_bann_aff = gen_liste($requete, "idcaddie", "name", "num_panier", "", $this->num_panier, 0, $msg['dsi_panier_aucun'], 0, $msg['dsi_panier_aucun'], 0);
     $dsi_bannette_form = str_replace('!!num_panier!!', $panier_bann_aff, $dsi_bannette_form);
     switch ($this->limite_type) {
         case "D":
             $selectn = "";
             $selecti = "";
             $selectd = " SELECTED ";
             break;
         case "I":
             $selectn = "";
             $selectd = "";
             $selecti = " SELECTED ";
             break;
         default:
         case "":
             $selecti = "";
             $selectd = "";
             $selectn = " SELECTED ";
             break;
     }
     $limite_type = "<select name='limite_type' id='limite_type'>\n\t\t\t\t\t\t<option value='' {$selectn}>" . $msg['dsi_ban_non_cumul'] . "</option>\n\t\t\t\t\t\t<option value='D' {$selectd}>" . $msg['dsi_ban_cumul_jours'] . "</option>\n\t\t\t\t\t\t<option value='I' {$selecti}>" . $msg['dsi_ban_cumul_notice'] . "</option>\n\t\t\t\t\t\t</select>";
     $dsi_bannette_form = str_replace('!!limite_type!!', $limite_type, $dsi_bannette_form);
     $dsi_bannette_form = str_replace('!!limite_nombre!!', $this->limite_nombre, $dsi_bannette_form);
     // update_type: se baser sur la date de création ou la date de mise à jour des notices ?
     switch ($this->update_type) {
         case "C":
             $selectu = "";
             $selectc = " SELECTED ";
             break;
         case "U":
             $selectc = "";
             $selectu = " SELECTED ";
             break;
         default:
         case "":
             $selectu = "";
             $selectc = " SELECTED ";
             break;
     }
     $update_type = "<select name='update_type' id='update_type'>\n\t\t\t\t\t\t<option value='C' {$selectc}>" . $msg['dsi_ban_update_type_c'] . "</option>\n\t\t\t\t\t\t<option value='U' {$selectu}>" . $msg['dsi_ban_update_type_u'] . "</option>\n\t\t\t\t\t\t</select>";
     $dsi_bannette_form = str_replace('!!update_type!!', $update_type, $dsi_bannette_form);
     $exp = start_export::get_exports();
     $liste_exports = "<select name='typeexport' onchange=\"if(this.selectedIndex==0) document.getElementById('liste_parametre').style.display='none'; else document.getElementById('liste_parametre').style.display=''; \">";
     if (!$this->typeexport) {
         $liste_exports .= "<option value='' selected>" . $msg['dsi_ban_noexport'] . "</option>";
     } else {
         $liste_exports .= "<option value=''>" . $msg['dsi_ban_noexport'] . "</option>";
     }
     for ($i = 0; $i < count($exp); $i++) {
         if ($this->typeexport == $exp[$i]["PATH"]) {
             $liste_exports .= "<option value='" . $exp[$i]["PATH"] . "' selected>" . $exp[$i]["NAME"] . "</option>";
         } else {
             $liste_exports .= "<option value='" . $exp[$i]["PATH"] . "' >" . $exp[$i]["NAME"] . "</option>";
         }
     }
     $liste_exports .= "</select>";
     $dsi_bannette_form = str_replace('!!typeexport!!', $liste_exports, $dsi_bannette_form);
     $dsi_bannette_form = str_replace('!!prefixe_fichier!!', $this->prefixe_fichier, $dsi_bannette_form);
     if ($this->bannette_opac_accueil) {
         $bannette_opac_accueil_check = " checked ";
     } else {
         $bannette_opac_accueil_check = "";
     }
     $dsi_bannette_form = str_replace('!!bannette_opac_accueil_check!!', $bannette_opac_accueil_check, $dsi_bannette_form);
     if ($this->document_generate) {
         $dsi_bannette_form = str_replace('!!document_generate!!', "checked=checked", $dsi_bannette_form);
     } else {
         $dsi_bannette_form = str_replace('!!document_generate!!', "", $dsi_bannette_form);
     }
     $dsi_bannette_form = str_replace('!!document_notice_tpl!!', notice_tpl_gen::gen_tpl_select("document_notice_tpl", $this->document_notice_tpl), $dsi_bannette_form);
     if ($this->document_insert_docnum) {
         $dsi_bannette_form = str_replace('!!document_insert_docnum!!', "checked=checked", $dsi_bannette_form);
     } else {
         $dsi_bannette_form = str_replace('!!document_insert_docnum!!', "", $dsi_bannette_form);
     }
     if ($this->document_group) {
         $dsi_bannette_form = str_replace('!!document_group!!', "checked=checked", $dsi_bannette_form);
     } else {
         $dsi_bannette_form = str_replace('!!document_group!!', "", $dsi_bannette_form);
     }
     if ($this->document_add_summary) {
         $dsi_bannette_form = str_replace('!!document_add_summary!!', "checked=checked", $dsi_bannette_form);
     } else {
         $dsi_bannette_form = str_replace('!!document_add_summary!!', "", $dsi_bannette_form);
     }
     $dsi_bannette_form = str_replace('!!delete!!', $button_delete, $dsi_bannette_form);
     // afin de revenir où on était : $form_cb, le critère de recherche
     $dsi_bannette_form = str_replace('!!form_cb!!', $form_cb, $dsi_bannette_form);
     if ($this->param_export) {
         $param = new export_param(EXP_DSI_CONTEXT, $this->param_export);
     } else {
         $param = new export_param(EXP_DEFAULT_GESTION);
     }
     if (!$this->typeexport) {
         $dsi_bannette_form = str_replace('!!display_liste_param!!', 'display:none', $dsi_bannette_form);
     } else {
         $dsi_bannette_form = str_replace('!!display_liste_param!!', '', $dsi_bannette_form);
     }
     $dsi_bannette_form = str_replace('!!form_param!!', $param->check_default_param(), $dsi_bannette_form);
     //ajout champs emprunteur
     $dsi_bannette_form = str_replace('!!info_empr!!', $dsi_bannette_form_selvars, $dsi_bannette_form);
     print $dsi_bannette_form;
 }
Exemplo n.º 5
0
 function update_config_from_form()
 {
     global $dbh;
     parent::update_config_from_form();
     global $repo_name, $admin_email, $included_sets, $repositoryIdentifier, $chunksize, $token_lifeduration, $cache_complete_records, $cache_complete_records_seconds, $link_status_to_deletion, $linked_status_to_deletion, $allow_gzip_compression, $baseURL, $include_items, $suppr_feuille_xslt;
     global $deletion_management, $deletion_management_transient_duration;
     //les trucs faciles
     $this->config["repo_name"] = stripslashes($repo_name);
     $this->config["admin_email"] = stripslashes($admin_email);
     $this->config["repositoryIdentifier"] = stripslashes($repositoryIdentifier);
     $this->config["chunksize"] = $chunksize + 0;
     $this->config["token_lifeduration"] = $token_lifeduration + 0;
     $this->config["cache_complete_records"] = isset($cache_complete_records);
     $this->config["cache_complete_records_seconds"] = $cache_complete_records_seconds + 0;
     $this->config["link_status_to_deletion"] = isset($link_status_to_deletion);
     $this->config["linked_status_to_deletion"] = $linked_status_to_deletion + 0;
     $this->config["allow_gzip_compression"] = isset($allow_gzip_compression);
     $this->config["baseURL"] = stripslashes($baseURL);
     $this->config["include_items"] = isset($include_items);
     $this->config["deletion_management"] = $deletion_management;
     $this->config["deletion_management_transient_duration"] = $deletion_management_transient_duration * 1;
     if (!$_FILES['feuille_xslt']['error']) {
         $this->config['feuille_xslt'] = file_get_contents($_FILES['feuille_xslt']['tmp_name']);
         $this->config['feuille_xslt_name'] = $_FILES['feuille_xslt']['name'];
     }
     if ($suppr_feuille_xslt) {
         $this->config['feuille_xslt'] = "";
         $this->config['feuille_xslt_name'] = "";
     }
     $this->config['include_links'] = array();
     $this->config['include_links']['genere_lien'] = 0;
     global $include_path, $class_path;
     require_once $class_path . '/export_param.class.php';
     $e_param = new export_param(EXP_GLOBAL_CONTEXT);
     $this->config['include_links'] = $e_param->get_parametres(EXP_OAI_CONTEXT);
     //Vérifions que le statut proposé existe bien
     $sql = "SELECT COUNT(1) > 0 FROM notice_statut WHERE id_notice_statut = " . ($linked_status_to_deletion + 0);
     $status_exists = pmb_mysql_result(pmb_mysql_query($sql, $dbh), 0, 0);
     if (!$status_exists) {
         $this->config["linked_status_to_deletion"] = 0;
     }
     if (!$this->config["cache_complete_records_seconds"]) {
         $this->config["cache_complete_records_seconds"] = 86400;
     }
     if ($this->config["deletion_management"] == 1 && !$this->config["deletion_management_transient_duration"]) {
         $this->config["deletion_management"] = 0;
     }
     //et maintenant les sets
     if (!is_array($included_sets)) {
         $included_sets = array($included_sets);
     }
     array_walk($included_sets, create_function('&$a', '$a+=0;'));
     //Virons ce qui n'est pas entier
     //Virons ce qui n'est pas un index de set de notice
     $sql = "SELECT connector_out_set_id FROM connectors_out_sets WHERE connector_out_set_type IN (" . implode(",", $this->allowed_set_types) . ") AND connector_out_set_id IN (" . implode(",", $included_sets) . ')';
     $res = pmb_mysql_query($sql, $dbh);
     $this->config["included_sets"] = array();
     while ($row = pmb_mysql_fetch_assoc($res)) {
         $this->config["included_sets"][] = $row["connector_out_set_id"];
     }
     //Vérifions que les formats autorisés proposés existent bien
     $allowed_paths = array();
     $admin_convert_catalog = external_services_converter_notices::get_export_possibilities();
     foreach ($admin_convert_catalog as $aconvert) {
         $allowed_paths[] = $aconvert["path"];
     }
     global $allowed_admin_convert_paths;
     if (!is_array($allowed_admin_convert_paths)) {
         $allowed_admin_convert_paths = array($allowed_admin_convert_paths);
     }
     $this->config["allowed_admin_convert_paths"] = array();
     foreach ($allowed_admin_convert_paths as $apath) {
         if (!in_array($apath, $allowed_paths)) {
             continue;
         }
         $this->config["allowed_admin_convert_paths"][] = $apath;
     }
     return;
 }
Exemplo n.º 6
0
$no_notice = pmb_mysql_result($resultat_max, 0, 0) * 1 + 1;
$z = 0;
if ($_SESSION["param_export"]["notice_exporte"]) {
    $notice_exporte = $_SESSION["param_export"]["notice_exporte"];
} else {
    $notice_exporte = array();
}
if ($_SESSION["param_export"]["bulletin_exporte"]) {
    $bulletin_exporte = $_SESSION["param_export"]["bulletin_exporte"];
} else {
    $bulletin_exporte = array();
}
while (list($id) = pmb_mysql_fetch_row($resultat)) {
    if (!$specialexport) {
        $e_notice = array();
        $param = new export_param(EXP_SESSION_CONTEXT);
        $e = new export(array($id), $notice_exporte, $bulletin_exporte);
        do {
            $nn = $e->get_next_notice($lender, $td, $sd, $keep_expl, $param->get_parametres($param->context));
            if ($e->notice) {
                $e_notice[] = $e->notice;
            }
        } while ($nn);
        $notice_exporte = $e->notice_exporte;
        //Pour les exemplaires de bulletin
        do {
            $nn = $e->get_next_bulletin($lender, $td, $sd, $keep_expl, $param->get_parametres($param->context));
            if ($e->notice) {
                $e_notice[] = $e->notice;
            }
        } while ($nn);
Exemplo n.º 7
0
 function getByRefContent($source_id, $notice_id, $uri, $entity)
 {
     global $include_path;
     global $openurl_map;
     $openurl_map = array();
     $params = $this->get_source_params($source_id);
     if ($params["PARAMETERS"]) {
         //Affichage du formulaire avec $params["PARAMETERS"]
         $vars = unserialize($params["PARAMETERS"]);
         foreach ($vars as $key => $val) {
             global ${$key};
             ${$key} = $val;
         }
     }
     require_once $include_path . "/parser.inc.php";
     _parser_($include_path . "/openurl/openurl_mapping.xml", array("ITEM" => "_getMapItem_"), "MAP");
     if ($entity) {
         //récupère les param d'exports
         $export_param = new export_param();
         $param = $export_param->get_parametres($export_param->context);
         //petit nettoyage pour un bon fonctionnement...
         foreach ($param as $key => $value) {
             $param["exp_" . $key] = $param[$key];
         }
         //maintenant que c'est en ordre, on peut y aller!
         $export = new export(array($notice_id), array(), array());
         $export->get_next_notice("", array(), array(), false, $param);
         $elem = new $openurl_map[$uri]['class']($export->xml_array, true);
         $elem->setEntityType($entity);
         print $elem->serialize();
     } else {
         //si on demande pas une entité, c'est un contextObject
         $openurl_param = new openurl_parameters();
         $openurl_param->setParameters($vars);
         $openurl_instance = new openurl_instance($notice_id, 0, $openurl_param->getParameters(), $source_id);
         $openurl_instance->generateContextObject();
         print $openurl_instance->contextObject->serialize();
     }
 }
Exemplo n.º 8
0
    $requete = "select idtyp_doc, concat(tdoc_libelle) as lib from docs_type, exemplaires, lenders where idtyp_doc=expl_typdoc and expl_owner={$id_lender} and (idlender=tdoc_owner or tdoc_owner=0) group by expl_typdoc";
    $typ_doc_lists .= "<div id=\"dtypdoc{$id_lender}\" style=\"display:none\">";
    $typ_doc_lists .= gen_liste($requete, "idtyp_doc", "lib", "typdoc" . $id_lender . "[]", "", "", "", "", "", "", 1);
    $typ_doc_lists .= "</div>";
}
//Tous les types
$requete = "select idtyp_doc, concat(tdoc_libelle) as lib from docs_type order by lib";
$typ_doc_lists .= "<div id=\"dtypdocx\" style=\"display:block\">";
$typ_doc_lists .= gen_liste($requete, "idtyp_doc", "lib", "typdocx[]", "", "", "", "", "", "", 1);
$typ_doc_lists .= "</div>";
$form = str_replace("!!typ_doc_lists!!", $typ_doc_lists, $form);
//Status
$requete = "select idlender, lender_libelle from lenders";
$resultat = mysql_query($requete);
while (list($id_lender, $lender_libelle) = mysql_fetch_row($resultat)) {
    //Récupération des codes exemplaires du propriétaire ayant le statut
    $requete = "select idstatut, concat(statut_libelle) as lib from docs_statut, exemplaires, lenders where idstatut=expl_statut and expl_owner={$id_lender} and (idlender=statusdoc_owner or statusdoc_owner=0) group by expl_statut";
    $statut_lists .= "<div id=\"dstatut{$id_lender}\" style=\"display:none\">";
    $statut_lists .= gen_liste($requete, "idstatut", "lib", "statut" . $id_lender . "[]", "", "", "", "", "", "", 1);
    $statut_lists .= "</div>";
}
//Tous les status
$requete = "select idstatut, concat(statut_libelle) as lib from docs_statut order by lib";
$statut_lists .= "<div id=\"dstatutx\" style=\"display:block\">";
$statut_lists .= gen_liste($requete, "idstatut", "lib", "statutx[]", "", "", "", "", "", "", 1);
$statut_lists .= "</div>";
$form = str_replace("!!statut_lists!!", $statut_lists, $form);
$param = new export_param(EXP_DEFAULT_GESTION);
$form = str_replace("!!form_param!!", $param->check_default_param(), $form);
echo pmb_bidi($form);
print "</body></html>";
Exemplo n.º 9
0
 function start_export($id_notice, $type_export, $param_export)
 {
     global $i;
     global $param_path;
     global $specialexport;
     global $output_type;
     global $output_params;
     global $step;
     global $export_type;
     global $base_path;
     global $class_path;
     global $include_path;
     global $msg;
     $step = array();
     if ($id_notice) {
         $this->id_notice = $id_notice;
         $this->export_type = $type_export;
         $export_type = $type_export;
         $this->param_export = $param_export;
         //Récupération du répertoire
         $i = 0;
         $param_path = "";
         if (file_exists("{$base_path}/admin/convert/imports/catalog_subst.xml")) {
             $fic_catal = "{$base_path}/admin/convert/imports/catalog_subst.xml";
         } else {
             $fic_catal = "{$base_path}/admin/convert/imports/catalog.xml";
         }
         _parser_($fic_catal, array("ITEM" => "_item_"), "CATALOG");
         //Lecture des paramètres
         _parser_("{$base_path}/admin/convert/imports/" . $param_path . "/params.xml", array("IMPORTNAME" => "_import_name_", "STEP" => "_step_", "OUTPUT" => "_output_", "INPUT" => "_input_"), "PARAMS");
         //Si l'export est spécial, on charge la fonction d'export
         if ($specialexport) {
             require_once "{$base_path}/admin/convert/imports/" . $param_path . "/export.inc.php";
         }
         //En fonction du type de fichier de sortie, inclusion du script de gestion des sorties
         switch ($output_type) {
             case "xml":
                 require_once "{$base_path}/admin/convert/imports/output_xml.inc.php";
                 break;
             case "iso_2709":
                 require_once "{$base_path}/admin/convert/imports/output_iso_2709.inc.php";
                 break;
             case "custom":
                 require_once "{$base_path}/admin/convert/imports/" . $param_path . "/" . $output_params['SCRIPT'];
                 break;
             case "txt":
                 require_once "{$base_path}/admin/convert/imports/output_txt.inc.php";
                 break;
             default:
                 die($msg["export_cant_find_output_type"]);
         }
         $e_notice = array();
         if ($_SESSION["param_export"]["notice_exporte"]) {
             $notice_exporte = $_SESSION["param_export"]["notice_exporte"];
         } else {
             $notice_exporte = array();
         }
         if ($_SESSION["param_export"]["bulletin_exporte"]) {
             $bulletin_exporte = $_SESSION["param_export"]["bulletin_exporte"];
         } else {
             $bulletin_exporte = array();
         }
         if (!$specialexport) {
             $param = new export_param(EXP_DSI_CONTEXT, $this->param_export);
             $e = new export(array($this->id_notice), $notice_exporte, $bulletin_exporte);
             do {
                 $nn = $e->get_next_notice("", "", "", 0, $param->get_parametres($param->context));
                 if ($e->notice) {
                     $e_notice[] = $e->notice;
                 }
             } while ($nn);
             $notice_exporte = $e->notice_exporte;
             $_SESSION["param_export"]["notice_exporte"] = $notice_exporte;
             //Pour les exemplaires de bulletin
             do {
                 $nn = $e->get_next_bulletin("", "", "", 0, $param->get_parametres($param->context));
                 if ($e->notice) {
                     $e_notice[] = $e->notice;
                 }
             } while ($nn);
             $bulletin_exporte = $e->bulletins_exporte;
             $_SESSION["param_export"]["bulletin_exporte"] = $bulletin_exporte;
         } else {
             $e_notice = _export_($this->id_notice);
         }
         if (!is_array($e_notice)) {
             $this->prepared_notice = $e_notice;
             $this->output_notice .= $this->transform();
         } else {
             for ($i = 0; $i < sizeof($e_notice); $i++) {
                 $this->prepared_notice = $e_notice[$i];
                 $this->output_notice .= $this->transform();
             }
         }
     }
 }
Exemplo n.º 10
0
    die("no access");
}
require_once "{$include_path}/templates/export_param.tpl.php";
require_once $class_path . "/export_param.class.php";
switch ($act) {
    case 'update':
        if ($sub == 'paramopac') {
            $export_param_context = new export_param(EXP_GLOBAL_CONTEXT);
            $export_param_context->get_parametres(EXP_DEFAULT_OPAC);
            $export_param_context->update();
            $export_param_context->check_default_param();
        } elseif ($sub == 'paramgestion') {
            $export_param_context = new export_param(EXP_GLOBAL_CONTEXT);
            $export_param_context->get_parametres(EXP_DEFAULT_GESTION);
            $export_param_context->update();
            $export_param_context->check_default_param();
        }
        $act = '';
        break;
    default:
        if ($sub == 'paramopac') {
            $export_param_opac = new export_param(EXP_DEFAULT_OPAC);
            $export_param_opac->check_default_param();
        } else {
            $export_param_gestion = new export_param(EXP_DEFAULT_GESTION);
            $export_param_gestion->check_default_param();
        }
        break;
}
$form_entete_param = str_replace('!!form_param!!', $form_param, $form_entete_param);
print $form_entete_param;