public function get_form()
 {
     $args = "num_record:" . $this->id . "";
     if ($this->id_parent) {
         $args .= ",child_detail :\"" . addslashes(encoding_normalize::json_encode($this->nomenclature_record->record_child->get_data())) . "\"";
     } else {
         $args .= ",record_formations :\"" . addslashes(encoding_normalize::json_encode($this->nomenclature_record->record_formations->get_data())) . "\"";
     }
     $div = nomenclature_datastore::get_form();
     return $div . "<div data-dojo-type='apps/nomenclature/nomenclature_record_ui' data-dojo-props='" . $args . "'></div>";
 }
 function process($source_id, $pmb_user_id)
 {
     global $opac_biblio_name, $opac_biblio_email;
     global $biblio_name, $biblio_adr1, $biblio_adr2, $biblio_cp, $biblio_town, $biblio_state, $biblio_country, $biblio_phone, $biblio_email, $biblio_website;
     global $biblio_logo;
     $source = new bibloto_source($this, $source_id, $this->msg);
     $param = $source->config;
     $param['biblio']['name'] = $opac_biblio_name;
     $param['biblio']['adr1'] = $biblio_adr1;
     $param['biblio']['adr2'] = $biblio_adr2;
     $param['biblio']['cp'] = $biblio_cp;
     $param['biblio']['town'] = $biblio_town;
     $param['biblio']['phone'] = $biblio_phone;
     $param['biblio']['email'] = $opac_biblio_email;
     echo encoding_normalize::json_encode($param);
     return;
 }
 public function get_form()
 {
     return "\n\t\t\t<script type='text/javascript' src='./javascript/instru_drag_n_drop.js'></script>\n\t\t\t<script type='text/javascript' src='./javascript/drag_n_drop.js'></script>\n\t\t\t<script type='text/javascript' src='./javascript/ajax.js'></script>\n\t\t\t<script type='text/javascript' >\t\n\t\t\t\tfunction mis_en_forme_instrument(id){\n\t\t\t\t\tvar str=document.getElementById(id).value;\n\t\t\t\t\tvar res = str.split(' - ');\n\t\t\t\t\tif(res[0]) document.getElementById(id).value=res[0];\n\t\t\t\t}\n\t\t\t</script>\n\t\t\t<div id='nomenclature_tutti' data-dojo-type='apps/nomenclature/nomenclature_nomenclature_ui' data-dojo-props='nomenclature_abbr:\"" . $this->nomenclature->get_abbreviation() . "\",nomenclature_tree:\"" . addslashes(json_encode(encoding_normalize::utf8_normalize($this->nomenclature->get_families_tree()))) . "\",nomenclature_indefinite_character:\"" . $this->nomenclature->get_indefinite_character() . "\",workshop_tree:\"" . addslashes(json_encode(encoding_normalize::utf8_normalize($this->nomenclature->get_workshops_tree()))) . "\"'></div>";
 }
// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: ajax_main.inc.php,v 1.1 2015-07-31 16:06:57 vtouchard Exp $
require_once $class_path . '/expl.class.php';
require_once $include_path . '/connecteurs_out_common.inc.php';
switch ($sub) {
    case 'update_cb':
        if (isset($old_cb) && isset($new_cb) && (trim($old_cb) != '' && trim($new_cb) != '')) {
            switch (exemplaire::update_cb($old_cb, $new_cb)) {
                case 0:
                    //Le nouveau code est déjà utilisé dans pmb
                    print encoding_normalize::json_encode(array('status' => 0, 'message' => $msg['pointage_message_code_utilise']));
                    break;
                case 1:
                    //La mise à jour a fonctionnée
                    print encoding_normalize::json_encode(array('status' => 1, 'message' => ''));
                    break;
                case 2:
                    //Impossible d'effectuer la mise à jour
                    print encoding_normalize::json_encode(array('status' => 2, 'message' => $msg['circ_edit_cb_end_up']));
                    break;
                case 3:
                    //L'utilisateur n'a pas les droits nécessaires pour effectuer la mise à jour
                    print encoding_normalize::json_encode(array('status' => 3, 'message' => $msg[12]));
                    break;
            }
        }
        break;
}
<?php

// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: nomenclature.inc.php,v 1.4 2015-02-10 17:45:39 arenou Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
switch ($sub) {
    case 'record_child':
        require_once $class_path . "/nomenclature/nomenclature_record_child_ui.class.php";
        $record_child = new nomenclature_record_child_ui($id);
        switch ($action) {
            case "create":
                print encoding_normalize::json_encode($record_child->create_record_child($id_parent));
                break;
            case "get_child":
                print $record_child->get_child($id_parent);
                break;
            case "get_possible_values":
                print $record_child->get_possible_values($id_parent);
                break;
        }
        break;
}
<?php

// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: messages.inc.php,v 1.3 2015-02-19 13:56:20 vtouchard Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
require_once $class_path . "/encoding_normalize.class.php";
switch ($action) {
    case 'get_messages':
        if ($group) {
            if ($messages->table_js[$group]) {
                $array_message_retourne = array();
                foreach ($messages->table_js[$group] as $key => $value) {
                    $array_message_retourne[] = array("code" => $key, "message" => $value, "group" => $group);
                }
                print encoding_normalize::json_encode($array_message_retourne);
            } else {
                print encoding_normalize::json_encode(array());
            }
        }
        break;
}
                    $response = array('result' => $result, 'elementId' => $docwatch_datasource->get_id(), 'response' => $response);
                    print encoding_normalize::json_encode($response);
                }
                break;
            case "get_env":
                $element = new $elem();
                print $element->get_page_env_select($pageid, $name, $var);
                break;
        }
        break;
    case "forms":
        require_once $class_path . "/docwatch/docwatch_ui.class.php";
        switch ($action) {
            case "get_form":
                switch ($form) {
                    case "docwatch_watch_form_tpl":
                        print docwatch_ui::get_watch_form();
                        break;
                    case "docwatch_category_form_tpl":
                        print docwatch_ui::get_category_form();
                        break;
                }
                break;
            case "get_datas":
                print encoding_normalize::json_encode(array("categoryForm" => docwatch_ui::get_category_form(), "watchForm" => docwatch_ui::get_watch_form()));
                break;
        }
        break;
    default:
        break;
}
 static function getAutomaticTu($notice)
 {
     global $dbh, $charset, $opac_enrichment_bnf_sparql;
     if (!$opac_enrichment_bnf_sparql) {
         return 0;
     }
     $requete = "select code, responsability_author from notices left join responsability on (responsability_notice={$notice} and responsability_type=0)\n\t\t\tleft join notices_titres_uniformes on notice_id=ntu_num_notice where notice_id={$notice} and ntu_num_notice is null";
     $resultat = pmb_mysql_query($requete, $dbh);
     if (pmb_mysql_num_rows($resultat, $dbh)) {
         $code = pmb_mysql_result($resultat, 0, 0, $dbh);
         $id_author = pmb_mysql_result($resultat, 0, 1, $dbh);
     } else {
         $code = "";
     }
     $id_tu = 0;
     if (isISBN($code)) {
         $uri = titre_uniforme::get_data_bnf_uri($code);
         if ($uri) {
             //Recherche du titre uniforme déjà existant ?
             $requete = "select tu_id from titres_uniformes where tu_databnf_uri='" . addslashes($uri) . "'";
             $resultat = pmb_mysql_query($requete, $dbh);
             if (pmb_mysql_num_rows($resultat, $dbh)) {
                 $id_tu = pmb_mysql_result($resultat, 0, 0, $dbh);
             } else {
                 //Interrogation de data.bnf pour obtenir les infos !
                 $configbnf = array('remote_store_endpoint' => 'http://data.bnf.fr/sparql');
                 $storebnf = ARC2::getRemoteStore($configbnf);
                 $sparql = "\n\t\t\t\t\t\tPREFIX dc: <http://purl.org/dc/terms/>\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tSELECT ?title ?date ?description WHERE {\n\t\t\t\t\t\t  <" . $uri . "> dc:title ?title.\n\t\t\t\t\t\t  OPTIONAL { <" . $uri . "> dc:date ?date. }\n\t\t\t\t\t\t  OPTIONAL { <" . $uri . "> dc:description ?description. }\n\t\t\t\t\t\t}";
                 $rows = $storebnf->query($sparql, 'rows');
                 // On vérifie qu'il n'y a pas d'erreur sinon on stoppe le programme et on renvoi une chaine vide
                 $err = $storebnf->getErrors();
                 if (!$err) {
                     $value = array("name" => encoding_normalize::charset_normalize($rows[0]['title'], "utf-8"), "num_author" => $id_author, "date" => encoding_normalize::charset_normalize($rows[0]['date'], "utf-8"), "comment" => encoding_normalize::charset_normalize($rows[0]['description'], "utf-8"), "databnf_uri" => $uri);
                     $id_tu = titre_uniforme::import($value);
                 }
             }
         }
     }
     if ($id_tu) {
         $titres_uniformes = array(array("num_tu" => $id_tu));
         $ntu = new tu_notice($notice);
         $ntu->update($titres_uniformes);
     }
     return $id_tu;
 }
 public static function get_form()
 {
     global $pmb_nomenclature_record_children_link;
     $datas = nomenclature_datastore::get_datas();
     $messages = nomenclature_datastore::get_messages();
     $formations_json_datastore = json_encode(encoding_normalize::utf8_normalize($datas["formations_datastore"]), JSON_HEX_APOS | JSON_HEX_QUOT);
     $families_json_datastore = json_encode(encoding_normalize::utf8_normalize($datas["families_datastore"]), JSON_HEX_APOS | JSON_HEX_QUOT);
     $instruments_json_datastore = json_encode(encoding_normalize::utf8_normalize($datas["instruments_datastore"]), JSON_HEX_APOS | JSON_HEX_QUOT);
     $voices_json_datastore = json_encode(encoding_normalize::utf8_normalize($datas["voices_datastore"]), JSON_HEX_APOS | JSON_HEX_QUOT);
     $messages_json_datastore = json_encode(encoding_normalize::utf8_normalize($messages), JSON_HEX_APOS | JSON_HEX_QUOT);
     $div = "\n  \t\t<div id='nomenclature_datastore' data-dojo-type='apps/nomenclature/nomenclature_datastore' data-dojo-props= 'relation_code:\"" . $pmb_nomenclature_record_children_link . "\",formations_datastore:\"" . addslashes($formations_json_datastore) . "\" ,families_datastore:\"" . addslashes($families_json_datastore) . "\" , instruments_datastore:\"" . addslashes($instruments_json_datastore) . "\" , voices_datastore:\"" . addslashes($voices_json_datastore) . "\", messages_datastore:\"" . addslashes($messages_json_datastore) . "\"'/></div>";
     return $div;
 }
 public function get_form()
 {
     $data = encoding_normalize::json_encode($this->record_formations->get_data());
     $div .= "\n  \t\t<script type='text/javascript' src='./javascript/instru_drag_n_drop.js'></script>\n  \t\t<div id='nomenclature_record_formations_" . $this->record_formations->get_id() . "' data-dojo-type='apps/nomenclature/nomenclature_record_formations_ui' data-dojo-props='num_record:" . $this->record_formations->id . ",record_formations:\"" . addslashes($data) . "\"'></div>";
     return $div;
 }
