fiche); }else { // emprunteur inconnu error_message($msg['391'], $msg['392'], 1, './circ.php'); } }else { include("./circ/pret.inc.php"); } break; case 'pret_prolongation': case 'pret_prolongation_bloc': if (!empty($id_doc)) { $id_bloc=$id_doc; } if ($id_bloc) { require_once('./circ/prolongation.inc.php'); $query_empr="select id_empr from empr where empr_cb='".$form_cb."'"; $result_empr=pmb_mysql_query($query_empr); $id_empr=pmb_mysql_result($result_empr,0,'id_empr'); $temp=array(); if ($sub=='pret_prolongation') { $bloc_prolongation=0; $ids=array(0=>($id_bloc*1)); $ok_msg='390'; } else { $bloc_prolongation=1; $ids=explode(" ",$id_bloc); $date_retour=$date_retbloc; $ok_msg='prets_prolong'; } if (($id_empr)&&(count($ids)>0)) { require_once($class_path."/emprunteur.class.php"); foreach ($ids as $dummykey=>$id){ $temp[]= prolonger($id); } $erreur_affichage = prolonger_retour_affichage($temp, $bloc_prolongation, $form_cb, $date_retour); $ficEmpr = new emprunteur($id_empr, $erreur_affichage, FALSE, 1); $affichage= $ficEmpr->fiche; print pmb_bidi($affichage); } else { // prolongation d'un prêt. exemplaire ou emprunteur inconnu error_message($msg['391'], $msg['392'], 1, './circ.php'); } } else { include("./circ/pret.inc.php"); } break; case 'compte': //Gestion des comptes financiers include("./circ/comptes.inc.php"); break; case 'pret_express': $pe_isbn=traite_code_isbn(stripslashes($pe_isbn)); $suite_rqt=""; $requete_idexpl = "select expl_id from exemplaires where expl_cb='".addslashes($pe_excb)."'"; $result = pmb_mysql_query($requete_idexpl, $dbh); if(pmb_mysql_num_rows($result)==0) { if (isISBN($pe_isbn)) { if (strlen($pe_isbn)==13) $suite_rqt=" or code='".formatISBN($pe_isbn,13)."' "; else $suite_rqt="or code='".formatISBN($pe_isbn,10)."' "; } $acreer = 1 ; if ($pe_isbn) { $requete = "select notice_id from notices where code='".addslashes($pe_isbn)."' ".$suite_rqt." and niveau_biblio='m' and niveau_hierar='0' "; $result = pmb_mysql_query($requete, $dbh); if ($tmp_not = pmb_mysql_fetch_object($result)) { $id_notice=$tmp_not->notice_id; $acreer = 0 ; } } if ($acreer) { $requete = "INSERT INTO notices SET code='".addslashes($pe_isbn)."', tit1='$pe_titre', statut='$pmb_pret_express_statut', niveau_biblio='m', niveau_hierar='0', create_date=sysdate() "; $result = pmb_mysql_query($requete, $dbh); if (!$result) die ('ERROR PE: insert into notice'); $id_notice=pmb_mysql_insert_id(); audit::insert_creation (AUDIT_NOTICE, $id_notice) ; indexation_stack::push($id_notice, TYPE_NOTICE); if ($gestion_acces_active==1) { require_once("$class_path/acces.class.php"); $ac= new acces(); //traitement des droits acces user_notice if ($gestion_acces_user_notice==1) { $dom_1= $ac->setDomain(1); $dom_1->storeUserRights(0, $id_notice); } //traitement des droits acces empr_notice if ($gestion_acces_empr_notice==1) { $dom_2= $ac->setDomain(2); $dom_2->storeUserRights(0, $id_notice); } } } if (!$id_notice) die ('ERROR PE: aucun id_notice pour exemplaire...'); // exemplaire express if ($pe_excb=="") $pe_excb='PE'.rand(0,100000); $requete = "INSERT INTO exemplaires SET expl_cb='$pe_excb', expl_notice='$id_notice', expl_typdoc='$pe_tdoc', expl_location='$deflt_docs_location', expl_section='$deflt_docs_section', expl_statut='$deflt_docs_statut', expl_codestat='$deflt_docs_codestat', expl_owner='$deflt_lenders', create_date=CURRENT_TIMESTAMP() "; $result = pmb_mysql_query($requete, $dbh); if (!$result) { error_message($msg[350], $msg['pecb_already_exist'], 1 ,''); exit(); } $id_expl= pmb_mysql_insert_id(); audit::insert_creation (AUDIT_EXPL, $id_expl) ; if (preg_match('/^PE/',$pe_excb)) { //redefine exemplaires.expl_cb if $pe_excb is random $pe_excb='PE'.$id_expl; $requete = "UPDATE exemplaires SET expl_cb='$pe_excb' WHERE expl_id='$id_expl'"; $result = pmb_mysql_query($requete, $dbh); if (!$result) die ('ERROR PE: update exemplaires'); } $cb_doc=$pe_excb; $rqtstatut = "select gestion_libelle from notice_statut where id_notice_statut='$pmb_pret_express_statut' "; $resstatut = pmb_mysql_fetch_object(pmb_mysql_query($rqtstatut, $dbh)); $noteexpress = addslashes($resstatut->gestion_libelle) ; $requete = "UPDATE exemplaires SET expl_note='$noteexpress' WHERE expl_id='$id_expl'"; $result = pmb_mysql_query($requete, $dbh); include("./circ/pret.inc.php"); } else error_message($msg[350], $msg['pecb_already_exist'], 1 ,''); break; case 'suppr_resa_from_fiche': include("./circ/listeresa/main.inc.php"); include("./circ/pret.inc.php"); break; case 'suppr_resa_planning_from_fiche' : include("./circ/resa_planning/main.inc.php"); include("./circ/pret.inc.php"); break; case 'show_late': include("./circ/show_late.inc.php"); break; default: include("./circ/pret.inc.php"); break; } break; // ---------------------- LLIUREX 21/02/2018 --------------------- case 'carnetsUsuarios': include("./circ/frmListado-carnets.php"); break; case 'carnetsUsuariosMigrados': include("./circ/frmListado-carnets-NIA.php"); break; // ---------------------- FIN LLIUREX 21/02/2018 -------------- case 'retour': echo window_title($database_window_title.$msg["5"]." : ".$msg["14"]); include("./circ/retour.inc.php"); break; case 'retour_secouru': include("./circ/retour_secouru_download.inc.php"); break; case 'retour_secouru_int': include("./circ/retour_secouru.inc.php"); break; case 'resa': include("./circ/resa/main.inc.php"); break; case 'express': include("./circ/express/main.inc.php"); break; case 'visu_rech': echo window_title($database_window_title.$msg["5"]." : ".$msg["voir_document"]); include("./circ/visu_rech/visu_rech.inc.php"); break; case 'empr_update': // update/insert d'un emprunteur include("./circ/empr/empr_update.inc.php"); break; case 'empr_create': echo window_title($database_window_title.$msg["5"]." : ".$msg["15"]); // récupération code barre en vue création d'un emprunteur include("./circ/empr/empr_create.inc.php"); break; case 'empr_delete': // suppression d'un emprunteur include("./circ/empr/delete.inc.php"); break; case 'empr_saisie': if($pmb_javascript_office_editor){ print $pmb_javascript_office_editor; print ""; } // affichage formulaire de saisie d'un emprunteur include("./circ/empr/empr_saisie.inc.php"); break; case 'empr_duplicate': echo window_title($database_window_title.$msg["empr_duplicate"].$msg[1003].$msg[1001]); $rqt = "select max(id_empr+1) as max_id from empr "; $res = pmb_mysql_query($rqt, $dbh); $id_initial = pmb_mysql_fetch_object($res); $id_a_creer = (string)$id_initial->max_id; // modif pour nouvelle méthode d'incrémentation ********************************************************************* $pmb_num_carte_auto_array=array(); $pmb_num_carte_auto_array=explode(",",$pmb_num_carte_auto); if ($pmb_num_carte_auto_array[0] == "1" ) { $rqt = "select max(empr_cb+1) as max_cb from empr "; $res = pmb_mysql_query($rqt, $dbh); $cb_initial = pmb_mysql_fetch_object($res); $cb_a_creer = (string)$cb_initial->max_cb; } elseif ($pmb_num_carte_auto_array[0] == "2" ) { $long_prefixe = $pmb_num_carte_auto_array[1]; $nb_chiffres = $pmb_num_carte_auto_array[2]; $prefix = $pmb_num_carte_auto_array[3]; $rqt = "SELECT CAST(SUBSTRING(empr_cb,".($long_prefixe+1).") AS UNSIGNED) AS max_cb, SUBSTRING(empr_cb,1,".($long_prefixe*1).") AS prefixdb FROM empr ORDER BY max_cb DESC limit 0,1" ; // modif f cerovetti pour sortir dernier code barre tri par ASCII $res = pmb_mysql_query($rqt, $dbh); $cb_initial = pmb_mysql_fetch_object($res); $cb_a_creer = ($cb_initial->max_cb*1)+1; if (!$nb_chiffres) $nb_chiffres=strlen($cb_a_creer); if (!$prefix) $prefix = $cb_initial->prefixdb; $cb_a_creer = $prefix.substr((string)str_pad($cb_a_creer, $nb_chiffres, "0", STR_PAD_LEFT),-$nb_chiffres); // fin modif pour nouvelle méthode d'incrémentation******************************************************************* } else $cb_a_creer=""; if($pmb_javascript_office_editor){ print $pmb_javascript_office_editor; print ""; } show_empr_form("./circ.php?categ=empr_update","./circ.php?categ=empr_create",$dbh, $id, (string)$cb_a_creer,(string)$id_a_creer); break; case 'visu_ex': echo window_title($database_window_title.$msg["5"]." : ".$msg["voir_exemplaire"]); // visualisation d'un exemplaire include("./circ/visu_ex.inc.php"); break; case 'note_ex': // visualisation d'un exemplaire include("./circ/note_ex.inc.php"); break; case 'groups': echo window_title($database_window_title.$msg["5"]." : ".$msg["903"]); // interface de gestion des groupes include("./circ/groups/group_main.inc.php"); break; case 'listeresa': // gestion des réservations include("./circ/listeresa/main.inc.php"); break; case 'resa_planning': echo window_title($database_window_title.$msg["5"]." : ".$msg["resa_menu"]." ".$msg["resa_menu_planning"]); // gestion des réservations planifiées include("./circ/resa_planning/main.inc.php"); break; case 'relance': //Gestion des relances include("./circ/relance/main.inc.php"); break; case 'caddie': include('./circ/caddie/caddie.inc.php'); break; case 'sug' : echo window_title($database_window_title.$msg["5"]." : ".$msg["acquisition_sug_do"]); //Création de suggestion include("./circ/suggestions/make_sug.inc.php"); break; case 'resa_from_catal' : // on est en pose de résa en arrivant avec un id_notice ou bulletin mais sans emprunteur if(isset($id_notice)) $id_notice += 0; else $id_notice = 0; if(isset($id_bulletin)) $id_bulletin += 0; else $id_bulletin = 0; if(!isset($cb_initial)) $cb_initial = ''; if ($id_notice || $id_bulletin) { require_once($class_path.'/event/events/event_resa.class.php'); $evt = new event_resa('resa', 'resa_from_catal'); $evt->set_resa($id_notice, $id_bulletin); $evth = events_handler::get_instance(); $evth->send($evt); if($evt->get_result()){ $cb_initial= $evt->get_result(); } get_cb( $msg['reserv_doc'], $msg[34], $msg['circ_tit_form_cb_empr'], './circ.php?categ=pret&id_notice='.$id_notice.'&id_bulletin='.$id_bulletin.(isset($force_resa) && $force_resa && $pmb_resa_records_no_expl ? '&force_resa=1' : ''), 0, $cb_initial); } break; case 'resa_planning_from_catal' : // on est en pose de prévision en arrivant avec un id_notice mais sans emprunteur if ($id_notice || $id_bulletin) { get_cb( $msg['prevision_doc'], $msg[34], $msg['circ_tit_form_cb_empr'], './circ.php?categ=pret&id_notice='.$id_notice.'&id_bulletin='.$id_bulletin.'&type_resa=1', 0); } break; case 'trans' : // Transferts entre bibliothèques include("./circ/transferts/main.inc.php"); break; case 'rfid_prog' : echo window_title($database_window_title.$msg["5"]." : ".$msg["circ_menu_rfid"]." ".$msg["circ_menu_rfid_programmer"]); // programmer les étiquettes rfid en masse include("./circ/rfid/rfid_prog.inc.php"); break; case 'rfid_del' : echo window_title($database_window_title.$msg["5"]." : ".$msg["circ_menu_rfid"]." ".$msg["circ_menu_rfid_effacer"]); // effacer les étiquettes rfid en masse include("./circ/rfid/rfid_del.inc.php"); break; case 'rfid_read' : echo window_title($database_window_title.$msg["5"]." : ".$msg["circ_menu_rfid"]." ".$msg["circ_menu_rfid_lire"]); // lire les étiquettes rfid en masse include("./circ/rfid/rfid_read.inc.php"); break; case 'rfid_gates' : // programmer les étiquettes rfid en masse include("./circ/rfid/rfid_gates.inc.php"); break; case 'rfid_readers' : // programmer les étiquettes rfid en masse include("./circ/rfid/rfid_readers.inc.php"); break; case 'ret_todo' : echo window_title($database_window_title.$msg["5"]." : ".$msg["circ_doc_a_traiter"]); // voir les exemplaires qui nécessitent un traitement non effectué lors d'un retour include("./circ/ret_todo/ret_todo.inc.php"); break; case 'search' : // recherches emprunteurs switch ($sub) { case "launch": include("./circ/pret.inc.php"); break; default: include('./circ/empr/search.inc.php'); break; } break; case 'serialcirc' : echo window_title($database_window_title.$msg["5"]." : ".$msg["serialcirc_circ_menu"]); // voir les exemplaires qui nécessitent un traitement non effectué lors d'un retour include("./circ/serialcirc/serialcirc.inc.php"); break; case 'groupexpl' : include("./circ/groupexpl/main.inc.php"); break; case 'scan_request' : require_once('./circ/scan_request/main.inc.php'); break; case 'search_perso' : require_once('./circ/search_perso/main.inc.php'); break; case 'plugin' : $plugins = plugins::get_instance(); $file = $plugins->proceed("circ",$plugin,$sub); if($file){ include $file; } break; default: echo window_title($database_window_title.$msg["5"]." : ".$msg["13"]); if (SESSrights & RESTRICTCIRC_AUTH) get_login_empr_pret ( $msg[13], $msg[34], $msg['circ_tit_form_cb_empr'], './circ.php?categ=pretrestrict', 0); else get_cb( $msg[13], $msg[34], $msg['circ_tit_form_cb_empr'], './circ.php?categ=pret', 0); break; }