Example #1
0
 function getEnrichment($notice_id, $source_id, $type = "", $enrich_params = array(), $page = 1)
 {
     $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;
         }
     }
     $enrichment = array();
     //on renvoi ce qui est demandé... si on demande rien, on renvoi tout..
     switch ($type) {
         case "external":
         default:
             $rqt = "select code from notices where notice_id = '{$notice_id}'";
             $res = pmb_mysql_query($rqt);
             $es_source_id = $source_id;
             $nb_result = 0;
             if (pmb_mysql_num_rows($res)) {
                 $code = pmb_mysql_result($res, 0, 0);
                 if ($code) {
                     $queries = array();
                     for ($i = 0; $i < count($es_selected); $i++) {
                         $queries[] = "select recid,source_id from entrepot_source_" . $es_selected[$i] . " where (ufield = '011' or ufield ='010')  and usubfield = 'a' and value = '" . addslashes($code) . "'";
                     }
                     $query = "select recid,source_id from ((" . implode(") union (", $queries) . ")) as subs";
                     $result = pmb_mysql_query($query);
                     $nb_result = pmb_mysql_num_rows($result);
                     if (pmb_mysql_num_rows($result)) {
                         while ($row = pmb_mysql_fetch_object($result)) {
                             $es_source_id = $row->source_id;
                             $enrichment[$type]['content'] .= aff_notice_unimarc($row->recid);
                         }
                     } else {
                         $enrichment[type]['content'] = $query . "<span>" . $this->msg["es_list_no_preview"] . "</span>";
                     }
                 } else {
                     $enrichment[$type]['content'] = "<span>" . $this->msg["es_list_no_preview"] . "</span>";
                 }
             }
             break;
     }
     if ($nb_result <= 1) {
         switch ($source_as_origine) {
             //Cette source
             case 0:
                 $enrichment['source_label'] = sprintf($this->msg['es_list_enrichment_source'], $params['NAME']);
                 break;
                 //source de la notice
             //source de la notice
             case 1:
                 $query = "select name from connectors_sources where source_id=" . $es_source_id . "";
                 $result = pmb_mysql_query($query);
                 if (pmb_mysql_num_rows($result)) {
                     $name = pmb_mysql_result($result, 0, 0);
                 } else {
                     $name = $params['NAME'];
                 }
                 $enrichment['source_label'] = sprintf($this->msg['es_list_enrichment_source'], $name);
                 break;
         }
     } else {
         $enrichment['source_label'] = sprintf($this->msg['es_list_enrichment_source'], $params['NAME']);
     }
     return $enrichment;
 }