<?php

// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: ajax_main.inc.php,v 1.2 2015-12-24 13:36:11 vtouchard Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
require_once $class_path . '/encoding_normalize.class.php';
require_once $class_path . '/form_mapper/form_mapper.class.php';
if ($quoi && $id && $sub) {
    $mapper = form_mapper::getMapper($quoi, $id);
    if ($mapper) {
        $mapper->setId($id);
        $mapping = $mapper->getMapping($sub);
        print encoding_normalize::json_encode($mapping);
    } else {
        print encoding_normalize::json_encode(array('mapping' => 'false'));
    }
}
function print_info($expl, $mode_affichage = 0, $affichage_emprunteurs = 1, $affichage_zone_notes = 1)
{
    global $msg;
    global $pmb_sur_location_activate;
    global $pmb_location_resa_planning;
    global $pmb_expl_show_lastempr;
    global $pmb_droits_explr_localises, $explr_visible_mod;
    // $expl est l'objet exemplaire rempli avec ce qu'il faut
    // $mode_affichage :
    //	0 en liste dépliable : le contenu est affiché dans le div
    //	1 : le contenu est affiché APRES l'isbd, sans liste dépliable
    //	2 : le contenu n'est pas affiché du tout
    if (!is_object($expl)) {
        die("serious application error occured in ./circ/visu_ex.inc [print_info()]. Please contact developpment team");
    }
    switch ($mode_affichage) {
        case '0':
            $temp = "\n\t\t\t\t<div id='el!!id!!Parent' class='notice-parent'>\n\t    \t\t\t<img src='./images/plus.gif' class='img_plus' name='imEx' id='el!!id!!Img' title='" . $msg['admin_param_detail'] . "' border='0' onClick=\"expandBase('el!!id!!', true); return false;\" hspace='3'>\n\t    \t\t\t<span class='notice-heada'>!!heada!!</span>\n\t    \t\t\t<br />\n\t\t\t\t</div>\n\t\t\t\t<div id='el!!id!!Child' class='notice-child' style='margin-bottom:6px;display:none;'>\n\t        \t   \t!!contenu!!\n\t \t\t\t</div>\n\t\t\t\t";
            $temp = str_replace('!!id!!', $expl->expl_id, $temp);
            if ($expl->expl_bulletin) {
                if (SESSrights & CATALOGAGE_AUTH) {
                    $heada = "<a href='./catalog.php?categ=serials&sub=bulletinage&action=expl_form&bul_id=" . $expl->expl_bulletin . "&expl_id=" . $expl->expl_id . "'>" . $msg[376] . "&nbsp;" . $expl->expl_cb . "</a> / " . $expl->aff_reduit;
                } else {
                    $heada = "<a href='./circ.php?categ=visu_ex&form_cb_expl=" . rawurlencode($expl->expl_cb) . "'>" . $msg[376] . "&nbsp;" . $expl->expl_cb . "</a> / " . $expl->aff_reduit;
                }
            } else {
                if (SESSrights & CATALOGAGE_AUTH) {
                    $heada = "<a href='./catalog.php?categ=edit_expl&id=" . $expl->expl_notice . "&expl_id=" . $expl->expl_id . "'>" . $msg[376] . "&nbsp;" . $expl->expl_cb . "</a> / " . $expl->aff_reduit;
                } else {
                    $heada = "<a href='./circ.php?categ=visu_ex&form_cb_expl=" . rawurlencode($expl->expl_cb) . "'>" . $msg[376] . "&nbsp;" . $expl->expl_cb . "</a> / " . $expl->aff_reduit;
                }
            }
            $temp = str_replace('!!heada!!', $expl->lien_suppr_cart . $heada, $temp);
            break;
        case '1':
            $selector_prop = "toolbar=no, dependent=yes, resizable=yes, scrollbars=yes";
            $cart_click_expl = "onClick=\"openPopUp('./cart.php?object_type=EXPL&item=" . $expl->expl_id . "', 'cart', 600, 700, -2, -2, '{$selector_prop}')\"";
            $cart_click_expl = "<img src='./images/basket_small_20x20.gif' align='middle' alt='basket' title=\"{$msg[400]}\" {$cart_click_expl}>";
            if ($expl->expl_notice) {
                $cart_click_isbd = "onClick=\"openPopUp('./cart.php?object_type=NOTI&item={$expl->expl_notice}', 'cart', 600, 700, -2, -2, '{$selector_prop}')\"";
            } elseif ($expl->expl_bulletin) {
                $cart_click_isbd = "onClick=\"openPopUp('./cart.php?object_type=BULL&item=" . $expl->expl_bulletin . "', 'cart', 600, 700, -2, -2, '{$selector_prop}')\"";
            }
            $cart_click_isbd = "<img src='./images/basket_small_20x20.gif' align='middle' alt='basket' title=\"{$msg[400]}\" {$cart_click_isbd}>";
            if (SESSrights & CATALOGAGE_AUTH) {
                $link_cb_not = "<a href='./catalog.php?categ=edit_expl&id=" . $expl->expl_notice . "&expl_id=" . $expl->expl_id . "'>";
                $link_cb_bull = "<a href='./catalog.php?categ=serials&sub=bulletinage&action=expl_form&bul_id=" . $expl->expl_bulletin . "&expl_id=" . $expl->expl_id . "'>";
                $link_cb_end = "</a>";
                if ($pmb_droits_explr_localises) {
                    $explr_tab_modif = explode(",", $explr_visible_mod);
                    if (array_search($expl->expl_location, $explr_tab_modif) === false) {
                        $link_cb_not = "";
                        $link_cb_bull = "";
                        $link_cb_end = "";
                    }
                }
                if ($expl->expl_bulletin) {
                    $temp = "<div class='row'><h1>{$cart_click_expl}&nbsp;{$link_cb_bull}{$msg[376]}&nbsp;" . $expl->expl_cb . "{$link_cb_end} : {$cart_click_isbd}&nbsp;" . $expl->aff_reduit . "</h1></div><div class='row'><b>" . $expl->isbd . "</b></div>";
                } else {
                    $temp = "<div class='row'><h1>{$cart_click_expl}&nbsp;{$link_cb_not}{$msg[376]}&nbsp;" . $expl->expl_cb . "{$link_cb_end} : {$cart_click_isbd}&nbsp;" . $expl->aff_reduit . "</h1></div><div class='row'><b>" . $expl->isbd . "</b></div>";
                }
            } else {
                $temp = "<div class='row'><h1>{$cart_click_expl}&nbsp;{$msg[376]}&nbsp;" . $expl->expl_cb . " : {$cart_click_isbd}&nbsp;" . $expl->aff_reduit . "</h1></div><div class='row'><b>" . $expl->isbd . "</b></div>";
            }
            break;
    }
    // isbd complet
    $__isbd .= "<div class=\"row\">";
    $__isbd .= $expl->aff_reduit;
    $__isbd .= "</div>";
    $__modif_cb = '';
    if (SESSrights & CATALOGAGE_AUTH + CATAL_MODIF_CB_EXPL_AUTH) {
        $__modif_cb .= "<hr /><div class='row'><input type='button' id='button_edit_cb' class='bouton' value='{$msg['circ_edit_cb']}'/><br/>";
        $__modif_cb .= "<input type='text' id='input_edit_cb' style='display:none;'/>";
        $__modif_cb .= "<input type='button' class='bouton' value='" . $msg['transferts_popup_btValider'] . "' id='button_send_edit' style='display:none;'/>";
        $__modif_cb .= "</div>";
        $__modif_cb .= "<script>\n\t\t\t\t\t\tvar editButton = document.getElementById('button_edit_cb');\n\t\t\t\t\t\tvar callbackEnter = function(evt){\n\t\t\t\t\t\t\tvar key = evt.which || evt.keyCode;\n\t\t\t\t\t\t\tif (key === 13) { \n\t\t\t\t\t\t\t\tif(evt.target.value.replace(/^\\s+\$/g,'').length == 0) {\n\t\t\t\t\t\t\t\t\talert('{$msg['326']}');\n\t\t\t\t\t\t\t\t\tevt.target.focus();\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\tlaunchUpdateRequest();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar launchUpdateRequest = function(){\n\t\t\t\t\t\t\tvar request = new http_request();\n\t\t\t\t\t\t\tvar inputCb = document.getElementById('input_edit_cb');\n\t\t\t\t\t\t\tvar callback = function(response){\n\t\t\t\t\t\t\t\tresponse = JSON.parse(response);\n\t\t\t\t\t\t\t\tif(response.status == 1){\n\t\t\t\t\t\t\t\t\tdocument.location.href = './circ.php?categ=visu_ex&form_cb_expl=' + encode_URL(inputCb.value);\n\t\t\t\t\t\t\t\t}else{ //Print message derreur\n\t\t\t\t\t\t\t\t\talert(response.message);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\trequest.request('./ajax.php?module=circ&categ=expl&sub=update_cb&old_cb=" . rawurlencode(encoding_normalize::utf8_normalize($expl->expl_cb)) . "&new_cb='+encodeURIComponent(inputCb.value), false,'', true, callback);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar callbackButton = function(evt){\n\t\t\t\t\t\t\tvar inputCb = document.getElementById('input_edit_cb');\n\t\t\t\t\t\t\tif(inputCb.value.replace(/^\\s+\$/g,'').length == 0) {\n\t\t\t\t\t\t\t\talert('{$msg['326']}');\n\t\t\t\t\t\t\t\tinputCb.focus();\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tlaunchUpdateRequest();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar showCbInput = function(evt){\n\t\t\t\t\t\t\tvar inputCb = document.getElementById('input_edit_cb');\n\t\t\t\t\t\t\tvar buttonValid = document.getElementById('button_send_edit');\n\t\t\t\t\t\t\tif(inputCb.style.display == 'none' && buttonValid.style.display == 'none'){\n\t\t\t\t\t\t\t\tinputCb.style.display = '';\n\t\t\t\t\t\t\t\tinputCb.addEventListener('keypress', callbackEnter, true);\n\t\t\t\t\t\t\t\tinputCb.focus();\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tbuttonValid.style.display = '';\n\t\t\t\t\t\t\t\tbuttonValid.addEventListener('click', callbackButton, true);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tinputCb.removeEventListener('keypress', callbackEnter, false);\n\t\t\t\t\t\t\t\tinputCb.style.display = 'none';\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tbuttonValid.removeEventListener('click', callbackButton, false);\n\t\t\t\t\t\t\t\tbuttonValid.style.display = 'none';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\teditButton.addEventListener('click', showCbInput, false);\t\t\t\t\t\n\t\t\t\t\t  </script>";
    }
    // informations de localisation
    $__local .= "<hr /><div class=\"row\">";
    if ($pmb_sur_location_activate) {
        $__local .= $msg["sur_location_expl"] . ":&nbsp;<b>" . $expl->sur_loc_libelle . "</b>&nbsp;&nbsp;";
    }
    $__local .= "{$msg['298']}:&nbsp;<b>" . $expl->location_libelle . "</b>&nbsp;&nbsp;\n\t\t\t{$msg['295']}:&nbsp;<b>" . $expl->section_libelle . "</b>&nbsp;&nbsp;\n\t\t\t{$msg['296']}:&nbsp;<b>" . $expl->expl_cote . "</b><br />";
    $__local .= "{$msg['297']}:&nbsp;" . $expl->statut_libelle;
    // tester si réservé
    $sql = "SELECT resa_cb from resa_ranger where resa_cb='" . addslashes($expl->expl_cb) . "'";
    $execute_query = pmb_mysql_query($sql);
    if (pmb_mysql_num_rows($execute_query)) {
        $situation = $msg['resa_menu_a_ranger'];
    } elseif ($expl->expl_retloc) {
        $situation = $msg['resa_menu_a_traiter'];
    } elseif (verif_cb_utilise($expl->expl_cb)) {
        $situation = $msg['expl_reserve'];
    } elseif ($expl->pret_flag && !$expl->pret_idempr) {
        $situation = "{$msg[359]}";
    } else {
        $situation = "";
    }
    $__local .= "&nbsp;&nbsp;<b>" . $situation . "</b><br />";
    $__local .= $msg[299] . ":&nbsp;<b>" . $expl->codestat_libelle . "</b><br />";
    $__local .= "</div>";
    if ($affichage_emprunteurs) {
        // zone de l'emprunteur
        if ($expl->pret_idempr) {
            $__empr .= "<hr /><div class='row'><b>{$msg['380']}</b><br /> ";
            $link = "<a href='./circ.php?categ=pret&form_cb=" . rawurlencode($expl->empr_cb) . "'>";
            $__empr .= $link . $expl->empr_prenom . " " . $expl->empr_nom . " (" . $expl->empr_cb . ")</a>";
            $__empr .= "&nbsp;{$msg[381]}&nbsp;" . $expl->aff_pret_date;
            $__empr .= ".&nbsp;{$msg[358]}&nbsp;" . $expl->aff_pret_retour . ".";
            $__empr .= "</div>";
        }
        // zone du dernier emrunteur
        if ($pmb_expl_show_lastempr && $expl->expl_lastempr) {
            $__empr .= "<hr /><div class='row'><b>{$msg['expl_lastempr']}</b><br /> ";
            $link = "<a href='./circ.php?categ=pret&form_cb=" . rawurlencode($expl->lastempr_cb) . "'>";
            $__empr .= $link . $expl->lastempr_prenom . ' ' . $expl->lastempr_nom . ' (' . $expl->lastempr_cb . ')</a>';
            $__empr .= "</div>";
        }
    }
    if ($affichage_zone_notes) {
        // zone du message exemplaire
        $__note = "<hr /><div class='row'>";
        $__note .= "<b>{$msg[377]}</b><br />";
        if ($expl->expl_note) {
            $__note .= "<div class='message_important'>" . $expl->expl_note . "</div>";
        }
        if ($expl->expl_comment) {
            $__note .= "<b>{$msg[expl_zone_comment]}</b><br />";
            $__note .= "<div class='expl_comment'>" . $expl->expl_comment . "</div>";
        }
        $__note .= "<br /><input type='button' class='bouton' value='{$msg['378']}' onclick=\"document.location='./circ.php?categ=note_ex&cb=" . rawurlencode($expl->expl_cb) . "&id=" . $expl->expl_id . "'\" />";
        $__note .= "</div><hr />";
    }
    // zone des réservations
    $__resa = check_resa_liste($expl);
    if ($__resa) {
        $__resa = "<div class=\"row\"><b>" . $msg["reserv_en_cours_doc"] . "</b><br />" . $__resa;
        $__resa .= "</div>";
    }
    // zone des réservations prévisionnelles
    if ($pmb_location_resa_planning) {
        $__resa_planning = check_resa_planning_liste($expl);
        if ($__resa_planning) {
            $__resa_planning = "<div class=\"row\"><b>" . $msg["previsions_en_cours_doc"] . "</b><br />" . $__resa_planning;
            $__resa_planning .= "</div>";
        }
    } else {
        $__resa_planning = "";
    }
    switch ($mode_affichage) {
        case '0':
            $temp = str_replace('!!contenu!!', $__isbd . $__modif_cb . $__local . $__empr . $__note . $__resa . $__resa_planning, $temp);
            break;
        case '1':
            $temp = str_replace('!!contenu!!', "", $temp);
            $temp .= $__modif_cb . $__local . $__empr . $__note . $__resa . $__resa_planning;
            break;
        case '2':
            $temp = str_replace('!!contenu!!', "", $temp);
            break;
    }
    return $temp;
}
    /** Fonctions: */
    public static function get_watch_form()
    {
        global $docwatch_watch_form_tpl, $msg;
        $marc_select = new marc_select("doctype", 'record_types');
        $cms_editorial_article = new cms_editorial_types('article');
        $cms_editorial_section = new cms_editorial_types('section');
        $cms_section = new cms_section();
        $cms_article = new cms_article();
        $cms_publication_state = new cms_editorial_publications_states();
        $status = $cms_publication_state->get_selector_options();
        $record_part = gen_plus("record_options", encoding_normalize::utf8_normalize($msg['dsi_docwatch_watch_form_options_record']), '<div class="row">
					<label>' . encoding_normalize::utf8_normalize($msg['dsi_docwatch_watch_form_record_default_type']) . '</label>
				</div>
				<div class="row">' . str_replace('<select', '<select data-dojo-type="dijit/form/Select" style="width:auto"', $marc_select->display) . '</div>
				<div class="row">
					<label>' . encoding_normalize::utf8_normalize($msg['dsi_docwatch_watch_form_record_default_status']) . '</label>
				</div>
				<div class="row">		
					<select  id="record_status" data-dojo-type="dijit/form/Select" style="width:auto" name="record_status">' . self::get_record_status() . '</select>
				</div>');
        $article_part = gen_plus("article_options", encoding_normalize::utf8_normalize($msg['dsi_docwatch_watch_form_options_article']), '<div class="row">
					<label>' . encoding_normalize::utf8_normalize($msg['dsi_docwatch_watch_form_article_default_content_type']) . '</label>
				</div>
				<div class="row">
					<select  id="article_type" data-dojo-type="dijit/form/Select" style="width:auto" name="article_type">' . $cms_editorial_article->get_selector_options() . '</select>
				</div>
				<div class="row">
					<label>' . encoding_normalize::utf8_normalize($msg['dsi_docwatch_watch_form_article_default_publication_status']) . '</label>
				</div>
				<div class="row">
					<select  id="article_status" data-dojo-type="dijit/form/Select" style="width:auto" name="article_status">' . $status . '</select>
				</div>
				<div class="row">
					<label>' . encoding_normalize::utf8_normalize($msg['dsi_docwatch_watch_form_article_default_parent']) . '</label>
				</div>
				<div class="row">
					<select  id="article_parent" data-dojo-type="dijit/form/Select" style="width:auto" name="article_parent">' . $cms_article->get_parent_selector() . '</select>
				</div>');
        $section_part = gen_plus("section_options", encoding_normalize::utf8_normalize($msg['dsi_docwatch_watch_form_options_section']), '<div class="row">
					<label>' . encoding_normalize::utf8_normalize($msg['dsi_docwatch_watch_form_section_default_content_type']) . '</label>
				</div>
				<div class="row">
					<select  id="section_type" data-dojo-type="dijit/form/Select" style="width:auto" name="section_type">' . $cms_editorial_section->get_selector_options() . '</select>
				</div>
				<div class="row">
					<label>' . encoding_normalize::utf8_normalize($msg['dsi_docwatch_watch_form_section_default_publication_status']) . '</label>
				</div>
				<div class="row">
					<select  id="section_status" data-dojo-type="dijit/form/Select" style="width:auto" name="section_status">' . $status . '</select>
				</div>
				<div class="row">
					<label>' . encoding_normalize::utf8_normalize($msg['dsi_docwatch_watch_form_section_default_parent']) . '</label>
				</div>
				<div class="row">
					<select  id="section_parent" data-dojo-type="dijit/form/Select" style="width:auto" name="section_parent">' . $cms_section->get_parent_selector() . '</select>
				</div>');
        $form = $docwatch_watch_form_tpl;
        $form = str_replace('!!users_checkboxes!!', self::generate_users(), $form);
        $form = str_replace('!!options_record!!', $record_part, $form);
        $form = str_replace('!!options_article!!', $article_part, $form);
        $form = str_replace('!!options_section!!', $section_part, $form);
        return $form;
    }
<?php

// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: nomenclature_instrument.tpl.php,v 1.1 2016-01-06 15:05:58 dgoron Exp $
if (stristr($_SERVER['REQUEST_URI'], ".tpl.php")) {
    die("no access");
}
$nomenclature_instrument_dialog_tpl = "\n<div style='width: 400px; height: 500px; overflow: auto;'>\n<form data-dojo-attach-point='containerNode' data-dojo-attach-event='onreset:_onReset,onsubmit:_onSubmit' {${!nameAttrSetting}}>\n\t<div class='form-contenu'>\n\t\t<div class='row'>\n\t\t\t<label class='etiquette' for='code'>" . encoding_normalize::utf8_normalize($msg['admin_nomenclature_instrument_form_code']) . "</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<input type='text' class='saisie-50em' name='code' id='code' value='' />\n\t\t</div>\t\t\t\t\n\t\t<div class='row'>\n\t\t\t<label class='etiquette' for='name'>" . encoding_normalize::utf8_normalize($msg['admin_nomenclature_instrument_form_name']) . "</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<input type='text' class='saisie-50em' name='name' id='name' value='' />\n\t\t</div>\t\t\t\t\t\n\t\t<div class='row'>\n\t\t\t<label class='etiquette' for='musicstand'>" . encoding_normalize::utf8_normalize($msg['admin_nomenclature_instrument_form_musicstand']) . "</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t!!musicstand!!\n\t\t</div>\t\t\t\t\n\t\t<div class='row'>\n\t\t\t<label class='etiquette' for='name'>" . encoding_normalize::utf8_normalize($msg['admin_nomenclature_instrument_form_standard']) . "</label>\n\t\t</div>\n\t\t<div class='row'>\n\t\t\t<input type='checkbox' name='standard' id='standard' value='1' />\n\t\t</div>\t\t\n\t\t<div class='row'> \n\t\t</div>\n\t</div>\n\t<div class='erreur' id='nomenclature_instrument_save_error'></div>\n\t<div class='row'>\n\t\t<div class='left'>\n\t\t\t<button data-dojo-type='dijit/form/Button' id='nomenclature_instrument_form_exit' type='button'>" . encoding_normalize::utf8_normalize($msg['admin_nomenclature_instrument_form_exit']) . "</button>\n\t\t\t<button data-dojo-type='dijit/form/Button' id='nomenclature_instrument_form_save' type='submit'>" . encoding_normalize::utf8_normalize($msg['admin_nomenclature_instrument_form_save']) . "</button>\n\t\t</div>\n\t\t<div class='right'>\t\t\n\t\t</div>\n\t</div>\n\t<div class='row'></div>\n</form>\n</div>";
            return false;
        } else {
            print encoding_normalize::json_encode(array('status' => false));
        }
        break;
    case "get_datas":
        $datas = json_decode(stripslashes($datas));
        $query = 'select grille_auth_descr_format from grilles_auth
					where grille_auth_type="' . addslashes($datas->authType) . '"
					and grille_auth_filter="' . addslashes($datas->authSign) . '"';
        $result = pmb_mysql_query($query);
        if ($result && pmb_mysql_num_rows($result)) {
            $datas = pmb_mysql_result($result, 0);
            print encoding_normalize::json_encode(array('status' => true, 'datas' => $datas));
        } else {
            print encoding_normalize::json_encode(array('status' => false));
        }
        break;
    default:
        ajax_http_send_error("404 Not Found", "Invalid command : " . $action);
        break;
}
function save_grid($auth_type, $auth_sign, $zones)
{
    global $dbh;
    $query = 'select grille_auth_type from grilles_auth
					where grille_auth_type="' . addslashes($auth_type) . '"
					and grille_auth_filter="' . addslashes($auth_sign) . '"';
    $result = pmb_mysql_query($query);
    if ($result && pmb_mysql_num_rows($result)) {
        $requete = 'update grilles_auth set
Exemple #16
0
        $css = $_SESSION["css"] = $opac_default_style;
    }
}
// si paramétrage authentification particulière et pour la re-authentification ntlm
if (file_exists($base_path . '/includes/ext_auth.inc.php')) {
    require_once $base_path . '/includes/ext_auth.inc.php';
}
function array_uft8_decode($tab)
{
    foreach ($tab as $key => $val) {
        if (is_array($val)) {
            $tab[$key] = array_uft8_decode($val);
        } else {
            $tab[$key] = utf8_decode($val);
        }
    }
    return $tab;
}
//TOUT EST CHARGE, on va au plus simple...
$elems = explode("/", $_SERVER['PATH_INFO']);
require_once $class_path . "/autoloader.class.php";
$autoloader = new autoloader();
$autoloader->add_register("cms_modules", true);
if (file_exists('./temp/' . $elems[1])) {
    $content = unserialize(file_get_contents('./temp/' . $elems[1]));
    $jsonsource = new $content['classname']($content['id']);
    $jsonsource->set_datas($content['datas']);
    $jsonsource->set_nb_row($content['nb_row']);
    //   	header('Content-Type: application/json');
    print encoding_normalize::json_encode($jsonsource->store_proceed($content));
}
Exemple #17
0
 static function author_enrichment($id)
 {
     global $opac_enrichment_bnf_sparql;
     global $lang;
     global $charset;
     if ($opac_enrichment_bnf_sparql) {
         // definition des endpoints databnf et dbpedia
         $configbnf = array('remote_store_endpoint' => 'http://data.bnf.fr/sparql');
         $storebnf = ARC2::getRemoteStore($configbnf);
         $configdbp = array('remote_store_endpoint' => 'http://dbpedia.org/sparql');
         $storedbp = ARC2::getRemoteStore($configdbp);
         // verifier la date de author_enrichment_last_update => if(self)
         $aut_id_bnf = self::get_id_bnf($id);
         // si l'auteur est dans la base on récupère son uri bnf...
         if ($aut_id_bnf != "") {
             $sparql = "\n\t\t\t\t\t\tPREFIX skos: <http://www.w3.org/2004/02/skos/core#>\n\t\t\t\t\t\tPREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n\t\t\t\t\t\tPREFIX bnf-onto: <http://data.bnf.fr/ontology/bnf-onto/>\n\t\t\t\t\t\tSELECT distinct ?author WHERE {\n\t\t\t\t\t\t?author rdf:type skos:Concept .\n\t\t\t\t\t\t?author bnf-onto:FRBNF {$aut_id_bnf}\n\t\t\t\t\t}";
             $rows = $storebnf->query($sparql, 'rows');
             // On vérifie qu'il n'y a pas d'erreur sinon on stoppe le programme et on renvoi une chaine vide
             $err = $storebnf->getErrors();
             if ($err) {
                 return;
             }
         }
         // definition de l'uri bnf
         if ($rows[0]["author"]) {
             $uri_bnf = $rows[0]["author"];
             $enrichment['links']['uri_bnf'] = $uri_bnf;
             // ... ainsi que son uri dbpedia si elle existe
             $sparql = "\n\t\t\t\t\t\tPREFIX rdagroup2elements: <http://rdvocab.info/ElementsGr2/>\n\t\t\t\t\t\tPREFIX owl:<http://www.w3.org/2002/07/owl#>\n\t\t\t\t\t\tPREFIX foaf: <http://xmlns.com/foaf/0.1/>\n\t\t\t\t\t\tSELECT  ?dbpedia WHERE{\n\t\t\t\t\t\t<{$uri_bnf}> foaf:focus ?author.\n\t\t\t\t\t\tOPTIONAL {?author owl:sameAs ?dbpedia.\n\t\t\t\t\t\t\tFILTER regex(str(?dbpedia), 'http://dbpedia', 'i')}.\n\t\t\t\t\t}";
             try {
                 $rows = $storebnf->query($sparql, 'rows');
             } catch (Exception $e) {
                 $rows = array();
             }
             if ($rows[0]["dbpedia"]) {
                 $sub_dbp_uri = substr($rows[0]["dbpedia"], 28);
                 $uri_dbpedia = "http://dbpedia.org/resource/" . rawurlencode($sub_dbp_uri);
                 $enrichment['links']['uri_dbpedia'] = $uri_dbpedia;
             }
         }
         // debut de la requete d'enrichissement
         if ($uri_bnf != "") {
             // recuperation des infos biographiques bnf
             $sparql = "\n\t\t\t\t\t\tPREFIX foaf: <http://xmlns.com/foaf/0.1/>\n\t\t\t\t\t\tPREFIX rdagroup2elements: <http://rdvocab.info/ElementsGr2/>\n\t\t\t\t\t\tPREFIX skos: <http://www.w3.org/2004/02/skos/core#>\n\t\t\t\t\t\tPREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n\t\t\t\t\t\tPREFIX bnf-onto: <http://data.bnf.fr/ontology/bnf-onto/>\n\t\t\t\t\t\tSELECT * WHERE {\n\t\t\t\t\t\t\t<{$uri_bnf}> foaf:focus ?person .\n\t\t\t\t\t\t\t<{$uri_bnf}> skos:prefLabel ?isbd .\n\t\t\t\t\t\t\t?person foaf:page ?page .\n\t\t\t\t\t\t\tOPTIONAL {\n\t\t\t\t\t\t\t\t?person rdagroup2elements:biographicalInformation ?biography\n\t\t\t\t\t\t\t}.\n\t\t\t\t\t\t\tOPTIONAL {\n\t\t\t\t\t\t\t\t?person rdagroup2elements:dateOfBirth ?birthdate.\n\t\t\t\t\t\t\t\t?birthdate rdfs:label ?birth.\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tOPTIONAL {?person bnf-onto:firstYear ?birthfirst.}\n\t\t\t\t\t\t\tOPTIONAL {?person rdagroup2elements:placeOfBirth ?birthplace .}\n\t\t\t\t\t\t\tOPTIONAL {\n\t\t\t\t\t\t\t\t?person rdagroup2elements:dateOfDeath ?deathdate .\n\t\t\t\t\t\t\t\t?deathdate rdfs:label ?death.\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tOPTIONAL {?person rdagroup2elements:placeOfDeath ?deathplace .}\n\t\t\t\t\t\t}";
             try {
                 $rows = $storebnf->query($sparql, 'rows');
             } catch (Exception $e) {
                 $rows = array();
             }
             if ($rows[0]['birth']) {
                 $birthdate = $rows[0]['birth'];
             } else {
                 if ($rows[0]['birthfirst']) {
                     $birthdate = $rows[0]['birthfirst'];
                 } else {
                     $birthdate = "";
                 }
             }
             $enrichment['bio'] = array('isbd' => $rows[0]['isbd'], 'biography_bnf' => $rows[0]['biography'], 'birthdate' => $birthdate, 'birthplace' => $rows[0]['birthplace'], 'deathdate' => $rows[0]['death'], 'deathplace' => $rows[0]['deathplace']);
             // fin bio bnf
             // vignettes bnf
             $sparql = "\n\t\t\t\t\t\t\tPREFIX foaf: <http://xmlns.com/foaf/0.1/>\n\t\t\t\t\t\t\tPREFIX dc: <http://purl.org/dc/elements/1.1/>\n\t\t\t\t\t\t\tPREFIX dcterm: <http://purl.org/dc/terms/>\n\t\t\t\t\t\t\tSELECT * WHERE {\n\t\t\t\t\t\t\t\t<{$uri_bnf}> foaf:focus ?person .\n\t\t\t\t\t\t\t\t?person foaf:depiction ?url .\n\t\t\t\t\t\t\t}";
             try {
                 $rows = $storebnf->query($sparql, 'rows');
             } catch (Exception $e) {
                 $rows = array();
             }
             foreach ($rows as $row) {
                 $depictions[] = $row['url'];
             }
             $enrichment['depictions']['depictions_bnf'] = $depictions;
             // biblio bnf
             $sparql = "\n\t\t\t\t\t\t\tPREFIX foaf: <http://xmlns.com/foaf/0.1/>\n\t\t\t\t\t\t\tPREFIX dcterms: <http://purl.org/dc/terms/>\n\t\t\t\t\t\t\tPREFIX rdarelationships: <http://rdvocab.info/RDARelationshipsWEMI/>\n\t\t\t\t\t\t\tSELECT ?work ?date ?dates ?work_concept  ?title MIN(?minUrl) AS ?url MIN(?minGallica) AS ?gallica WHERE {\n\t\t\t\t\t\t\t\t<{$uri_bnf}> foaf:focus ?person .\n\t\t\t\t\t\t\t\t?work dcterms:creator ?person .\n\t\t\t\t\t\t\t\tOPTIONAL { ?work dcterms:date ?date } .\n\t\t\t\t\t\t\t\tOPTIONAL { ?work <http://rdvocab.info/Elements/dateOfWork> ?dates } .\n\t\t\t\t\t\t\t\t?work_concept foaf:focus ?work .\n\t\t\t\t\t\t\t\t?work dcterms:title ?title .\n\t\t\t\t\t\t\t\tOPTIONAL{?work foaf:depiction ?minUrl .}\n\t\t\t\t\t\t\t\tOPTIONAL{\n\t\t\t\t\t\t\t\t\t?manifestation rdarelationships:workManifested ?work .\n\t\t\t\t\t\t\t\t\t?manifestation rdarelationships:electronicReproduction ?minGallica .\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}  order by ?dates";
             try {
                 $rows = $storebnf->query($sparql, 'rows');
             } catch (Exception $e) {
                 $rows = array();
             }
             if ($rows[0]['work']) {
                 foreach ($rows as $row) {
                     $tab_isbn = array();
                     $sparql = "\n\t\t\t\t\t\t\t\tPREFIX rdarelationships: <http://rdvocab.info/RDARelationshipsWEMI/>\n\t\t\t\t\t\t\t\tPREFIX bnf-onto: <http://data.bnf.fr/ontology/bnf-onto/>\n\t\t\t\t\t\t\t\tSELECT distinct ?isbn WHERE {\n\t\t\t\t\t\t\t\t\t?manifestation rdarelationships:workManifested <" . $row['work'] . ">.\n\t\t\t\t\t\t\t\t\t?manifestation bnf-onto:isbn ?isbn\n\t\t\t\t\t\t\t\t}order by ?isbn";
                     try {
                         $isbns = $storebnf->query($sparql, 'rows');
                     } catch (Exception $e) {
                         $isbns = array();
                     }
                     foreach ($isbns as $isbn) {
                         $isbn['isbn'] = formatISBN($isbn['isbn']);
                         $tab_isbn[] = "'" . $isbn['isbn'] . "'";
                     }
                     $aut_works[] = array('title' => $row['title'], 'uri_work' => $row['work'], 'date' => $row['date'], 'work_concept' => $row['work_concept'], 'url' => $row['url'], 'gallica' => $row['gallica'], 'tab_isbn' => $tab_isbn);
                 }
                 $enrichment['biblio'] = $aut_works;
             }
         }
         // si uri dbpedia on recherche la bio dbpedia et l'image
         if ($uri_dbpedia != "") {
             $langue = substr($lang, 0, 2);
             $sparqldbp = "\n\t\t\t\t\t\tPREFIX dbpedia-owl:<http://dbpedia.org/ontology/>\n\t\t\t\t\t\tSELECT  ?comment ?image WHERE{\n\t\t\t\t\t\t\t<{$uri_dbpedia}> dbpedia-owl:abstract ?comment FILTER langMatches( lang(?comment), '" . $langue . "' ).\n\t\t\t\t\t\t\tOPTIONAL {<{$uri_dbpedia}> dbpedia-owl:thumbnail ?image} .\n\t\t\t\t\t\t}";
             try {
                 $rows = $storedbp->query($sparqldbp, 'rows');
             } catch (Exception $e) {
                 $rows = array();
             }
             $enrichment['bio']['biography_dbpedia'] = encoding_normalize::clean_cp1252($rows[0]['comment'], "utf-8");
             if ($rows[0]['image']) {
                 $enrichment['depictions']['depiction_dbpedia'] = $rows[0]['image'];
             }
             // recherche du mouvement litteraire ...
             $sparqldbp = "\n\t\t\t\t\t\tPREFIX dbpedia-owl:<http://dbpedia.org/ontology/>\n\t\t\t\t\t\tPREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n\t\t\t\t\t\tSELECT ?movement ?mov WHERE{\n\t\t\t\t\t\t\t<{$uri_dbpedia}> dbpedia-owl:movement ?mov.\n\t\t\t\t\t\t\t?mov rdfs:label ?movement\n\t\t\t\t\t\t\t\tFILTER langMatches( lang(?movement), '{$langue}').\n\t\t\t\t\t\t}";
             try {
                 $rows = $storedbp->query($sparqldbp, 'rows');
             } catch (Exception $e) {
                 $rows = array();
             }
             foreach ($rows as $row) {
                 $movement = array();
                 $list_aut = array();
                 $movement['title'] = $row['movement'];
                 $sparqldbp = "\n\t\t\t\t\t\t\tPREFIX dbpedia-owl:<http://dbpedia.org/ontology/>\n\t\t\t\t\t\t\tPREFIX foaf: <http://xmlns.com/foaf/0.1/>\n\t\t\t\t\t\t\tSELECT distinct ?auts WHERE{\n\t\t\t\t\t\t\t\t?auts ?p <" . $row['mov'] . ">.\n\t\t\t\t\t\t\t\t\tFILTER( ?p = dbpedia-owl:genre || ?p = dbpedia-owl:movement)\n\t\t\t\t\t\t\t\t?auts rdf:type foaf:Person\n\t\t\t\t\t\t\t}";
                 try {
                     $rows = $storedbp->query($sparqldbp, 'rows');
                 } catch (Exception $e) {
                     $rows = array();
                 }
                 foreach ($rows as $row) {
                     if ($row['auts'] != $uri_dbpedia) {
                         $list_aut[] = rawurldecode($row['auts']);
                     }
                 }
                 $list_aut = array_unique($list_aut);
                 foreach (array_chunk($list_aut, 10) as $chunk) {
                     $sparql = "\n\t\t\t\t\t\t\t\t\tPREFIX bnf-onto: <http://data.bnf.fr/ontology/bnf-onto/>\n\t\t\t\t\t\t\t\t\tPREFIX foaf: <http://xmlns.com/foaf/0.1/>\n\t\t\t\t\t\t\t\t\tPREFIX skos: <http://www.w3.org/2004/02/skos/core#>\n\t\t\t\t\t\t\t\t\tPREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n\t\t\t\t\t\t\t\t\tSELECT ?numaut ?name WHERE{\n\t\t\t\t\t\t\t\t\t\t?aut rdf:type foaf:Person .\n\t\t\t\t\t\t\t    \t\t?author foaf:focus ?aut.\n\t\t\t\t\t\t\t    \t\t?author skos:exactMatch ?uri_dbpedia.\n\t\t\t\t\t\t\t\t\t\t\tFILTER (?uri_dbpedia = <" . implode("> || ?uri_dbpedia = <", $chunk) . ">) \n\t\t\t\t\t\t\t\t\t\t?author bnf-onto:FRBNF ?numaut.\n\t\t\t\t\t\t\t\t\t\t?aut foaf:name ?name.\n\t\t\t\t\t\t\t\t\t}";
                     try {
                         $rows = $storebnf->query($sparql, 'rows');
                     } catch (Exception $e) {
                         $rows = array();
                     }
                     foreach ($rows as $row) {
                         $aauthor = array("id_bnf" => $row['numaut'], "name" => $row['name']);
                         $movement['authors'][] = $aauthor;
                     }
                 }
                 $enrichment['movement'][] = $movement;
             }
             // ... et du genre
             $sparqldbp = "\n\t\t\t\t\t\tPREFIX dbpedia-owl:<http://dbpedia.org/ontology/>\n\t\t\t\t\t\tPREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n\t\t\t\t\t\tSELECT ?genre ?mov WHERE{\n\t\t\t\t\t\t\t<{$uri_dbpedia}> dbpedia-owl:genre ?mov.\n\t\t\t\t\t\t\t?mov rdfs:label ?genre\n\t\t\t\t\t\t\t\tFILTER langMatches( lang(?genre), '{$langue}').\n\t\t\t\t\t\t}";
             try {
                 $rows = $storedbp->query($sparqldbp, 'rows');
             } catch (Exception $e) {
                 $rows = array();
             }
             foreach ($rows as $row) {
                 $genre = array();
                 $list_aut = array();
                 $genre['title'] = $row['genre'];
                 $sparqldbp = "\n\t\t\t\t\t\t\tPREFIX dbpedia-owl:<http://dbpedia.org/ontology/>\n\t\t\t\t\t\t\tPREFIX foaf: <http://xmlns.com/foaf/0.1/>\n\t\t\t\t\t\t\tSELECT distinct ?auts WHERE{\n\t\t\t\t\t\t\t\t?auts ?p <" . $row['mov'] . ">.\n\t\t\t\t\t\t\t\t\tFILTER( ?p = dbpedia-owl:genre || ?p = dbpedia-owl:genre)\n\t\t\t\t\t\t\t\t?auts rdf:type foaf:Person\n\t\t\t\t\t\t\t}";
                 try {
                     $rows = $storedbp->query($sparqldbp, 'rows');
                 } catch (Exception $e) {
                     $rows = array();
                 }
                 foreach ($rows as $row) {
                     if ($row['auts'] != $uri_dbpedia) {
                         $list_aut[] = rawurldecode($row['auts']);
                     }
                 }
                 $list_aut = array_unique($list_aut);
                 foreach (array_chunk($list_aut, 10) as $chunk) {
                     $sparql = "\n\t\t\t\t\t\t\t\t\tPREFIX bnf-onto: <http://data.bnf.fr/ontology/bnf-onto/>\n\t\t\t\t\t\t\t\t\tPREFIX foaf: <http://xmlns.com/foaf/0.1/>\n\t\t\t\t\t\t\t\t\tPREFIX skos: <http://www.w3.org/2004/02/skos/core#>\n\t\t\t\t\t\t\t\t\tPREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n\t\t\t\t\t\t\t\t\tSELECT ?numaut ?name WHERE{\n\t\t\t\t\t\t\t\t\t\t?aut rdf:type foaf:Person .\n\t\t\t\t\t\t\t    \t\t?author foaf:focus ?aut.\n\t\t\t\t\t\t\t    \t\t?author skos:exactMatch ?uri_dbpedia.\n\t\t\t\t\t\t\t\t\t\t\tFILTER (?uri_dbpedia = <" . implode("> || ?uri_dbpedia = <", $chunk) . ">) \n\t\t\t\t\t\t\t\t\t\t?author bnf-onto:FRBNF ?numaut.\n\t\t\t\t\t\t\t\t\t\t?aut foaf:name ?name.\n\t\t\t\t\t\t\t\t\t}";
                     try {
                         $rows = $storebnf->query($sparql, 'rows');
                     } catch (Exception $e) {
                         $rows = array();
                     }
                     foreach ($rows as $row) {
                         $aauthor = array("id_bnf" => $row['numaut'], "name" => $row['name']);
                         $genre['authors'][] = $aauthor;
                     }
                 }
                 $enrichment['genre'][] = $genre;
             }
         }
         if ($charset != 'utf-8') {
             $enrichment = pmb_utf8_array_decode($enrichment);
         }
         $enrichments = serialize($enrichment);
         $enrichments = addslashes($enrichments);
         $query = "UPDATE authors SET author_enrichment = '" . $enrichments . "', author_enrichment_last_update = NOW() WHERE author_id='" . $id . "'";
         $result = @pmb_mysql_query($query, $dbh);
         // update
     }
 }
// +-------------------------------------------------+
// � 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: ajax_main.inc.php,v 1.1 2016-01-06 15:05:58 dgoron Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) {
    die("no access");
}
require_once $class_path . "/encoding_normalize.class.php";
require_once $class_path . "/nomenclature/nomenclature_instrument.class.php";
switch ($sub) {
    case "instrument":
        switch ($action) {
            case "create":
                $return = nomenclature_instrument::create();
                print encoding_normalize::json_encode($return);
                break;
        }
        break;
    case "forms":
        switch ($action) {
            case "get_form":
                switch ($form) {
                    case "nomenclature_instrument_form_tpl":
                        print nomenclature_instrument::get_dialog_form();
                        break;
                }
                break;
        }
        break;
    default:
 public function get_json_informations()
 {
     $data = json_encode(encoding_normalize::utf8_normalize($this->get_data()));
     return $data;
 }
</form>
</div>';
$docwatch_category_form_tpl = '
<form data-dojo-attach-point="containerNode" data-dojo-attach-event="onreset:_onReset,onsubmit:_onSubmit" ${!nameAttrSetting}>	
	<div class="form-contenu">
		<input type="hidden" name="id" id="id" value=""/>
		<div class="row">
			<label>' . encoding_normalize::utf8_normalize($msg['dsi_docwatch_category_form_category_parent']) . '</label>
		</div>
		<div class="row">
			<select  id="parent" name="parent" data-dojo-type="dijit/form/Select" style="width:auto"></select>
		</div>
		<div class="row">
			<label>' . encoding_normalize::utf8_normalize($msg['dsi_docwatch_category_form_libelle']) . '</label>
		</div>	
		<div class="row">		
			<input type="text" id="title" name="title" required="true" data-dojo-type="dijit/form/ValidationTextBox"/>
		</div>
		<div class="row"></div>
	</div>
	<div class="row">	
		<div class="left">
			<button data-dojo-type="dijit/form/Button" id="docwatch_form_save" type="submit">' . encoding_normalize::utf8_normalize($msg['dsi_docwatch_form_save']) . '</button>
		</div>
		<div class="right">
			<button data-dojo-type="dijit/form/Button" id="docwatch_form_delete" type="button">' . encoding_normalize::utf8_normalize($msg['dsi_docwatch_form_delete']) . '</button>
		</div>
	</div>	
	<div class="row"></div>		
</form>
';
Exemple #21
0
 /**
  * Renvoie le formulaire de la vedette composée
  * 
  * @param $property onto_common_property
  * @param $restrictions onto_restriction
  * @param $datas
  * @param $instance_name
  *
  * @return string
  * @access public
  */
 public function get_form($property, $order, $instance_name)
 {
     global $dbh, $base_path, $charset, $lang;
     global $vedette_tpl;
     //TODO Retirer le style brut
     $form_html = $vedette_tpl['css'] . $vedette_tpl['form_body'];
     if (!count($this->vedette_composee->get_elements())) {
         $form_html = str_replace("!!vedette_composee_apercu!!", "", $form_html);
     } else {
         $form_html = str_replace("!!vedette_composee_apercu!!", $this->vedette_composee->get_label(), $form_html);
     }
     $form_html = str_replace("!!vedette_composee_id!!", $this->vedette_composee->get_id(), $form_html);
     $form_html = str_replace("!!vedette_composee_type!!", $property->range[0], $form_html);
     //les champs disponibles
     $available_fields_html = '';
     $available_fields_scripts = "";
     $get_vedette_element_switchcases = "";
     foreach ($this->vedette_composee->get_available_fields() as $key => $available_field) {
         $vedette_element_ui_class_name = vedette_element::search_vedette_element_ui_class_name($available_field["class_name"]);
         if ($available_field['params']) {
             $available_fields_scripts .= $vedette_element_ui_class_name::get_create_box_js($available_field['params']);
         } else {
             $available_fields_scripts .= $vedette_element_ui_class_name::get_create_box_js();
         }
         $get_vedette_element_switchcases .= str_replace("!!vedette_type!!", $available_field["class_name"], $vedette_tpl["vedette_composee_get_vedette_element_switchcase"]);
         $tmp_html = $vedette_tpl['vedette_composee_available_field'];
         $tmp_html = str_replace("!!available_field_id!!", $key, $tmp_html);
         $tmp_html = str_replace("!!available_field_type!!", $available_field["class_name"], $tmp_html);
         $tmp_html = str_replace("!!vedette_composee_available_field_label!!", get_msg_to_display($available_field['name']), $tmp_html);
         $available_fields_html .= $tmp_html;
     }
     $form_html = str_replace("!!available_fields_scripts!!", $available_fields_scripts, $form_html);
     $form_html = str_replace("!!vedette_composee_available_fields!!", $available_fields_html, $form_html);
     $form_html = str_replace("!!get_vedette_element_switchcases!!", $get_vedette_element_switchcases, $form_html);
     //les zones de subdivision
     $subdivisions_html = '';
     $tab_vedette_elements = array();
     //On parcourt les subdivisions
     foreach ($this->vedette_composee->get_subdivisions() as $key => $subdivision) {
         $tmp_html = $vedette_tpl['vedette_composee_subdivision'];
         $tab_vedette_elements[$subdivision["order"]] = array();
         if ($subdivision["min"]) {
             $tmp_html = str_replace("!!vedette_composee_subdivision_cardmin!!", $subdivision["min"], $tmp_html);
         } else {
             $tmp_html = str_replace("!!vedette_composee_subdivision_cardmin!!", "", $tmp_html);
         }
         if ($subdivision["max"]) {
             $tmp_html = str_replace("!!vedette_composee_subdivision_cardmax!!", $subdivision["max"], $tmp_html);
         } else {
             $tmp_html = str_replace("!!vedette_composee_subdivision_cardmax!!", "", $tmp_html);
         }
         $tmp_html = str_replace("!!vedette_composee_subdivision_order!!", $subdivision["order"], $tmp_html);
         $elements_html = '';
         if ($elements = $this->vedette_composee->get_at_elements_subdivision($subdivision['code'])) {
             // tableau pour la gestion de l'ordre à l'intérieur d'une subdivision
             $elements_order = array();
             // On parcourt les éléments de la subdivision
             foreach ($elements as $position => $element) {
                 $current_element_html = $vedette_tpl['vedette_composee_element'];
                 $elements_order[] = $position;
                 $tab_vedette_elements[$subdivision["order"]][$position] = $element->get_isbd();
                 $element_ui_class_name = vedette_element::search_vedette_element_ui_class_name(get_class($element));
                 if ($element->params) {
                     $current_element_html = str_replace("!!vedette_composee_element_form!!", $element_ui_class_name::get_form($element->params), $current_element_html);
                 } else {
                     $current_element_html = str_replace("!!vedette_composee_element_form!!", $element_ui_class_name::get_form(), $current_element_html);
                 }
                 $current_element_html = str_replace("!!vedette_composee_element_order!!", $position, $current_element_html);
                 $current_element_html = str_replace("!!vedette_composee_element_type!!", get_class($element), $current_element_html);
                 $current_element_html = str_replace("!!vedette_element_rawlabel!!", $element->get_isbd(), $current_element_html);
                 $field_class_name = $this->vedette_composee->get_at_available_field_class_name(get_class($element));
                 $autority_type = get_msg_to_display($field_class_name["name"]);
                 $current_element_html = str_replace("!!vedette_element_label!!", "[" . $autority_type . "] " . $element->get_isbd(), $current_element_html);
                 $current_element_html = str_replace("!!vedette_element_id!!", $element->get_id(), $current_element_html);
                 $elements_html .= $current_element_html;
             }
             $tmp_html = str_replace("!!vedette_composee_subdivision_elements!!", $elements_html, $tmp_html);
             $tmp_html = str_replace("!!elements_order!!", implode(",", $elements_order), $tmp_html);
         } else {
             $tmp_html = str_replace("!!vedette_composee_subdivision_elements!!", "", $tmp_html);
             $tmp_html = str_replace("!!elements_order!!", "", $tmp_html);
         }
         $tmp_html = str_replace("!!vedette_composee_subdivision_label!!", get_msg_to_display($subdivision['name']), $tmp_html);
         $tmp_html = str_replace("!!vedette_composee_subdivision_id!!", $subdivision['code'], $tmp_html);
         $subdivisions_html .= $tmp_html;
     }
     $form_html = str_replace("!!vedette_composee_subdivisions!!", $subdivisions_html, $form_html);
     $form_html = str_replace("!!caller!!", $instance_name, $form_html);
     $form_html = str_replace("!!vedette_composee_order!!", $order, $form_html);
     $form_html = str_replace("!!property_name!!", $property->pmb_name . "_composed", $form_html);
     $form_html = str_replace("!!tab_vedette_elements!!", encoding_normalize::json_encode($tab_vedette_elements), $form_html);
     $form_html = str_replace("!!vedette_separator!!", htmlentities($this->vedette_composee->get_separator(), ENT_QUOTES), $form_html);
     return $form_html;
 }
 public function get_possible_values($num_parent)
 {
     return encoding_normalize::json_encode($this->record_child->get_possible_values($num_parent));
 }
 static function tu_enrichment($id)
 {
     global $dbh;
     $requete = "select tu_databnf_uri from titres_uniformes where tu_id={$id}";
     $resultat = pmb_mysql_query($requete, $dbh);
     if ($resultat && pmb_mysql_num_rows($resultat, $dbh)) {
         $uri = pmb_mysql_result($resultat, 0, 0, $dbh);
     } else {
         $uri = "";
     }
     if ($uri) {
         $configbnf = array('remote_store_endpoint' => 'http://data.bnf.fr/sparql');
         $storebnf = ARC2::getRemoteStore($configbnf);
         $sparql = "\n\t\t\tPREFIX dc: <http://purl.org/dc/terms/>\n\t\t\tPREFIX rdarelationships: <http://rdvocab.info/RDARelationshipsWEMI/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\tSELECT min(?gallica) as ?gallica2 ?title ?date ?editeur WHERE {\n\t\t\t  ?manifestation rdarelationships:workManifested <" . $uri . ">.\n\t\t\t  ?manifestation rdarelationships:electronicReproduction ?gallica.\n\t\t\t  ?manifestation dc:title ?title.\n\t\t\t  OPTIONAL { ?manifestation dc:date ?date.}\n\t\t\t  OPTIONAL { ?manifestation dc:publisher ?editeur.}\n\t\t\t} group by ?title ?date ?editeur";
         $ret = false;
         $rows = $storebnf->query($sparql, 'rows');
         // On vérifie qu'il n'y a pas d'erreur sinon on stoppe le programme et on renvoi une chaine vide
         $err = $storebnf->getErrors();
         $tr = array();
         if (!$err) {
             foreach ($rows as $row) {
                 $t = array();
                 $t["uri_gallica"] = $row["gallica2"];
                 $t["titre"] = $row["title"];
                 $t["date"] = $row["date"];
                 $t["editeur"] = $row["editeur"];
                 $t["uri_gallica"] = $row["gallica2"];
                 $tr[] = $t;
             }
         }
         $tr = encoding_normalize::charset_normalize($tr, "utf-8");
         //Stockage du tableau
         $requete = "update titres_uniformes set tu_enrichment='" . addslashes(serialize($tr)) . "', tu_enrichment_last_update=now() where tu_id={$id}";
         pmb_mysql_query($requete, $dbh);
     }
 }
 public static function get_dialog_form()
 {
     global $nomenclature_instrument_dialog_tpl, $msg;
     $form = $nomenclature_instrument_dialog_tpl;
     $query = "select id_musicstand, concat(musicstand_name,' ( ',family_name,' )')as label from nomenclature_musicstands,nomenclature_families where musicstand_famille_num=id_family order by musicstand_name";
     $musicstand = gen_liste($query, "id_musicstand", "label", "id_musicstand", "", "", 0, encoding_normalize::utf8_normalize($msg["admin_nomenclature_instrument_form_musicstand_no"]), 0, encoding_normalize::utf8_normalize($msg["admin_nomenclature_instrument_form_musicstand_no_sel"]));
     $form = str_replace('!!musicstand!!', $musicstand, $form);
     return $form;
 }