Ejemplo n.º 1
0
 function processing_cp($type, $id, $val_f = "")
 {
     $mes_pp = new parametres_perso($type);
     $mes_pp->get_values($id);
     $values = $mes_pp->values;
     foreach ($values as $field_id => $vals) {
         //si on peut on exporte les infos du résolveur (DOI / PMID)
         if ($type == "notices" && $mes_pp->t_fields[$field_id]['TYPE'] == "resolve") {
             //les ids sont fixé en dur, on c'est traité : DOI = 2 , PMID = 1
             foreach ($vals as $value) {
                 $id_infos = explode('|', $value);
                 switch ($id_infos[1]) {
                     case "1":
                         $resolver = "PMID";
                         break;
                     case "2":
                         $resolver = "DOI";
                         break;
                     default:
                         $resolver = "";
                 }
                 if ($resolver != "") {
                     $subfields = array();
                     $subfields["a"] = $id_infos[0];
                     $subfields["b"] = $resolver;
                     $this->add_field("014", "  ", $subfields);
                 }
             }
         }
         if ($mes_pp->t_fields[$field_id]["EXPORT"]) {
             //champ exportable
             foreach ($vals as $value) {
                 $subfields = array();
                 switch ($mes_pp->t_fields[$field_id]['TYPE']) {
                     case "resolve":
                     case "url":
                         $subfields["c"] = $value;
                         $id_infos = explode('|', $value);
                         $link = $mes_pp->get_formatted_output(array($value), $field_id);
                         //Valeur
                         if (count($id_infos) == 2) {
                             $subfields["a"] = $id_infos[0];
                             $subfields["b"] = $link;
                         } else {
                             $subfields["a"] = $link;
                         }
                         break;
                     case "query_auth":
                     case "query_list":
                         $subfields["c"] = $value;
                         //break; C'est voulu
                     //break; C'est voulu
                     default:
                         $subfields["a"] = $mes_pp->get_formatted_output(array($value), $field_id);
                         //Val
                         break;
                 }
                 $subfields["l"] = $mes_pp->t_fields[$field_id]["TITRE"];
                 //Libelle du champ
                 $subfields["n"] = $mes_pp->t_fields[$field_id]["NAME"];
                 //Nom du champ
                 $subfields["t"] = $mes_pp->t_fields[$field_id]["TYPE"];
                 //Type du champ
                 if ($val_f) {
                     $subfields["f"] = $val_f;
                 }
                 switch ($type) {
                     case "notices":
                         $this->add_field("900", "  ", $subfields);
                         break;
                     case "expl":
                         $this->add_field("999", "  ", $subfields);
                         break;
                     case "collstate":
                         $this->add_field("951", "  ", $subfields);
                         break;
                     default:
                         break;
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
 function show_expl_per_notice($no_notice, $link_expl = '', $expl_bulletin = 0)
 {
     global $msg, $dbh, $base_path, $class_path;
     global $explr_invisible, $explr_visible_unmod, $explr_visible_mod, $pmb_droits_explr_localises, $transferts_gestion_transferts;
     global $pmb_expl_list_display_comments;
     global $pmb_sur_location_activate;
     global $pmb_url_base, $pmb_expl_data, $charset;
     global $pmb_expl_display_location_without_expl;
     global $pmb_html_allow_expl_cote;
     // params :
     // $no_notice= id de la notice
     // $link_expl= lien associé à l'exemplaire avec !!expl_id!! et !!expl_cb!! à mettre à jour
     if (!$no_notice && !$expl_bulletin) {
         return;
     }
     $explr_tab_invis = explode(",", $explr_invisible);
     $explr_tab_unmod = explode(",", $explr_visible_unmod);
     $explr_tab_modif = explode(",", $explr_visible_mod);
     // récupération du nombre total d'exemplaires
     if ($expl_bulletin) {
         $requete = "SELECT COUNT(1) FROM exemplaires WHERE expl_bulletin='{$expl_bulletin}' ";
     } else {
         $requete = "SELECT COUNT(1) FROM exemplaires WHERE expl_notice='{$no_notice}' ";
     }
     $res = pmb_mysql_query($requete, $dbh);
     $nb_ex = pmb_mysql_result($res, 0, 0);
     if ($nb_ex) {
         // on récupère les données des exemplaires
         // visibilité des exemplaires:
         if ($pmb_droits_explr_localises && $explr_invisible) {
             $where_expl_localises = "and expl_location not in ({$explr_invisible})";
         } else {
             $where_expl_localises = "";
         }
         //Liste des champs d'exemplaires
         if ($pmb_sur_location_activate) {
             $surloc_field = "surloc_libelle,";
         }
         if (!$pmb_expl_data) {
             $pmb_expl_data = "expl_cb,expl_cote," . $surloc_field . "location_libelle,section_libelle,statut_libelle,tdoc_libelle";
         }
         $colonnesarray = explode(",", $pmb_expl_data);
         if (!in_array("expl_cb", $colonnesarray)) {
             array_unshift($colonnesarray, "expl_cb");
         }
         $total_columns = count($colonnesarray);
         //Présence de champs personnalisés
         if (strstr($pmb_expl_data, "#")) {
             require_once $class_path . "/parametres_perso.class.php";
             $cp = new parametres_perso("expl");
         }
         if ($expl_bulletin) {
             $where_expl_notice_expl_bulletin = " expl_bulletin='{$expl_bulletin}' ";
         } else {
             $where_expl_notice_expl_bulletin = " expl_notice='{$no_notice}' ";
         }
         $requete = "SELECT exemplaires.*, pret.*, docs_location.*, docs_section.*, docs_statut.*, docs_codestat.*, lenders.*, tdoc_libelle, ";
         if (in_array("surloc_libelle", $colonnesarray)) {
             $requete .= "sur_location.*, ";
         }
         $requete .= " date_format(pret_date, '" . $msg["format_date"] . "') as aff_pret_date, ";
         $requete .= " date_format(pret_retour, '" . $msg["format_date"] . "') as aff_pret_retour, ";
         $requete .= " IF(pret_retour>sysdate(),0,1) as retard ";
         $requete .= " FROM exemplaires LEFT JOIN pret ON exemplaires.expl_id=pret.pret_idexpl ";
         $requete .= " left join docs_location on exemplaires.expl_location=docs_location.idlocation ";
         if (in_array("surloc_libelle", $colonnesarray)) {
             $requete .= " left join sur_location on docs_location.surloc_num=sur_location.surloc_id ";
         }
         $requete .= " left join docs_section on exemplaires.expl_section=docs_section.idsection ";
         $requete .= " left join docs_statut on exemplaires.expl_statut=docs_statut.idstatut ";
         $requete .= " left join docs_codestat on exemplaires.expl_codestat=docs_codestat.idcode ";
         $requete .= " left join lenders on exemplaires.expl_owner=lenders.idlender ";
         $requete .= " left join docs_type on exemplaires.expl_typdoc=docs_type.idtyp_doc  ";
         $requete .= " WHERE {$where_expl_notice_expl_bulletin} {$where_expl_localises} ";
         if (in_array("surloc_libelle", $colonnesarray)) {
             $requete .= " order by surloc_libelle,location_libelle, section_libelle, expl_cote, expl_cb ";
         } else {
             $requete .= " order by location_libelle, section_libelle, expl_cote, expl_cb ";
         }
         $result = pmb_mysql_query($requete, $dbh) or die("<br />" . pmb_mysql_error() . "<br />" . $requete);
         $nbr_expl = pmb_mysql_num_rows($result);
         if ($nbr_expl) {
             while ($expl = pmb_mysql_fetch_object($result)) {
                 //visibilité des exemplaires
                 if ($pmb_droits_explr_localises) {
                     $as_invis = array_search($expl->idlocation, $explr_tab_invis);
                     $as_unmod = array_search($expl->idlocation, $explr_tab_unmod);
                     $as_modif = array_search($expl->idlocation, $explr_tab_modif);
                 } else {
                     $as_invis = false;
                     $as_unmod = false;
                     $as_modif = true;
                 }
                 if ($link_expl) {
                     if ($expl_bulletin) {
                         $tlink = "./catalog.php?categ=serials&sub=bulletinage&action=expl_form&bul_id=!!bull_id!!&expl_id=!!expl_id!!";
                         $tlink = str_replace('!!bull_id!!', $expl_bulletin, $tlink);
                         $tlink = str_replace('!!expl_id!!', $expl->expl_id, $tlink);
                         $tlink = str_replace('!!expl_cb!!', rawurlencode($expl->expl_cb), $tlink);
                     } else {
                         $tlink = str_replace('!!expl_id!!', $expl->expl_id, $link_expl);
                         $tlink = str_replace('!!expl_cb!!', rawurlencode($expl->expl_cb), $tlink);
                         $tlink = str_replace('!!notice_id!!', $expl->expl_notice, $tlink);
                     }
                 }
                 $expl_liste .= "<tr>";
                 for ($i = 0; $i < count($colonnesarray); $i++) {
                     if (!(substr($colonnesarray[$i], 0, 1) == "#")) {
                         eval("\$colencours=\$expl->" . $colonnesarray[$i] . ";");
                     }
                     if ($i == 0 && ($expl->expl_note || $expl->expl_comment) && $pmb_expl_list_display_comments) {
                         $expl_rowspan = "rowspan='2'";
                     } else {
                         $expl_rowspan = "";
                     }
                     $aff_column = "";
                     if (substr($colonnesarray[$i], 0, 1) == "#") {
                         //champs personnalisés
                         $id = substr($colonnesarray[$i], 1);
                         $cp->get_values($expl->expl_id);
                         if (!$cp->no_special_fields) {
                             $temp = $cp->get_formatted_output($cp->values[$id], $id);
                             if (!$temp) {
                                 $temp = "&nbsp;";
                             }
                             $aff_column .= $temp;
                         }
                     } else {
                         if ($colonnesarray[$i] == "expl_cb") {
                             if ($tlink && ($as_modif !== FALSE && $as_modif !== NULL)) {
                                 $aff_column .= "<a href='{$tlink}'>" . $colencours . "</a>";
                             } else {
                                 $aff_column .= $colencours;
                             }
                         } else {
                             if ($colonnesarray[$i] == "expl_cote") {
                                 if ($pmb_html_allow_expl_cote) {
                                     $aff_column .= "<strong>" . $colencours . "</strong>";
                                 } else {
                                     $aff_column .= "<strong>" . htmlentities($colencours, ENT_QUOTES, $charset) . "</strong>";
                                 }
                             } else {
                                 if ($colonnesarray[$i] == "statut_libelle") {
                                     if ($expl->pret_retour) {
                                         // exemplaire sorti
                                         $rqt_empr = "SELECT empr_nom, empr_prenom, id_empr, empr_cb FROM empr WHERE id_empr='{$expl->pret_idempr}' ";
                                         $res_empr = pmb_mysql_query($rqt_empr, $dbh);
                                         $res_empr_obj = pmb_mysql_fetch_object($res_empr);
                                         $situation = "<strong>{$msg[358]} " . $expl->aff_pret_retour . "</strong>";
                                         global $empr_show_caddie, $selector_prop_ajout_caddie_empr;
                                         if ($empr_show_caddie && SESSrights & CIRCULATION_AUTH) {
                                             $img_ajout_empr_caddie = "<img src='" . $base_path . "/images/basket_empr.gif' align='middle' alt='basket' title=\"{$msg[400]}\" onClick=\"openPopUp('" . $base_path . "/cart.php?object_type=EMPR&item=" . $expl->pret_idempr . "', 'cart', 600, 700, -2, -2, '{$selector_prop_ajout_caddie_empr}')\">&nbsp;";
                                         } else {
                                             $img_ajout_empr_caddie = "";
                                         }
                                         switch ($this->print_mode) {
                                             case '2':
                                                 $situation .= "<br />{$res_empr_obj->empr_prenom} {$res_empr_obj->empr_nom}";
                                                 break;
                                             default:
                                                 $situation .= "<br />{$img_ajout_empr_caddie}<a href='" . $base_path . "/circ.php?categ=pret&form_cb=" . rawurlencode($res_empr_obj->empr_cb) . "'>{$res_empr_obj->empr_prenom} {$res_empr_obj->empr_nom}</a>";
                                                 break;
                                         }
                                     } else {
                                         // tester si réservé
                                         $result_resa = pmb_mysql_query("select 1 from resa where resa_cb='" . addslashes($expl->expl_cb) . "' ", $dbh) or die("<br />" . pmb_mysql_error() . "<br />" . $requete);
                                         $reserve = pmb_mysql_num_rows($result_resa);
                                         // tester à ranger
                                         $result_aranger = pmb_mysql_query(" select 1 from resa_ranger where resa_cb='" . addslashes($expl->expl_cb) . "' ", $dbh) or die("<br />" . pmb_mysql_error() . "<br />" . $requete);
                                         $aranger = pmb_mysql_num_rows($result_aranger);
                                         if ($reserve) {
                                             $situation = "<strong>" . $msg['expl_reserve'] . "</strong>";
                                         } elseif ($expl->expl_retloc) {
                                             $situation = $msg['resa_menu_a_traiter'];
                                         } elseif ($aranger) {
                                             $situation = "<strong>" . $msg['resa_menu_a_ranger'] . "</strong>";
                                         } elseif ($expl->pret_flag) {
                                             $situation = "<strong>{$msg[359]}</strong>";
                                         } else {
                                             $situation = "";
                                         }
                                     }
                                     $aff_column .= htmlentities($colencours, ENT_QUOTES, $charset);
                                     if ($situation) {
                                         $aff_column .= "<br />{$situation}";
                                     }
                                 } else {
                                     $aff_column = htmlentities($colencours, ENT_QUOTES, $charset);
                                 }
                             }
                         }
                     }
                     $expl_liste .= "<td {$expl_rowspan}>" . $aff_column . "</td>";
                 }
                 if ($this->print_mode) {
                     $expl_liste .= "<td>&nbsp;</td>";
                 } else {
                     if (SESSrights & CATALOGAGE_AUTH) {
                         //le panier d'exemplaire
                         $cart_click = "onClick=\"openPopUp('" . $base_path . "/cart.php?object_type=EXPL&item=" . $expl->expl_id . "', 'cart', 600, 700, -2, -2, 'toolbar=no, dependent=yes, width=500, height=400, resizable=yes, scrollbars=yes')\"";
                         $cart_link = "<a href='#' {$cart_click}><img src='" . $base_path . "/images/basket_small_20x20.gif' align='center' alt='basket' title=\"{$msg[400]}\"></a>";
                         //l'icon pour le drag&drop de panier
                         $drag_link = "<span onMouseOver='if(init_drag) init_drag();' id='EXPL_drag_" . $expl->expl_id . "'  dragicon=\"" . $base_path . "/images/icone_drag_notice.png\" dragtext=\"" . htmlentities($expl->expl_cb, ENT_QUOTES, $charset) . "\" draggable=\"yes\" dragtype=\"notice\" callback_before=\"show_carts\" callback_after=\"\" style=\"padding-left:7px\"><img src=\"" . $base_path . "/images/notice_drag.png\"/></span>";
                     } else {
                         $cart_click = "";
                         $cart_link = "";
                         $drag_link = "";
                     }
                     //l'impression de la fiche exemplaire
                     $fiche_click = "onClick=\"openPopUp('" . $base_path . "/pdf.php?pdfdoc=fiche_catalographique&expl_id=" . $expl->expl_id . "', 'Fiche', 500, 400, -2, -2, 'toolbar=no, dependent=yes, resizable=yes, scrollbars=yes')\"";
                     $fiche_link = "<a href='#' {$fiche_click}><img src='" . $base_path . "/images/print.gif' align='center' alt='" . $msg['print_fiche_catalographique'] . "' title='" . $msg['print_fiche_catalographique'] . "'></a>";
                     global $pmb_transferts_actif;
                     //si les transferts sont activés
                     if ($pmb_transferts_actif) {
                         //si l'exemplaire n'est pas transferable on a une image vide
                         $transfer_link = "<img src='" . $base_path . "/images/spacer.gif' align='center' height=20 width=20>";
                         $dispo_pour_transfert = transfert::est_transferable($expl->expl_id);
                         if (SESSrights & TRANSFERTS_AUTH && $dispo_pour_transfert) {
                             //l'icon de demande de transfert
                             $transfer_link = "<a href=\"#\" onClick=\"openPopUp('" . $base_path . "/catalog/transferts/transferts_popup.php?expl=" . $expl->expl_id . "', 'cart', 600, 450, -2, -2, 'toolbar=no, dependent=yes, resizable=yes, scrollbars=yes');\"><img src='" . $base_path . "/images/peb_in.png' align='center' border=0 alt=\"" . $msg["transferts_alt_libelle_icon"] . "\" title=\"" . $msg["transferts_alt_libelle_icon"] . "\"></a>";
                         }
                     }
                     //on met tout dans la colonne
                     $expl_liste .= "<td>{$fiche_link} {$cart_link} {$transfer_link} {$drag_link}</td>";
                 }
                 $expl_liste .= "</tr>";
                 if (($expl->expl_note || $expl->expl_comment) && $pmb_expl_list_display_comments) {
                     $notcom = array();
                     $expl_liste .= "<tr><td colspan='" . $total_columns . "'>";
                     if ($expl->expl_note && $pmb_expl_list_display_comments & 1) {
                         $notcom[] .= "<span class='erreur'>{$expl->expl_note}</span>";
                     }
                     if ($expl->expl_comment && $pmb_expl_list_display_comments & 2) {
                         $notcom[] .= "{$expl->expl_comment}";
                     }
                     $expl_liste .= implode("<br />", $notcom);
                     $expl_liste .= "</tr>";
                 }
             }
             // fin while
         }
         // fin il y a des expl visibles
         if ($expl_liste) {
             $entry = "<table border='0' class='expl-list'><tr>";
             for ($i = 0; $i < count($colonnesarray); $i++) {
                 if (substr($colonnesarray[$i], 0, 1) == "#") {
                     //champs personnalisés
                     if (!$cp->no_special_fields) {
                         $id = substr($colonnesarray[$i], 1);
                         $entry .= "<th>" . htmlentities($cp->t_fields[$id][TITRE], ENT_QUOTES, $charset) . "</th>";
                     }
                 } else {
                     eval("\$colencours=\$msg[expl_header_" . $colonnesarray[$i] . "];");
                     $entry .= "<th>" . htmlentities($colencours, ENT_QUOTES, $charset) . "</th>";
                 }
             }
             $entry .= "<th>&nbsp;</th></tr>{$expl_liste}</table>";
         } else {
             $entry = "";
         }
         if ($pmb_expl_display_location_without_expl) {
             if ($pmb_sur_location_activate) {
                 $array_surloc = array();
                 $requete = "SELECT * FROM sur_location ORDER BY surloc_libelle";
                 $result = pmb_mysql_query($requete, $dbh) or die("<br />" . pmb_mysql_error() . "<br />" . $requete);
                 $nb_surloc = pmb_mysql_num_rows($result);
                 if ($nb_surloc) {
                     while ($surloc = pmb_mysql_fetch_object($result)) {
                         $array_surloc[] = array("id" => $surloc->surloc_id, "libelle" => $surloc->surloc_libelle, "locations" => array());
                     }
                 }
                 if (count($array_surloc)) {
                     foreach ($array_surloc as $key => $surloc) {
                         $requete = "SELECT idlocation, location_libelle from docs_location where surloc_num=" . $surloc["id"] . " AND \n\t\t\t\t\t\tidlocation not in (SELECT expl_location from exemplaires WHERE expl_notice={$no_notice}) order by location_libelle";
                         $result = pmb_mysql_query($requete, $dbh) or die("<br />" . pmb_mysql_error() . "<br />" . $requete);
                         $nb_loc = pmb_mysql_num_rows($result);
                         if ($nb_loc) {
                             while ($loc = pmb_mysql_fetch_object($result)) {
                                 $array_surloc[$key]["locations"][] = array("id" => $loc->idlocation, "libelle" => $loc->location_libelle);
                             }
                         } else {
                             unset($array_surloc[$key]);
                         }
                     }
                 }
                 //Au moins une surloc à afficher
                 if (count($array_surloc)) {
                     $tr_surloc = "";
                     foreach ($array_surloc as $key => $surloc) {
                         $tr_surloc .= "<tr><td>";
                         $tr_loc = "";
                         foreach ($surloc["locations"] as $keyloc => $loc) {
                             $tr_loc .= "<tr><td>" . $loc["libelle"] . "</td></tr>";
                         }
                         $tpl_surloc = "\n\t\t\t\t\t\t\t<table border='0' class='expl-list'>\n\t\t\t\t\t\t\t\t{$tr_loc}\n\t\t\t\t\t\t\t</table>";
                         $tr_surloc .= gen_plus('surlocation_without_expl' . $key . '_' . $no_notice, $surloc["libelle"], $tpl_surloc, 0);
                         $tr_surloc .= "</td></tr>";
                     }
                     $tpl = "\n\t\t\t\t\t<table border='0' class='expl-list'>\n\t\t\t\t\t\t{$tr_surloc}\n\t\t\t\t\t</table>";
                     $entry .= gen_plus('location_without_expl' . $no_notice, $msg['expl_surlocation_without_expl'], $tpl, 0);
                 }
             } else {
                 $requete = "SELECT location_libelle from docs_location where\n\t\t\t\tidlocation not in (SELECT expl_location from exemplaires WHERE expl_notice={$no_notice}) order by location_libelle";
                 $result = pmb_mysql_query($requete, $dbh) or die("<br />" . pmb_mysql_error() . "<br />" . $requete);
                 $nb_loc = pmb_mysql_num_rows($result);
                 if ($nb_loc) {
                     $items = "";
                     while ($loc = pmb_mysql_fetch_object($result)) {
                         $items .= "<tr><td>" . $loc->location_libelle . "</td></tr>";
                     }
                     $tpl = "\n\t\t\t\t\t<table border='0' class='expl-list'>\n\t\t\t\t\t\t{$items}\n\t\t\t\t\t</table>";
                     $tpl = gen_plus('location_without_expl' . $no_notice, $msg['expl_location_without_expl'], $tpl, 0);
                     $entry .= $tpl;
                 }
             }
         }
         $this->nb_expl = $nbr_expl;
         return $entry;
     } else {
         return "";
     }
 }
Ejemplo n.º 3
0
function get_expl($expl, $show_in_reception = 0, $return_count = false)
{
    global $msg, $dbh, $charset;
    global $base_path, $class_path;
    global $cart_link_non;
    global $explr_invisible, $explr_visible_unmod, $explr_visible_mod, $pmb_droits_explr_localises;
    global $pmb_transferts_actif;
    global $pmb_expl_list_display_comments;
    global $pmb_sur_location_activate;
    global $pmb_expl_data;
    // attention, $bul est un array
    if (!sizeof($expl) || !is_array($expl)) {
        return $msg["bull_no_expl"];
    }
    $explr_tab_invis = explode(",", $explr_invisible);
    $explr_tab_unmod = explode(",", $explr_visible_unmod);
    $explr_tab_modif = explode(",", $explr_visible_mod);
    //	$th_sur_location="";
    //	if($pmb_sur_location_activate)$th_sur_location="<th>".$msg["sur_location_expl"]."</th>";
    //
    //	$result  = "<table border=\"0\" cellspacing=\"1\">";
    //	$result .= "<tr><th>".$msg[293]."</th><th>".$msg[4016]."</th>$th_sur_location<th>".$msg[4017]."</th><th>".$msg[4018]."</th><th>".$msg[4019]."</th><th>".$msg[4015]."</th><th></th>";
    //	while(list($cle, $valeur) = each($expl)) {
    //		$requete = "SELECT pret_idempr, ";
    //		$requete .= " date_format(pret_retour, '".$msg["format_date"]."') as aff_pret_retour ";
    //		$requete .= " FROM pret ";
    //		$requete .= " WHERE pret_idexpl='$valeur->expl_id' ";
    //		$result_prets = pmb_mysql_query($requete, $dbh) or die ("<br />".pmb_mysql_error()."<br />".$requete);
    //		if (pmb_mysql_num_rows($result_prets)) $expl_pret = pmb_mysql_fetch_object($result_prets) ;
    //		else $expl_pret="";
    //		$situation = "";
    //		// prêtable ou pas s'il est prêté, on affiche son état
    //		if (is_object($expl_pret) && $expl_pret->pret_idempr) {
    //			// exemplaire sorti
    //			$rqt_empr = "SELECT empr_nom, empr_prenom, id_empr, empr_cb FROM empr WHERE id_empr='$expl_pret->pret_idempr' ";
    //			$res_empr = pmb_mysql_query($rqt_empr, $dbh) ;
    //			$res_empr_obj = pmb_mysql_fetch_object($res_empr) ;
    //			$situation = "<strong>${msg[358]} ".$expl_pret->aff_pret_retour."</strong>";
    //			global $empr_show_caddie, $selector_prop_ajout_caddie_empr;
    //			if (!$show_in_reception && $empr_show_caddie && (SESSrights & CIRCULATION_AUTH)) {
    //				$img_ajout_empr_caddie="<img src='./images/basket_empr.gif' align='middle' alt='basket' title=\"${msg[400]}\" onClick=\"openPopUp('./cart.php?object_type=EMPR&item=".$expl->pret_idempr."', 'cart', 600, 700, -2, -2, '$selector_prop_ajout_caddie_empr')\">&nbsp;";
    //			} else {
    //				$img_ajout_empr_caddie="";
    //			}
    //			if (!$show_in_reception) {
    //				$situation .= "<br />$img_ajout_empr_caddie<a href='./circ.php?categ=pret&form_cb=".rawurlencode($res_empr_obj->empr_cb)."'>$res_empr_obj->empr_prenom $res_empr_obj->empr_nom</a>";
    //			} else {
    //				$situation .= "<br />$res_empr_obj->empr_prenom $res_empr_obj->empr_nom";
    //			}
    //		} else {
    //			// tester si réservé
    //			$result_resa = pmb_mysql_query("select 1 from resa where resa_cb='".addslashes($valeur->expl_cb)."' ", $dbh) or die ();
    //			$reserve = pmb_mysql_num_rows($result_resa);
    //			if ($reserve)
    //				$situation = "<strong>".$msg['expl_reserve']."</strong>"; // exemplaire réservé
    //			elseif ($valeur->pret_flag)
    //				$situation = "<strong>${msg[359]}</strong>"; // exemplaire disponible
    //			else
    //				$situation = "";
    //		}
    //
    //		if(!$show_in_reception && (SESSrights & CATALOGAGE_AUTH)){
    //			$selector_prop = "toolbar=no, dependent=yes, resizable=yes, scrollbars=yes";
    //			$cart_click_expl = "onClick=\"openPopUp('./cart.php?object_type=EXPL&item=!!item!!', 'cart', 600, 700, -2, -2, '$selector_prop')\"";
    //			$cart_link = "<img src='./images/basket_small_20x20.gif' align='center' alt='middle' title=\"${msg[400]}\" $cart_click_expl>";
    //			$ajout_expl_panier = str_replace('!!item!!', $valeur->expl_id, $cart_link) ;
    //		}else{
    //			$ajout_expl_panier ="";
    //		}
    //
    //		//si les transferts sont activés
    //		if (!$show_in_reception && $pmb_transferts_actif) {
    //			//si l'exemplaire n'est pas transferable on a une image vide
    //			$dispo_pour_transfert = transfert::est_transferable ( $valeur->expl_id );
    //			if (SESSrights & TRANSFERTS_AUTH && $dispo_pour_transfert)
    //				//l'icon de demande de transfert
    //				$ajout_expl_panier .= "<a href=\"#\" onClick=\"openPopUp('./catalog/transferts/transferts_popup.php?expl=" . $valeur->expl_id . "', 'cart', 600, 450, -2, -2, 'toolbar=no, dependent=yes, resizable=yes, scrollbars=yes');\">" . "<img src='./images/peb_in.png' align='center' border=0 alt=\"" . $msg ["transferts_alt_libelle_icon"] . "\" title=\"" . $msg ["transferts_alt_libelle_icon"] . "\"></a>";
    //			else
    //				$ajout_expl_panier .= "<img src='./images/spacer.gif' align='center' height=20 width=20>";
    //
    //		}
    //
    //		$as_invis = false;
    //		$as_unmod = false;
    //		$as_modif = true;
    //		global $flag_no_delete_bulletin;
    //		$flag_no_delete_bulletin=0;
    //		//visibilité des exemplaires
    //		if ($pmb_droits_explr_localises) {
    //			$as_invis = in_array($valeur->expl_location,$explr_tab_invis);
    //			$as_unmod = in_array($valeur->expl_location,$explr_tab_unmod);
    //			//$as_modif = in_array($valeur->expl_location,$explr_tab_modif);
    //
    //			if(!($as_modif=in_array  ($valeur->expl_location,$explr_tab_modif) )) $flag_no_delete_bulletin=1;
    //
    //		}
    //		if ($show_in_reception || $cart_link_non || !(SESSrights & CATALOGAGE_AUTH))
    //			$link =  htmlentities($valeur->expl_cb,ENT_QUOTES, $charset);
    //		else {
    //			if ($as_modif) {
    //				$link = "<a href=\"./catalog.php?categ=serials&sub=bulletinage&action=expl_form&bul_id=".$valeur->expl_bulletin."&expl_id=".$valeur->expl_id."\">".htmlentities($valeur->expl_cb,ENT_QUOTES, $charset)."</a>";
    //			} else {
    //				$link = htmlentities($valeur->expl_cb,ENT_QUOTES, $charset);
    //			}
    //		}
    //
    //		if ($situation) $situation="<br />".$situation;
    //		if(!$show_in_reception && SESSrights & CATALOGAGE_AUTH){
    //			$ajout_expl_panier.="<span id='EXPL_drag_".$valeur->expl_id."'  dragicon=\"$base_path/images/icone_drag_notice.png\" dragtext=\"".htmlentities($valeur->expl_cb,ENT_QUOTES, $charset)."\" draggable=\"yes\" dragtype=\"notice\" callback_before=\"show_carts\" callback_after=\"\" style=\"padding-left:7px\"><img src=\"".$base_path."/images/notice_drag.png\"/></span>";
    //		}
    //
    //		$line = "<tr>";
    //		if (($valeur->expl_note || $valeur->expl_comment) && $pmb_expl_list_display_comments) $line .= "<td rowspan='2'>$link</td>";
    //		else $line .= "<td>$link</td>";
    //		$line .= "<td>$valeur->expl_cote</td>";
    //		if($pmb_sur_location_activate) $line .= "<td>$valeur->sur_loc_libelle</td>";
    //		$line .= "<td>$valeur->location_libelle</td>";
    //		$line .= "<td>$valeur->section_libelle</td>";
    //		$line .= "<td>$valeur->statut_libelle.$situation</td>";
    //		$line .= "<td>$valeur->tdoc_libelle</td>";
    //		$line .= "<td>$ajout_expl_panier</td>";
    //		if (($valeur->expl_note || $valeur->expl_comment) && $pmb_expl_list_display_comments) {
    //			$notcom=array();
    //			$line .= "<tr><td colspan='6'>";
    //			if ($valeur->expl_note && ($pmb_expl_list_display_comments & 1)) $notcom[] .= "<span class='erreur'>$valeur->expl_note</span>";
    //			if ($valeur->expl_comment && ($pmb_expl_list_display_comments & 2)) $notcom[] .= "$valeur->expl_comment";
    //			$line .= implode("<br />",$notcom);
    //			$line .= "</tr>";
    //		}
    //		$result .= $line;
    //	} //while(list($cle, $valeur) = each($expl))
    //
    //	$result .= "</table>";
    //
    //maintenant
    //Liste des champs d'exemplaires
    if ($pmb_sur_location_activate) {
        $surloc_field = "surloc_libelle,";
    }
    if (!$pmb_expl_data) {
        $pmb_expl_data = "expl_cb,expl_cote," . $surloc_field . "location_libelle,section_libelle,statut_libelle,tdoc_libelle";
    }
    $colonnesarray = explode(",", $pmb_expl_data);
    if (!in_array("expl_cb", $colonnesarray)) {
        array_unshift($colonnesarray, "expl_cb");
    }
    $total_columns = count($colonnesarray);
    //Présence de champs personnalisés
    if (strstr($pmb_expl_data, "#")) {
        require_once $class_path . "/parametres_perso.class.php";
        $cp = new parametres_perso("expl");
    }
    if ($return_count) {
        return count($expl);
    }
    if (count($expl)) {
        $result .= "<table border=\"0\" cellspacing=\"1\">";
        //un premier tour pour aller chercher les libellés...
        for ($i = 0; $i < count($colonnesarray); $i++) {
            if (substr($colonnesarray[$i], 0, 1) == "#") {
                //champs personnalisés
                if (!$cp->no_special_fields) {
                    $id = substr($colonnesarray[$i], 1);
                    $entry .= "<th>" . htmlentities($cp->t_fields[$id][TITRE], ENT_QUOTES, $charset) . "</th>";
                }
            } else {
                eval("\$colencours=\$msg['expl_header_" . $colonnesarray[$i] . "'];");
                $entry .= "<th>" . htmlentities($colencours, ENT_QUOTES, $charset) . "</th>";
            }
        }
        $result .= "<tr>" . $entry . "<th>&nbsp;</th></tr>";
        foreach ($expl as $exemplaire) {
            $requete = "SELECT pret_idempr, ";
            $requete .= " date_format(pret_retour, '" . $msg["format_date"] . "') as aff_pret_retour ";
            $requete .= " FROM pret ";
            $requete .= " WHERE pret_idexpl='{$exemplaire->expl_id}' ";
            $result_prets = pmb_mysql_query($requete, $dbh) or die("<br />" . pmb_mysql_error() . "<br />" . $requete);
            if (pmb_mysql_num_rows($result_prets)) {
                $expl_pret = pmb_mysql_fetch_object($result_prets);
            } else {
                $expl_pret = "";
            }
            $situation = "";
            // prêtable ou pas s'il est prêté, on affiche son état
            if (is_object($expl_pret) && $expl_pret->pret_idempr) {
                // exemplaire sorti
                $rqt_empr = "SELECT empr_nom, empr_prenom, id_empr, empr_cb FROM empr WHERE id_empr='{$expl_pret->pret_idempr}' ";
                $res_empr = pmb_mysql_query($rqt_empr, $dbh);
                $res_empr_obj = pmb_mysql_fetch_object($res_empr);
                $situation = "<strong>{$msg[358]} " . $expl_pret->aff_pret_retour . "</strong>";
                global $empr_show_caddie, $selector_prop_ajout_caddie_empr;
                if (!$show_in_reception && $empr_show_caddie && SESSrights & CIRCULATION_AUTH) {
                    $img_ajout_empr_caddie = "<img src='./images/basket_empr.gif' align='middle' alt='basket' title=\"{$msg[400]}\" onClick=\"openPopUp('./cart.php?object_type=EMPR&item=" . $exemplaire->pret_idempr . "', 'cart', 600, 700, -2, -2, '{$selector_prop_ajout_caddie_empr}')\">&nbsp;";
                } else {
                    $img_ajout_empr_caddie = "";
                }
                if (!$show_in_reception) {
                    $situation .= "<br />{$img_ajout_empr_caddie}<a href='./circ.php?categ=pret&form_cb=" . rawurlencode($res_empr_obj->empr_cb) . "'>{$res_empr_obj->empr_prenom} {$res_empr_obj->empr_nom}</a>";
                } else {
                    $situation .= "<br />{$res_empr_obj->empr_prenom} {$res_empr_obj->empr_nom}";
                }
            } else {
                // tester si réservé
                $result_resa = pmb_mysql_query("select 1 from resa where resa_cb='" . addslashes($exemplaire->expl_cb) . "' ", $dbh) or die;
                $reserve = pmb_mysql_num_rows($result_resa);
                if ($reserve) {
                    $situation = "<strong>" . $msg['expl_reserve'] . "</strong>";
                    // exemplaire réservé
                } elseif ($exemplaire->pret_flag) {
                    $situation = "<strong>{$msg[359]}</strong>";
                    // exemplaire disponible
                } else {
                    $situation = "";
                }
            }
            if (!$show_in_reception && SESSrights & CATALOGAGE_AUTH) {
                $selector_prop = "toolbar=no, dependent=yes, resizable=yes, scrollbars=yes";
                $cart_click_expl = "onClick=\"openPopUp('./cart.php?object_type=EXPL&item=!!item!!', 'cart', 600, 700, -2, -2, '{$selector_prop}')\"";
                $cart_link = "<img src='./images/basket_small_20x20.gif' align='center' alt='middle' title=\"{$msg[400]}\" {$cart_click_expl}>";
                $ajout_expl_panier = str_replace('!!item!!', $exemplaire->expl_id, $cart_link);
            } else {
                $ajout_expl_panier = "";
            }
            //si les transferts sont activés
            if (!$show_in_reception && $pmb_transferts_actif) {
                //si l'exemplaire n'est pas transferable on a une image vide
                $dispo_pour_transfert = transfert::est_transferable($exemplaire->expl_id);
                if (SESSrights & TRANSFERTS_AUTH && $dispo_pour_transfert) {
                    //l'icon de demande de transfert
                    $ajout_expl_panier .= "<a href=\"#\" onClick=\"openPopUp('./catalog/transferts/transferts_popup.php?expl=" . $exemplaire->expl_id . "', 'cart', 600, 450, -2, -2, 'toolbar=no, dependent=yes, resizable=yes, scrollbars=yes');\">" . "<img src='./images/peb_in.png' align='center' border=0 alt=\"" . $msg["transferts_alt_libelle_icon"] . "\" title=\"" . $msg["transferts_alt_libelle_icon"] . "\"></a>";
                } else {
                    $ajout_expl_panier .= "<img src='./images/spacer.gif' align='center' height=20 width=20>";
                }
            }
            $as_invis = false;
            $as_unmod = false;
            $as_modif = true;
            global $flag_no_delete_bulletin;
            $flag_no_delete_bulletin = 0;
            //visibilité des exemplaires
            if ($pmb_droits_explr_localises) {
                $as_invis = in_array($exemplaire->expl_location, $explr_tab_invis);
                $as_unmod = in_array($exemplaire->expl_location, $explr_tab_unmod);
                //$as_modif = in_array($exemplaire->expl_location,$explr_tab_modif);
                if (!($as_modif = in_array($exemplaire->expl_location, $explr_tab_modif))) {
                    $flag_no_delete_bulletin = 1;
                }
            }
            if ($show_in_reception || $cart_link_non || !(SESSrights & CATALOGAGE_AUTH)) {
                $link = htmlentities($exemplaire->expl_cb, ENT_QUOTES, $charset);
            } else {
                if ($as_modif) {
                    $link = "<a href=\"./catalog.php?categ=serials&sub=bulletinage&action=expl_form&bul_id=" . $exemplaire->expl_bulletin . "&expl_id=" . $exemplaire->expl_id . "\">" . htmlentities($exemplaire->expl_cb, ENT_QUOTES, $charset) . "</a>";
                } else {
                    $link = htmlentities($exemplaire->expl_cb, ENT_QUOTES, $charset);
                }
            }
            if ($situation) {
                $situation = "<br />" . $situation;
            }
            if (!$show_in_reception && SESSrights & CATALOGAGE_AUTH) {
                $ajout_expl_panier .= "<span id='EXPL_drag_" . $exemplaire->expl_id . "'  dragicon=\"{$base_path}/images/icone_drag_notice.png\" dragtext=\"" . htmlentities($exemplaire->expl_cb, ENT_QUOTES, $charset) . "\" draggable=\"yes\" dragtype=\"notice\" callback_before=\"show_carts\" callback_after=\"\" style=\"padding-left:7px\"><img src=\"" . $base_path . "/images/notice_drag.png\"/></span>";
            }
            global $pmb_serialcirc_subst;
            if ($pmb_serialcirc_subst) {
                $ajout_expl_panier .= "<img src='./images/print.gif' alt='Imprimer...' title='Imprimer...' align='middle' border='0'\tstyle='padding-left:7px' \t\t\t\n\t\t\t\t\tonclick=\"openPopUp('./ajax.php?module=circ&categ=periocirc&sub=print_cote&expl_id=" . $exemplaire->expl_id . "', 'circulation', 600, 500, -2, -2, 'toolbar=no, dependent=yes, resizable=yes');\"\n\t\t\t\t>";
            }
            $line = "<tr>";
            for ($i = 0; $i < count($colonnesarray); $i++) {
                if ($i == 0 && ($exemplaire->expl_note || $exemplaire->expl_comment) && $pmb_expl_list_display_comments) {
                    $expl_rowspan = "rowspan='2'";
                } else {
                    $expl_rowspan = "";
                }
                $aff_column = "";
                if (substr($colonnesarray[$i], 0, 1) == "#") {
                    //champs personnalisés
                    $id = substr($colonnesarray[$i], 1);
                    $cp->get_values($exemplaire->expl_id);
                    if (!$cp->no_special_fields) {
                        $temp = $cp->get_formatted_output($cp->values[$id], $id);
                        if (!$temp) {
                            $temp = "&nbsp;";
                        }
                        $aff_column .= $temp;
                    }
                } else {
                    eval("\$colencours=\$exemplaire->" . $colonnesarray[$i] . ";");
                    if ($colonnesarray[$i] == "expl_cb") {
                        $aff_column = $link;
                    } else {
                        if ($colonnesarray[$i] == "expl_cote") {
                            $aff_column = "<strong>" . htmlentities($colencours, ENT_QUOTES, $charset) . "</strong>";
                        } else {
                            if ($colonnesarray[$i] == "surloc_libelle") {
                                $aff_column = htmlentities($exemplaire->sur_loc_libelle, ENT_QUOTES, $charset);
                            } else {
                                if ($colonnesarray[$i] == "statut_libelle") {
                                    $aff_column = htmlentities($colencours, ENT_QUOTES, $charset) . $situation;
                                } else {
                                    $aff_column = htmlentities($colencours, ENT_QUOTES, $charset);
                                }
                            }
                        }
                    }
                }
                $line .= "<td {$expl_rowspan}>" . $aff_column . "</td>";
            }
            $line .= "<td>{$ajout_expl_panier}</td>";
            $line .= "</tr>";
            if (($exemplaire->expl_note || $exemplaire->expl_comment) && $pmb_expl_list_display_comments) {
                $notcom = array();
                $line .= "<tr><td colspan='" . $total_columns . "'>";
                if ($exemplaire->expl_note && $pmb_expl_list_display_comments & 1) {
                    $notcom[] .= "<span class='erreur'>{$exemplaire->expl_note}</span>";
                }
                if ($exemplaire->expl_comment && $pmb_expl_list_display_comments & 2) {
                    $notcom[] .= "{$exemplaire->expl_comment}";
                }
                $line .= implode("<br />", $notcom);
                $line .= "</tr>";
            }
            $result .= $line;
        }
        $result .= "</table>";
    }
    return $result;
}
Ejemplo n.º 4
0
function aff_authors_by_type_with_tpl($param)
{
    global $fonction_auteur;
    // $param[0] = 0=principal seul, 1=principal+autres, 2=tous, 3=autres, 4=secondaires, 5=autres+secondaires
    // $param[1] = nombre maxi d'auteurs à afficher
    // $param[2] = séparateur entre auteurs
    // $param[3] = séparateur entre principal/autres/secondaires
    // $param[4] = afficher la fonction : 0=non, 1=toujours
    // $param[5] = afficher "et al." si plus d'auteurs que le maxi
    // $param[6] = 70=physique, 71=collectivités, 72=congrès (séparé parune virgule...)
    // $param[7] = template d'affichage de l'autorité
    // $param[8] = filtre sur code fonction
    global $parser_environnement, $dbh;
    if (!$parser_environnement['id_notice']) {
        return "";
    }
    $notice = gere_global();
    $param[6] = explode(",", $param[6]);
    $param[6] = implode("','", $param[6]);
    if ($param[8]) {
        $filtre_fonctions = " and responsability_fonction='" . addslashes($param[8]) . "'";
    } else {
        $filtre_fonctions = "";
    }
    $rqt_count = "select count(*) as nb from responsability, authors \n\t\t\twhere responsability_notice='" . $parser_environnement['id_notice'] . "' \n\t\t\t\tand responsability_author=author_id\n\t\t\t\tand author_type in('" . $param[6] . "')";
    if ($param[0] <= 2) {
        $rqt_count .= " and responsability_type<='" . $param[0] . "'";
    } else {
        if ($param[0] == 3) {
            $rqt_count .= " and responsability_type='1'";
        } else {
            if ($param[0] == 4) {
                $rqt_count .= " and responsability_type='2'";
            } else {
                if ($param[0] == 5) {
                    $rqt_count .= " and responsability_type in('1','2')";
                }
            }
        }
    }
    $rqt_count .= $filtre_fonctions;
    $res_sql_count = pmb_mysql_query($rqt_count, $dbh);
    $res_count = pmb_mysql_fetch_object($res_sql_count);
    $rqt = "select author_id, responsability_fonction, responsability_type \n\t\t\tfrom responsability, authors \n\t\t\twhere responsability_notice='" . $parser_environnement['id_notice'] . "' \n\t\t\t\tand responsability_author=author_id\n\t\t\t\tand author_type in('" . $param[6] . "')";
    if ($param[0] <= 2) {
        $rqt .= " and responsability_type<='" . $param[0] . "' ";
    } else {
        if ($param[0] == 3) {
            $rqt .= " and responsability_type='1' ";
        } else {
            if ($param[0] == 4) {
                $rqt .= " and responsability_type='2' ";
            } else {
                if ($param[0] == 5) {
                    $rqt .= " and responsability_type in('1','2') ";
                }
            }
        }
    }
    $rqt .= $filtre_fonctions;
    $rqt .= " order by responsability_type, responsability_ordre ";
    if ($param[1] > 0) {
        $rqt .= " limit 0," . $param[1];
    }
    $res_sql = pmb_mysql_query($rqt, $dbh);
    while ($authors = pmb_mysql_fetch_object($res_sql)) {
        $aut_detail = new auteur($authors->author_id);
        $aut_pp = new parametres_perso("author");
        $aut_pp->get_values($authors->author_id);
        $values_pp = $aut_pp->values;
        $aut_detail->parametres_perso = array();
        foreach ($values_pp as $field_id => $vals) {
            $aut_detail->parametres_perso[$aut_pp->t_fields[$field_id]["NAME"]]["TITRE"] = $aut_pp->t_fields[$field_id]["TITRE"];
            foreach ($vals as $value) {
                $aut_detail->parametres_perso[$aut_pp->t_fields[$field_id]["NAME"]]["VALUE"][] = $aut_pp->get_formatted_output(array($value), $field_id);
            }
        }
        if ($authors->responsability_fonction && $param[4] == 1) {
            $aut_detail->function = $fonction_auteur[$authors->responsability_fonction];
        }
        if ($authors->responsability_type == 0) {
            $aut[] = _get_aut_infos($aut_detail, $param[7]);
        }
        if ($authors->responsability_type == 1) {
            $aut1[] = _get_aut_infos($aut_detail, $param[7]);
        }
        if ($authors->responsability_type == 2) {
            $aut2[] = _get_aut_infos($aut_detail, $param[7]);
        }
    }
    if (count($aut1)) {
        $aut[] = implode($param[2], $aut1);
    }
    if (count($aut2)) {
        $aut[] = implode($param[2], $aut2);
    }
    if ($param[1] != 0 && $param[5] && $res_count->nb > $param[1]) {
        $aut[] = "et al.";
    }
    if (count($aut)) {
        return implode($param[3], $aut);
    }
    return "";
}
Ejemplo n.º 5
0
function _export_($id, $keep_expl = 0)
{
    global $charset;
    $requete = "select * from notices where notice_id={$id}";
    $resultat = pmb_mysql_query($requete);
    $rn = pmb_mysql_fetch_object($resultat);
    $dt = $rn->typdoc;
    $bl = $rn->niveau_biblio;
    $hl = $rn->niveau_hierar;
    $notice .= "<notice>\n";
    $notice .= "  <rs>n</rs>\n";
    $notice .= "  <dt>" . $dt . "</dt>\n";
    $notice .= "  <bl>" . $bl . "</bl>\n";
    $notice .= "  <hl>" . $hl . "</hl>\n";
    $notice .= "  <el>1</el>\n";
    $notice .= "  <ru>i</ru>\n";
    //ISBN
    if ($rn->code != '') {
        $notice .= "  <f c='010' ind=' '>\n";
        $notice .= "    <s c='a'>" . htmlspecialchars($rn->code, ENT_QUOTES, $charset) . "</s>\n";
        $notice .= "  </f>\n";
    }
    //Langage
    $rqttmp_lang = "select type_langue,code_langue from notices_langues where num_notice='{$id}' order by ordre_langue ";
    $restmp_lang = pmb_mysql_query($rqttmp_lang);
    if (pmb_mysql_num_rows($restmp_lang)) {
        $ind = "0 ";
        $notice_langue_temp = "";
        while ($tmp_lang = pmb_mysql_fetch_object($restmp_lang)) {
            if ($tmp_lang->type_langue) {
                $ind = "1 ";
                $notice_langue_temp .= "    <s c='c'>" . htmlspecialchars($tmp_lang->code_langue, ENT_QUOTES, $charset) . "</s>\n";
            } else {
                $notice_langue_temp .= "    <s c='a'>" . htmlspecialchars($tmp_lang->code_langue, ENT_QUOTES, $charset) . "</s>\n";
            }
        }
        $notice .= "  <f c='101' ind='" . $ind . "'>\n";
        $notice .= $notice_langue_temp;
        $notice .= "  </f>\n";
    }
    //Titre
    if ($rn->tit1 != '') {
        $notice .= "  <f c='200' ind='1 '>\n";
        $notice .= "    <s c='a'>" . htmlspecialchars($rn->tit1, ENT_QUOTES, $charset) . "</s>\n";
        if ($rn->tit2 != '') {
            $notice .= "    <s c='c'>" . htmlspecialchars($rn->tit2, ENT_QUOTES, $charset) . "</s>\n";
        }
        if ($rn->tit3 != '') {
            $notice .= "    <s c='d'>" . htmlspecialchars($rn->tit3, ENT_QUOTES, $charset) . "</s>\n";
        }
        if ($rn->tit4 != '') {
            $notice .= "    <s c='e'>" . htmlspecialchars($rn->tit4, ENT_QUOTES, $charset) . "</s>\n";
        }
        $notice .= "  </f>\n";
    }
    //Mention d'édition
    if ($rn->mention_edition) {
        $notice .= "  <f c='205' ind='  '>\n";
        $notice .= "    <s c='a'>" . htmlspecialchars($rn->mention_edition, ENT_QUOTES, $charset) . "</s>\n";
        $notice .= "  </f>\n";
    }
    //Editeurs
    if ($rn->ed1_id) {
        $requete = "select * from publishers where ed_id=" . $rn->ed1_id;
        $resultat = pmb_mysql_query($requete);
        $red = pmb_mysql_fetch_object($resultat);
        $notice .= "  <f c='210' ind='  '>\n";
        $notice .= "    <s c='c'>" . htmlspecialchars($red->ed_name, ENT_QUOTES, $charset) . "</s>\n";
        if ($red->ed_ville != '') {
            $notice .= "    <s c='a'>" . htmlspecialchars($red->ed_ville, ENT_QUOTES, $charset) . "</s>\n";
        }
        if ($rn->year != '') {
            $notice .= "    <s c='d'>" . htmlspecialchars($rn->year, ENT_QUOTES, $charset) . "</s>\n";
        }
        $notice .= "  </f>\n";
    }
    if ($rn->ed2_id) {
        $requete = "select * from publishers where ed_id=" . $rn->ed2_id;
        $resultat = pmb_mysql_query($requete);
        $red = pmb_mysql_fetch_object($resultat);
        $notice .= "  <f c='210' ind='  '>\n";
        $notice .= "    <s c='c'>" . htmlspecialchars($red->ed_name, ENT_QUOTES, $charset) . "</s>\n";
        if ($red->ed_ville != '') {
            $notice .= "    <s c='a'>" . htmlspecialchars($red->ed_ville, ENT_QUOTES, $charset) . "</s>\n";
        }
        if ($rn->year != '') {
            $notice .= "    <s c='d'>" . htmlspecialchars($rn->year, ENT_QUOTES, $charset) . "</s>\n";
        }
        $notice .= "  </f>\n";
    }
    //Collation
    if ($rn->npages || $rn->ill || $rn->size || $rn->accomp) {
        $notice .= "  <f c='215' ind='  '>\n";
        if ($rn->npages) {
            $notice .= "    <s c='a'>" . htmlspecialchars($rn->npages, ENT_QUOTES, $charset) . "</s>\n";
        }
        if ($rn->ill) {
            $notice .= "    <s c='c'>" . htmlspecialchars($rn->ill, ENT_QUOTES, $charset) . "</s>\n";
        }
        if ($rn->size) {
            $notice .= "    <s c='d'>" . htmlspecialchars($rn->size, ENT_QUOTES, $charset) . "</s>\n";
        }
        if ($rn->accomp) {
            $notice .= "    <s c='e'>" . htmlspecialchars($rn->accomp, ENT_QUOTES, $charset) . "</s>\n";
        }
        $notice .= "  </f>\n";
    }
    //Collection
    if ($rn->coll_id) {
        $requete = "select * from collections where collection_id=" . $rn->coll_id;
        $resultat = pmb_mysql_query($requete);
        if ($col = pmb_mysql_fetch_object($resultat)) {
            $notice .= "  <f c='225' ind='2 '>\n";
            $notice .= "    <s c='a'>" . htmlspecialchars($col->collection_name, ENT_QUOTES, $charset) . "</s>\n";
            if ($rn->nocoll != '') {
                $notice .= "    <s c='v'>" . htmlspecialchars($rn->nocoll, ENT_QUOTES, $charset) . "</s>\n";
            }
            if ($col->collection_issn != '') {
                $notice .= "    <s c='x'>" . htmlspecialchars($col->collection_issn, ENT_QUOTES, $charset) . "</s>\n";
            }
        }
        //sous-collection
        if ($rn->subcoll_id) {
            $requete = "select * from sub_collections where sub_coll_id=" . $rn->subcoll_id;
            $resultat = pmb_mysql_query($requete);
            if ($subcol = pmb_mysql_fetch_object($resultat)) {
                $notice .= "    <s c='i'>" . htmlspecialchars($subcol->sub_coll_name, ENT_QUOTES, $charset) . "</s>\n";
            }
        }
        $notice .= "  </f>\n";
    }
    //Notes
    //Générale
    if ($rn->n_gen) {
        $notice .= "  <f c='300' ind='  '>\n";
        $notice .= "    <s c='a'>" . htmlspecialchars($rn->n_gen, ENT_QUOTES, $charset) . "</s>\n";
        $notice .= "  </f>\n";
    }
    //de contenu
    if ($rn->n_contenu) {
        $notice .= "  <f c='327' ind='  '>\n";
        $notice .= "    <s c='a'>" . htmlspecialchars($rn->n_contenu, ENT_QUOTES, $charset) . "</s>\n";
        $notice .= "  </f>\n";
    }
    //Résumé
    if ($rn->n_resume) {
        $notice .= "  <f c='330' ind='  '>\n";
        $notice .= "    <s c='a'>" . htmlspecialchars($rn->n_resume, ENT_QUOTES, $charset) . "</s>\n";
        $notice .= "  </f>\n";
    }
    //Titre de série
    $serie = "";
    if ($rn->tparent_id != 0 || $rn->tnvol != '') {
        $requete = "select serie_name from series where serie_id=" . $rn->tparent_id;
        $resultat = pmb_mysql_query($requete);
        if (pmb_mysql_num_rows($resultat)) {
            $serie = pmb_mysql_result($resultat, 0, 0);
        }
        $notice .= "  <f c='461' ind=' 0'>\n";
        if ($serie != '') {
            $notice .= "    <s c='t'>" . htmlspecialchars($serie, ENT_QUOTES, $charset) . "</s>\n";
        }
        if ($rn->tnvol) {
            $notice .= "    <s c='v'>" . htmlspecialchars($rn->tnvol, ENT_QUOTES, $charset) . "</s>\n";
        }
        $notice .= "  </f>\n";
    }
    if ($bl == 'a') {
        //liens vers les périodiques et bulletins pour les notices d'article
        $req_link = "SELECT notice_id, tit1, code ";
        $req_link .= "bulletin_id, bulletin_numero, date_date, mention_date, bulletin_titre, bulletin_numero ";
        $req_link .= "from analysis,bulletins,notices WHERE analysis_notice=" . $id . " and bulletin_id=analysis_bulletin and bulletin_notice=notice_id ";
        $result_link = pmb_mysql_query($req_link);
        if (pmb_mysql_num_rows($result_link)) {
            $row = pmb_mysql_fetch_object($result_link);
            $notice .= "  <f c='461' ind='  '>\n";
            $notice .= "    <s c='t'>" . htmlspecialchars($row->tit1, ENT_QUOTES, $charset) . "</s>\n";
            $notice .= "    <s c='9'>lnk:perio</s>\n";
            $notice .= "  </f>\n";
            $notice .= "  <f c='463' ind='  '>\n";
            $notice .= "    <s c='d'>" . htmlspecialchars(formatdate($row->date_date), ENT_QUOTES, $charset) . "</s>\n";
            if ($row->mention_date) {
                $notice .= "    <s c='e'>" . htmlspecialchars($row->mention_date, ENT_QUOTES, $charset) . "</s>\n";
            }
            $notice .= "    <s c='v'>" . htmlspecialchars($row->bulletin_numero, ENT_QUOTES, $charset) . "</s>\n";
            if ($row->bulletin_titre != '') {
                $notice .= "    <s c='t'>" . htmlspecialchars($row->bulletin_titre, ENT_QUOTES, $charset) . "</s>\n";
            }
            $notice .= "    <s c='9'>lnk:bull</s>\n";
            $notice .= "  </f>\n";
        }
    }
    //Descripteurs
    $requete = "SELECT libelle_categorie FROM categories, notices_categories WHERE notcateg_notice=" . $id . " and categories.num_noeud = notices_categories.num_noeud ORDER BY ordre_categorie";
    $resultat = pmb_mysql_query($requete);
    if (pmb_mysql_num_rows($resultat)) {
        while ($row = pmb_mysql_fetch_object($resultat)) {
            $notice .= "  <f c='606' ind=' 1'>\n";
            $notice .= "    <s c='a'>" . htmlspecialchars($row->libelle_categorie, ENT_QUOTES, $charset) . "</s>\n";
            $notice .= "  </f>\n";
        }
    }
    //Auteurs
    //Recherche des auteurs;
    $requete = "select author_type, author_name, author_rejete, author_date, responsability_fonction, responsability_type \n\t,author_subdivision, author_lieu,author_ville, author_pays,author_numero,author_web\n\tfrom authors, responsability where responsability_notice=" . $id . " and responsability_author=author_id";
    $resultat = pmb_mysql_query($requete);
    while ($auth = pmb_mysql_fetch_object($resultat)) {
        //Si c'est un 70 (individuel) alors on l'exporte
        if ($auth->author_type == "70") {
            // Personne physique
            $notice .= "  <f c='" . $auth->author_type . $auth->responsability_type . "' ind=' 1'>\n";
            $notice .= "    <s c='a'>" . htmlspecialchars($auth->author_name, ENT_QUOTES, $charset) . "</s>\n";
            if ($auth->author_rejete != '') {
                $notice .= "    <s c='b'>" . htmlspecialchars($auth->author_rejete, ENT_QUOTES, $charset) . "</s>\n";
            }
            if ($auth->responsability_fonction != '') {
                $notice .= "    <s c='4'>" . $auth->responsability_fonction . "</s>\n";
            }
            if ($auth->author_date != "") {
                $notice .= "    <s c='f'>" . htmlspecialchars($auth->author_date, ENT_QUOTES, $charset) . "</s>\n";
            }
            if ($auth->author_web != '') {
                $notice .= "    <s c='N'>" . htmlspecialchars($auth->author_web, ENT_QUOTES, $charset) . "</s>\n";
            }
            $notice .= "  </f>\n";
        } elseif ($auth->author_type == "71" || $auth->author_type == "72") {
            //Collectivité
            $notice .= "  <f c='" . $auth->author_type . $auth->responsability_type;
            if ($auth->author_type == "71") {
                $notice .= "' ind='02'>\n";
            } elseif ($auth->author_type == "72") {
                $notice .= "' ind='12'>\n";
            }
            $notice .= "    <s c='a'>" . htmlspecialchars($auth->author_name, ENT_QUOTES, $charset) . "</s>\n";
            if ($auth->author_subdivision != '') {
                $notice .= "    <s c='b'>" . htmlspecialchars($auth->author_subdivision, ENT_QUOTES, $charset) . "</s>\n";
            }
            if ($auth->author_rejete != '') {
                $notice .= "    <s c='g'>" . htmlspecialchars($auth->author_rejete, ENT_QUOTES, $charset) . "</s>\n";
            }
            if ($auth->author_numero != '') {
                $notice .= "    <s c=d'>" . htmlspecialchars($auth->author_numero, ENT_QUOTES, $charset) . "</s>\n";
            }
            if ($auth->responsability_fonction != '') {
                $notice .= "    <s c='4'>" . $auth->responsability_fonction . "</s>\n";
            }
            if ($auth->author_date != "") {
                $notice .= "    <s c='f'>" . htmlspecialchars($auth->author_date, ENT_QUOTES, $charset) . "</s>\n";
            }
            $lieu = $auth->author_lieu;
            if ($auth->author_ville) {
                if ($lieu) {
                    $lieu .= "; ";
                }
                $lieu .= $auth->author_ville;
            }
            if ($auth->author_pays) {
                if ($lieu) {
                    $lieu .= "; ";
                }
                $lieu .= $auth->author_pays;
            }
            if ($lieu != '') {
                $notice .= "    <s c='e'>" . htmlspecialchars($lieu, ENT_QUOTES, $charset) . "</s>\n";
            }
            if ($auth->author_lieu != '') {
                $notice .= "    <s c='K'>" . htmlspecialchars($auth->author_lieu, ENT_QUOTES, $charset) . "</s>\n";
            }
            if ($auth->author_ville != '') {
                $notice .= "    <s c='L'>" . htmlspecialchars($auth->author_ville, ENT_QUOTES, $charset) . "</s>\n";
            }
            if ($auth->author_pays != '') {
                $notice .= "    <s c='M'>" . htmlspecialchars($auth->author_pays, ENT_QUOTES, $charset) . "</s>\n";
            }
            if ($auth->author_web != '') {
                $notice .= "    <s c='N'>" . htmlspecialchars($auth->author_web, ENT_QUOTES, $charset) . "</s>\n";
            }
            $notice .= "  </f>\n";
        }
    }
    //URL
    if ($rn->lien != '') {
        $notice .= "  <f c='856'>\n";
        $notice .= "    <s c='u'>" . htmlspecialchars($rn->lien, ENT_QUOTES, $charset) . "</s>\n";
        if ($rn->eformat != '') {
            $notice .= "    <s c='q'>" . htmlspecialchars($rn->eformat, ENT_QUOTES, $charset) . "</s>\n";
        }
        $notice .= "  </f>\n";
    }
    //Champs perso de notice traite par la table notice_custom
    $mes_pp = new parametres_perso("notices");
    $mes_pp->get_values($id);
    $values = $mes_pp->values;
    foreach ($values as $field_id => $vals) {
        if ($mes_pp->t_fields[$field_id]["EXPORT"]) {
            //champ exportable
            foreach ($vals as $value) {
                if ($value) {
                    $notice .= "  <f c='900' ind='  '>\n";
                    $notice .= "    <s c='a'>" . htmlspecialchars($mes_pp->get_formatted_output(array($value), $field_id), ENT_QUOTES, $charset) . "</s>\n";
                    $notice .= "    <s c='l'>" . htmlspecialchars($mes_pp->t_fields[$field_id]["TITRE"], ENT_QUOTES, $charset) . "</s>\n";
                    $notice .= "    <s c='n'>" . htmlspecialchars($mes_pp->t_fields[$field_id]["NAME"], ENT_QUOTES, $charset) . "</s>\n";
                    $notice .= "  </f>\n";
                }
            }
        }
    }
    $notice .= "</notice>\n";
    return $notice;
}
Ejemplo n.º 6
0
 function fetch_collstate()
 {
     if ($this->niveau_biblio == 's' && $this->niveau_hierar == 1) {
         global $dbh;
         global $opac_sur_location_activate;
         //Traitement des exemplaires
         $this->memo_collstate = array();
         $q = "select collstate_id, id_serial, state_collections, collstate_origine, collstate_cote, collstate_archive, collstate_lacune, collstate_note, ";
         $q .= "idlocation, location_libelle, ";
         $q .= "archempla_id, archempla_libelle, ";
         $q .= "archtype_id, archtype_libelle, ";
         $q .= "archstatut_id, archstatut_opac_libelle ";
         if ($opac_sur_location_activate) {
             $q .= ", ifnull(surloc_id,0) as surloc_id, ifnull(surloc_libelle,'') as surloc_libelle ";
         }
         $q .= "from collections_state ";
         $q .= "join docs_location on location_id=idlocation ";
         if ($opac_sur_location_activate) {
             $q .= "left join sur_location on surloc_num=surloc_id ";
         }
         $q .= "join arch_emplacement on collstate_emplacement=archempla_id ";
         $q .= "join arch_type on collstate_type=archtype_id ";
         $q .= "join arch_statut on collstate_statut=archstatut_id ";
         $q .= "where id_serial = '" . $this->notice_id . "' ";
         //pour l'opac
         //$q.= "and ((archstatut_visible_opac=1 and archstatut_visible_opac_abon=0)".($_SESSION["user_code"]?" or (archstatut_visible_opac_abon=1 and archstatut_visible_opac=1)":"").")";
         $r = pmb_mysql_query($q, $dbh);
         if ($r) {
             while ($cs = pmb_mysql_fetch_object($r)) {
                 //Champs perso d'etats de collection
                 $parametres_perso = array();
                 $pp = new parametres_perso("collstate");
                 if (!$pp->no_special_fields) {
                     $pp->get_values($cs->expl_id);
                     $values = $pp->values;
                     foreach ($values as $field_id => $vals) {
                         foreach ($vals as $value) {
                             $parametres_perso[$pp->t_fields[$field_id]["NAME"]]["TITRE"] = $pp->t_fields[$field_id]["TITRE"];
                             $parametres_perso[$pp->t_fields[$field_id]["NAME"]]["VALUE"] = $pp->get_formatted_output(array($value), $field_id);
                         }
                     }
                 }
                 $cs->parametres_perso = $parametres_perso;
                 $this->memo_collstate[] = $cs;
             }
         }
     }
 }
Ejemplo n.º 7
0
function renseigne_cp_agro($val, $notice_id, $type = "notices")
{
    $nom = $val["n"];
    $valeur = $val["a"];
    if (!trim($nom) || !trim($valeur) || !$notice_id) {
        return false;
    }
    //on va chercher les informations sur le champs
    $rqt = "SELECT idchamp, type, datatype FROM " . $type . "_custom WHERE name='" . addslashes(trim($nom)) . "'";
    $res = mysql_query($rqt);
    if (!mysql_num_rows($res)) {
        return false;
    }
    $cp = mysql_fetch_object($res);
    if ($cp->type != $val["t"]) {
        return false;
    }
    //On enregistre la valeur au bon endroit
    switch ($cp->type) {
        case "list":
            //On est sur une liste
            switch ($cp->datatype) {
                case "integer":
                    $requete = "select " . $type . "_custom_list_value from " . $type . "_custom_lists where " . $type . "_custom_list_lib='" . addslashes(trim($valeur)) . "' and " . $type . "_custom_champ='" . $cp->idchamp . "' ";
                    $resultat = mysql_query($requete);
                    if (mysql_num_rows($resultat)) {
                        $value2 = mysql_result($resultat, 0, 0);
                    } else {
                        $requete = "select max(" . $type . "_custom_list_value*1) from " . $type . "_custom_lists where " . $type . "_custom_champ='" . $cp->idchamp . "' ";
                        $resultat = mysql_query($requete);
                        $max = @mysql_result($resultat, 0, 0);
                        $n = $max + 1;
                        $requete = "insert into " . $type . "_custom_lists (" . $type . "_custom_champ," . $type . "_custom_list_value," . $type . "_custom_list_lib) values('" . $cp->idchamp . "',{$n},'" . addslashes(trim($valeur)) . "')";
                        if (!mysql_query($requete)) {
                            return false;
                        }
                        $value2 = $n;
                    }
                    $requete = "insert into " . $type . "_custom_values (" . $type . "_custom_champ," . $type . "_custom_origine," . $type . "_custom_integer) values('" . $cp->idchamp . "','" . $notice_id . "','" . $value2 . "')";
                    if (!mysql_query($requete)) {
                        return false;
                    }
                    break;
                default:
                    $requete = "select " . $type . "_custom_list_value from " . $type . "_custom_lists where " . $type . "_custom_list_lib='" . addslashes(trim($valeur)) . "' and " . $type . "_custom_champ='" . $cp->idchamp . "' ";
                    $resultat = mysql_query($requete);
                    if (mysql_num_rows($resultat)) {
                        $value2 = mysql_result($resultat, 0, 0);
                    } else {
                        $requete = "select " . $type . "_custom_list_value from " . $type . "_custom_lists where " . $type . "_custom_list_value='" . addslashes(trim($valeur)) . "' and " . $type . "_custom_champ='" . $cp->idchamp . "' ";
                        $resultat = mysql_query($requete);
                        if (mysql_num_rows($resultat)) {
                            $value2 = mysql_result($resultat, 0, 0);
                        } else {
                            $requete = "insert into " . $type . "_custom_lists (" . $type . "_custom_champ," . $type . "_custom_list_value," . $type . "_custom_list_lib) values('" . $cp->idchamp . "','" . addslashes(trim($valeur)) . "','" . addslashes($valeur) . "')";
                            if (!mysql_query($requete)) {
                                return false;
                            }
                            $value2 = trim($valeur);
                        }
                    }
                    $requete = "insert into " . $type . "_custom_values (" . $type . "_custom_champ," . $type . "_custom_origine," . $type . "_custom_" . $cp->datatype . ") values('" . $cp->idchamp . "','" . $notice_id . "','" . $value2 . "')";
                    if (!mysql_query($requete)) {
                        return false;
                    }
                    break;
            }
            break;
        case "url":
            $requete = "insert into " . $type . "_custom_values (" . $type . "_custom_champ," . $type . "_custom_origine," . $type . "_custom_" . $cp->datatype . ") values('" . $cp->idchamp . "','" . $notice_id . "','" . addslashes(trim($val["c"])) . "')";
            if (!mysql_query($requete)) {
                return false;
            }
            break;
        case "resolve":
            $mes_pp = new parametres_perso($type);
            if ($mes_pp->get_formatted_output(array($val["c"]), $cp->idchamp) == $val["b"]) {
                $requete = "insert into " . $type . "_custom_values (" . $type . "_custom_champ," . $type . "_custom_origine," . $type . "_custom_" . $cp->datatype . ") values('" . $cp->idchamp . "','" . $notice_id . "','" . addslashes($val["c"]) . "')";
                if (!mysql_query($requete)) {
                    return false;
                }
            } else {
                return false;
            }
            break;
        case "query_list":
        case "query_auth":
            $mes_pp = new parametres_perso($type);
            if ($mes_pp->get_formatted_output(array($val["c"]), $cp->idchamp) == $valeur) {
                $requete = "insert into " . $type . "_custom_values (" . $type . "_custom_champ," . $type . "_custom_origine," . $type . "_custom_" . $cp->datatype . ") values('" . $cp->idchamp . "','" . $notice_id . "','" . addslashes($val["c"]) . "')";
                if (!mysql_query($requete)) {
                    return false;
                }
            } else {
                return false;
            }
            break;
        default:
            switch ($cp->datatype) {
                case "small_text":
                    $requete = "insert into " . $type . "_custom_values (" . $type . "_custom_champ," . $type . "_custom_origine," . $type . "_custom_small_text) values('" . $cp->idchamp . "','" . $notice_id . "','" . addslashes(trim($valeur)) . "')";
                    if (!mysql_query($requete)) {
                        return false;
                    }
                    break;
                case "int":
                case "integer":
                    $requete = "insert into " . $type . "_custom_values (" . $type . "_custom_champ," . $type . "_custom_origine," . $type . "_custom_integer) values('" . $cp->idchamp . "','" . $notice_id . "','" . addslashes(trim($valeur)) . "')";
                    if (!mysql_query($requete)) {
                        return false;
                    }
                    break;
                case "text":
                    $requete = "insert into " . $type . "_custom_values (" . $type . "_custom_champ," . $type . "_custom_origine," . $type . "_custom_text) values('" . $cp->idchamp . "','" . $notice_id . "','" . addslashes(trim($valeur)) . "')";
                    if (!mysql_query($requete)) {
                        return false;
                    }
                    break;
                case "date":
                    $requete = "insert into " . $type . "_custom_values (" . $type . "_custom_champ," . $type . "_custom_origine," . $type . "_custom_date) values('" . $cp->idchamp . "','" . $notice_id . "','" . addslashes(decoupe_date(trim($valeur))) . "')";
                    if (!mysql_query($requete)) {
                        return false;
                    }
                    break;
            }
            break;
    }
    return true;
}
Ejemplo n.º 8
0
 function get_display_list($base_url, $filtre, $debut = 0, $page = 0, $type = 0)
 {
     global $dbh, $msg, $nb_per_page_a_search, $tpl_collstate_liste, $tpl_collstate_liste_line, $tpl_collstate_surloc_liste, $tpl_collstate_surloc_liste_line;
     global $opac_sur_location_activate, $opac_view_filter_class;
     global $collstate_list_header, $collstate_list_footer;
     global $opac_collstate_data, $opac_collstate_order, $opac_url_base;
     global $charset, $class_path;
     $location = $filtre->location;
     if ($opac_view_filter_class) {
         if (!$opac_view_filter_class->params["nav_collections"]) {
             $opac_view_filter_class->params["nav_collections"][0] = "0";
         }
         $req = "SELECT  collstate_id , location_id, num_infopage, surloc_id FROM arch_statut, collections_state \n\t\t\t\tLEFT JOIN arch_emplacement ON collstate_emplacement=archempla_id, docs_location\n\t\t\t\tLEFT JOIN sur_location on docs_location.surloc_num=surloc_id \n\t\t\t\tWHERE " . ($location ? "(location_id='{$location}') and " : "") . "id_serial='" . $this->serial_id . "' \n\t\t\t\tand location_id=idlocation and idlocation in(" . implode(",", $opac_view_filter_class->params["nav_collections"]) . ")\n\t\t\t\tand archstatut_id=collstate_statut \n\t\t\t\tand ((archstatut_visible_opac=1 and archstatut_visible_opac_abon=0)" . ($_SESSION["user_code"] ? " or (archstatut_visible_opac_abon=1 and archstatut_visible_opac=1)" : "") . ")";
         if ($opac_collstate_order) {
             $req .= " ORDER BY " . $opac_collstate_order;
         } else {
             $req .= " ORDER BY " . ($type ? "location_libelle, " : "") . "archempla_libelle, collstate_cote";
         }
     } else {
         $req = "SELECT collstate_id , location_id, num_infopage, surloc_id FROM arch_statut, collections_state \n\t\t\t\tLEFT  JOIN docs_location ON location_id = idlocation\n\t\t\t\tLEFT JOIN sur_location on docs_location.surloc_num=surloc_id \n\t\t\t\tLEFT JOIN arch_emplacement ON collstate_emplacement=archempla_id\n\t\t\t\tWHERE " . ($location ? "(location_id='{$location}') and " : "") . "id_serial='" . $this->serial_id . "' \n\t\t\t\tand archstatut_id=collstate_statut \n\t\t\t\tand ((archstatut_visible_opac=1 and archstatut_visible_opac_abon=0)" . ($_SESSION["user_code"] ? " or (archstatut_visible_opac_abon=1 and archstatut_visible_opac=1)" : "") . ")";
         if ($opac_collstate_order) {
             $req .= " ORDER BY " . $opac_collstate_order;
         } else {
             $req .= " ORDER BY " . ($type ? "location_libelle, " : "") . "archempla_libelle, collstate_cote";
         }
     }
     $myQuery = pmb_mysql_query($req, $dbh);
     if (!pmb_mysql_error() && ($this->nbr = pmb_mysql_num_rows($myQuery))) {
         if ($opac_sur_location_activate) {
             $tpl_collstate_liste[$type] = str_replace('<!-- surloc -->', $tpl_collstate_surloc_liste, $tpl_collstate_liste[$type]);
             $tpl_collstate_liste_line[$type] = str_replace('<!-- surloc -->', $tpl_collstate_surloc_liste_line, $tpl_collstate_liste_line[$type]);
         }
         if ($opac_collstate_data) {
             if (strstr($opac_collstate_data, "#")) {
                 require_once $class_path . "/parametres_perso.class.php";
                 $cp = new parametres_perso("collstate");
             }
             $colonnesarray = explode(",", $opac_collstate_data);
             $collstate_list_header_deb = "<tr>";
             for ($i = 0; $i < count($colonnesarray); $i++) {
                 if (substr($colonnesarray[$i], 0, 1) == "#") {
                     //champs personnalisés
                     $id = substr($colonnesarray[$i], 1);
                     if (!$cp->no_special_fields) {
                         $collstate_list_header_deb .= "<th class='collstate_header_cp_" . str_replace('#', '', $colonnesarray[$i]) . "'>" . htmlentities($cp->t_fields[$id]["TITRE"], ENT_QUOTES, $charset) . "</th>";
                     }
                 } else {
                     eval("\$colencours=\$msg['collstate_header_" . $colonnesarray[$i] . "'];");
                     $collstate_list_header_deb .= "<th class='collstate_header_" . $colonnesarray[$i] . "'>" . htmlentities($colencours, ENT_QUOTES, $charset) . "</th>";
                 }
             }
             $collstate_list_header_deb .= "</tr>";
             $parity = 1;
             $liste = "";
             while ($coll = pmb_mysql_fetch_object($myQuery)) {
                 $my_collstate = new collstate($coll->collstate_id);
                 if ($parity++ % 2) {
                     $pair_impair = "even";
                 } else {
                     $pair_impair = "odd";
                 }
                 $tr_surbrillance = "onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='" . $pair_impair . "'\" ";
                 $liste .= "<tr class='" . $pair_impair . "' " . $tr_surbrillance . " >";
                 $colencours = "";
                 for ($i = 0; $i < count($colonnesarray); $i++) {
                     if (substr($colonnesarray[$i], 0, 1) == "#") {
                         //champs personnalisés
                         $id = substr($colonnesarray[$i], 1);
                         $cp->get_values($coll->collstate_id);
                         if (!$cp->no_special_fields) {
                             $temp = $cp->get_formatted_output($cp->values[$id], $id);
                             if (!$temp) {
                                 $temp = " ";
                             }
                             $liste .= "<td class='" . $colonnesarray[$i] . "' >" . htmlentities($temp, ENT_QUOTES, $charset) . "</td>";
                         }
                     } else {
                         eval("\$colencours=\$my_collstate->" . $colonnesarray[$i] . ";");
                         if ($colonnesarray[$i] == "location_libelle" && $my_collstate->num_infopage) {
                             if ($my_collstate->surloc_id != "0") {
                                 $param_surloc = "&surloc=" . $my_collstate->surloc_id;
                             } else {
                                 $param_surloc = "";
                             }
                             $collstate_location = "<a href=\"" . $opac_url_base . "index.php?lvl=infopages&pagesid=" . $my_collstate->num_infopage . "&location=" . $my_collstate->location_id . $param_surloc . "\" alt=\"" . $msg['location_more_info'] . "\" title=\"" . $msg['location_more_info'] . "\">" . $my_collstate->location_libelle . "</a>";
                             $liste .= "<td class='" . $colonnesarray[$i] . "'>" . $collstate_location . "</td>";
                         } else {
                             $liste .= "<td class='" . $colonnesarray[$i] . "'>" . htmlentities($colencours, ENT_QUOTES, $charset) . "</td>";
                         }
                     }
                 }
                 $liste .= "</tr>";
             }
             $liste = $collstate_list_header . $collstate_list_header_deb . $liste . $collstate_list_footer;
         } else {
             $parity = 1;
             while ($coll = pmb_mysql_fetch_object($myQuery)) {
                 $my_collstate = new collstate($coll->collstate_id);
                 if ($parity++ % 2) {
                     $pair_impair = "even";
                 } else {
                     $pair_impair = "odd";
                 }
                 $tr_javascript = "  ";
                 $tr_surbrillance = "onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='" . $pair_impair . "'\" ";
                 $line = str_replace('!!tr_javascript!!', $tr_javascript, $tpl_collstate_liste_line[$type]);
                 $line = str_replace('!!tr_surbrillance!!', $tr_surbrillance, $line);
                 $line = str_replace('!!pair_impair!!', $pair_impair, $line);
                 if ($opac_sur_location_activate) {
                     $line = str_replace('!!surloc!!', $my_collstate->surloc_libelle, $line);
                 }
                 if ($my_collstate->num_infopage) {
                     if ($my_collstate->surloc_id != "0") {
                         $param_surloc = "&surloc=" . $my_collstate->surloc_id;
                     } else {
                         $param_surloc = "";
                     }
                     $collstate_location = "<a href=\"" . $opac_url_base . "index.php?lvl=infopages&pagesid=" . $my_collstate->num_infopage . "&location=" . $my_collstate->location_id . $param_surloc . "\" alt=\"" . $msg['location_more_info'] . "\" title=\"" . $msg['location_more_info'] . "\">" . $my_collstate->location_libelle . "</a>";
                 } else {
                     $collstate_location = $my_collstate->location_libelle;
                 }
                 $line = str_replace('!!localisation!!', $collstate_location, $line);
                 $line = str_replace('!!cote!!', $my_collstate->cote, $line);
                 $line = str_replace('!!type_libelle!!', $my_collstate->type_libelle, $line);
                 $line = str_replace('!!emplacement_libelle!!', $my_collstate->emplacement_libelle, $line);
                 $line = str_replace('!!statut_libelle!!', $my_collstate->statut_opac_libelle, $line);
                 $line = str_replace('!!origine!!', $my_collstate->origine, $line);
                 $line = str_replace('!!state_collections!!', str_replace("\n", "<br />", $my_collstate->state_collections), $line);
                 $line = str_replace('!!archive!!', $my_collstate->archive, $line);
                 $line = str_replace('!!lacune!!', str_replace("\n", "<br />", $my_collstate->lacune), $line);
                 $liste .= $line;
             }
             $liste = str_replace('!!collstate_liste!!', $liste, $tpl_collstate_liste[$type]);
             $liste = str_replace('!!base_url!!', $base_url, $liste);
             $liste = str_replace('!!location!!', $location, $liste);
         }
     } else {
         $liste = $msg["collstate_no_collstate"];
     }
     $this->liste = $liste;
 }
Ejemplo n.º 9
0
 function display_result()
 {
     global $class_path, $charset, $msg;
     $aff = "";
     if ($this->query) {
         $execute_query = mysql_query($this->query);
         $aff .= "<table class='" . $this->css["table"]["class"] . "' style='" . $this->css["table"]["style"] . "'>";
         $parity = 0;
         $header = "";
         $s = explode(",", $this->displaycolumns);
         for ($n = 0; $n < count($s); $n++) {
             if (substr($s[$n], 0, 1) == "#" && $this->params["REFERENCE"][0]["DYNAMICFIELDS"] == "yes") {
                 //champs perso
                 require_once $class_path . "/parametres_perso.class.php";
                 $cp = new parametres_perso($this->params["REFERENCE"][0]["PREFIXNAME"]);
                 if (!$cp->no_special_fields) {
                     $id = substr($s[$n], 1);
                     $header .= "<th>" . htmlentities($cp->t_fields[$id][TITRE], ENT_QUOTES, $charset) . "</th>";
                 }
             } elseif (array_key_exists($s[$n], $this->fixedfields)) {
                 //champs fixes
                 $header .= "<th>" . $msg[str_replace("msg:", "", $this->fixedfields[$s[$n]]["NAME"])] . "</th>";
             } elseif (array_key_exists($s[$n], $this->specialfields)) {
                 //champs spéciaux
                 $header .= "<th>" . $msg[str_replace("msg:", "", $this->specialfields[$s[$n]]["NAME"])] . "</th>";
             } else {
                 $header .= "<th>&nbsp;</th>";
             }
         }
         $aff .= $header;
         while ($result = mysql_fetch_array($execute_query)) {
             $onmouseout = $this->scripts["row"]["onmouseout"];
             $onmouseover = $this->scripts["row"]["onmouseover"];
             $onmousedown = $this->scripts["row"]["onmousedown"];
             if ($parity % 2) {
                 $pair_impair = $this->css["row_even"]["class"];
                 $pair_impair_style = $this->css["row_even"]["style"];
                 $onmouseout = str_replace('!!parity!!', $this->css["row_even"]["class"], $onmouseout);
                 $onmouseover = str_replace('!!parity!!', $this->css["row_even"]["class"], $onmouseover);
                 $onmouseout = str_replace('!!parity!!', $this->css["row_even"]["class"], $onmouseout);
             } else {
                 $pair_impair = $this->css["row_odd"]["class"];
                 $pair_impair_style = $this->css["row_odd"]["style"];
                 $onmouseout = str_replace('!!parity!!', $this->css["row_odd"]["class"], $onmouseout);
                 $onmouseover = str_replace('!!parity!!', $this->css["row_odd"]["class"], $onmouseover);
                 $onmousedown = str_replace('!!parity!!', $this->css["row_odd"]["class"], $onmousedown);
             }
             $ligne = "";
             $s = explode(",", $this->displaycolumns);
             //parcours des champs
             for ($i = 0; $i < count($s); $i++) {
                 //détermination de la valeur
                 if (substr($s[$i], 0, 1) == "#" && $this->params["REFERENCE"][0]["DYNAMICFIELDS"] == "yes") {
                     //champs perso
                     require_once $class_path . "/parametres_perso.class.php";
                     $cp = new parametres_perso($this->params["REFERENCE"][0]["PREFIXNAME"]);
                     $id = substr($s[$i], 1);
                     $cp->get_values($result[$this->params["REFERENCEKEY"][0]["value"]]);
                     if (!$cp->no_special_fields) {
                         //    						$temp=$result[$this->params["REFERENCE"][0]["PREFIXNAME"]."_custom_".$cp->t_fields[$id]["DATATYPE"].$id];
                         $onmouseout = str_replace("!!" . $s[$i] . "!!", rawurlencode($temp), $onmouseout);
                         $onmouseover = str_replace("!!" . $s[$i] . "!!", rawurlencode($temp), $onmouseover);
                         $onmousedown = str_replace("!!" . $s[$i] . "!!", rawurlencode($temp), $onmousedown);
                         $temp = $cp->get_formatted_output($cp->values[$id], $id);
                         if (!$temp) {
                             $temp = "&nbsp;";
                         }
                         $ligne .= "<td class='" . $this->css["cols"][$i]["class"] . "' style='" . $this->css["cols"][$i]["style"] . "'>" . $temp . "</td>";
                     }
                 } elseif (array_key_exists($s[$i], $this->fixedfields)) {
                     //champs fixes
                     $f = array();
                     if ($this->fixedfields[$s[$i]]["LINK"]) {
                         for ($x = 0; $x < count($this->fixedfields[$s[$i]]["LINK"]); $x++) {
                             if ($this->fixedfields[$s[$i]]["LINK"][$x]["TYPE"] == "nn") {
                                 if ($this->fixedfields[$s[$i]]["TABLEALIAS"][0]["NAME"]) {
                                     $f[0] = $this->fixedfields[$s[$i]]["TABLEALIAS"][0]["NAME"];
                                 } else {
                                     $f[0] = $this->fixedfields[$s[$i]]["TABLEFIELD"][0]["NAME"];
                                 }
                             } else {
                                 if ($this->fixedfields[$s[$i]]["TABLEALIAS"][0][value]) {
                                     $f[0] = $this->fixedfields[$s[$i]]["TABLEALIAS"][0][value];
                                 } else {
                                     $f[0] = $this->fixedfields[$s[$i]]["TABLEFIELD"][0][value];
                                 }
                             }
                         }
                     } else {
                         if ($this->fixedfields[$s[$i]]["TABLEALIAS"][0][value]) {
                             $f = explode(",", $this->fixedfields[$s[$i]]["TABLEALIAS"][0][value]);
                         } else {
                             $f = explode(",", $this->fixedfields[$s[$i]]["TABLEFIELD"][0][value]);
                         }
                     }
                     $b = 0;
                     $ligne .= "<td class='" . $this->css["cols"][$i]["class"] . "' style='" . $this->css["cols"][$i]["style"] . "'>";
                     while ($b < count($f)) {
                         $temp = $result[$f[$b]];
                         if ($temp == '') {
                             $temp = "&nbsp;";
                         }
                         $ligne .= $temp . "&nbsp;";
                         $b++;
                     }
                     $ligne .= "</td>";
                     $onmouseout = str_replace("!!" . $s[$i] . "!!", rawurlencode($temp), $onmouseout);
                     $onmouseover = str_replace("!!" . $s[$i] . "!!", rawurlencode($temp), $onmouseover);
                     $onmousedown = str_replace("!!" . $s[$i] . "!!", rawurlencode($temp), $onmousedown);
                 } else {
                     $name_function = $this->specialfields[$s[$i]]["FUNCTION"];
                     $r = "";
                     $key = $result[$this->params["REFERENCEKEY"][0][value]];
                     eval("\$r=" . $name_function . "(\$key);");
                     $ligne .= $r;
                 }
             }
             if ($this->filter_name == "empr" && !array_search("b", $s)) {
                 require_once $class_path . "/emprunteur.class.php";
                 $code_b = emprunteur::get_cb_empr($result[$this->params["REFERENCEKEY"][0][value]]);
                 if ($code_b) {
                     $onmouseout = str_replace("!!b!!", $code_b, $onmouseout);
                     $onmouseover = str_replace("!!b!!", $code_b, $onmouseover);
                     $onmousedown = str_replace("!!b!!", $code_b, $onmousedown);
                 }
             }
             $onmouseout = str_replace("!!" . $this->params["REFERENCEKEY"][0][value] . "!!", $result[$this->params["REFERENCEKEY"][0][value]], $onmouseout);
             $onmouseover = str_replace("!!" . $this->params["REFERENCEKEY"][0][value] . "!!", $result[$this->params["REFERENCEKEY"][0][value]], $onmouseover);
             $onmousedown = str_replace("!!" . $this->params["REFERENCEKEY"][0][value] . "!!", $result[$this->params["REFERENCEKEY"][0][value]], $onmousedown);
             $aff .= "<tr class='" . $pair_impair . "' style='{$pair_impair_style}' onmouseover=\"this.className='surbrillance';" . $onmouseover . "\" onmouseout=\"" . $onmouseout . "\" onmousedown='" . $onmousedown . "'>";
             $aff .= $ligne;
             $aff .= "</tr>";
             $parity += 1;
         }
         $aff .= "</table>";
     }
     return $aff;
 }
Ejemplo n.º 10
0
 function get_display_list($base_url, $filtre, $debut = 0, $page = 0, $type = 0, $form = 1, $no_pagination = false)
 {
     global $dbh, $msg, $nb_per_page_a_search, $tpl_collstate_liste, $tpl_collstate_liste_line, $tpl_collstate_liste_form, $tpl_collstate_surloc_liste, $tpl_collstate_surloc_liste_line;
     global $explr_invisible, $pmb_droits_explr_localises, $pmb_etat_collections_localise, $deflt_docs_location;
     global $pmb_sur_location_activate;
     global $pmb_collstate_data, $class_path, $collstate_list_header, $collstate_list_footer;
     $location = $filtre->location;
     if (!$pmb_etat_collections_localise) {
         $location = "";
     }
     if ($pmb_droits_explr_localises && $explr_invisible) {
         $restrict_location = " location_id not in (" . $explr_invisible . ") and ";
     } else {
         $restrict_location = "";
     }
     if ($pmb_sur_location_activate) {
         $join_sur_loc = " left join sur_location on docs_location.surloc_num=sur_location.surloc_id ";
         $order_sur_loc = "surloc_libelle,";
     } else {
         $join_sur_loc = "";
         $order_sur_loc = "";
     }
     //On compte les bulletins à afficher
     $rqt = "SELECT count( collstate_id) FROM collections_state WHERE {$restrict_location} " . ($location ? "(location_id='{$location}') and " : "") . " id_serial='" . $this->serial_id . "' ";
     $myQuery = pmb_mysql_query($rqt, $dbh);
     $nbr_lignes = pmb_mysql_result($myQuery, 0, 0);
     $req = "SELECT  collstate_id , location_id FROM collections_state LEFT JOIN docs_location ON location_id=idlocation " . $join_sur_loc . " LEFT JOIN arch_emplacement ON collstate_emplacement=archempla_id WHERE {$restrict_location} " . ($location ? "(location_id='{$location}') and " : "") . "\n\tid_serial='" . $this->serial_id . "' ORDER BY " . $order_sur_loc . " " . ($pmb_etat_collections_localise ? "location_libelle, " : "") . "archempla_libelle, collstate_cote " . ($no_pagination ? '' : "LIMIT {$debut},{$nb_per_page_a_search}");
     $myQuery = pmb_mysql_query($req, $dbh);
     if (pmb_mysql_num_rows($myQuery)) {
         if ($pmb_sur_location_activate) {
             $tpl_collstate_liste[$type] = str_replace('<!-- surloc -->', $tpl_collstate_surloc_liste, $tpl_collstate_liste[$type]);
             $tpl_collstate_liste_line[$type] = str_replace('<!-- surloc -->', $tpl_collstate_surloc_liste_line, $tpl_collstate_liste_line[$type]);
         }
         if ($pmb_collstate_data) {
             if (strstr($pmb_collstate_data, "#")) {
                 require_once $class_path . "/parametres_perso.class.php";
                 $cp = new parametres_perso("collstate");
             }
             $colonnesarray = explode(",", $pmb_collstate_data);
             $collstate_list_header_deb = "<tr>";
             for ($i = 0; $i < count($colonnesarray); $i++) {
                 if (substr($colonnesarray[$i], 0, 1) == "#") {
                     //champs personnalisés
                     $id = substr($colonnesarray[$i], 1);
                     if (!$cp->no_special_fields) {
                         $collstate_list_header_deb .= "<th class='collstate_header_" . $colonnesarray[$i] . "'>" . htmlentities($cp->t_fields[$id]["TITRE"], ENT_QUOTES, $charset) . "</th>";
                     }
                 } else {
                     eval("\$colencours=\$msg['collstate_header_" . $colonnesarray[$i] . "'];");
                     $collstate_list_header_deb .= "<th class='collstate_header_" . $colonnesarray[$i] . "'>" . htmlentities($colencours, ENT_QUOTES, $charset) . "</th>";
                 }
             }
             $collstate_list_header_deb .= "</tr>";
             $parity = 1;
             $liste = "";
             while ($coll = pmb_mysql_fetch_object($myQuery)) {
                 $my_collstate = new collstate($coll->collstate_id);
                 if ($parity++ % 2) {
                     $pair_impair = "even";
                 } else {
                     $pair_impair = "odd";
                 }
                 $tr_surbrillance = "onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='" . $pair_impair . "'\" ";
                 $liste .= "<tr class='" . $pair_impair . "' style='cursor: pointer' " . $tr_surbrillance . " >";
                 $colencours = "";
                 for ($i = 0; $i < count($colonnesarray); $i++) {
                     if ($my_collstate->explr_acces_autorise == "MODIF") {
                         $tr_javascript = "  onmousedown=\"document.location='./catalog.php?categ=serials&sub=collstate_form&id=" . $coll->collstate_id . "&serial_id=" . $this->serial_id . "';\" ";
                     } else {
                         $tr_javascript = "";
                     }
                     if (substr($colonnesarray[$i], 0, 1) == "#") {
                         //champs personnalisés
                         $id = substr($colonnesarray[$i], 1);
                         $cp->get_values($coll->collstate_id);
                         if (!$cp->no_special_fields) {
                             $temp = $cp->get_formatted_output($cp->values[$id], $id);
                             if (!$temp) {
                                 $temp = " ";
                             }
                             $liste .= "<td class='" . $colonnesarray[$i] . "' " . $tr_javascript . " >" . htmlentities($temp, ENT_QUOTES, $charset) . "</td>";
                         }
                     } else {
                         eval("\$colencours=\$my_collstate->" . $colonnesarray[$i] . ";");
                         $liste .= "<td class='" . $colonnesarray[$i] . "' " . $tr_javascript . " >" . htmlentities($colencours, ENT_QUOTES, $charset) . "</td>";
                     }
                 }
                 $liste .= "</tr>";
             }
             $liste = $collstate_list_header . $collstate_list_header_deb . $liste . $collstate_list_footer;
         } else {
             $parity = 1;
             while ($coll = pmb_mysql_fetch_object($myQuery)) {
                 $my_collstate = new collstate($coll->collstate_id);
                 /*
                 	Avoir comment gerer un + pour des grands etats de collections
                 			if (count($my_collstate->state_collections)>80 || count($my_collstate->lacune)>80) {
                 				$plus_statecollection="<img src='images/plus.gif' class='img_plus' onClick='if (event) e=event; else e=window.event; e.cancelBubble=true; if (e.stopPropagation) e.stopPropagation(); show_sources(\"!!id!!\"); '/>";
                 				$texte_statecollection="<tr class='$pair_impair' style='display:none' id='".$coll->collstate_id."'><td>&nbsp;</td><td colspan='3'><table style='border:1px solid'>
                 				<td>".str_replace("\n","<br />",$my_collstate->state_collections)."</td>
                 				<td>".str_replace("\n","<br />",$my_collstate->lacune)."</td>";
                 			} else $plus_statecollection="<td>&nbsp;</td>";
                 */
                 if ($parity++ % 2) {
                     $pair_impair = "even";
                 } else {
                     $pair_impair = "odd";
                 }
                 // Si modifiable, ajout du lien vers le formulaire
                 if ($my_collstate->explr_acces_autorise == "MODIF") {
                     $tr_javascript = "  onmousedown=\"document.location='./catalog.php?categ=serials&sub=collstate_form&id=" . $coll->collstate_id . "&serial_id=" . $this->serial_id . "';\" ";
                 } else {
                     $tr_javascript = "";
                 }
                 $tr_surbrillance = "onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='" . $pair_impair . "'\" ";
                 $line = str_replace('!!tr_javascript!!', $tr_javascript, $tpl_collstate_liste_line[$type]);
                 $line = str_replace('!!tr_surbrillance!!', $tr_surbrillance, $line);
                 $line = str_replace('!!pair_impair!!', $pair_impair, $line);
                 if ($pmb_sur_location_activate) {
                     $line = str_replace('!!surloc!!', $my_collstate->surloc_libelle, $line);
                 }
                 $line = str_replace('!!localisation!!', $my_collstate->location_libelle, $line);
                 $line = str_replace('!!cote!!', $my_collstate->cote, $line);
                 $line = str_replace('!!type_libelle!!', $my_collstate->type_libelle, $line);
                 $line = str_replace('!!emplacement_libelle!!', $my_collstate->emplacement_libelle, $line);
                 $line = str_replace('!!statut_libelle!!', "<span class='" . $my_collstate->statut_class_html . "'  style='margin-right: 3px;'><img src='./images/spacer.gif' width='10' height='10' /></span>" . $my_collstate->statut_gestion_libelle, $line);
                 $line = str_replace('!!origine!!', $my_collstate->origine, $line);
                 $line = str_replace('!!state_collections!!', str_replace("\n", "<br />", $my_collstate->state_collections), $line);
                 $line = str_replace('!!archive!!', $my_collstate->archive, $line);
                 $line = str_replace('!!lacune!!', str_replace("\n", "<br />", $my_collstate->lacune), $line);
                 $liste .= $line;
             }
             $liste = str_replace('!!collstate_liste!!', $liste, $tpl_collstate_liste[$type]);
         }
     } else {
         $liste = $msg["collstate_no_collstate"];
     }
     if ($form) {
         $liste = str_replace('!!collstate_table!!', $liste, $tpl_collstate_liste_form);
     }
     $liste = str_replace('!!base_url!!', $base_url, $liste);
     $liste = str_replace('!!location!!', $location, $liste);
     $this->liste = $liste;
     $this->nbr = $nbr_lignes;
     // barre de navigation par page
     $this->pagination = aff_pagination($base_url . "&location={$location}", $nbr_lignes, $nb_per_page_a_search, $page, 10, false, true);
 }
Ejemplo n.º 11
0
 function do_public($short = 0, $ex = 1)
 {
     global $dbh;
     global $msg;
     global $tdoc;
     global $charset;
     global $memo_notice;
     global $opac_notice_affichage_class;
     $this->notice_public = $this->genere_in_perio();
     if (!$this->notice_id) {
         return;
     }
     /* début modif */
     // Notices parentes
     //$this->notice_public.=$this->parents;
     /* fin modif */
     $this->notice_public .= "<table>";
     //Titre
     // constitution de la mention de titre
     if ($this->notice->serie_name) {
         $this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>" . $msg['tparent_start'] . "</span></td><td>" . inslink($this->notice->serie_name, str_replace("!!id!!", $this->notice->tparent_id, $this->lien_rech_serie));
         if ($this->notice->tnvol) {
             $this->notice_public .= ',&nbsp;' . $this->notice->tnvol;
         }
         $this->notice_public .= "</td></tr>";
     }
     $this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>" . $msg['title'] . " :</span></td>";
     $this->notice_public .= "<td><span class='public_title'>" . $this->notice->tit1;
     //if($tdoc->table[$this->notice->typdoc]) $this->notice_public .= "&nbsp;[".$tdoc->table[$this->notice->typdoc]."]";
     if ($this->notice->tit4) {
         $this->notice_public .= "&nbsp;: " . $this->notice->tit4;
     }
     if ($this->notice->tit3) {
         $this->notice_public .= "&nbsp;= " . $this->notice->tit3;
     }
     if ($this->notice->mention_edition) {
         $this->notice_public .= "&nbsp;-&nbsp;" . $this->notice->mention_edition;
     }
     $this->notice_public .= "</span></td></tr>";
     //Préparation des champs personnalisés
     if (!$this->p_perso->no_special_fields) {
         if (!$this->memo_perso_) {
             $this->memo_perso_ = $this->p_perso->show_fields($this->notice_id);
         }
     }
     if (!$this->memo_perso_) {
         $this->memo_perso_["FIELDS"] = array();
     }
     //PPN
     foreach ($this->memo_perso_["FIELDS"] as $i => $value) {
         $p = $this->memo_perso_["FIELDS"][$i];
         if ($p["AFF"] && $p["NAME"] == "ppn001") {
             $this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>" . strip_tags($p["TITRE"]) . "</span></td><td>" . str_replace("Sudoc : ", "", $p["AFF"]) . "</td></tr>";
             unset($this->memo_perso_["FIELDS"][$i]);
             break;
         }
     }
     //ISSN
     // ISBN ou NO. commercial
     $issn = $this->notice->code;
     $mes_pp = new parametres_perso("notices");
     $mes_pp->get_values($this->notice_id);
     $values = $mes_pp->values;
     foreach ($values as $field_id => $vals) {
         if ($mes_pp->t_fields[$field_id]["NAME"] == "cp_issn_autres") {
             foreach ($vals as $value) {
                 if ($issn) {
                     $issn .= ". ";
                 }
                 $issn .= $mes_pp->get_formatted_output(array($value), $field_id);
                 //Val
             }
         }
     }
     if ($issn) {
         $this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>" . $msg['code_start'] . "</span></td><td>" . htmlentities($issn, ENT_QUOTES, $charset) . "</td></tr>";
     }
     //Auteurs
     if ($this->auteurs_tous) {
         $this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>" . $msg['auteur_start'] . "</span></td><td>" . $this->auteurs_tous . "</td></tr>";
     }
     if ($this->congres_tous) {
         $this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>" . $msg['congres_aff_public_libelle'] . "</span></td><td>" . $this->congres_tous . "</td></tr>";
     }
     //Editeurs
     foreach ($this->memo_perso_["FIELDS"] as $i => $value) {
         $p = $this->memo_perso_["FIELDS"][$i];
         if ($p["AFF"] && $p["NAME"] == "cp_editeurs") {
             $this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>" . strip_tags($p["TITRE"]) . "</span></td><td>" . $p["AFF"] . "</td></tr>";
             unset($this->memo_perso_["FIELDS"][$i]);
             break;
         }
     }
     //if ($this->notice->tit2) $this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>".$msg['other_title_t2']." :</span></td><td>".$this->notice->tit2."</td></tr>" ;
     //if ($this->notice->tit3) $this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>".$msg['other_title_t3']." :</span></td><td>".$this->notice->tit3."</td></tr>" ;
     //if ($tdoc->table[$this->notice->typdoc]) $this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>".$msg['typdocdisplay_start']."</span></td><td>".$tdoc->table[$this->notice->typdoc]."</td></tr>";
     // mention d'édition
     //if ($this->notice->mention_edition) $this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>".$msg['mention_edition_start']."</span></td><td>".$this->notice->mention_edition."</td></tr>";
     // Années de publication
     if ($this->notice->year) {
         $this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>" . ($charset != "utf-8" ? "Années de publication" : utf8_encode("Années de publication")) . " :</span></td><td>" . $this->notice->year . "</td></tr>";
     }
     // $annee est vide si ajoutée avec l'éditeur, donc si pas éditeur, on l'affiche ici
     /*$this->notice_public .= $annee ;
     		if ($this->notice->ed1_id) {
     			$editeur = new publisher($this->notice->ed1_id);			
     			$this->publishers[]=$editeur;
     			$this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>".$msg['editeur_start']."</span></td><td>".inslink($editeur->display,  str_replace("!!id!!", $this->notice->ed1_id, $this->lien_rech_editeur))."</td></tr>" ;
     			if ($annee) {
     				$this->notice_public .= $annee ;
     				$annee = "" ;
     			}  
     		}*/
     // Autre editeur
     /*if ($this->notice->ed2_id) {
     			$editeur_2 = new publisher($this->notice->ed2_id);			
     			$this->publishers[]=$editeur;
     			$this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>".$msg['other_editor']."</span></td><td>".inslink($editeur_2->display,  str_replace("!!id!!", $this->notice->ed2_id, $this->lien_rech_editeur))."</td></tr>" ;
     		}*/
     // Numérotation
     foreach ($this->memo_perso_["FIELDS"] as $i => $value) {
         $p = $this->memo_perso_["FIELDS"][$i];
         if ($p["AFF"] && $p["NAME"] == "numerotation207") {
             $this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>" . strip_tags($p["TITRE"]) . "</span></td><td>" . $p["AFF"] . "</td></tr>";
             unset($this->memo_perso_["FIELDS"][$i]);
             break;
         }
     }
     // Pays de publication
     foreach ($this->memo_perso_["FIELDS"] as $i => $value) {
         $p = $this->memo_perso_["FIELDS"][$i];
         if ($p["AFF"] && $p["NAME"] == "paysdepublication102") {
             $this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>" . strip_tags($p["TITRE"]) . "</span></td><td>" . $p["AFF"] . "</td></tr>";
             unset($this->memo_perso_["FIELDS"][$i]);
             break;
         }
     }
     // Langues
     if (count($this->langues)) {
         $this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>" . $msg['537'] . " :</span></td><td>" . $this->construit_liste_langues($this->langues);
         if (count($this->languesorg)) {
             $this->notice_public .= " <span class='etiq_champ'>" . $msg['711'] . " :</span> " . $this->construit_liste_langues($this->languesorg);
         }
         $this->notice_public .= "</td></tr>";
     } elseif (count($this->languesorg)) {
         $this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>" . $msg['711'] . " :</span></td><td>" . $this->construit_liste_langues($this->languesorg) . "</td></tr>";
     }
     // Périodicité
     foreach ($this->memo_perso_["FIELDS"] as $i => $value) {
         $p = $this->memo_perso_["FIELDS"][$i];
         if ($p["AFF"] && $p["NAME"] == "periodicite110") {
             $this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>" . strip_tags($p["TITRE"]) . "</span></td><td>" . $p["AFF"] . "</td></tr>";
             unset($this->memo_perso_["FIELDS"][$i]);
             break;
         }
     }
     // Note générale
     if ($this->notice->n_gen) {
         $zoneNote = nl2br(htmlentities($this->notice->n_gen, ENT_QUOTES, $charset));
     }
     if ($zoneNote) {
         $this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>" . $msg['n_gen_start'] . "</span></td><td>" . $zoneNote . "</td></tr>";
     }
     // Périodicité
     if (!$this->p_perso->no_special_fields) {
         if (!$this->memo_perso_) {
             $this->memo_perso_ = $this->p_perso->show_fields($this->notice_id);
         }
         foreach ($this->memo_perso_["FIELDS"] as $i => $value) {
             $p = $this->memo_perso_["FIELDS"][$i];
             if ($p["AFF"] && $p["NAME"] == "annexes320") {
                 $this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>" . strip_tags($p["TITRE"]) . "</span></td><td>" . $p["AFF"] . "</td></tr>";
                 unset($this->memo_perso_["FIELDS"][$i]);
                 break;
             }
         }
     }
     // Catégories
     if ($this->categories_toutes) {
         $this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>Sujets :</span></td><td>" . $this->categories_toutes . "</td></tr>";
     }
     // Titre clé
     foreach ($this->memo_perso_["FIELDS"] as $i => $value) {
         $p = $this->memo_perso_["FIELDS"][$i];
         if ($p["AFF"] && $p["NAME"] == "titrecle530") {
             $this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>" . strip_tags($p["TITRE"]) . "</span></td><td>" . $p["AFF"] . "</td></tr>";
             unset($this->memo_perso_["FIELDS"][$i]);
             break;
         }
     }
     // Titre abrégé
     foreach ($this->memo_perso_["FIELDS"] as $i => $value) {
         $p = $this->memo_perso_["FIELDS"][$i];
         if ($p["AFF"] && $p["NAME"] == "titreabrege531") {
             $this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>" . strip_tags($p["TITRE"]) . "</span></td><td>" . $p["AFF"] . "</td></tr>";
             unset($this->memo_perso_["FIELDS"][$i]);
             break;
         }
     }
     // Titre(s) parallèle(s)
     foreach ($this->memo_perso_["FIELDS"] as $i => $value) {
         $p = $this->memo_perso_["FIELDS"][$i];
         if ($p["AFF"] && $p["NAME"] == "titreparallele510") {
             $this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>" . strip_tags($p["TITRE"]) . "</span></td><td>" . $p["AFF"] . "</td></tr>";
             unset($this->memo_perso_["FIELDS"][$i]);
             break;
         }
     }
     // Titre(s) de couverture
     foreach ($this->memo_perso_["FIELDS"] as $i => $value) {
         $p = $this->memo_perso_["FIELDS"][$i];
         if ($p["AFF"] && $p["NAME"] == "titredecouverture512") {
             $this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>" . strip_tags($p["TITRE"]) . "</span></td><td>" . $p["AFF"] . "</td></tr>";
             unset($this->memo_perso_["FIELDS"][$i]);
             break;
         }
     }
     // Titre(s) courant(s)
     foreach ($this->memo_perso_["FIELDS"] as $i => $value) {
         $p = $this->memo_perso_["FIELDS"][$i];
         if ($p["AFF"] && $p["NAME"] == "titrecourant515") {
             $this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>" . strip_tags($p["TITRE"]) . "</span></td><td>" . $p["AFF"] . "</td></tr>";
             unset($this->memo_perso_["FIELDS"][$i]);
             break;
         }
     }
     // Titre(s) historique(s)
     foreach ($this->memo_perso_["FIELDS"] as $i => $value) {
         $p = $this->memo_perso_["FIELDS"][$i];
         if ($p["AFF"] && $p["NAME"] == "titrehistorique520") {
             $this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>" . strip_tags($p["TITRE"]) . "</span></td><td>" . $p["AFF"] . "</td></tr>";
             unset($this->memo_perso_["FIELDS"][$i]);
             break;
         }
     }
     // Autres titres
     foreach ($this->memo_perso_["FIELDS"] as $i => $value) {
         $p = $this->memo_perso_["FIELDS"][$i];
         if ($p["AFF"] && $p["NAME"] == "titreautres517") {
             $this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>" . strip_tags($p["TITRE"]) . "</span></td><td>" . $p["AFF"] . "</td></tr>";
             unset($this->memo_perso_["FIELDS"][$i]);
             break;
         }
     }
     // Titre développé
     foreach ($this->memo_perso_["FIELDS"] as $i => $value) {
         $p = $this->memo_perso_["FIELDS"][$i];
         if ($p["AFF"] && $p["NAME"] == "titredeveloppe532") {
             $this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>" . strip_tags($p["TITRE"]) . "</span></td><td>" . $p["AFF"] . "</td></tr>";
             unset($this->memo_perso_["FIELDS"][$i]);
             break;
         }
     }
     //Lien notices
     if ($this->parents) {
         $this->notice_public .= $this->parents;
     }
     $this->genere_notice_childs();
     if ($this->notice_childs) {
         $this->notice_public .= $this->notice_childs;
     }
     // Origine de la notice
     foreach ($this->memo_perso_["FIELDS"] as $i => $value) {
         $p = $this->memo_perso_["FIELDS"][$i];
         if ($p["AFF"] && $p["NAME"] == "originenotice") {
             $this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>" . strip_tags($p["TITRE"]) . "</span></td><td>" . $p["AFF"] . "</td></tr>";
             unset($this->memo_perso_["FIELDS"][$i]);
             break;
         }
     }
     // collection
     /*if ($this->notice->nocoll) $affnocoll = " ".str_replace("!!nocoll!!", $this->notice->nocoll, $msg['subcollection_details_nocoll']) ;
     		else $affnocoll = "";
     		if($this->notice->subcoll_id) {
     			$subcollection = new subcollection($this->notice->subcoll_id);
     			$collection = new collection($this->notice->coll_id);
     			$this->collections[]=$collection;
     			$this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>".$msg['coll_start']."</span></td><td>".inslink($collection->name,  str_replace("!!id!!", $this->notice->coll_id, $this->lien_rech_collection))." ".$collection->collection_web_link."</td></tr>" ;
     			$this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>".$msg['subcoll_start']."</span></td><td>".inslink($subcollection->name,  str_replace("!!id!!", $this->notice->subcoll_id, $this->lien_rech_subcollection)) ;
     			$this->notice_public .=$affnocoll."</td></tr>";
     		} elseif ($this->notice->coll_id) {
     			$collection = new collection($this->notice->coll_id);
     			$this->collections[]=$collection;
     			$this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>".$msg['coll_start']."</span></td><td>".inslink($collection->isbd_entry,  str_replace("!!id!!", $this->notice->coll_id, $this->lien_rech_collection)) ;
     			$this->notice_public .=$affnocoll." ".$collection->collection_web_link."</td></tr>";
     		}*/
     // Titres uniformes
     /*if($this->notice->tu_print_type_2) {
     			$this->notice_public.= 
     			"<tr><td align='left' class='bg-grey'><span class='etiq_champ'>".$msg['titre_uniforme_aff_public']."</span></td>
     			<td>".$this->notice->tu_print_type_2."</td></tr>";
     		}*/
     // zone de la collation
     /*if($this->notice->npages) {
     			if ($this->notice->niveau_biblio<>"a") {
     				$this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>".$msg['npages_start']."</span></td><td>".$this->notice->npages."</td></tr>";
     			} else {
     				$this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>".$msg['npages_start_perio']."</span></td><td>".$this->notice->npages."</td></tr>";
     			}
     		}*/
     //if ($this->notice->ill) $this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>".$msg['ill_start']."</span></td><td>".$this->notice->ill."</td></tr>";
     //if ($this->notice->size) $this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>".$msg['size_start']."</span></td><td>".$this->notice->size."</td></tr>";
     //if ($this->notice->accomp) $this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>".$msg['accomp_start']."</span></td><td>".$this->notice->accomp."</td></tr>";
     //if ($this->notice->prix) $this->notice_public .= "<tr><td align='left' class='bg-grey'><span class='etiq_champ'>".$msg['price_start']."</span></td><td>".$this->notice->prix."</td></tr>";
     if (!$short) {
         $this->notice_public .= $this->aff_suite();
     } else {
         $this->notice_public .= $this->genere_in_perio();
     }
     $this->notice_public .= "</table>\n";
     //etat des collections
     if ($this->notice->niveau_biblio == 's' && $this->notice->niveau_hierar == 1) {
         $this->notice_public .= $this->affichage_etat_collections();
     }
     // exemplaires, résas et compagnie
     if ($ex) {
         $this->affichage_resa_expl = $this->aff_resa_expl();
     }
     return;
 }