Example #2
0
 /**
  * Consultation d'une liste statique
  */
 function consulter_liste()
 {
     global $liste_lecture_consultation, $dbh, $charset, $msg, $opac_search_results_per_page, $page;
     $rqt = "select id_liste, nom_liste, description, read_only, empr_nom, empr_prenom, notices_associees, public, if(abo.num_empr is null,0,1) as abo \n\t\t\tfrom opac_liste_lecture op\n\t\t\tleft join empr e on op.num_empr=e.id_empr \n            left join abo_liste_lecture abo on (num_liste=id_liste and abo.num_empr='" . $this->num_empr . "')\n\t\t \twhere id_liste='" . $this->id_liste . "'\n\t\t \t";
     $res = pmb_mysql_query($rqt, $dbh);
     $liste_noti = array();
     while ($liste = pmb_mysql_fetch_object($res)) {
         $liste_lecture_consultation = str_replace('!!nom_liste!!', sprintf($msg['list_lecture_view'], htmlentities($liste->nom_liste, ENT_QUOTES, $charset)), $liste_lecture_consultation);
         $liste_lecture_consultation = str_replace('!!liste_comment!!', htmlentities($liste->description, ENT_QUOTES, $charset), $liste_lecture_consultation);
         $liste_lecture_consultation = str_replace('!!id_liste!!', $this->id_liste, $liste_lecture_consultation);
         $proprio = "(" . sprintf($msg[list_lecture_owner], $liste->empr_prenom . " " . $liste->empr_nom) . ")";
         $liste_lecture_consultation = str_replace('!!proprio!!', $proprio, $liste_lecture_consultation);
         if ($liste->notices_associees) {
             $liste_noti = explode(',', $liste->notices_associees);
         }
         $abo_btn = "<input type='submit' class='bouton' name='abo' onclick='this.form.act.value=\"get_acces\";this.form.action=\"empr.php?tab=lecture&lvl=public_list\";' value=\"" . $msg['list_lecture_abo'] . "\" />";
         $desabo_btn = "<input type='submit'  class='bouton' name='desabo' onclick='this.form.act.value=\"suppr_acces\";this.form.action=\"empr.php?tab=lecture&lvl=public_list\";' value=\"" . $msg['list_lecture_desabo'] . "\" />";
         if (!$liste->read_only) {
             $add_noti_btn = "<input type='submit' class='bouton' name='list_in' onclick='this.form.act.value=\"list_in\";' value='" . $msg['list_lecture_list_in'] . "' />";
         } else {
             $add_noti_btn = '';
         }
         if ($liste->abo) {
             $liste_lecture_consultation = str_replace('!!abo_btn!!', $desabo_btn, $liste_lecture_consultation);
             $liste_lecture_consultation = str_replace('!!add_noti_btn!!', $add_noti_btn, $liste_lecture_consultation);
         } else {
             $liste_lecture_consultation = str_replace('!!abo_btn!!', $abo_btn, $liste_lecture_consultation);
             $liste_lecture_consultation = str_replace('!!add_noti_btn!!', '', $liste_lecture_consultation);
         }
         //Gestion de la liste des notices et de la pagination
         if ($page == "") {
             $page = 1;
         }
         $affich .= "<span><b>" . sprintf($msg["show_cart_n_notices"], count($liste_noti)) . "</b></span>";
         $affich .= "<blockquote>";
         // case à cocher de suppression transférée dans la classe notice_affichage
         $affich .= "<form action='./index.php?lvl=show_list&sub=view&id_liste={$this->id_liste}&page={$page}' method='post' name='list_form'>\n";
         for ($i = ($page - 1) * $opac_search_results_per_page; $i < count($liste_noti) && $i < $page * $opac_search_results_per_page; $i++) {
             if (substr($liste_noti[$i], 0, 2) != "es") {
                 $affich .= aff_notice($liste_noti[$i], 1);
             } else {
                 $affich .= aff_notice_unimarc(substr($liste_noti[$i], 2), 1);
             }
         }
         $affich .= "</form>";
         $affich .= "</blockquote>";
         $affich .= $this->aff_navigation_notices($liste_noti, $this->id_liste, 'consultation');
     }
     $liste_lecture_consultation = str_replace('!!notice_filtre!!', htmlentities(implode(',', $liste_noti), ENT_QUOTES, $charset), $liste_lecture_consultation);
     $liste_lecture_consultation = str_replace('!!liste_notice!!', $affich, $liste_lecture_consultation);
     print $liste_lecture_consultation;
 }
 function genere_bulletin($bulletin_infos)
 {
     global $opac_notices_depliable;
     $html .= "<div id='es_bull_" . $bulletin_infos->bulletin_id . "' class='notice-parent'></div>";
     $titre = $bulletin_infos->bulletin_num;
     if ($bulletin_infos->bulletin_date) {
         $titre .= " (" . format_date($bulletin_infos->bulletin_date) . ")";
     }
     if ($bulletin_infos->bulletin_titre) {
         $titre .= ": " . $bulletin_infos->bulletin_titre;
     }
     $contenu = "";
     $analysis = explode(",", $bulletin_infos->analysis);
     $opac_notices_depliable = 1;
     foreach ($analysis as $article) {
         $contenu .= aff_notice_unimarc($article);
     }
     $opac_notices_depliable = 0;
     return gen_plus("es_bull_" . $bulletin_infos->bulletin_id, $titre, $contenu);
 }
