die("no access"); } $prefix_url_image = "./"; if (!$back_to_visu) { get_cb_expl($msg[375], $msg[661], $msg[circ_tit_form_cb_expl], './circ.php?categ=visu_ex', 1); if ($form_cb_expl) { $query = "select expl_id, expl_notice, pret_flag, pret_idempr from docs_statut, exemplaires left join pret on pret_idexpl=expl_id where expl_cb='{$form_cb_expl}' and expl_statut=idstatut "; $result = pmb_mysql_query($query, $dbh); if (!pmb_mysql_num_rows($result)) { // exemplaire inconnu $alert_sound_list[] = "critique"; print "<strong>{$form_cb_expl} : {$msg[367]}</strong>"; } else { $expl_lu = pmb_mysql_fetch_object($result); if ($stuff = get_expl_info($expl_lu->expl_id, 1)) { $stuff = check_pret($stuff); // print $begin_result_liste; print print_info($stuff, 1, 1); // pour affichage de l'image de couverture if ($pmb_book_pics_show == '1' && ($pmb_book_pics_url && $stuff->code || $stuff->thumbnail_url)) { print "<script type='text/javascript'>\n\t\t\t\t\t\t<!--\n\t\t\t\t\t\tvar img = document.getElementById('PMBimagecover" . $expl_lu->expl_notice . "');\n\t\t\t\t\t\tisbn=img.getAttribute('isbn');\n\t\t\t\t\t\turl_image=img.getAttribute('url_image');\n\t\t\t\t\t\tif (isbn) {\n\t\t\t\t\t\t\tif (img.src.substring(img.src.length-8,img.src.length)=='vide.png') {\n\t\t\t\t\t\t\t\timg.src=url_image.replace(/!!noticecode!!/,isbn);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\t//-->\n\t\t\t\t\t\t</script>\n\t\t\t\t\t\t"; } } else { // exemplaire inconnu $alert_sound_list[] = "critique"; print "<strong>{$form_cb_expl} : {$msg[367]}</strong>"; } } } } else { //droits d'acces lecture notice
function rec_retour($line) { global $action_piege, $piege_resa; $form_cb_expl = $line; $expl = new expl_to_do($form_cb_expl); //print $expl->cb_tmpl; //if(!$form_cb_expl) exit; $expl->do_form_retour($action_piege, $piege_resa); print $expl->expl_form; return; // la suite n'est plus utilisé if ($form_cb_expl) { print "<hr />"; // étape 1 : on regarde si le code-barre est connu if ($stuff = check_barcode($form_cb_expl)) { $stuff = check_pret($stuff); $stuff = check_resa($stuff); // on a maintenant un gros objet $stuff avec toutes les infos pour traiter les choses // les propriétés de cet objet sont visibles dans la fonction show_reports() plus bas // show_report($stuff); // uncomment for debugging // appel de la fonction do_retour, qui va gérer tout cela do_retour_secouru($stuff); } else { print "<div class='erreur'>" . $form_cb_expl . " : Exemplaire inconnu" . "</div>"; } } }
function pret_construit_infos_stat($id_expl) { global $dbh; $query = "select * from exemplaires where expl_id='{$id_expl}' "; $result = mysql_query($query, $dbh); $stuff = mysql_fetch_object($result); if (!$stuff->expl_id) { // exemplaire inconnu return FALSE; } $stuff = check_pret($stuff); $stuff = check_resa($stuff); return $stuff; }
function resa_ranger_list() { global $base_path, $dbh; global $msg; global $current_module; global $begin_result_liste; global $end_result_liste; global $deflt_docs_location; global $pmb_lecteurs_localises; global $f_loc; $aff_final = ""; if ($pmb_lecteurs_localises) { if ($f_loc == "") { $f_loc = $deflt_docs_location; } if ($f_loc) { $sql_expl_loc = " where expl_location='" . $f_loc . "' "; } } if ($pmb_lecteurs_localises) { //la liste de sélection de la localisation $aff_final .= "<form class='form-{$current_module}' name='check_docranger' action='" . $base_path . "/circ.php?categ=listeresa&sub=docranger' method='post'>"; $aff_final .= "<br />" . $msg["transferts_circ_resa_lib_localisation"]; $aff_final .= "<select name='f_loc' onchange='document.check_docranger.submit();'>"; $res = pmb_mysql_query("SELECT idlocation, location_libelle FROM docs_location order by location_libelle"); $aff_final .= "<option value='0'>" . $msg["all_location"] . "</option>"; //on parcours la liste des options while ($value = pmb_mysql_fetch_array($res)) { //debut de l'option $aff_final .= "<option value='" . $value[0] . "'"; if ($value[0] == $f_loc) { $aff_final .= " selected"; } //c'est l'option par défaut $aff_final .= ">" . $value[1] . "</option>"; } $aff_final .= "</select></form>"; } $sql = "SELECT resa_cb, expl_id from resa_ranger left join exemplaires on resa_cb=expl_cb " . $sql_expl_loc; $res = pmb_mysql_query($sql, $dbh); while ($ranger = pmb_mysql_fetch_object($res)) { if ($ranger->expl_id) { if ($stuff = get_expl_info($ranger->expl_id)) { $stuff = check_pret($stuff); $aff_final .= print_info($stuff, 0, 0, 0); } else { $aff_final .= "<strong>" . $ranger->resa_cb . " : {$msg[395]}</strong><br>"; } } else { $aff_final .= "<strong>" . $ranger->resa_cb . " : {$msg[395]}</strong><br>"; } } if ($aff_final) { return $begin_result_liste . $aff_final . $end_result_liste; } else { return $msg['resa_liste_docranger_nodoc']; } }
function aff_cart_notices($liste, $caddie_type, $idcaddie = 0) { global $msg; global $dbh; global $begin_result_liste; global $end_result_liste; global $page, $nbr_lignes, $nb_per_page; //Calcul des variables pour la suppression d'items if ($nb_per_page) { $modulo = $nbr_lignes % $nb_per_page; if ($modulo == 1) { $page_suppr = !$page ? 1 : $page - 1; } else { $page_suppr = $page; } $nb_after_suppr = $nbr_lignes ? $nbr_lignes - 1 : 0; } if (!sizeof($liste) || !is_array($liste)) { print $msg[399]; return; } else { // en fonction du type de caddie on affiche ce qu'il faut if ($caddie_type == "NOTI") { // boucle de parcours des notices trouvées // inclusion du javascript de gestion des listes dépliables // début de liste print $begin_result_liste; while (list($cle, $notice) = each($liste)) { // affichage de la liste des notices sous la forme 'expandable' $requete = "SELECT * FROM notices WHERE notice_id={$notice} LIMIT 1"; $fetch = mysql_query($requete, $dbh); if (mysql_num_rows($fetch)) { $notice = mysql_fetch_object($fetch); if ($notice->niveau_biblio != 's' && $notice->niveau_biblio != 'a') { // notice de monographie $link = './catalog.php?categ=isbd&id=!!id!!'; $link_expl = './catalog.php?categ=edit_expl&id=!!notice_id!!&cb=!!expl_cb!!&expl_id=!!expl_id!!'; $link_explnum = './catalog.php?categ=edit_explnum&id=!!notice_id!!&explnum_id=!!explnum_id!!'; $lien_suppr_cart = "<a href='./catalog.php?categ=search&mode=3&action=del_item&object_type=NOTI&idcaddie={$idcaddie}&item={$notice->notice_id}&page={$page_suppr}&nbr_lignes={$nb_after_suppr}&nb_per_page={$nb_per_page}'><img src='./images/basket_empty_20x20.gif' alt='basket' title='" . $msg[caddie_icone_suppr_elt] . "' /></a>"; $display = new mono_display($notice, 6, $link, 1, $link_expl, $lien_suppr_cart, $link_explnum, 1, 0, 1, 1); print pmb_bidi($display->result); } else { // on a affaire à un périodique // préparation des liens pour lui $link_serial = './catalog.php?categ=serials&sub=view&serial_id=!!id!!'; $link_analysis = './catalog.php?categ=serials&sub=bulletinage&action=view&bul_id=!!bul_id!!&art_to_show=!!id!!'; $link_bulletin = './catalog.php?categ=serials&sub=bulletinage&action=view&bul_id=!!id!!'; $lien_suppr_cart = "<a href='./catalog.php?categ=search&mode=3&action=del_item&object_type=NOTI&idcaddie={$idcaddie}&item={$notice->notice_id}&page={$page_suppr}&nbr_lignes={$nb_after_suppr}&nb_per_page={$nb_per_page}'><img src='./images/basket_empty_20x20.gif' alt='basket' title='" . $msg[caddie_icone_suppr_elt] . "' /></a>"; // function serial_display ($id, $level='1', $action_serial='', $action_analysis='', $action_bulletin='', $lien_suppr_cart="", $lien_explnum="", $bouton_explnum=1,$print=0,$show_explnum=1, $show_statut=0, $show_opac_hidden_fields=true, $draggable=0 ) { $serial = new serial_display($notice, 6, $link_serial, $link_analysis, $link_bulletin, $lien_suppr_cart, "", 1, 0, 1, 1, true, 1); print pmb_bidi($serial->result); } } } // fin de liste print $end_result_liste; } // fin si NOTI // si EXPL if ($caddie_type == "EXPL") { // boucle de parcours des exemplaires trouvés // inclusion du javascript de gestion des listes dépliables // début de liste print $begin_result_liste; while (list($cle, $expl) = each($liste)) { if ($stuff = get_expl_info($expl)) { $stuff->lien_suppr_cart = "<a href='./catalog.php?categ=search&mode=3&action=del_item&object_type=EXPL&idcaddie={$idcaddie}&item={$expl}&page={$page_suppr}&nbr_lignes={$nb_after_suppr}&nb_per_page={$nb_per_page}'><img src='./images/basket_empty_20x20.gif' alt='basket' title='" . $msg[caddie_icone_suppr_elt] . "' /></a>"; $stuff = check_pret($stuff); print pmb_bidi(print_info($stuff, 0, 1)); } else { print "<strong>{$form_cb_expl} : {$msg[395]}</strong>"; } } // fin de liste print $end_result_liste; } // fin si EXPL if ($caddie_type == "BULL") { // boucle de parcours des bulletins trouvés // inclusion du javascript de gestion des listes dépliables // début de liste print $begin_result_liste; while (list($cle, $expl) = each($liste)) { if ($bull_aff = show_bulletinage_info($expl)) { $javascript_template = "\n\t\t\t\t\t\t<div id=\"el!!id!!Parent\" class=\"notice-parent\">\n \t\t\t\t\t\t<img src=\"./images/plus.gif\" class=\"img_plus\" name=\"imEx\" id=\"el!!id!!Img\" title=\"" . $msg['admin_param_detail'] . "\" border=\"0\" onClick=\"expandBase('el!!id!!', true); return false;\" hspace=\"3\">\n \t\t\t\t\t\t<span class=\"notice-heada\">!!heada!!</span>\n \t\t\t\t\t\t<br />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div id=\"el!!id!!Child\" class=\"notice-child\" style=\"margin-bottom:6px;display:none;\">\n \t\t\t\t \t\t!!CONTENU!!\n \t\t\t\t\t\t</div>"; $lien_suppr_cart = "<a href='./catalog.php?categ=search&mode=3&action=del_item&object_type=EXPL&idcaddie={$idcaddie}&item={$expl}&page={$page_suppr}&nbr_lignes={$nb_after_suppr}&nb_per_page={$nb_per_page}'><img src='./images/basket_empty_20x20.gif' alt='basket' title='" . $msg[caddie_icone_suppr_elt] . "' /></a>"; $aff = str_replace('!!id!!', $expl, $javascript_template); $aff = str_replace('!!unique!!', md5(microtime()), $aff); $aff = str_replace('!!heada!!', $lien_suppr_cart . $bull_aff->header, $aff); $aff = str_replace('!!CONTENU!!', $bull_aff->display, $aff); print pmb_bidi($aff); } else { print "<strong>{$form_cb_expl} : {$msg[395]}</strong>"; } } // fin de liste print $end_result_liste; } // fin si BULL } }
function aff_cart_unique_object($item, $caddie_type, $url_base = "./catalog.php?categ=caddie&sub=gestion&quoi=panier&idcaddie=0") { global $msg; global $dbh; global $begin_result_liste; global $end_result_list; global $page, $nbr_lignes, $nb_per_page, $nb_per_page_search; // nombre de références par pages if ($nb_per_page_search != "") { $nb_per_page = $nb_per_page_search; } else { $nb_per_page = 10; } $cb_display = "\n\t\t\t<div id=\"el!!id!!Parent\" class=\"notice-parent\">\n\t \t\t<span class=\"notice-heada\">!!heada!!</span>\n\t \t\t<br />\n\t\t\t</div>\n\t\t\t"; $liste[] = array('object_id' => $item, 'content' => "", 'blob_type' => ""); $aff_retour = ""; //Calcul des variables pour la suppression d'items $modulo = $nbr_lignes % $nb_per_page; if ($modulo == 1) { $page_suppr = !$page ? 1 : $page - 1; } else { $page_suppr = $page; } $nb_after_suppr = $nbr_lignes ? $nbr_lignes - 1 : 0; if (!sizeof($liste) || !is_array($liste)) { return $msg[399]; } else { // en fonction du type de caddie on affiche ce qu'il faut if ($caddie_type == "NOTI") { // boucle de parcours des notices trouvées while (list($cle, $object) = each($liste)) { if ($object[content] == "") { // affichage de la liste des notices sous la forme 'expandable' $requete = "SELECT * FROM notices WHERE notice_id={$object['object_id']} LIMIT 1"; $fetch = pmb_mysql_query($requete); if (pmb_mysql_num_rows($fetch)) { $notice = pmb_mysql_fetch_object($fetch); if ($notice->niveau_biblio == 'b') { // notice de bulletin $rqtbull = "select bulletin_id from bulletins where num_notice=" . $notice->notice_id; $fetchbull = pmb_mysql_query($rqtbull); $bull = pmb_mysql_fetch_object($fetchbull); $link = "./catalog.php?categ=serials&sub=bulletinage&action=view&bul_id=" . $bull->bulletin_id; // pas affichés pour l'instant: $link_expl = ''; $link_explnum = ''; $display = new mono_display($notice, 6, $link, 1, $link_expl, $lien_suppr_cart, $link_explnum); $aff_retour .= $display->result; } elseif ($notice->niveau_biblio != 's' && $notice->niveau_biblio != 'a') { // notice de monographie $link = './catalog.php?categ=isbd&id=!!id!!'; $link_expl = './catalog.php?categ=edit_expl&id=!!notice_id!!&cb=!!expl_cb!!&expl_id=!!expl_id!!'; $link_explnum = './catalog.php?categ=edit_explnum&id=!!notice_id!!&explnum_id=!!explnum_id!!'; $lien_suppr_cart = "<a href='{$url_base}&action=del_item&object_type=NOTI&item={$notice->notice_id}&page={$page_suppr}&nbr_lignes={$nb_after_suppr}&nb_per_page={$nb_per_page}'><img src='./images/basket_empty_20x20.gif' alt='basket' title=\"" . $msg[caddie_icone_suppr_elt] . "\" /></a>"; $display = new mono_display($notice, 6, $link, 1, $link_expl, $lien_suppr_cart, $link_explnum); $aff_retour .= $display->result; } else { // on a affaire à un périodique // préparation des liens pour lui $link_serial = './catalog.php?categ=serials&sub=view&serial_id=!!id!!'; $link_analysis = './catalog.php?categ=serials&sub=bulletinage&action=view&bul_id=!!bul_id!!&art_to_show=!!id!!'; $link_bulletin = './catalog.php?categ=serials&sub=bulletinage&action=view&bul_id=!!id!!'; $lien_suppr_cart = "<a href='{$url_base}&action=del_item&object_type=NOTI&item={$notice->notice_id}&page={$page_suppr}&nbr_lignes={$nb_after_suppr}&nb_per_page={$nb_per_page}'><img src='./images/basket_empty_20x20.gif' alt='basket' title=\"" . $msg[caddie_icone_suppr_elt] . "\" /></a>"; $link_explnum = "./catalog.php?categ=serials&sub=analysis&action=explnum_form&bul_id=!!bul_id!!&analysis_id=!!analysis_id!!&explnum_id=!!explnum_id!!"; $serial = new serial_display($notice, 6, $link_serial, $link_analysis, $link_bulletin, $lien_suppr_cart, $link_explnum, 0); $aff_retour .= $serial->result; } } } else { $cb_display = "\n\t\t\t\t\t\t<div id=\"el!!id!!Parent\" class=\"notice-parent\">\n\t\t\t\t \t\t<span class=\"notice-heada\"><strong>Code-barre : {$object['content']} : {$msg[395]}</strong></span>\n\t\t\t\t \t\t<br />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t"; $aff_retour .= $cb_display; } } // fin de liste print $end_result_list; } // fin si NOTI // si EXPL if ($caddie_type == "EXPL") { // boucle de parcours des exemplaires trouvés // inclusion du javascript de gestion des listes dépliables // début de liste while (list($cle, $expl) = each($liste)) { if (!$expl[content]) { if ($stuff = get_expl_info($expl[object_id])) { $stuff->lien_suppr_cart = "<a href='{$url_base}&action=del_item&object_type=EXPL&item={$expl}&page={$page_suppr}&nbr_lignes={$nb_after_suppr}&nb_per_page={$nb_per_page}'><img src='./images/basket_empty_20x20.gif' alt='basket' title=\"" . $msg[caddie_icone_suppr_elt] . "\" /></a>"; $stuff = check_pret($stuff); $aff_retour .= print_info($stuff, 0, 1); } else { $aff_retour .= "<strong>ID : {$expl['object_id']} : {$msg[395]}</strong>"; } } else { $cb_display = "\n\t\t\t\t\t\t<div id=\"el!!id!!Parent\" class=\"notice-parent\">\n\t\t\t\t \t\t<span class=\"notice-heada\"><strong>Code-barre : {$expl['content']} : {$msg[395]}</strong></span>\n\t\t\t\t \t\t<br />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t"; $aff_retour .= $cb_display; } } // fin de liste print $end_result_list; } // fin si EXPL if ($caddie_type == "BULL") { // boucle de parcours des bulletins trouvés // inclusion du javascript de gestion des listes dépliables // début de liste while (list($cle, $expl) = each($liste)) { global $url_base_suppr_cart; $url_base_suppr_cart = $url_base; if ($bull_aff = show_bulletinage_info($expl["object_id"], 0, 1)) { $aff_retour .= $bull_aff; } else { $aff_retour .= "<strong>{$form_cb_expl} : {$msg[395]}</strong><br />"; } } // fin de liste print $end_result_list; } // fin si BULL } return $aff_retour; }
function fetch_data() { global $dbh, $msg; global $pmb_confirm_retour; global $confirmation_retour_tpl, $retour_ok_tpl; $this->build_cb_tmpl($msg[660], $msg[661], $msg[circ_tit_form_cb_expl], $this->url, 1); if ($this->expl_cb) { $query = "select * from exemplaires where expl_cb='" . $this->expl_cb . "' "; } elseif ($this->expl_id) { $query = "select * from exemplaires where expl_id='" . $this->expl_id . "' "; } else { return; } $result = pmb_mysql_query($query, $dbh); $this->expl = pmb_mysql_fetch_object($result); if (!$this->expl->expl_id) { return false; } else { $this->expl_cb = $this->expl->expl_cb; $this->expl_id = $this->expl->expl_id; // récupération des infos exemplaires if ($this->expl->expl_notice) { $notice = new mono_display($this->expl->expl_notice, 0); $this->expl->libelle = $notice->header; } else { $bulletin = new bulletinage_display($this->expl->expl_bulletin); $this->expl->libelle = $bulletin->display; } if ($this->expl->expl_lastempr) { // récupération des infos emprunteur $query_last_empr = "select empr_cb, empr_nom, empr_prenom from empr where id_empr='" . $this->expl->expl_lastempr . "' "; $result_last_empr = pmb_mysql_query($query_last_empr, $dbh); if (pmb_mysql_num_rows($result_last_empr)) { $last_empr = pmb_mysql_fetch_object($result_last_empr); $this->expl->lastempr_cb = $last_empr->empr_cb; $this->expl->lastempr_nom = $last_empr->empr_nom; $this->expl->lastempr_prenom = $last_empr->empr_prenom; } } } $query = "select lender_libelle from lenders where idlender='" . $this->expl->expl_owner . "' "; $result_expl_owner = pmb_mysql_query($query, $dbh); if (pmb_mysql_num_rows($result_expl_owner)) { $expl_owner = pmb_mysql_fetch_object($result_expl_owner); $this->expl_owner_name = $expl_owner->lender_libelle; } $rqt = "SELECT transfert_flag \tFROM exemplaires INNER JOIN docs_statut ON expl_statut=idstatut \n\t\t\tWHERE expl_id=" . $this->expl_id; $res = pmb_mysql_query($rqt) or die(pmb_mysql_error() . "<br /><br />" . $rqt); $value = pmb_mysql_fetch_array($res); $this->trans_aut = $value[0]; $this->expl = check_pret($this->expl); $this->expl = check_resa($this->expl); $this->expl = check_resa_planning($this->expl); // récupération localisation exemplaire $query = "SELECT t.tdoc_libelle as type_doc, l.location_libelle as location, s.section_libelle as section, docs_s.statut_libelle as statut FROM docs_type t, docs_location l, docs_section s, docs_statut docs_s"; $query .= " WHERE t.idtyp_doc=" . $this->expl->expl_typdoc; $query .= " AND l.idlocation=" . $this->expl->expl_location; $query .= " AND s.idsection=" . $this->expl->expl_section; $query .= " AND docs_s.idstatut=" . $this->expl->expl_statut; $query .= " LIMIT 1"; $result = pmb_mysql_query($query, $dbh); $this->info_doc = pmb_mysql_fetch_object($result); // En profiter pour faire le menage doc à ranger $rqt = "delete from resa_ranger where resa_cb='" . $this->expl_cb . "' "; $res = pmb_mysql_query($rqt, $dbh); // flag confirm retour if ($pmb_confirm_retour) { $this->expl_form .= $confirmation_retour_tpl; } elseif ($this->expl->pret_idempr) { $this->expl_form .= $retour_ok_tpl; } return true; }
function resa_ranger_list() { global $dbh; global $msg; global $begin_result_liste; global $end_result_liste; $sql = "SELECT resa_cb, expl_id from resa_ranger left join exemplaires on resa_cb=expl_cb "; $res = mysql_query($sql, $dbh); while ($ranger = mysql_fetch_object($res)) { if ($ranger->expl_id) { if ($stuff = get_expl_info($ranger->expl_id)) { $stuff = check_pret($stuff); $aff_final .= print_info($stuff, 0, 0, 0); } else { $aff_final .= "<strong>{$form_cb_expl} : {$msg[395]}</strong>"; } } } if ($aff_final) { return $begin_result_liste . $aff_final . $end_result_liste; } else { return $msg['resa_liste_docranger_nodoc']; } }