Example #4
0
 }
 if (count($cart_) <= $pmb_nb_max_tri) {
     print str_replace("!!page_en_cours!!", "lvl=show_cart", $affich_tris_result_liste);
 }
 if ($_SESSION["last_sortnotices"] != "") {
     print " " . $msg['tri_par'] . " " . $sort->descriptionTriParId($_SESSION["last_sortnotices"]) . "<span class=\"espaceCartAction\">&nbsp;</span>";
 }
 print "<blockquote>";
 // case à cocher de suppression transférée dans la classe notice_affichage
 $cart_aff_case_traitement = 1;
 print "<form action='./index.php?lvl=show_cart&action=del&page={$page}' method='post' name='cart_form'>\n";
 for ($i = ($page - 1) * $opac_search_results_per_page; $i < count($cart_) && $i < $page * $opac_search_results_per_page; $i++) {
     if (substr($cart_[$i], 0, 2) != "es") {
         print pmb_bidi(aff_notice($cart_[$i], 1));
     } else {
         print pmb_bidi(aff_notice_unimarc(substr($cart_[$i], 2), 1));
     }
 }
 print "</form>";
 print "</blockquote>";
 print "</div>";
 $nbepages = ceil(count($cart_) / $opac_search_results_per_page);
 $suivante = $page + 1;
 $precedente = $page - 1;
 // affichage du lien précédent si nécéssaire
 print "<hr /><table border='0' summary='navigation bar' align='center'><tr>";
 // affichage du lien pour retour au début
 if ($precedente > 1) {
     print "<td width=\"14\" align=\"center\"><a href=\"index.php?lvl=show_cart&page=1\"><img src=\"./images/first.gif\"";
     print " border=\"0\" alt=\"{$msg['start']}\"";
     print " title=\"{$msg['first_page']}\"></a></td>";
 function getNoticesResults()
 {
     global $dbh;
     global $begin_result_liste;
     global $opac_notices_depliable;
     global $opac_show_suggest;
     global $opac_resa_popup;
     global $opac_search_results_per_page;
     $nb_per_page_search = $opac_search_results_per_page;
     global $page;
     global $charset;
     global $search;
     global $msg;
     global $affich_tris_result_liste;
     global $count;
     global $add_cart_link;
     if (!$page) {
         $page = 1;
     }
     $start_page = $nb_per_page_search * ($page - 1);
     //Y-a-t-il des champs ?
     if (count($search) == 0) {
         return;
     }
     if (!$this->table_tempo) {
         global $search;
         $this->makeSearch();
     }
     $requete = "select * from " . $this->table_tempo;
     $requete .= " limit " . $start_page . "," . $nb_per_page_search;
     $resultat = pmb_mysql_query($requete, $dbh);
     $this->results = "\n\n\t\t<div id=\"resultatrech_container\">\n\t\t<div id=\"resultatrech_see\">\n\t\t";
     $this->results .= pmb_bidi("<h3>" . $this->getTotalNbResults() . " " . $msg['titles_found'] . " " . $this->external_search->make_human_query() . activation_surlignage() . "</h3>");
     if ($opac_show_suggest) {
         $bt_sugg = "&nbsp;&nbsp;&nbsp;<span class=\"search_bt_sugg\"><a href=# ";
         if ($opac_resa_popup) {
             $bt_sugg .= " onClick=\"w=window.open('./do_resa.php?lvl=make_sugg&oresa=popup','doresa','scrollbars=yes,width=600,height=600,menubar=0,resizable=yes'); w.focus(); return false;\"";
         } else {
             $bt_sugg .= "onClick=\"document.location='./do_resa.php?lvl=make_sugg&oresa=popup' \" ";
         }
         $bt_sugg .= " title='" . $msg["empr_bt_make_sugg"] . "' >" . $msg['empr_bt_make_sugg'] . "</a></span>";
         $this->results .= $bt_sugg;
     }
     flush();
     $entrepots_localisations = array();
     $entrepots_localisations_sql = "SELECT * FROM entrepots_localisations ORDER BY loc_visible DESC";
     $res = pmb_mysql_query($entrepots_localisations_sql);
     while ($row = pmb_mysql_fetch_array($res)) {
         $entrepots_localisations[$row["loc_code"]] = array("libelle" => $row["loc_libelle"], "visible" => $row["loc_visible"]);
     }
     if ($opac_notices_depliable) {
         $this->results .= $begin_result_liste;
     }
     $this->results .= $add_cart_link;
     $this->results .= "\t</div>\n\n\t\t<div id=\"resultatrech_liste\">";
     $this->results .= "<blockquote>";
     while ($r = pmb_mysql_fetch_object($resultat)) {
         $this->results .= aff_notice_unimarc($r->notice_id, 0, $entrepots_localisations);
     }
     $this->results .= "</blockquote>";
     $this->results .= "</div>\n\t\t</div>";
     //on a besoin d'un formulaire pour reposter la recherche
     //$this->results.= $this->make_hidden_search_form();
     //gestion de la pagination...
     $nbepages = ceil($this->getTotalNbResults() / $opac_search_results_per_page);
     $url_page = "javascript:document.form_values.page.value=!!page!!; document.form_values.action = \"./index.php?lvl=more_results&tab=affiliate\"; document.form_values.affiliate_page.value=document.form_values.page.value; document.form_values.submit()";
     $action = "javascript:document.form_values.page.value=document.form.page.value; document.form_values.action = \"./index.php?lvl=more_results&tab=affiliate\"; document.form_values.affiliate_page.value=document.form_values.page.value; document.form_values.submit()";
     $this->results .= "<div id='navbar'><hr />\n<center>" . printnavbar($page, $nbepages, $url_page, $action, "catal_pag") . "</center></div>";
     return $this->results;
 }
Example #6
0
 function show_results_unimarc($url, $url_to_search_form, $hidden_form = true, $search_target = "")
 {
     global $dbh;
     global $begin_result_liste;
     global $opac_notices_depliable;
     global $opac_search_results_per_page;
     $nb_per_page_search = $opac_search_results_per_page;
     global $page;
     global $charset;
     global $search;
     global $msg;
     global $affich_tris_result_liste;
     global $count;
     global $add_cart_link;
     $start_page = $nb_per_page_search * ($page - 1);
     //Y-a-t-il des champs ?
     if (count($search) == 0) {
         return;
     }
     $table = $this->make_search();
     $requete = "select count(1) from {$table}";
     $nb_results = pmb_mysql_result(pmb_mysql_query($requete), 0, 0);
     $count = $nb_results;
     $requete = "select * from {$table}";
     $requete .= " limit " . $start_page . "," . $nb_per_page_search;
     $resultat = pmb_mysql_query($requete, $dbh);
     print "\t<div id=\"resultatrech\"><h3>{$msg['resultat_recherche']}</h3>\n\n\t\t<div id=\"resultatrech_container\">\n\t\t<div id=\"resultatrech_see\">\n\t\t";
     print pmb_bidi("<h3>{$nb_results} {$msg['titles_found']} " . $this->make_human_query() . " <input type='button' class='bouton' value='" . $msg["connecteurs_alter_criteria"] . "' onClick='document.form_values.action=\"./index.php?lvl=search_result&search_type_asked=external_search\"; document.form_values.submit();'/></h3>");
     if ($opac_show_suggest) {
         $bt_sugg = "&nbsp;&nbsp;&nbsp;<a href=# ";
         if ($opac_resa_popup) {
             $bt_sugg .= " onClick=\"w=window.open('./do_resa.php?lvl=make_sugg&oresa=popup','doresa','scrollbars=yes,width=600,height=600,menubar=0,resizable=yes'); w.focus(); return false;\"";
         } else {
             $bt_sugg .= "onClick=\"document.location='./do_resa.php?lvl=make_sugg&oresa=popup' \" ";
         }
         $bt_sugg .= " title='" . $msg["empr_bt_make_sugg"] . "' >" . $msg[empr_bt_make_sugg] . "</a>";
         print $bt_sugg;
     }
     flush();
     $entrepots_localisations = array();
     $entrepots_localisations_sql = "SELECT * FROM entrepots_localisations ORDER BY loc_visible DESC";
     $res = pmb_mysql_query($entrepots_localisations_sql);
     while ($row = pmb_mysql_fetch_array($res)) {
         $entrepots_localisations[$row["loc_code"]] = array("libelle" => $row["loc_libelle"], "visible" => $row["loc_visible"]);
     }
     if ($opac_notices_depliable) {
         print $begin_result_liste;
     }
     print $add_cart_link;
     print "\t</div>\n\n\t\t\t\t<div id=\"resultatrech_liste\">";
     print "<blockquote>";
     while ($r = pmb_mysql_fetch_object($resultat)) {
         print aff_notice_unimarc($r->notice_id, 0, $entrepots_localisations);
     }
     print "</blockquote>";
     print " </div>\n\n\t\t\t\t</div>\n\t\t\t\t</div>";
 }